2019-11-03 22:03:22 -05:00
|
|
|
package Common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/ResourcePaths"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MissileCalcParam struct {
|
|
|
|
Param int
|
|
|
|
Desc string
|
|
|
|
}
|
|
|
|
|
|
|
|
type MissileCalc struct {
|
|
|
|
Calc string
|
|
|
|
Desc string
|
|
|
|
Params []MissileCalcParam
|
|
|
|
}
|
|
|
|
|
|
|
|
type MissileLight struct {
|
|
|
|
Diameter int
|
|
|
|
Flicker int
|
|
|
|
Red uint8
|
|
|
|
Green uint8
|
|
|
|
Blue uint8
|
|
|
|
}
|
|
|
|
|
|
|
|
type MissileAnimation struct {
|
|
|
|
StepsBeforeVisible int
|
|
|
|
StepsBeforeActive int
|
|
|
|
LoopAnimation bool
|
|
|
|
CelFileName string
|
|
|
|
AnimationRate int // seems to do nothing
|
|
|
|
AnimationLength int
|
|
|
|
AnimationSpeed int
|
2019-11-05 20:46:52 -05:00
|
|
|
StartingFrame int // called "RandFrame"
|
2019-11-03 22:03:22 -05:00
|
|
|
HasSubLoop bool // runs after first animation ends
|
|
|
|
SubStartingFrame int
|
|
|
|
SubEndingFrame int
|
|
|
|
}
|
|
|
|
|
|
|
|
type MissileCollision struct {
|
2019-11-05 20:46:52 -05:00
|
|
|
CollisionType int // controls the kind of collision
|
|
|
|
// 0 = none, 1 = units only, 3 = normal (units, walls),
|
|
|
|
// 6 = walls only, 8 = walls, units, and floors
|
2019-11-03 22:03:22 -05:00
|
|
|
DestroyedUponCollision bool
|
|
|
|
FriendlyFire bool
|
|
|
|
LastCollide bool // unknown
|
|
|
|
Collision bool // unknown
|
|
|
|
ClientCollision bool // unknown
|
|
|
|
ClientSend bool // unclear
|
|
|
|
UseCollisionTimer bool // after hit, use timer before dying
|
2019-11-05 20:46:52 -05:00
|
|
|
TimerFrames int // how many frames to persist
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type MissileDamage struct {
|
2019-11-05 20:46:52 -05:00
|
|
|
MinDamage int
|
|
|
|
MaxDamage int
|
|
|
|
MinLevelDamage [5]int // additional damage per missile level
|
2019-11-03 22:03:22 -05:00
|
|
|
// [0]: lvs 2-8, [1]: lvs 9-16, [2]: lvs 17-22, [3]: lvs 23-28, [4]: lv 29+
|
2019-11-05 20:46:52 -05:00
|
|
|
MaxLevelDamage [5]int // see above
|
|
|
|
DamageSynergyPerCalc string // works like synergy in skills.txt, not clear
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type MissileElementalDamage struct {
|
|
|
|
Damage MissileDamage
|
|
|
|
ElementType string
|
2019-11-05 20:46:52 -05:00
|
|
|
Duration int // frames, 25 = 1 second
|
2019-11-03 22:03:22 -05:00
|
|
|
LevelDuration [3]int // 0,1,2, unknown level intervals, bonus duration per level
|
|
|
|
}
|
|
|
|
|
|
|
|
type MissileRecord struct {
|
2019-11-05 20:46:52 -05:00
|
|
|
Name string
|
|
|
|
Id int
|
|
|
|
|
|
|
|
ClientMovementFunc int
|
|
|
|
ClientCollisionFunc int
|
|
|
|
ServerMovementFunc int
|
|
|
|
ServerCollisionFunc int
|
|
|
|
ServerDamageFunc int
|
|
|
|
ServerMovementCalc MissileCalc
|
|
|
|
ClientMovementCalc MissileCalc
|
|
|
|
ServerCollisionCalc MissileCalc
|
|
|
|
ClientCollisionCalc MissileCalc
|
|
|
|
ServerDamageCalc MissileCalc
|
|
|
|
|
|
|
|
Velocity int
|
|
|
|
MaxVelocity int
|
|
|
|
LevelVelocityBonus int
|
|
|
|
Accel int
|
|
|
|
Range int
|
|
|
|
LevelRangeBonus int
|
|
|
|
|
|
|
|
Light MissileLight
|
|
|
|
|
|
|
|
Animation MissileAnimation
|
|
|
|
|
|
|
|
Collision MissileCollision
|
|
|
|
|
|
|
|
XOffset int
|
|
|
|
YOffset int
|
|
|
|
ZOffset int
|
|
|
|
Size int // diameter
|
|
|
|
|
|
|
|
DestroyedByTP bool // if true, destroyed when source player teleports to town
|
|
|
|
DestroyedByTPFrame int // see above, for client side, (this is a guess) which frame it vanishes on
|
|
|
|
CanDestroy bool // unknown
|
|
|
|
|
|
|
|
UseAttackRating bool // if true, uses 'attack rating' to determine if it hits or misses
|
2019-11-03 22:03:22 -05:00
|
|
|
// if false, has a 95% chance to hit.
|
2019-11-05 20:46:52 -05:00
|
|
|
AlwaysExplode bool // if true, always calls its collision function when it is destroyed, even if it doesn't hit anything
|
2019-11-03 22:03:22 -05:00
|
|
|
// note that some collision functions (lightning fury) seem to ignore this and always explode regardless of setting (requires investigation)
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
ClientExplosion bool // if true, does not really exist
|
2019-11-03 22:03:22 -05:00
|
|
|
// is only aesthetic / client side
|
2019-11-05 20:46:52 -05:00
|
|
|
TownSafe bool // if true, doesn't vanish when spawned in town
|
2019-11-03 22:03:22 -05:00
|
|
|
// if false, vanishes when spawned in town
|
2019-11-05 20:46:52 -05:00
|
|
|
IgnoreBossModifiers bool // if true, doesn't get bonuses from boss mods
|
|
|
|
IgnoreMultishot bool // if true, can't gain the mulitshot modifier
|
|
|
|
HolyFilterType int // specifies what this missile can hit
|
2019-11-03 22:03:22 -05:00
|
|
|
// 0 = all units, 1 = undead only, 2 = demons only, 3 = all units (again?)
|
2019-11-05 20:46:52 -05:00
|
|
|
CanBeSlowed bool // if true, is affected by skill_handofathena
|
|
|
|
TriggersHitEvents bool // if true, triggers events that happen "upon getting hit" on targets
|
|
|
|
TriggersGetHit bool // if true, can cause target to enter hit recovery mode
|
|
|
|
SoftHit bool // unknown
|
|
|
|
KnockbackPercent int // chance of knocking the target back, 0-100
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
TransparencyMode int // controls rendering
|
2019-11-03 22:03:22 -05:00
|
|
|
// 0 = normal, 1 = alpha blending (darker = more transparent)
|
|
|
|
// 2 = special (black and white?)
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
UseQuantity bool // if true, uses quantity
|
2019-11-03 22:03:22 -05:00
|
|
|
// not clear what this means. Also apparently requires a special starting function in skills.txt
|
2019-11-05 20:46:52 -05:00
|
|
|
AffectedByPierce bool // if true, affected by the pierce modifier and the Pierce skill
|
|
|
|
SpecialSetup bool // unknown, only true for potions
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
MissileSkill bool // if true, applies elemental damage from items to the splash radius instead of normal damage modifiers
|
|
|
|
SkillName string // if not empty, the missile will refer to this skill instead of its own data for the following:
|
2019-11-03 22:03:22 -05:00
|
|
|
// "ResultFlags, HitFlags, HitShift, HitClass, SrcDamage (SrcDam in skills.txt!),
|
|
|
|
// MinDam, MinLevDam1-5, MaxDam, MaxLevDam1-5, DmgSymPerCalc, EType, EMin, EMinLev1-5,
|
|
|
|
// EMax, EMaxLev1-5, EDmgSymPerCalc, ELen, ELenLev1-3, ELenSymPerCalc"
|
2019-11-05 20:46:52 -05:00
|
|
|
|
|
|
|
ResultFlags int // unknown
|
2019-11-03 22:03:22 -05:00
|
|
|
// 4 = normal missiles, 5 = explosions, 8 = non-damaging missiles
|
2019-11-05 20:46:52 -05:00
|
|
|
HitFlags int // unknown
|
2019-11-03 22:03:22 -05:00
|
|
|
// 2 = explosions, 5 = freezing arrow
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
HitShift int // damage is measured in 256s
|
2019-11-03 22:03:22 -05:00
|
|
|
// the actual damage is [damage] * 2 ^ [hitshift]
|
|
|
|
// e.g. 100 damage, 8 hitshift = 100 * 2 ^ 8 = 100 * 256 = 25600
|
|
|
|
// (visually, the damage is this result / 256)
|
2019-11-05 20:46:52 -05:00
|
|
|
ApplyMastery bool // unknown
|
|
|
|
SourceDamage int // 0-128, 128 is 100%
|
2019-11-03 22:03:22 -05:00
|
|
|
// percentage of source units attack properties to apply to the missile?
|
|
|
|
// not only affects damage but also other modifiers like lifesteal and manasteal (need a complete list)
|
|
|
|
// setting this to -1 "gets rid of SrcDmg from skills.txt", not clear what that means
|
|
|
|
HalfDamageForTwoHander bool // if true, damage is halved when a two-handed weapon is used
|
2019-11-05 20:46:52 -05:00
|
|
|
SourceMissDamage int // 0-128, 128 is 100%
|
2019-11-03 22:03:22 -05:00
|
|
|
// unknown, only used for poison clouds.
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
Damage MissileDamage
|
|
|
|
ElementalDamage MissileElementalDamage
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
HitClass int // controls clientside aesthetic effects for collisions
|
2019-11-03 22:03:22 -05:00
|
|
|
// particularly sound effects that are played on a hit
|
2019-11-05 20:46:52 -05:00
|
|
|
NumDirections int // count of dirs in the DCC loaded by CelFile
|
2019-11-03 22:03:22 -05:00
|
|
|
// apparently this value is no longer needed in D2
|
2019-11-05 20:46:52 -05:00
|
|
|
LocalBlood int // blood effects?
|
2019-11-03 22:03:22 -05:00
|
|
|
// 0 = no blood, 1 = blood, 2 = blood and affected by open wounds
|
2019-11-05 20:46:52 -05:00
|
|
|
DamageReductionRate int // how many frames between applications of the
|
2019-11-03 22:03:22 -05:00
|
|
|
// magic_damage_reduced stat, so for instance on a 0 this stat applies every frame
|
|
|
|
// on a 3, only every 4th frame has damage reduced
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
TravelSound string // name of sound to play during lifetime
|
2019-11-03 22:03:22 -05:00
|
|
|
// whether or not it loops depends on the specific sound's settings?
|
|
|
|
// if it doesn't loop, it's just a on-spawn sound effect
|
2019-11-05 20:46:52 -05:00
|
|
|
HitSound string // sound plays upon collision
|
|
|
|
ProgSound string // plays at "special events", like a mariachi band
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
ProgOverlay string // name of an overlay from overlays.txt to use at special events
|
|
|
|
ExplosionMissile string // name of a missile from missiles.txt that is created upon collision
|
2019-11-03 22:03:22 -05:00
|
|
|
// or anytime it is destroyed if AlwaysExplode is true
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
SubMissile [3]string // 0,1,2 name of missiles spawned by movement function
|
|
|
|
HitSubMissile [4]string // 0,1,2 name of missiles spawned by collision function
|
|
|
|
ClientSubMissile [3]string // see above, but for client only
|
|
|
|
ClientHitSubMissile [4]string // see above, but for client only
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func createMissileRecord(line string) MissileRecord {
|
|
|
|
r := strings.Split(line, "\t")
|
|
|
|
i := -1
|
|
|
|
inc := func() int {
|
|
|
|
i++
|
|
|
|
return i
|
|
|
|
}
|
|
|
|
// note: in this file, empties are equivalent to zero, so all numerical conversions should
|
|
|
|
// be wrapped in an EmptyToZero transform
|
|
|
|
result := MissileRecord{
|
|
|
|
Name: r[inc()],
|
2019-11-05 20:46:52 -05:00
|
|
|
Id: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
ClientMovementFunc: StringToInt(EmptyToZero(AsterToEmpty(r[inc()]))),
|
2019-11-03 22:03:22 -05:00
|
|
|
ClientCollisionFunc: StringToInt(EmptyToZero(AsterToEmpty(r[inc()]))),
|
2019-11-05 20:46:52 -05:00
|
|
|
ServerMovementFunc: StringToInt(EmptyToZero(AsterToEmpty(r[inc()]))),
|
2019-11-03 22:03:22 -05:00
|
|
|
ServerCollisionFunc: StringToInt(EmptyToZero(AsterToEmpty(r[inc()]))),
|
2019-11-05 20:46:52 -05:00
|
|
|
ServerDamageFunc: StringToInt(EmptyToZero(AsterToEmpty(r[inc()]))),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
ServerMovementCalc: loadMissileCalc(&r, inc, 5),
|
|
|
|
ClientMovementCalc: loadMissileCalc(&r, inc, 5),
|
2019-11-03 22:03:22 -05:00
|
|
|
ServerCollisionCalc: loadMissileCalc(&r, inc, 3),
|
|
|
|
ClientCollisionCalc: loadMissileCalc(&r, inc, 3),
|
2019-11-05 20:46:52 -05:00
|
|
|
ServerDamageCalc: loadMissileCalc(&r, inc, 2),
|
|
|
|
|
|
|
|
Velocity: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
MaxVelocity: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
LevelVelocityBonus: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
Accel: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
Range: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
LevelRangeBonus: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
|
|
|
Light: loadMissileLight(&r, inc),
|
|
|
|
|
|
|
|
Animation: loadMissileAnimation(&r, inc),
|
|
|
|
|
|
|
|
Collision: loadMissileCollision(&r, inc),
|
|
|
|
|
|
|
|
XOffset: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
YOffset: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
ZOffset: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
Size: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
DestroyedByTP: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-03 22:03:22 -05:00
|
|
|
DestroyedByTPFrame: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
CanDestroy: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-03 22:03:22 -05:00
|
|
|
|
|
|
|
UseAttackRating: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-05 20:46:52 -05:00
|
|
|
AlwaysExplode: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
ClientExplosion: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
TownSafe: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-03 22:03:22 -05:00
|
|
|
IgnoreBossModifiers: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-05 20:46:52 -05:00
|
|
|
IgnoreMultishot: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
HolyFilterType: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
CanBeSlowed: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
TriggersHitEvents: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
TriggersGetHit: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
SoftHit: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
KnockbackPercent: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
|
|
|
TransparencyMode: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
UseQuantity: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-03 22:03:22 -05:00
|
|
|
AffectedByPierce: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-05 20:46:52 -05:00
|
|
|
SpecialSetup: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-03 22:03:22 -05:00
|
|
|
|
|
|
|
MissileSkill: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-05 20:46:52 -05:00
|
|
|
SkillName: r[inc()],
|
2019-11-03 22:03:22 -05:00
|
|
|
|
|
|
|
ResultFlags: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
HitFlags: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
HitShift: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
ApplyMastery: StringToInt(EmptyToZero(r[inc()])) == 1,
|
|
|
|
SourceDamage: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
HalfDamageForTwoHander: StringToInt(EmptyToZero(r[inc()])) == 1,
|
2019-11-05 20:46:52 -05:00
|
|
|
SourceMissDamage: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
Damage: loadMissileDamage(&r, inc),
|
2019-11-03 22:03:22 -05:00
|
|
|
ElementalDamage: loadMissileElementalDamage(&r, inc),
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
HitClass: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
NumDirections: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
LocalBlood: StringToInt(EmptyToZero(r[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
DamageReductionRate: StringToInt(EmptyToZero(r[inc()])),
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
TravelSound: r[inc()],
|
|
|
|
HitSound: r[inc()],
|
|
|
|
ProgSound: r[inc()],
|
|
|
|
ProgOverlay: r[inc()],
|
2019-11-03 22:03:22 -05:00
|
|
|
ExplosionMissile: r[inc()],
|
|
|
|
|
2019-11-05 20:46:52 -05:00
|
|
|
SubMissile: [3]string{r[inc()], r[inc()], r[inc()]},
|
|
|
|
HitSubMissile: [4]string{r[inc()], r[inc()], r[inc()], r[inc()]},
|
|
|
|
ClientSubMissile: [3]string{r[inc()], r[inc()], r[inc()]},
|
2019-11-03 22:03:22 -05:00
|
|
|
ClientHitSubMissile: [4]string{r[inc()], r[inc()], r[inc()], r[inc()]},
|
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
var Missiles map[int]*MissileRecord
|
|
|
|
|
|
|
|
func LoadMissiles(fileProvider FileProvider) {
|
|
|
|
Missiles = make(map[int]*MissileRecord)
|
|
|
|
data := strings.Split(string(fileProvider.LoadFile(ResourcePaths.Missiles)), "\r\n")[1:]
|
|
|
|
for _, line := range data {
|
|
|
|
if len(line) == 0 {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
rec := createMissileRecord(line)
|
|
|
|
Missiles[rec.Id] = &rec
|
|
|
|
}
|
|
|
|
log.Printf("Loaded %d missiles", len(Missiles))
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileCalcParam(r *[]string, inc func() int) MissileCalcParam {
|
|
|
|
result := MissileCalcParam{
|
|
|
|
Param: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
Desc: (*r)[inc()],
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileCalc(r *[]string, inc func() int, params int) MissileCalc {
|
|
|
|
result := MissileCalc{
|
|
|
|
Calc: (*r)[inc()],
|
|
|
|
Desc: (*r)[inc()],
|
|
|
|
}
|
|
|
|
result.Params = make([]MissileCalcParam, params)
|
|
|
|
for p := 0; p < params; p++ {
|
2019-11-05 20:46:52 -05:00
|
|
|
result.Params[p] = loadMissileCalcParam(r, inc)
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileLight(r *[]string, inc func() int) MissileLight {
|
|
|
|
result := MissileLight{
|
|
|
|
Diameter: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
Flicker: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
Red: StringToUint8(EmptyToZero((*r)[inc()])),
|
|
|
|
Green: StringToUint8(EmptyToZero((*r)[inc()])),
|
|
|
|
Blue: StringToUint8(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileAnimation(r *[]string, inc func() int) MissileAnimation {
|
|
|
|
result := MissileAnimation{
|
|
|
|
StepsBeforeVisible: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-05 20:46:52 -05:00
|
|
|
StepsBeforeActive: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
LoopAnimation: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
CelFileName: (*r)[inc()],
|
|
|
|
AnimationRate: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
AnimationLength: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
AnimationSpeed: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StartingFrame: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
HasSubLoop: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
SubStartingFrame: StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
SubEndingFrame: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileCollision(r *[]string, inc func() int) MissileCollision {
|
|
|
|
result := MissileCollision{
|
2019-11-05 20:46:52 -05:00
|
|
|
CollisionType: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
DestroyedUponCollision: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
2019-11-05 20:46:52 -05:00
|
|
|
FriendlyFire: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
LastCollide: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
Collision: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
ClientCollision: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
ClientSend: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
UseCollisionTimer: StringToInt(EmptyToZero((*r)[inc()])) == 1,
|
|
|
|
TimerFrames: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileDamage(r *[]string, inc func() int) MissileDamage {
|
|
|
|
result := MissileDamage{
|
2019-11-05 20:46:52 -05:00
|
|
|
MinDamage: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
MinLevelDamage: [5]int{
|
2019-11-05 20:46:52 -05:00
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
},
|
2019-11-05 20:46:52 -05:00
|
|
|
MaxDamage: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
MaxLevelDamage: [5]int{
|
2019-11-05 20:46:52 -05:00
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
},
|
2019-11-05 20:46:52 -05:00
|
|
|
DamageSynergyPerCalc: (*r)[inc()],
|
2019-11-03 22:03:22 -05:00
|
|
|
}
|
|
|
|
return result
|
|
|
|
}
|
|
|
|
|
|
|
|
func loadMissileElementalDamage(r *[]string, inc func() int) MissileElementalDamage {
|
|
|
|
result := MissileElementalDamage{
|
|
|
|
ElementType: (*r)[inc()],
|
2019-11-05 20:46:52 -05:00
|
|
|
Damage: loadMissileDamage(r, inc),
|
|
|
|
Duration: StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
LevelDuration: [3]int{
|
2019-11-05 20:46:52 -05:00
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
|
|
|
StringToInt(EmptyToZero((*r)[inc()])),
|
2019-11-03 22:03:22 -05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
return result
|
2019-11-05 20:46:52 -05:00
|
|
|
}
|