DT6

From OHRRPGCE-Wiki
Jump to navigation Jump to search

This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records ATTACK.BIN, which is resizeable using BINSIZE.BIN

In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.

Grey fields are obsolete or unused.

Complete Attack Data Formal Specs[edit]

About Formal Specs

Offset Data Meaning
0 INT (1) Animation picture
1 INT (1) Animation palette, or -1 for default
2 INT (1) Animation pattern:

0 = Cycle forward
1 = Cycle backward
2 = Oscillate
3 = Random

3 INT (1) Target Class:

0 = Enemy
1 = Ally excluding dead
2 = Self
3 = All
4 = Ally including dead
5 = Ally excluding self
6 = Revenge (last to hurt attacker)
7 = Revenge (whole battle)
8 = Previous target
9 = Recorded target
10 = Dead allies (heroes only)
11 = Thankvenge (last to cure attacker)
12 = Thankvenge (whole battle)
13 = Counter (last to hit attacker)
14 = all-including-dead
15 = dead foe (heroes only)
16 = foe-including-dead
17 = Spawned by last attack

4 INT (1) Target Setting:

0 = Focused
1 = Spread
2 = Optional spread
3 = Random focus
4 = First target

5 INT (1) Damage Equation:

0 = Normal: Atk - Def*.5
1 = Blunt: Atk*.8 - Def*.1
2 = Sharp: Atk*1.3 - Def
3 = Pure Damage
4 = No Damage
5 = Set target stat to (100+extra damage)% of Max
6 = Set target stat to (100+extra damage)% of Current
7 = Custom: Atk * Attack_multiplier - Def * Defense_multiplier

6 INT (1) Aim Math:

(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while AccStat and DogStat refer to "Base Accuracy Stat" and "Base Dodge Stat", AimMult and DogMult are the Accuracy multiplier and Dodge multiplier data, and Extra is Aim Math extra value)

0 = Normal: Aim*4 vs Dog
1 = Poor: Aim*2 vs Dog
2 = Bad: Aim vs Dog
3 = Never misses
4 = Magic: Mag vs Wil*1.25
5 = Percentage: Aim% * (100 - Dog)%
6 = Percentage: Aim%
7 = Percentage: Mag% * (100 - Wil)%
8 = Percentage: Mag%
9 = Custom: Extra + AccMult * AccStat vs DogMult * DogStat
10 = Custom Percentage: Extra + AccMult * AccStat% * (100 - DogMult * DogStat)%
11 = Custom Gaussian: F(Extra + AccMult * AccStat vs DogMult * DogStat) where F is the cumulative distrib. of Normal(0, sqrt(2))
12 = Custom Percentage (capped defense): (Extra + AccMult * AccStat)% * (100 - DogMult * DogStat)%

7 INT (1) Base Attack Stat:

0 = Atk (attacker)
1 = Mag (attacker)
2 = HP (attacker)
3 = Lost HP (attacker)
4 = Random (0 to 999)
5 = 100
6 = HP (attacker)
7 = MP (attacker)
8 = Atk (attacker)
9 = Aim (attacker)
10 = Def (attacker)
11 = Dog (attacker)
12 = Mag (attacker)
13 = Wil (attacker)
14 = Spd (attacker)
15 = Ctr (attacker)
16 = Focus (attacker)
17 = Extra Hits (attacker)
18 = Last damage by attacker
19 = Last damage to attacker
20 = Last damage to target
21 = Last cure to attacker
22 = Last cure to target
23 = HP (target)
24 = MP (target)
25 = Atk (target)
26 = Aim (target)
27 = Def (target)
28 = Dog (target)
29 = Mag (target)
30 = Wil (target)
31 = Spd (target)
32 = Ctr (target)
33 = Focus (target)
34 = Extra Hits (target)
35 = Max HP (attacker)
36 = Max MP (attacker)
37 = Max Atk (attacker)
38 = Max Aim (attacker)
39 = Max Def (attacker)
40 = Max Dog (attacker)
41 = Max Mag (attacker)
42 = Max Wil (attacker)
43 = Max Spd (attacker)
44 = Max Ctr (attacker)
45 = Max Focus (attacker)
46 = Max extra Hits (attacker)
47 = Max HP (target)
48 = Max MP (target)
49 = Max Atk (target)
50 = Max Aim (target)
51 = Max Def (target)
52 = Max Dog (target)
53 = Max Mag (target)
54 = Max Wil (target)
55 = Max Spd (target)
56 = Max Ctr (target)
57 = Max Focus (target)
58 = Max extra Hits (target)
59 = 100 times number of targets
60 = Lost MP (attacker)
61 = Lost MP (target)
62 = Lost HP (target)

8 INT (1) MP Cost
9 INT (1) HP Cost
10 INT (1) Money Cost
11 INT (1) Extra Damage %
12 INT (1) Chain-to attack number + 1, 0 for none
13 INT (1) Chain Rate % (0-100)
14 INT (1) Attacker Animation:

0 = Strike (shows weapon)
1 = Cast
2 = Dash In (shows weapon)
3 = SpinStrike (shows weapon)
4 = Jump (hides attacker)
5 = Land (unhides attacker)
6 = Null
7 = Standing Cast
8 = Teleport (shows weapon)
9 = Standing Strike
10 = Run and Hide (hides attacker)
11 = Unhide (unhides attacker)

15 INT (1) Attack Animation:

0 = Normal
1 = Projectile
2 = Reverse projectile
3 = Drop
4 = Ring
5 = Wave
6 = Scatter
7 = Sequential Projectile
8 = Meteor
9 = Driveby
10 = Null
11 = Screen Center

16 INT (1) Attack Delay (ticks)
17 INT (1) Number of hits (range 1 to 20)
18 INT (1) Target Stat:

0 = HP
1 = MP
2 = Atk
3 = Aim
4 = Def
5 = Dog
6 = Mag
7 = Wil
8 = Spd
9 = Ctr
10 = Focus
11 = Extra Hits
12 = Poison register
13 = Regen register
14 = Stun register
15 = Mute register

19 INT (1) Preferred target:
0 = default
1 = first
2 = closest
3 = farthest
4 = random
5 = weakest
6 = strongest
7 = weakest%
8 = strongest%
20 - 23:
Attack Bitsets 1 (64)
BIT (1) 0: Cure Instead of Harm
BIT (1) 1: Divide Spread Damage
BIT (1) 2: Absorb Damage
BIT (1) 3: Unreversable Picture
BIT (1) 4: Steal Item
BIT (8) 5 - 12: Elementary 1 - 8 Damage
BIT (8) 13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)
BIT (8) 21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see #Note 1)
BIT (8) 29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see #Note 1)
BIT (8) 37: Cannot target enemy slot 0 - 7
BIT (4) 45: Cannot target hero slot 0 - 3
BIT (1) 49: Ignore attacker's extra hits
BIT (1) 50: Erase rewards (enemy target only)
BIT (1) 51: Show damage without inflicting
BIT (1) 52: Add Target to Stored Targets
BIT (1) 53: Delete Stored Targets
BIT (1) 54: Automatically choose target
BIT (1) 55: Show attack name
BIT (1) 56: Do not display Damage
BIT (1) 57: Reset target stat to max before hit
BIT (1) 58: Allow Cure to exceed maximum
BIT (1) 59: Useable Outside of Battle
BIT (1) 60: Damage MP (obsolete, but still supported)
BIT (1) 61: Do not randomize (obsolete, ignored if fixAttackMultipliers is on)
BIT (1) 62: Damage can be Zero
BIT (1) 63: Cause heroes to run away
24 - 35 FVSTR (1i+1i+10i=12i) Attack Name, 10 characters max:
First INT contains length, the second is unused
36 INT (1) Caption Display Time:

-1 = Do not display
0 = Full duration of attack
>=1 = Number of ticks to display

37 - 56 FVSTR (1i+38b=40b) Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)
57 INT (1) Caption Delay (range 0 to 16383)
58 INT (1) Base Defense Stat:

0 = Default (Wil if base attack stat is Mag, Def otherwise)
1 = HP
2 = MP
3 = Atk
4 = Aim
5 = Def
6 = Dog
7 = Mag
8 = Wil
9 = Spd
10 = Ctr
11 = Focus
12 = extra Hits

59 INT (1) Tag to Set

0 - none
> 0 - set tag
< 0 - unset tag

60 INT (1) Tag Condition

0 - Never
1 - Always
2 - Hit
3 - Miss
4 - Kill
5 - Targeting Failed (This is a WIP feature)

61 INT (1) Tag Check

0 - none
> 0 - tag must be on
< 0 - tag must be off

62 INT (1) Tag to Set #2

0 - none
> 0 - set tag
< 0 - unset tag

63 INT (1) Tag Condition #2

0 - Never
1 - Always
2 - Hit
3 - Miss
4 - Kill
5 - Targeting Failed (This is a WIP feature)

64 INT (1) Tag Check #2

0 - none
> 0 - tag must be on
< 0 - tag must be off

65 - 72:
Bitsets 2 (128)
BIT (1) 0: Mutable
BIT (1) 1: Fail if target is Poisoned
BIT (1) 2: Fail if target is Regened
BIT (1) 3: Fail if target is Stunned
BIT (1) 4: Fail if target is Muted
BIT (1) 5: % based attacks damage instead of set (#Note 2)
BIT (1) 6: Check costs when used as a weapon
BIT (1) 7: Do not chain if attack fails
BIT (1) 8: Reset Poisoned register
BIT (1) 9: Reset Regened register
BIT (1) 10: Reset Stun Register
BIT (1) 11: Reset Mute Register
BIT (1) 12: Cancel target's attack
BIT (1) 13: Can't be canceled by other attacks
BIT (1) 14: Do not trigger spawning on attack
BIT (1) 15: Do not trigger spawning on death
BIT (1) 16: Check costs when used as an item in battle
BIT (1) 17: Re-check costs after attack delay
BIT (1) 18: Does not cause target to flinch
BIT (1) 19: Don't allow damage to exceed target stat
BIT (1) 20: Delay doesn't block further actions
BIT (1) 21: Force victory
BIT (1) 22: Force battle exit
BIT (1) 23: Never trigger counterattacks
BIT (1) 24: Healing poison register past max becomes regen and vice versa
BIT (1) 25: attack is not usable inside battle
BIT (1) 26: don't display miss
BIT (1) 27: don't display fail
BIT (1) 28: Hide attacker regardless of attacker animation
BIT (1) 29: Unhide attacker regardless of attacker animation
BIT (1) 30: Block actions when used as a counterattack in active mode
BIT (1) 31: Empty target ready meter
BIT (1) 32: Fill target ready meter
BIT (1) 33: Exclude this attack from hero auto-battle
BIT (1) 34: Ignore damage cap
BIT (1) 35: Replace stored targets (This is a WIP feature)
BIT (44) 36-79: Unused
BIT (48) 80 - 127: Element 17 - 64 Damage
73 - 92 VSTR (1i+38b = 40b) Spell description
93, 95, 97 INT (1) x 3 Item ID+1 to be consumed (or given) or 0 for none (x3)
94, 96, 98 INT (1) x 3 Number of items to be consumed (or given) (x3)
99 INT (1) Sound effect to be played on a hit + 1 (0 for none)
100 INT (1) Stat for preferred target weakest/strongest
0 = same as target stat
1 = HP
2 = MP
3 = Atk
4 = Aim
5 = Def
6 = Dog
7 = Mag
8 = Wil
9 = Spd
10 = Ctr
11 = Focus
12 = extra Hits
13 = Poison register
14 = Regen register
15 = Stun register
16 = Mute register
101 INT(1) Chain condition type

0: No special conditions
1: both val1 and val2 are tags to check
2: attacker stat val1 greater than val2
3: attacker stat val1 less than than val2
4: attacker stat val1 greater than val2%
5: attacker stat val1 less than than val2%
6: any target stat val1 greater than val2
7: any target stat val1 less than val2
8: any target stat val1 greater than val2%
9: any target stat val1 less than val2%
10: all target stat val1 greater than val2
11: all target stat val1 less than val2
12: all target stat val1 greater than val2%
13: all target stat val1 less than val2%
14: all target stat val1 greater than attacker stat val2
15: all target stat val1 less than attacker stat val2
16: attacker stat val1 less than attacker stat val2
17: chain with scaled chance, attacker stat val1 divided by val2
18: chain with scaled chance, (max any target) stat val1 divided by val2
19: chain with scaled chance, (min all targets) stat val1 divided by val2

102 INT(1) Chain condition primary value (val1) (meaning varies depending on Chain type)
103 INT(1) Chain condition secondary value (val2) (meaning varies depending on Chain type)
104 Chain bits

0: Attacker must know the chained attack also
1: Chained attack ignores delay
2: Chain delay doesn't block actions
3: Don't retarget if target is lost
4: Invert condition

105 INT (1) Else-Chain-to attack number + 1, 0 for none
106 INT(1) Else-Chain condition type (see chain condition type for valid values)
107 INT (1) Else-Chain Rate % (0-100)
108 INT (1) Else-Chain condition value (meaning varies depending on Else-Chain type)
109 INT(1) Else-Chain condition secondary value (meaning varies depending on Else-Chain type)
110 BIT(16) Else-chain bits (see chain bits)
111 INT (1) Instead-Chain-to attack number + 1, 0 for none
112 INT(1) Instead-Chain condition type (see chain condition type for valid values)
113 INT (1) Instead-Chain Rate % (0-100)
114 INT (1) Instead-Chain condition value (meaning varies depending on Instead-Chain type)
115 INT(1) Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)
116 BIT(16) Instead-chain bits (see chain bits)
117 INT (1) Sound effect when learned from item or levelup + 1 (0 for none)
118 INT (1) Transmogrify enemy. new Enemy ID + 1 or 0 for no change
119 INT (1) What to do with HP when transmogrifying

0=keep current
1=restore to new max
2=preserve % of max
3=keep current, cap to new max

120 INT (1) What to do with other stats when transmogrifying

0=keep current
1=restore to new max
2=preserve % of max
3=keep current, cap to new max

121-312 AttackElementCondition (64)
(6 bytes each)
Conditions for attack failure if the target takes beyond some threshold of damage from some element. #Note 1

Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the amount of damage taken by a target from the element (for Types 3 and 4 only!), simulating the way in which the old fail bits ignored whether the Absorb bit was on.
Each condition has format:

Type INT A value from 0-6 plus some possible bits

0: No condition
3: Target takes < Value damage from this element
4: Target takes <= Value damage from this element
5: Target takes > Value damage from this element
6: Target takes >= Value damage from this element
+16: Compare against the absolute value of the target's resistance
+32: Display "miss" instead of "fail"
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0

Value FLOAT Percentage threshold (1.0 is 100%)
313 INT (1) Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1
314 INT (1) Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.
315 INT (1) Weapon picture frame 0 handle X (only applies to wep picture override)
316 INT (1) Weapon picture frame 0 handle Y (only applies to wep picture override)
317 INT (1) Weapon picture frame 1 handle X (only applies to wep picture override)
318 INT (1) Weapon picture frame 1 handle Y (only applies to wep picture override)
319 INT (1) Attack delay (turns)
320 INT (1) Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.
321 INT (1) Stat cost: index of stat + 1 (This incomplete feature is not in nightlies)
322 INT (1) Stat cost: amount to decrement (This incomplete feature is not in nightlies)
323 INT (1) Base Accuracy Stat (only used for Aim Math 9-12):

-1 = Constant (value 1)
statid + 0: Attacker's stat
statid + 256: Target's stat
statid + 512: Attacker's stat divided by number of targets

324 INT (1) Base Dodge Stat (only used for Aim Math 9-12):

Same as above, but dividing by number of targets is not available.
-1 = Constant (value 1)
statid + 0: Attacker's stat
statid + 256: Target's stat

325 FLOAT Accuracy multiplier #note 3
327 FLOAT Dodge multiplier #note 3
329 FLOAT Attack multiplier #note 3
331 FLOAT Defense multiplier #note 3
333 FLOAT Aim math extra value
335 FLOAT Absorb rate #note 3
337 INT (1) Damage +/- randomization percentage (0 - 100)

If fixAttackMultipliers is off, initialize to 20 unless "Do not randomize" was set

338 INT (1) Damage display color override (0=default, >=1 is master palette index (color 0 not available))
339 INT (1) What to do with rewards when transmogrifying

0=Don't give rewards from old enemy
1=Give rewards from old enemy

340 INT (1) Whether to provoke counter attacks:

0=Default (use global setting gen(genDefCounterProvoke))
1=Always
2=Never
3=If attack hits
4=If attack fails
5=If attack misses
6=If attack doesn't hit
7=If attack doesn't fail
8=If attack doesn't miss

341 INT (1) Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none (This incomplete feature is not in nightlies)
342 INT (1) Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none (This incomplete feature is not in nightlies)
343 INT (1) Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none (This incomplete feature is not in nightlies)
344 INT (1) X-offset of attack relative to target
345 INT (1) Y-offset of attack relative to target
346 INT (1) horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges
347 INT (1) vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges
348 INT (1) change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default
349 INT (1) change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default
350 INT (1) change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default
351 INT (1) change target's flipped sprite status - 0=no change, 1=flipped, 2=unflipped, 3=set to default
352 INT (1) Spawn an enemy if there is room (0 for none or enemy ID+1)

Note 1[edit]

If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:

  • All conditions default to "None".
  • If 'fail vs. elemental n resistance' is set, the element n condition is "If < 100% damage"
  • If 'fail vs. enemytype n ' is set, the element n+8 condition is "If > 100% damage"

If fixAttackElementFails is ON, the old bits contain garbage.

Note 2[edit]

"% based attacks damage instead of set" is a very messy bitset. We planned to get rid of it, replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8 if this bitset is on (adding a new fix bit, "fixPercentageAttacks"), but this was never done.

Note 3[edit]

The marked multipliers are initialised to 1.0 when the fixAttackMultipliers upgrade is applied.

Note 4[edit]

Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds

References to other lumps[edit]

Field Indicating record in lump:
Animation picture PT6
Animation palette PAL
Chain-to,Instead-chain-to,else-chain-to DT6 (this lump)
Sound effect (sound file)
Miss sound effect (sound file)
Fail sound effect (sound file)
'Learned' sound effect (sound file)