First, the game takes your Raw_Strength and scales it through the following table:
Raw_Strength | ||
700+ | 60 | |
650 | 699 | 56 |
600 | 649 | 52 |
550 | 599 | 48 |
500 | 549 | 44 |
450 | 499 | 39 |
400 | 449 | 34 |
350 | 399 | 30 |
300 | 349 | 26 |
250 | 299 | 22 |
200 | 249 | 18 |
125 | 199 | 12 |
85 | 124 | 10 |
55 | 84 | 8 |
35 | 54 | 6 |
20 | 34 | 5 |
13 | 19 | 4 |
8 | 12 | 3 |
1 | 7 | 2 |
<1 | 1 |
Now you have $pet1_attack_strength.
Then, during the attach phase of the battledome, the game finds equations such as these:
$pet2_damage[fire]+=scale($pet1_attack_strength,4,10); (<- 2.6 icons)
$pet2_damage[water]+=$pet1_attack_strength; (<- 1.0 icon)
The function, scale(), takes three parameters. The later two determine how many icons the item does. The last parameter is the column and the middle is the row on the following table:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
1 | 2 | 1.5 | 1.33 | 1.25 | 1.4 | 1.33 | 1.29 | 1.5 | 1.44 | 1.4 |
2 | 2 | 1.67 | 1.5 | 1.8 | 1.67 | 1.57 | 2 | 1.89 | 1.8 | |
3 | 2 | 1.75 | 2.2 | 2 | 1.86 | 2.5 | 2.33 | 2.2 | ||
4 | 2 | 2.6 | 2.33 | 2.14 | 3 | 2.78 | 2.6 | |||
5 | 3 | 2.67 | 2.43 | 3.5 | 3.22 | 3 | ||||
6 | 3 | 2.71 | 4 | 3.67 | 3.4 | |||||
7 | 3 | 4.5 | 4.11 | 3.8 | ||||||
8 | 5 | 4.56 | 4.2 | |||||||
9 | 5 | 4.6 | ||||||||
10 | 5 |
Nearly all weapons fall in one of these boxes. For those that don't, a universal formula is:
Icons = 1 + param2 / param3 * (Base(param3) - 1)
Base(1 or 2 or 3 or 4) = 2
Base(5 or 6 or 7) = 3
Base(8 or 9 or 10 or 12) = 5
Base(16 or 20) = 3
(Because there is no base() that equals 4, very few items will do 4 icons.)
(Several weapons have a second parameter larger than the first. Just use the formula.)
(So far, I have found less than a dozen weapons with a third parameter not listed above.)
Now that you have the icons, multiply the icons by the $pet1_attack_strength (done within scale() ). Some items also run the damage through another function, hit():
$pet2_damage[physical]+=hit(scale($pet1_attack_strength,7,7));
Hit() randomly reduces the damage by 0 to 90 percent in 10 percent increments. So, if $pet1_attack_strength = 12, scale(12, 7, 7) = 36. After hit(), it will be either 3, 7, 10, 14, 18, 21, 25, 28, 32, 36 and that is how many ticks of damage (before stance) an item does. Each element (fire, water) has a separate accumulator to track damage ticks.
Now, the damage is multiplied by the stance of both you and the defender.
Berserk Attack -> 1.5
Fierce Attack -> 1.4
Jump and Attack -> 1.3
Normal Attack -> 1.2
Cautious Attack -> 1.0
Defend -> 0.8
(One-player battledome opponents' have a defend factor of 0.7)
(If either you or the defender has a stance not on the above list, the factor is 1.0)
This Damage Calculator does an excellent job of calculating a weapon's damage if there are no defence icons in play.
Next we have the defense phase. The Raw_Defense is run through the same matrix that Raw_Strength is run through to get $pet1_defence_strength
if ($pet1_damage[air]) $pet1_damage[air]-=scale($pet1_defence_strength,2,3); <- 1.67 icons
if ($pet1_damage[fire]) $pet1_damage[fire]=0; <- All
Defensive ticks are calculated in the same way as offensive ticks (except stance does not modify) and they are subtracted from the running results. At this point, if any accumulator is less than zero, it is zeroed out. All the accumulators are summed together and then divided by 4 to convert from ticks to points of damage.
A sloppy programming example:
xTicks := 0; for (i in "fire","water","air","earth","light","darkness","physical") do { x := Your_Weapon_Icons[i] * Your_Strength_Factor * Your_Stance_Factor * His_Stance_Factor - His_Shield_Icons[i] * His_Defence_Factor; if (His_Shield_Icons[i] = "All") x := 0; if (x > 0) xTicks := xTicks + x; } His_Damage_Received := round(xTicks / 4)
A few weapons have defense code in the attack section of the weapon's script. This code will have no effect if the code executes before the defender's attack. Likewise, a few weapons have attack code in the defense section of the weapon's script. The damage from this code will be unblockable if the defender's defense section has already executed.
Following is a pretty standard dual-purpose weapon, the Ceremonial Qasalan Dagger.
Object Script : [switch ($objectaction) { case "battledome": switch ($phase) { case "attack": $pet1_scriptoutput="You attack $pet2->name with the Ceremonial Qasalan Dagger!"; $pet2_scriptoutput="$pet1->name attacks you with the Ceremonial Qasalan Dagger!"; $pet2_damage[physical]+=hit(scale($pet1_attack_strength,5,5)); $pet2_damage[fire]+=scale($pet1_attack_strength,4,4); break; case "defend": if ($pet1_damage[physical]) { $pet1_damage[physical]-=scale($pet1_defence_strength,5,5); $pet1_scriptoutput="You defend yourself against $pet2->name's physical attack by using your Ceremonial Qasalan Dagger!"; $pet2_scriptoutput="$pet1->name defends themself against your physical attack with the Ceremonial Qasalan Dagger!"; } if ($pet1_damage[light]) { $pet1_damage[light]-=scale($pet1_defence_strength,5,5); $pet1_scriptoutput="You deflect $pet2->name's light attack by using your Ceremonial Qasalan Dagger!"; $pet2_scriptoutput="$pet1->name deflects your light attack with the Ceremonial Qasalan Dagger!"; } break; } break; } ]Home