Documentation ¶
Index ¶
- Constants
- func WriteSpellsYAML(path string, list []Spell) error
- type AnimateDraw
- type Animation
- type AnimationKind
- type ArmorAnimateDraw
- type ArmorDraw
- type BaseDraw
- type Box
- type Center
- type Circle
- type Class
- type ConditionalAnimateDraw
- type Data
- type DoorDraw
- type Draw
- type Extent
- type Flag
- type FlagDraw
- type GlyphDraw
- type Image
- type ImageRef
- type MaidenDraw
- type Material
- type MissilesSpell
- type MissilesSpellConf
- type MonsterAnimation
- type MonsterAnimationType
- type MonsterDraw
- type MonsterGeneratorDraw
- type PlayerAnim
- type PlayerDraw
- type ProcFunc
- type RGB
- type Reader
- func (f *Reader) Buffered() int
- func (f *Reader) Close() error
- func (f *Reader) ReadAll() (*Data, error)
- func (f *Reader) ReadImages() ([]Image, error)
- func (f *Reader) ReadSpells() ([]Spell, error)
- func (f *Reader) ReadSpellsSect() ([]Spell, error)
- func (f *Reader) ReadThingSect() (*Thing, error)
- func (f *Reader) ReadThings() ([]Thing, error)
- func (f *Reader) ReadWalls() ([]Wall, error)
- func (f *Reader) SkipSpellsSect() error
- func (f *Reader) SkipThingSect() error
- type Spell
- type SpellFlags
- func (f SpellFlags) Has(f2 SpellFlags) bool
- func (f SpellFlags) MarshalJSON() ([]byte, error)
- func (f SpellFlags) MarshalYAML() (interface{}, error)
- func (f SpellFlags) Split() []SpellFlags
- func (f SpellFlags) String() string
- func (f *SpellFlags) UnmarshalJSON(data []byte) error
- func (f *SpellFlags) UnmarshalYAML(unmarshal func(interface{}) error) error
- type SphericalShieldDraw
- type StaticDraw
- type StaticRandomDraw
- type SubClass
- type SummonEffectDraw
- type Thing
- type UnknownDraw
- type Wall
- type WallDirection
- type WallImage
- type WallVariant
- type WeaponAnimateDraw
- type WeaponDraw
- type ZSize
Constants ¶
const ( AnimationOneShot = AnimationKind(0) AnimationOneShotRemove = AnimationKind(1) AnimationLoop = AnimationKind(2) AnimationLoopAndFade = AnimationKind(3) AnimationRandom = AnimationKind(4) AnimationSlave = AnimationKind(5) )
const ( SpellFlagUnk1 = SpellFlags(0x1) // 1 SpellDuration = SpellFlags(0x2) // 2 SpellTargeted = SpellFlags(0x4) // 4 SpellAtLocation = SpellFlags(0x8) // 8 SpellMobsCanCast = SpellFlags(0x10) // 16 SpellOffensive = SpellFlags(0x20) // 32 SpellFlagUnk7 = SpellFlags(0x40) // 64 SpellFlagUnk8 = SpellFlags(0x80) // 128 SpellInstant = SpellFlags(0x100) // 256 SpellDefensive = SpellFlags(0x200) // 512 SpellFlagUnk11 = SpellFlags(0x400) // 1024 SpellFlagUnk12 = SpellFlags(0x800) // 2048 SpellSummonMain = SpellFlags(0x1000) // 4096 SpellSummonCreature = SpellFlags(0x2000) // 8192 SpellMarkMain = SpellFlags(0x4000) // 16384 SpellMarkNumber = SpellFlags(0x8000) // 32768 SpellGotoMarkMain = SpellFlags(0x10000) // 65536 SpellGotoMarkNumber = SpellFlags(0x20000) // 131072 SpellCanCounter = SpellFlags(0x40000) // 262144 SpellCantHoldCrown = SpellFlags(0x80000) // 524288 SpellFlagUnk21 = SpellFlags(0x100000) // 1048576 SpellCantTargetSelf = SpellFlags(0x200000) // 2097152 SpellNoTrap = SpellFlags(0x400000) // 4194304 SpellNoMana = SpellFlags(0x800000) // 8388608 SpellClassAny = SpellFlags(0x1000000) // 16777216 SpellClassWizard = SpellFlags(0x2000000) // 33554432 SpellClassConjurer = SpellFlags(0x4000000) // 67108864 SpellFlagUnk28 = SpellFlags(0x8000000) // 134217728 SpellFlagUnk29 = SpellFlags(0x10000000) // 268435456 SpellFlagUnk30 = SpellFlags(0x20000000) // 536870912 SpellFlagUnk31 = SpellFlags(0x40000000) // 1073741824 SpellFlagUnk32 = SpellFlags(0x80000000) // 2147483648 )
const ( MonsterAnimSpecial3 = MonsterAnimationType(0) // TODO static? MonsterAnimMelee = MonsterAnimationType(1) MonsterAnimMeleeEnd = MonsterAnimationType(2) MonsterAnimRanged = MonsterAnimationType(3) MonsterAnimRangedEnd = MonsterAnimationType(4) MonsterAnimDefend = MonsterAnimationType(5) MonsterAnimDefendEnd = MonsterAnimationType(6) MonsterAnimCast = MonsterAnimationType(7) MonsterAnimIdle = MonsterAnimationType(8) MonsterAnimDie = MonsterAnimationType(9) MonsterAnimDead = MonsterAnimationType(10) MonsterAnimHurt = MonsterAnimationType(11) MonsterAnimWalk = MonsterAnimationType(12) MonsterAnimRun = MonsterAnimationType(13) MonsterAnimSpecial1 = MonsterAnimationType(14) MonsterAnimSpecial2 = MonsterAnimationType(15) )
Variables ¶
This section is empty.
Functions ¶
func WriteSpellsYAML ¶
Types ¶
type AnimateDraw ¶
type AnimateDraw struct {
Anim Animation `json:"anim"`
}
type Animation ¶
type Animation struct { Field byte `json:"field"` Kind AnimationKind `json:"kind"` Frames []ImageRef `json:"frames"` }
type AnimationKind ¶
type AnimationKind int
func (AnimationKind) MarshalText ¶
func (k AnimationKind) MarshalText() ([]byte, error)
func (AnimationKind) String ¶
func (k AnimationKind) String() string
func (*AnimationKind) UnmarshalText ¶
func (k *AnimationKind) UnmarshalText(text []byte) error
type ArmorAnimateDraw ¶
type ArmorAnimateDraw struct {
Anim Animation `json:"armor_anim"`
}
type ConditionalAnimateDraw ¶
type ConditionalAnimateDraw struct {
Anims []Animation `json:"cond_anim"`
}
type Extent ¶
type Extent interface {
// contains filtered or unexported methods
}
func ParseExtent ¶
type ImageRef ¶
type ImageRef struct { Ind int `json:"ind,omitempty" yaml:"ind,omitempty"` Ind2 int `json:"ind_2,omitempty" yaml:"ind_2,omitempty"` Name string `json:"name,omitempty" yaml:"name,omitempty"` }
func (ImageRef) MarshalJSON ¶
func (*ImageRef) UnmarshalJSON ¶
type MaidenDraw ¶
type MaidenDraw struct {
Anims []MonsterAnimation `json:"maiden"`
}
type MissilesSpell ¶
type MissilesSpell struct { Count int `json:"count,omitempty" yaml:"count,omitempty"` Spread uint16 `json:"spread,omitempty" yaml:"spread,omitempty"` Projectile string `json:"projectile,omitempty" yaml:"projectile,omitempty"` VelMult float32 `json:"vel_mult,omitempty" yaml:"vel_mult,omitempty"` Offset float32 `json:"offset,omitempty" yaml:"offset,omitempty"` SpeedRndMin float64 `json:"speed_rnd_min,omitempty" yaml:"speed_rnd_min,omitempty"` SpeedRndMax float64 `json:"speed_rnd_max,omitempty" yaml:"speed_rnd_max,omitempty"` SearchDist float32 `json:"search_dist,omitempty" yaml:"search_dist,omitempty"` }
func (*MissilesSpell) Merge ¶
func (opts *MissilesSpell) Merge(opts2 *MissilesSpell)
func (*MissilesSpell) SetDefaults ¶
func (opts *MissilesSpell) SetDefaults()
type MissilesSpellConf ¶
type MissilesSpellConf struct { MissilesSpell `yaml:",inline"` Levels []MissilesSpell `json:"levels,omitempty" yaml:"levels,omitempty"` }
func (*MissilesSpellConf) Level ¶
func (opts *MissilesSpellConf) Level(lvl int) MissilesSpell
type MonsterAnimation ¶
type MonsterAnimation struct { Type MonsterAnimationType `json:"type"` Sound string `json:"sound,omitempty"` Field8 string `json:"field_8,omitempty"` FramesPerDir byte `json:"frames_per_dir"` Field10 byte `json:"field_10,omitempty"` Kind AnimationKind `json:"kind"` Frames [8][]ImageRef `json:"frames"` }
type MonsterAnimationType ¶
type MonsterAnimationType byte
func (MonsterAnimationType) String ¶
func (v MonsterAnimationType) String() string
type MonsterDraw ¶
type MonsterDraw struct {
Anims []MonsterAnimation `json:"monster"`
}
type MonsterGeneratorDraw ¶
type MonsterGeneratorDraw struct {
Anims []Animation `json:"monster_gen"`
}
type PlayerAnim ¶
type PlayerDraw ¶
type PlayerDraw struct {
Anims map[player.AnimType]*PlayerAnim `json:"player"`
}
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(r io.ReadSeeker) *Reader
NewReader creates a new thing.bin file reader. It assumes the file was already decrypted.
func Open ¶
Open thing.bin file. It is similar to OpenReader, but will automatically open file and select decryption key.
func OpenReader ¶
func OpenReader(f io.ReadSeeker, key int) (*Reader, error)
OpenReader creates a new thing.bin file reader and decrypts it with a given key. If key is set to zero, default key is used.
func (*Reader) ReadImages ¶
func (*Reader) ReadSpells ¶
func (*Reader) ReadSpellsSect ¶
ReadSpellsSect reads one SPEL section. It assumes the reader is already positioned at the section start.
func (*Reader) ReadThingSect ¶
ReadThingSect reads one THNG section. It assumes the reader is already positioned at the section start.
func (*Reader) ReadThings ¶
func (*Reader) SkipSpellsSect ¶
SkipSpellsSect skips one SPEL section. It assumes the reader is already positioned at the section start.
func (*Reader) SkipThingSect ¶
SkipThingSect skips one THNG section. It assumes the reader is already positioned at the section start.
type Spell ¶
type Spell struct { ID string `json:"name" yaml:"name"` Effect string `json:"effect,omitempty" yaml:"effect,omitempty"` Icon *ImageRef `json:"icon,omitempty" yaml:"icon,omitempty"` IconEnabled *ImageRef `json:"icon_enabled,omitempty" yaml:"icon_enabled,omitempty"` ManaCost int `json:"mana_cost" yaml:"mana_cost"` Price int `json:"price" yaml:"price"` Flags SpellFlags `json:"flags" yaml:"flags"` Phonemes []spell.Phoneme `json:"phonemes,omitempty" yaml:"phonemes,flow,omitempty"` Title strman.ID `json:"title,omitempty" yaml:"title,omitempty"` Desc strman.ID `json:"desc,omitempty" yaml:"desc,omitempty"` CastSound string `json:"cast_sound,omitempty" yaml:"cast_sound,omitempty"` OnSound string `json:"on_sound,omitempty" yaml:"on_sound,omitempty"` OffSound string `json:"off_sound,omitempty" yaml:"off_sound,omitempty"` Missiles *MissilesSpellConf `json:"missiles,omitempty" yaml:"missiles,omitempty"` }
func ReadSpellsYAML ¶
type SpellFlags ¶
type SpellFlags uint32
func (SpellFlags) Has ¶
func (f SpellFlags) Has(f2 SpellFlags) bool
func (SpellFlags) MarshalJSON ¶
func (f SpellFlags) MarshalJSON() ([]byte, error)
func (SpellFlags) MarshalYAML ¶
func (f SpellFlags) MarshalYAML() (interface{}, error)
func (SpellFlags) Split ¶
func (f SpellFlags) Split() []SpellFlags
func (SpellFlags) String ¶
func (f SpellFlags) String() string
func (*SpellFlags) UnmarshalJSON ¶
func (f *SpellFlags) UnmarshalJSON(data []byte) error
func (*SpellFlags) UnmarshalYAML ¶
func (f *SpellFlags) UnmarshalYAML(unmarshal func(interface{}) error) error
type SphericalShieldDraw ¶
type SphericalShieldDraw struct {
Anim Animation `json:"spherical_shield"`
}
type StaticDraw ¶
type StaticDraw struct {
Img ImageRef `json:"static"`
}
type StaticRandomDraw ¶
type StaticRandomDraw struct {
Imgs []ImageRef `json:"random"`
}
type SummonEffectDraw ¶
type SummonEffectDraw struct {
Anim Animation `json:"summon"`
}
type Thing ¶
type Thing struct { Name string `json:"name" nox:"-"` PrettyName strman.ID `json:"pretty_name,omitempty" nox:"PRETTYNAME"` Description strman.ID `json:"description,omitempty" nox:"DESCRIPTION"` Class []Class `json:"class,omitempty" nox:"CLASS"` SubClass []SubClass `json:"sub_class,omitempty" nox:"SUBCLASS"` Flags []Flag `json:"flags,omitempty" nox:"FLAGS"` Material []Material `json:"material,omitempty" nox:"MATERIAL"` Menu *ImageRef `json:"menu,omitempty" nox:"MENUICON"` Image *ImageRef `json:"image,omitempty" nox:"PRETTYIMAGE"` Health *int `json:"health,omitempty" nox:"HEALTH"` Speed *int `json:"speed,omitempty" nox:"SPEED"` Size *image.Point `json:"size,omitempty" nox:"-"` ZSize *ZSize `json:"zsize,omitempty" nox:"-"` Z *int `json:"z,omitempty" nox:"Z"` Extent Extent `json:"extent,omitempty" nox:"-"` Mass float64 `json:"mass,omitempty" nox:"MASS"` Weight int `json:"weight,omitempty" nox:"WEIGHT"` Price *int `json:"price,omitempty" nox:"WORTH"` CarryCap int `json:"carry_cap,omitempty" nox:"CARRYCAPACITY"` Lifetime int `json:"lifetime,omitempty" nox:"LIFETIME"` Experience int `json:"experience,omitempty" nox:"EXPERIENCE"` Draw Draw `json:"draw,omitempty" nox:"-"` AudioLoop string `json:"audio_loop,omitempty" nox:"AUDIOLOOP"` DamageSound string `json:"damage_sound,omitempty" nox:"DAMAGESOUND"` LightIntensity int `json:"light_intensity,omitempty" nox:"LIGHTINTENSITY"` LightDirection int `json:"light_direction,omitempty" nox:"LIGHTDIRECTION"` LightPenumbra int `json:"light_penumbra,omitempty" nox:"LIGHTPENUMBRA"` LightColor *RGB `json:"light_color,omitempty" nox:"-"` Preprocess *ProcFunc `json:"preprocess,omitempty" nox:"PREPROCESS"` OnCreate *ProcFunc `json:"on_create,omitempty" nox:"CREATE"` OnInit *ProcFunc `json:"on_init,omitempty" nox:"INIT"` OnUpdate *ProcFunc `json:"on_update,omitempty" nox:"UPDATE"` OnDamage *ProcFunc `json:"on_damage,omitempty" nox:"DAMAGE"` OnClientUpdate *ProcFunc `json:"on_client_update,omitempty" nox:"CLIENTUPDATE"` OnCollide *ProcFunc `json:"on_collide,omitempty" nox:"COLLIDE"` OnPickup *ProcFunc `json:"on_pickup,omitempty" nox:"PICKUP"` OnUse *ProcFunc `json:"on_use,omitempty" nox:"USE"` OnDrop *ProcFunc `json:"on_drop,omitempty" nox:"DROP"` OnXfer *ProcFunc `json:"on_xfer,omitempty" nox:"XFER"` OnDestroy *ProcFunc `json:"on_destroy,omitempty" nox:"DESTROY"` OnDie *ProcFunc `json:"on_die,omitempty" nox:"DIE"` }
type UnknownDraw ¶
type UnknownDraw struct {
Type string `json:"unknown"`
}
type WallDirection ¶
type WallDirection struct {
Variants []WallVariant `json:"variants,omitempty"`
}
type WallVariant ¶
type WallVariant struct {
Images [4]WallImage `json:"images,omitempty"`
}
type WeaponAnimateDraw ¶
type WeaponAnimateDraw struct {
Anim Animation `json:"weapon_anim"`
}
type WeaponDraw ¶
type WeaponDraw struct {
Img ImageRef `json:"weapon"`
}