Account for crits carry over for bind/wrap turns

This commit is contained in:
Kyle Coburn 2015-05-04 19:05:41 -07:00
parent 52e9f11585
commit f2ab261959
2 changed files with 12 additions and 1 deletions

View File

@ -59,6 +59,12 @@ local function isDisabled(move)
end end
Combat.isDisabled = isDisabled Combat.isDisabled = isDisabled
local function xAccuracy()
local skipAccuracyCheck = 0x1
return bit.band(Memory.value("battle", "x_accuracy"), skipAccuracyCheck) == skipAccuracyCheck
end
Combat.xAccuracy = xAccuracy
local function calcDamage(move, attacker, defender, rng) local function calcDamage(move, attacker, defender, rng)
if move.fixed then if move.fixed then
return move.fixed, move.fixed return move.fixed, move.fixed
@ -67,7 +73,7 @@ local function calcDamage(move, attacker, defender, rng)
return 0, 0 return 0, 0
end end
if move.power > 9000 then if move.power > 9000 then
if Memory.value("battle", "x_accuracy") == 1 and defender.speed < attacker.speed then if xAccuracy() and defender.speed < attacker.speed then
return 9001, 9001 return 9001, 9001
end end
return 0, 0 return 0, 0
@ -382,6 +388,10 @@ function Combat.inKillRange(draw)
if ours.hp <= hpReq then if ours.hp <= hpReq then
local outsped = enemyAttack.outspeed local outsped = enemyAttack.outspeed
if outsped and outsped ~= true then if outsped and outsped ~= true then
if Memory.value("battle", "critical") == 1 then
hpReq = hpReq * 2
p("WB crit!", hpReq)
end
outsped = Memory.value("battle", "attack_turns") > 0 outsped = Memory.value("battle", "attack_turns") > 0
end end
if outsped or isConfused or turnsToKill > 1 or ours.speed <= enemy.speed or isSleeping() then if outsped or isConfused or turnsToKill > 1 or ours.speed <= enemy.speed or isSleeping() then

View File

@ -179,6 +179,7 @@ local moves = {
id = 20, id = 20,
move_type = 'normal', move_type = 'normal',
special = false, special = false,
outspeed = "turns",
power = 15, power = 15,
max_pp = 20, max_pp = 20,
accuracy = 85, accuracy = 85,