Adding modding folder with a hacked build.
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
package ids
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/inkyblackness/hacked/ss1/resource"
|
||||
)
|
||||
|
||||
// Filename defines a wrapper for a file that is possibly language-specific.
|
||||
type Filename interface {
|
||||
// For returns the name of the file for the given language.
|
||||
For(lang resource.Language) string
|
||||
|
||||
// Matches returns true if the given filename matches the described one.
|
||||
Matches(filename string) bool
|
||||
}
|
||||
|
||||
// I18nFile is for internationalized resource files - i.e., those that store resources per file.
|
||||
type I18nFile [resource.LanguageCount]string
|
||||
|
||||
// For returns the string per language index.
|
||||
func (spec I18nFile) For(lang resource.Language) string {
|
||||
return spec[int(lang)]
|
||||
}
|
||||
|
||||
// Matches returns true if the given filename matches one of the localized filenames.
|
||||
func (spec I18nFile) Matches(filename string) bool {
|
||||
lowercase := strings.ToLower(filename)
|
||||
for _, entry := range spec {
|
||||
if entry == lowercase {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// AnyLanguage is for generic resource files that are language agnostic.
|
||||
type AnyLanguage string
|
||||
|
||||
// For returns the string itself.
|
||||
func (any AnyLanguage) For(lang resource.Language) string {
|
||||
return string(any)
|
||||
}
|
||||
|
||||
// Matches returns true if the given filename matches this one.
|
||||
func (any AnyLanguage) Matches(filename string) bool {
|
||||
return strings.ToLower(filename) == string(any)
|
||||
}
|
||||
|
||||
// FilenameList is a list of filenames.
|
||||
type FilenameList []Filename
|
||||
|
||||
// Matches returns true if the given filename matches any of the contained entries.
|
||||
func (list FilenameList) Matches(filename string) bool {
|
||||
for _, entry := range list {
|
||||
if entry.Matches(filename) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package ids
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/inkyblackness/hacked/ss1/resource"
|
||||
)
|
||||
|
||||
// CybStrng contains all strings.
|
||||
var CybStrng = I18nFile([resource.LanguageCount]string{"cybstrng.res", "frnstrng.res", "gerstrng.res"})
|
||||
|
||||
// MfdArt contains all MFD graphics.
|
||||
var MfdArt = I18nFile([resource.LanguageCount]string{"mfdart.res", "mfdfrn.res", "mfdger.res"})
|
||||
|
||||
// CitALog contains all log audio.
|
||||
var CitALog = I18nFile([resource.LanguageCount]string{"citalog.res", "frnalog.res", "geralog.res"})
|
||||
|
||||
// CitBark contains all bark audio.
|
||||
var CitBark = I18nFile([resource.LanguageCount]string{"citbark.res", "frnbark.res", "gerbark.res"})
|
||||
|
||||
// LowIntr contains the low-res intro video.
|
||||
var LowIntr = I18nFile([resource.LanguageCount]string{"lowintr.res", "lofrintr.res", "logeintr.res"})
|
||||
|
||||
// SvgaIntr contains the high-res intro video.
|
||||
var SvgaIntr = I18nFile([resource.LanguageCount]string{"svgaintr.res", "svfrintr.res", "svgeintr.res"})
|
||||
|
||||
// Archive contains the game world.
|
||||
var Archive = AnyLanguage("archive.dat")
|
||||
|
||||
// GamePal contains the game palettes.
|
||||
var GamePal = AnyLanguage("gamepal.res")
|
||||
|
||||
// GameScr contains big bitmaps.
|
||||
var GameScr = AnyLanguage("gamescr.res")
|
||||
|
||||
// Texture contains all textures.
|
||||
var Texture = AnyLanguage("texture.res")
|
||||
|
||||
// VidMail contains all video mails.
|
||||
var VidMail = AnyLanguage("vidmail.res")
|
||||
|
||||
// Death contains another death video.
|
||||
var Death = AnyLanguage("death.res")
|
||||
|
||||
// Intro contains another intro video.
|
||||
var Intro = AnyLanguage("intro.res")
|
||||
|
||||
// Start1 contains ... ?.
|
||||
var Start1 = AnyLanguage("start1.res")
|
||||
|
||||
// Win1 contains ... ?.
|
||||
var Win1 = AnyLanguage("win1.res")
|
||||
|
||||
// LowDeth contains the low-res death video.
|
||||
var LowDeth = AnyLanguage("lowdeth.res")
|
||||
|
||||
// LowEnd contains the low-res end video.
|
||||
var LowEnd = AnyLanguage("lowend.res")
|
||||
|
||||
// SvgaDeth contains the high-res death video.
|
||||
var SvgaDeth = AnyLanguage("svgadeth.res")
|
||||
|
||||
// SvgaEnd contains the high-res end video.
|
||||
var SvgaEnd = AnyLanguage("svgaend.res")
|
||||
|
||||
// Obj3D contains 3D objects.
|
||||
var Obj3D = AnyLanguage("obj3D.res")
|
||||
|
||||
// ObjArt contains object art.
|
||||
var ObjArt = AnyLanguage("objart.res")
|
||||
|
||||
// ObjArt2 contains further object art.
|
||||
var ObjArt2 = AnyLanguage("objart2.res")
|
||||
|
||||
// ObjArt3 contains further object art.
|
||||
var ObjArt3 = AnyLanguage("objart3.res")
|
||||
|
||||
// CitMat contains materials for 3D objects.
|
||||
var CitMat = AnyLanguage("citmat.res")
|
||||
|
||||
// CutsPal contains palettes for the cutscenes.
|
||||
var CutsPal = AnyLanguage("cutspal.res")
|
||||
|
||||
// HandArt contains bitmaps for grabbed things.
|
||||
var HandArt = AnyLanguage("handart.res")
|
||||
|
||||
// SideArt contains bitmaps for the side buttons.
|
||||
var SideArt = AnyLanguage("sideart.res")
|
||||
|
||||
// DigiFX contains all the effect sounds.
|
||||
var DigiFX = AnyLanguage("digifx.res")
|
||||
|
||||
// Splash contains the splash screens.
|
||||
var Splash = AnyLanguage("splash.res")
|
||||
|
||||
// SplshPal contains the splash screen palettes.
|
||||
var SplshPal = AnyLanguage("splspal.res")
|
||||
|
||||
// LowResVideos returns the filename descriptors of all low-res videos.
|
||||
func LowResVideos() FilenameList {
|
||||
return []Filename{LowIntr, LowDeth, LowEnd, Intro, Start1, Win1}
|
||||
}
|
||||
|
||||
// HighResVideos returns the filename descriptors of all high-res videos.
|
||||
func HighResVideos() FilenameList {
|
||||
return []Filename{SvgaIntr, SvgaDeth, SvgaEnd}
|
||||
}
|
||||
|
||||
// LocalizedFiles returns the filename descriptors of all files that are localized.
|
||||
func LocalizedFiles() []Filename {
|
||||
return []Filename{CybStrng, MfdArt, CitALog, CitBark, LowIntr, SvgaIntr}
|
||||
}
|
||||
|
||||
// LocalizeFilename returns the language that the resource file would typically contain.
|
||||
func LocalizeFilename(filename string) resource.Language {
|
||||
all := LocalizedFiles()
|
||||
lowercase := strings.ToLower(filename)
|
||||
result := resource.LangAny
|
||||
for _, lang := range resource.Languages() {
|
||||
for _, file := range all {
|
||||
if file.For(lang) == lowercase {
|
||||
result = lang
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package ids_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/inkyblackness/hacked/ss1/resource"
|
||||
"github.com/inkyblackness/hacked/ss1/world/ids"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestLocalizedResources(t *testing.T) {
|
||||
tt := []struct {
|
||||
filename string
|
||||
expected resource.Language
|
||||
}{
|
||||
{"citmat.res", resource.LangAny},
|
||||
{"digifx.res", resource.LangAny},
|
||||
{"gamescr.res", resource.LangAny},
|
||||
{"handart.res", resource.LangAny},
|
||||
{"intro.res", resource.LangAny},
|
||||
{"obj3d.res", resource.LangAny},
|
||||
{"objart2.res", resource.LangAny},
|
||||
{"objart3.res", resource.LangAny},
|
||||
{"sideart.res", resource.LangAny},
|
||||
{"texture.res", resource.LangAny},
|
||||
|
||||
{"cybstrng.res", resource.LangDefault},
|
||||
{"mfdart.res", resource.LangDefault},
|
||||
|
||||
{"frnstrng.res", resource.LangFrench},
|
||||
{"mfdfrn.res", resource.LangFrench},
|
||||
|
||||
{"gerstrng.res", resource.LangGerman},
|
||||
{"mfdger.res", resource.LangGerman},
|
||||
|
||||
{"archive.dat", resource.LangAny},
|
||||
{"cutspal.res", resource.LangAny},
|
||||
{"death.res", resource.LangAny},
|
||||
{"gamepal.res", resource.LangAny},
|
||||
{"intro.res", resource.LangAny},
|
||||
{"lowdeth.res", resource.LangAny},
|
||||
{"lowend.res", resource.LangAny},
|
||||
{"objart.res", resource.LangAny},
|
||||
{"splash.res", resource.LangAny},
|
||||
{"splshpal.res", resource.LangAny},
|
||||
{"start1.res", resource.LangAny},
|
||||
{"svgadeth.res", resource.LangAny},
|
||||
{"svgaend.res", resource.LangAny},
|
||||
{"vidmail.res", resource.LangAny},
|
||||
{"win1.res", resource.LangAny},
|
||||
|
||||
{"citalog.res", resource.LangDefault},
|
||||
{"citbark.res", resource.LangDefault},
|
||||
{"lowintr.res", resource.LangDefault},
|
||||
{"svgaintr.res", resource.LangDefault},
|
||||
|
||||
{"frnalog.res", resource.LangFrench},
|
||||
{"frnbark.res", resource.LangFrench},
|
||||
{"lofrintr.res", resource.LangFrench},
|
||||
{"svfrintr.res", resource.LangFrench},
|
||||
|
||||
{"geralog.res", resource.LangGerman},
|
||||
{"gerbark.res", resource.LangGerman},
|
||||
{"logeintr.res", resource.LangGerman},
|
||||
{"svgeintr.res", resource.LangGerman},
|
||||
}
|
||||
|
||||
for _, tc := range tt {
|
||||
result := ids.LocalizeFilename(tc.filename)
|
||||
assert.Equal(t, tc.expected, result, "Wrong language for <"+tc.filename+">")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package ids
|
||||
|
||||
import "github.com/inkyblackness/hacked/ss1/resource"
|
||||
|
||||
// Palette identifier are listed below.
|
||||
const (
|
||||
GamePalettesStart resource.ID = 0x02BC
|
||||
)
|
||||
|
||||
// Texture identifier are listed below.
|
||||
const (
|
||||
IconTextures resource.ID = 0x004C
|
||||
SmallTextures resource.ID = 0x004D
|
||||
MediumTextures resource.ID = 0x02C3
|
||||
LargeTextures resource.ID = 0x03E8
|
||||
|
||||
ScreenTextures resource.ID = 0x0141
|
||||
|
||||
TextureNames resource.ID = 0x086A
|
||||
TextureUsages resource.ID = 0x086B
|
||||
)
|
||||
|
||||
// Bitmap identifier are listed below.
|
||||
const (
|
||||
ObjectBitmaps resource.ID = 0x0546
|
||||
ObjectTextureBitmaps resource.ID = 0x01DB
|
||||
ObjectMaterialBitmaps resource.ID = 0x0884
|
||||
|
||||
IconBitmaps resource.ID = 0x004E
|
||||
GraffitiBitmaps resource.ID = 0x004F
|
||||
|
||||
MfdDataBitmaps resource.ID = 0x0028
|
||||
)
|
||||
|
||||
// Animation and video identifier are listed below.
|
||||
const (
|
||||
VideoMailBitmapsStart resource.ID = 0x0A40
|
||||
VideoMailAnimationsStart resource.ID = 0x0A4C
|
||||
)
|
||||
|
||||
// Movie identifier are listed below.
|
||||
const (
|
||||
MovieIntro resource.ID = 0x0BD6
|
||||
MovieDeath resource.ID = 0x0BD7
|
||||
MovieEnd resource.ID = 0x0BD8
|
||||
)
|
||||
|
||||
// Text identifier are listed below.
|
||||
const (
|
||||
PaperTextsStart resource.ID = 0x003C
|
||||
TrapMessageTexts resource.ID = 0x0867
|
||||
WordTexts resource.ID = 0x0868
|
||||
PanelNameTexts resource.ID = 0x0869
|
||||
LogCategoryTexts resource.ID = 0x0870
|
||||
VariousMessageTexts resource.ID = 0x0871
|
||||
ScreenMessageTexts resource.ID = 0x0877
|
||||
InfoNodeMessageTexts resource.ID = 0x0878
|
||||
AccessCardNameTexts resource.ID = 0x0879
|
||||
DataletMessageTexts resource.ID = 0x087A
|
||||
|
||||
ObjectLongNames resource.ID = 0x0024
|
||||
ObjectShortNames resource.ID = 0x086D
|
||||
)
|
||||
|
||||
// Message identifier are listed below.
|
||||
const (
|
||||
MailsStart resource.ID = 0x0989
|
||||
LogsStart resource.ID = 0x09B8
|
||||
FragmentsStart resource.ID = 0x0A98
|
||||
|
||||
MailsAudioStart resource.ID = 0x0989 + 300
|
||||
LogsAudioStart resource.ID = 0x09B8 + 300
|
||||
)
|
||||
|
||||
// Sound identifier are listed below.
|
||||
const (
|
||||
TrapMessagesAudioStart resource.ID = 0x0C1C
|
||||
|
||||
SoundEffectsAudioStart resource.ID = 0x00C9
|
||||
)
|
||||
|
||||
// Archive identifier are listed below.
|
||||
const (
|
||||
ArchiveName resource.ID = 0x0FA0
|
||||
GameState resource.ID = 0x0FA1
|
||||
|
||||
LevelResourcesStart resource.ID = 4000
|
||||
)
|
||||
@@ -0,0 +1,161 @@
|
||||
package ids
|
||||
|
||||
import (
|
||||
"github.com/inkyblackness/hacked/ss1/content/archive"
|
||||
"github.com/inkyblackness/hacked/ss1/content/archive/level/lvlids"
|
||||
"github.com/inkyblackness/hacked/ss1/content/object"
|
||||
"github.com/inkyblackness/hacked/ss1/resource"
|
||||
)
|
||||
|
||||
// ResourceInfo describes a group of resources with their default serialization properties.
|
||||
type ResourceInfo struct {
|
||||
// StartID is the first ID of the resource block (inclusive).
|
||||
StartID resource.ID
|
||||
// EndID is the last ID of the resource block (exclusive).
|
||||
EndID resource.ID
|
||||
|
||||
// ContentType describes how to interpret resource data.
|
||||
ContentType resource.ContentType
|
||||
// Compound indicates whether the resource has a variable amount of blocks. Simple resources always have one block.
|
||||
Compound bool
|
||||
// Compressed indicates that the resource data shall be stored in compressed form.
|
||||
Compressed bool
|
||||
|
||||
// List is set for compound resources that have an atomic resource per block.
|
||||
List bool
|
||||
// MaxCount describes how many resources can be stored at maximum. Zero for unlimited / defined somewhere else.
|
||||
MaxCount int
|
||||
|
||||
// ResFile specifies the .res file in which this resource should be stored.
|
||||
ResFile Filename
|
||||
}
|
||||
|
||||
// Info returns the resource information for the identified resource.
|
||||
func Info(id resource.ID) (ResourceInfo, bool) {
|
||||
info, existing := infoByID[id]
|
||||
return info, existing
|
||||
}
|
||||
|
||||
func init() {
|
||||
register := func(info ResourceInfo) {
|
||||
count := info.EndID.Value() - info.StartID.Value()
|
||||
for offset := 0; offset < int(count); offset++ {
|
||||
infoByID[info.StartID.Plus(offset)] = info
|
||||
}
|
||||
}
|
||||
for _, info := range infoList {
|
||||
register(info)
|
||||
}
|
||||
levelInfo := func(lvl int, lvlResID int, compressed bool) ResourceInfo {
|
||||
resID := LevelResourcesStart.Plus(lvl*lvlids.PerLevel + lvlResID)
|
||||
return ResourceInfo{
|
||||
StartID: resID,
|
||||
EndID: resID.Plus(1),
|
||||
|
||||
ContentType: resource.Archive,
|
||||
Compound: false,
|
||||
Compressed: compressed,
|
||||
|
||||
List: false,
|
||||
MaxCount: 1,
|
||||
|
||||
ResFile: Archive,
|
||||
}
|
||||
}
|
||||
// In the following, the compression flags were set if the vanilla archive had
|
||||
// the respective resource compressed in at least one level.
|
||||
// Most of them were compressed uniform across all levels, some had exceptions.
|
||||
for lvl := 0; lvl < archive.MaxLevels; lvl++ {
|
||||
register(levelInfo(lvl, lvlids.MapVersionNumber, false))
|
||||
register(levelInfo(lvl, lvlids.ObjectVersionNumber, false))
|
||||
register(levelInfo(lvl, lvlids.Information, true))
|
||||
|
||||
register(levelInfo(lvl, lvlids.TileMap, true))
|
||||
register(levelInfo(lvl, lvlids.Schedules, false))
|
||||
register(levelInfo(lvl, lvlids.TextureAtlas, false))
|
||||
register(levelInfo(lvl, lvlids.ObjectMainTable, true))
|
||||
register(levelInfo(lvl, lvlids.ObjectCrossRefTable, true))
|
||||
for class := 0; class < object.ClassCount; class++ {
|
||||
register(levelInfo(lvl, lvlids.ObjectClassTablesStart+class, true))
|
||||
register(levelInfo(lvl, lvlids.ObjectDefaultTablesStart+class, true))
|
||||
}
|
||||
|
||||
register(levelInfo(lvl, lvlids.SavefileVersion, false))
|
||||
register(levelInfo(lvl, lvlids.Unused41, false))
|
||||
|
||||
register(levelInfo(lvl, lvlids.TextureAnimations, true))
|
||||
register(levelInfo(lvl, lvlids.SurveillanceSources, true))
|
||||
register(levelInfo(lvl, lvlids.SurveillanceSurrogates, true))
|
||||
register(levelInfo(lvl, lvlids.Parameters, true))
|
||||
register(levelInfo(lvl, lvlids.MapNotes, true))
|
||||
register(levelInfo(lvl, lvlids.MapNotesPointer, false))
|
||||
|
||||
register(levelInfo(lvl, lvlids.Unknown48, true))
|
||||
register(levelInfo(lvl, lvlids.Unknown49, true))
|
||||
register(levelInfo(lvl, lvlids.Unknown50, false))
|
||||
|
||||
register(levelInfo(lvl, lvlids.LoopConfiguration, true))
|
||||
|
||||
register(levelInfo(lvl, lvlids.Unknown52, false))
|
||||
register(levelInfo(lvl, lvlids.HeightSemaphores, true))
|
||||
}
|
||||
}
|
||||
|
||||
var infoByID = map[resource.ID]ResourceInfo{}
|
||||
|
||||
var infoList = []ResourceInfo{
|
||||
{GamePalettesStart, GamePalettesStart.Plus(3), resource.Palette, false, false, false, 3, GamePal},
|
||||
|
||||
{IconTextures, IconTextures.Plus(1), resource.Bitmap, true, false, true, 293, Texture},
|
||||
{SmallTextures, SmallTextures.Plus(1), resource.Bitmap, true, false, true, 293, Texture},
|
||||
{MediumTextures, MediumTextures.Plus(293), resource.Bitmap, true, false, false, 293, Texture},
|
||||
{LargeTextures, LargeTextures.Plus(293), resource.Bitmap, true, false, false, 293, Texture},
|
||||
{TextureNames, TextureNames.Plus(1), resource.Text, true, false, true, 293, CybStrng},
|
||||
{TextureUsages, TextureUsages.Plus(1), resource.Text, true, false, true, 293, CybStrng},
|
||||
|
||||
{ObjectBitmaps, ObjectBitmaps.Plus(1), resource.Bitmap, true, false, true, 0, ObjArt},
|
||||
{ObjectTextureBitmaps, ObjectTextureBitmaps.Plus(64), resource.Bitmap, true, false, false, 64, CitMat},
|
||||
{ObjectMaterialBitmaps, ObjectMaterialBitmaps.Plus(32), resource.Bitmap, true, false, false, 32, CitMat},
|
||||
|
||||
{ScreenTextures, ScreenTextures.Plus(102), resource.Bitmap, true, false, false, 102, Texture},
|
||||
|
||||
{IconBitmaps, IconBitmaps.Plus(1), resource.Bitmap, true, false, true, 64, ObjArt3},
|
||||
{GraffitiBitmaps, GraffitiBitmaps.Plus(1), resource.Bitmap, true, false, true, 64, ObjArt3},
|
||||
|
||||
{MfdDataBitmaps, MfdDataBitmaps.Plus(1), resource.Bitmap, true, true, true, 256, MfdArt},
|
||||
|
||||
{VideoMailBitmapsStart, VideoMailBitmapsStart.Plus(12), resource.Bitmap, true, false, false, 12, VidMail},
|
||||
{VideoMailAnimationsStart, VideoMailAnimationsStart.Plus(12), resource.Animation, true, false, false, 12, VidMail},
|
||||
|
||||
{MovieIntro, MovieIntro.Plus(1), resource.Movie, false, false, false, 1, SvgaIntr},
|
||||
{MovieDeath, MovieDeath.Plus(1), resource.Movie, false, false, false, 1, SvgaDeth},
|
||||
{MovieEnd, MovieEnd.Plus(1), resource.Movie, false, false, false, 1, SvgaEnd},
|
||||
|
||||
{PaperTextsStart, PaperTextsStart.Plus(16), resource.Text, true, false, false, 16, CybStrng},
|
||||
|
||||
{TrapMessageTexts, TrapMessageTexts.Plus(1), resource.Text, true, false, true, 256, CybStrng},
|
||||
{TrapMessagesAudioStart, TrapMessagesAudioStart.Plus(256), resource.Movie, false, false, false, 256, CitBark},
|
||||
|
||||
{SoundEffectsAudioStart, SoundEffectsAudioStart.Plus(114), resource.Sound, false, false, false, 114, DigiFX},
|
||||
|
||||
{WordTexts, WordTexts.Plus(1), resource.Text, true, false, true, 512, CybStrng},
|
||||
{PanelNameTexts, PanelNameTexts.Plus(1), resource.Text, true, false, true, 256, CybStrng},
|
||||
{LogCategoryTexts, LogCategoryTexts.Plus(1), resource.Text, true, false, true, 16, CybStrng},
|
||||
{VariousMessageTexts, VariousMessageTexts.Plus(1), resource.Text, true, false, true, 256, CybStrng},
|
||||
{ScreenMessageTexts, ScreenMessageTexts.Plus(1), resource.Text, true, false, true, 120, CybStrng},
|
||||
{InfoNodeMessageTexts, InfoNodeMessageTexts.Plus(1), resource.Text, true, false, true, 256, CybStrng},
|
||||
{AccessCardNameTexts, AccessCardNameTexts.Plus(1), resource.Text, true, false, true, 32 * 2, CybStrng},
|
||||
{DataletMessageTexts, DataletMessageTexts.Plus(1), resource.Text, true, false, true, 256, CybStrng},
|
||||
|
||||
{MailsStart, MailsStart.Plus(47), resource.Text, true, false, false, 47, CybStrng},
|
||||
{LogsStart, LogsStart.Plus(136), resource.Text, true, false, false, 136, CybStrng},
|
||||
{FragmentsStart, FragmentsStart.Plus(16), resource.Text, true, false, false, 16, CybStrng},
|
||||
{MailsAudioStart, MailsAudioStart.Plus(47), resource.Movie, false, false, false, 47, CitALog},
|
||||
{LogsAudioStart, LogsAudioStart.Plus(224), resource.Movie, false, false, false, 224, CitALog},
|
||||
|
||||
{ObjectLongNames, ObjectLongNames.Plus(1), resource.Text, true, false, true, 0, CybStrng},
|
||||
{ObjectShortNames, ObjectShortNames.Plus(1), resource.Text, true, false, true, 0, CybStrng},
|
||||
|
||||
{ArchiveName, ArchiveName.Plus(1), resource.Archive, false, false, false, 1, Archive},
|
||||
{GameState, GameState.Plus(1), resource.Archive, false, true, false, 1, Archive},
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package ids
|
||||
|
||||
// SoundEffectInfo describes one sound effect in the game.
|
||||
type SoundEffectInfo struct {
|
||||
// Name is the unique identifier for the effect source.
|
||||
Name string
|
||||
// Index refers to the audio index. Multiple effects may use the same audio. -1 indicates no audio mapped.
|
||||
AudioIndex int
|
||||
}
|
||||
|
||||
// SoundEffectsForAudio returns the effect information that share the same audio.
|
||||
func SoundEffectsForAudio(index int) []SoundEffectInfo {
|
||||
var result []SoundEffectInfo
|
||||
for _, effect := range soundEffects {
|
||||
if effect.AudioIndex == index {
|
||||
result = append(result, effect)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// The following table is based on the constants found in sfxlist.h (non-demo case).
|
||||
var soundEffects = []SoundEffectInfo{
|
||||
// Doors
|
||||
{Name: "DoorMetal", AudioIndex: 3},
|
||||
{Name: "DoorNormal", AudioIndex: 5},
|
||||
{Name: "DoorIris", AudioIndex: 6},
|
||||
{Name: "DoorBulkhead", AudioIndex: 67},
|
||||
{Name: "DoorGrating", AudioIndex: 90},
|
||||
|
||||
// Ambient
|
||||
{Name: "Bridge1", AudioIndex: -1},
|
||||
{Name: "Bridge2", AudioIndex: -1},
|
||||
{Name: "Bridge3", AudioIndex: -1},
|
||||
{Name: "Bridge4", AudioIndex: -1},
|
||||
{Name: "Maint1", AudioIndex: 9},
|
||||
{Name: "Maint2", AudioIndex: -1},
|
||||
{Name: "Maint3", AudioIndex: -1},
|
||||
{Name: "Maint4", AudioIndex: -1},
|
||||
{Name: "Grove1", AudioIndex: 43},
|
||||
|
||||
// Critters
|
||||
{Name: "Death1", AudioIndex: 11},
|
||||
{Name: "Death2", AudioIndex: 49},
|
||||
{Name: "Death3", AudioIndex: 50},
|
||||
{Name: "Death4", AudioIndex: 51},
|
||||
{Name: "Death5", AudioIndex: 53},
|
||||
{Name: "Death6", AudioIndex: 54},
|
||||
{Name: "Death7", AudioIndex: 68},
|
||||
{Name: "Death8", AudioIndex: 69},
|
||||
{Name: "Death9", AudioIndex: 88},
|
||||
{Name: "Death10", AudioIndex: 93},
|
||||
{Name: "Death11", AudioIndex: 101},
|
||||
{Name: "Attack1", AudioIndex: 12},
|
||||
{Name: "Attack4", AudioIndex: 46},
|
||||
{Name: "Attack5", AudioIndex: 48},
|
||||
{Name: "Attack6", AudioIndex: 52},
|
||||
{Name: "Attack7", AudioIndex: 55},
|
||||
{Name: "Attack8", AudioIndex: 63},
|
||||
{Name: "Attack9", AudioIndex: 16},
|
||||
{Name: "Notice1", AudioIndex: 58},
|
||||
{Name: "Notice2", AudioIndex: 59},
|
||||
{Name: "Notice3", AudioIndex: 74},
|
||||
{Name: "Notice4", AudioIndex: 75},
|
||||
{Name: "Notice5", AudioIndex: 100},
|
||||
{Name: "Near1", AudioIndex: 73},
|
||||
{Name: "Near2", AudioIndex: 56},
|
||||
{Name: "Near3", AudioIndex: 47},
|
||||
{Name: "Near4", AudioIndex: 25},
|
||||
|
||||
// Wacky Objects
|
||||
{Name: "Repulsor", AudioIndex: -1},
|
||||
{Name: "ForceBridge", AudioIndex: 72},
|
||||
{Name: "TerrainElevLoop", AudioIndex: 15},
|
||||
{Name: "SparkingCable", AudioIndex: 87},
|
||||
{Name: "SurgeryMachine", AudioIndex: 102},
|
||||
|
||||
// Combat
|
||||
{Name: "GunMinipistol", AudioIndex: 39},
|
||||
{Name: "GunDartpistol", AudioIndex: 86},
|
||||
{Name: "GunMagnum", AudioIndex: 40},
|
||||
{Name: "GunAssault", AudioIndex: 17},
|
||||
{Name: "GunRiot", AudioIndex: 41},
|
||||
{Name: "GunFlechette", AudioIndex: 38},
|
||||
{Name: "GunSkorpion", AudioIndex: 65},
|
||||
{Name: "GunMagpulse", AudioIndex: 45},
|
||||
{Name: "GunRailgun", AudioIndex: 29},
|
||||
{Name: "GunPipeHitMeat", AudioIndex: 4},
|
||||
{Name: "GunPipeHitMetal", AudioIndex: 21},
|
||||
{Name: "GunPipeMiss", AudioIndex: 24},
|
||||
{Name: "GunLaserepeeHit", AudioIndex: 31},
|
||||
{Name: "GunLaserepeeMiss", AudioIndex: 34},
|
||||
{Name: "GunPhaser", AudioIndex: 18},
|
||||
{Name: "GunBlaster", AudioIndex: 94},
|
||||
{Name: "GunIonbeam", AudioIndex: 95},
|
||||
{Name: "GunStungun", AudioIndex: 19},
|
||||
{Name: "GunPlasma", AudioIndex: 97},
|
||||
|
||||
{Name: "PlayerHurt", AudioIndex: 64},
|
||||
{Name: "Shield1", AudioIndex: 32},
|
||||
{Name: "Shield2", AudioIndex: 20},
|
||||
{Name: "ShieldUp", AudioIndex: 96},
|
||||
{Name: "ShieldDown", AudioIndex: 42},
|
||||
{Name: "MetalSpang", AudioIndex: 89},
|
||||
{Name: "Radiation", AudioIndex: 2},
|
||||
|
||||
{Name: "Reload1", AudioIndex: 22},
|
||||
{Name: "Reload2", AudioIndex: 23},
|
||||
{Name: "GrenadeArm", AudioIndex: 7},
|
||||
{Name: "BatteryUse", AudioIndex: 28},
|
||||
|
||||
{Name: "Explosion1", AudioIndex: 44},
|
||||
{Name: "Rumble", AudioIndex: 106},
|
||||
{Name: "Teleport", AudioIndex: 103},
|
||||
|
||||
{Name: "MonitorExplode", AudioIndex: 57},
|
||||
{Name: "CameraExplode", AudioIndex: 8},
|
||||
{Name: "CpuExplode", AudioIndex: 10},
|
||||
{Name: "DestroyCrate", AudioIndex: 37},
|
||||
{Name: "DestroyBarrel", AudioIndex: 109},
|
||||
|
||||
// Cspace
|
||||
{Name: "Pulser", AudioIndex: -1},
|
||||
{Name: "Drill", AudioIndex: -1},
|
||||
{Name: "Disc", AudioIndex: -1},
|
||||
{Name: "Datastorm", AudioIndex: -1},
|
||||
|
||||
{Name: "Recall", AudioIndex: -1},
|
||||
{Name: "Turbo", AudioIndex: -1},
|
||||
{Name: "Fakeid", AudioIndex: -1},
|
||||
{Name: "Decoy", AudioIndex: -1},
|
||||
|
||||
{Name: "EnterCspace", AudioIndex: 27},
|
||||
{Name: "OttoShodan", AudioIndex: 30},
|
||||
{Name: "CyberDamage", AudioIndex: -1},
|
||||
{Name: "Cyberheal", AudioIndex: -1},
|
||||
{Name: "Cybertoggle", AudioIndex: -1},
|
||||
{Name: "IceDefense", AudioIndex: -1},
|
||||
|
||||
{Name: "CyberAttack1", AudioIndex: -1},
|
||||
{Name: "CyberAttack2", AudioIndex: -1},
|
||||
{Name: "CyberAttack3", AudioIndex: -1},
|
||||
|
||||
// MFD and UI Wackiness
|
||||
{Name: "VideoDown", AudioIndex: 33},
|
||||
{Name: "MfdButton", AudioIndex: 35},
|
||||
{Name: "InventButton", AudioIndex: 79},
|
||||
{Name: "InventSelect", AudioIndex: 80},
|
||||
{Name: "InventAdd", AudioIndex: 81},
|
||||
{Name: "InventWare", AudioIndex: 82},
|
||||
{Name: "PatchUse", AudioIndex: 83},
|
||||
{Name: "ZoomBox", AudioIndex: 84},
|
||||
{Name: "MapZoom", AudioIndex: 85},
|
||||
{Name: "MfdKeypad", AudioIndex: 76},
|
||||
{Name: "MfdBuzz", AudioIndex: 77},
|
||||
{Name: "MfdSuccess", AudioIndex: 78},
|
||||
{Name: "Goggle", AudioIndex: 0},
|
||||
{Name: "Hudfrob", AudioIndex: 1},
|
||||
{Name: "Static", AudioIndex: 2},
|
||||
{Name: "Email", AudioIndex: 107},
|
||||
|
||||
// SHODAN
|
||||
{Name: "ShodanBark", AudioIndex: 30},
|
||||
{Name: "ShodanWeak", AudioIndex: 30},
|
||||
{Name: "ShodanStrong", AudioIndex: 30},
|
||||
|
||||
// Other
|
||||
{Name: "PanelSuccess", AudioIndex: 78},
|
||||
{Name: "PowerOut", AudioIndex: 26},
|
||||
{Name: "EnergyDrain", AudioIndex: 14},
|
||||
{Name: "EnergyRecharge", AudioIndex: 98},
|
||||
{Name: "Surge", AudioIndex: 60},
|
||||
{Name: "Vmail", AudioIndex: 92},
|
||||
{Name: "DropItem", AudioIndex: 99},
|
||||
|
||||
// 3d World
|
||||
{Name: "Button", AudioIndex: 71},
|
||||
{Name: "MechButton", AudioIndex: 36},
|
||||
{Name: "Bigbutton", AudioIndex: 61},
|
||||
{Name: "NormalLever", AudioIndex: 62},
|
||||
{Name: "Biglever", AudioIndex: 62},
|
||||
{Name: "Klaxon", AudioIndex: 70},
|
||||
|
||||
// Plot
|
||||
{Name: "GroveJett", AudioIndex: 66},
|
||||
|
||||
// Extra
|
||||
{Name: "PanelConfirm", AudioIndex: 13},
|
||||
{Name: "Death12", AudioIndex: 104},
|
||||
{Name: "Death13", AudioIndex: 105},
|
||||
{Name: "Death14", AudioIndex: 108},
|
||||
{Name: "Attack10", AudioIndex: 91},
|
||||
{Name: "Attack11", AudioIndex: 110},
|
||||
{Name: "Near5", AudioIndex: 111},
|
||||
{Name: "Death15", AudioIndex: 112},
|
||||
{Name: "FunPackAttackingUs", AudioIndex: 113},
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
// Package ids contains constants for all necessary identifier used in the world.
|
||||
// This package contains resource identifier, filenames and other constants necessary for storage.
|
||||
package ids
|
||||
Reference in New Issue
Block a user