mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 11:11:10 +02:00
CLOSES #455, CLOSES #487, CLOSES #501, CLOSES #540, CLOSES #585, CLOSES #591, CLOSES #593, CLOSES #595, CLOSES #597, CLOSES #599, CLOSES #600, CLOSES #606, CLOSES #607, CLOSES #610, CLOSES #613, CLOSES #616, CLOSES #620, CLOSES #626, CLOSES #632, CLOSES #633, CLOSES #647
This commit is contained in:
@@ -5221,11 +5221,12 @@ function BattleState:drawHUDs(slide)
|
||||
self:drawBallRow(self.enemyParty, 64, 16, -8)
|
||||
end
|
||||
|
||||
-- Safari shows only the ball count; the old man demo shows neither mon
|
||||
if self.safari then
|
||||
love.graphics.setColor(0, 0, 0, 1)
|
||||
Font.draw(("BALLx%2d"):format(self.safari.balls), 88, 72)
|
||||
end
|
||||
-- A safari / old-man battle has no player mon out, so no player HUD (see
|
||||
-- hidePlayer below). Nothing takes its place: PrintSafariZoneSteps -- the
|
||||
-- "nnn/500 / BALLx nn" box -- is start-menu only and returns early off the
|
||||
-- nine interior maps (engine/overworld/player_state.asm:219-224), so no
|
||||
-- ball count belongs over the battlefield. The count lives in the BALL
|
||||
-- menu item instead (drawTextArea, #540).
|
||||
-- Party pokeball rows and the HUD chrome under them, for exactly the
|
||||
-- window DrawAllPokeballs owns (common_text.asm:27, with the intro text).
|
||||
-- SetupOwnPartyPokeballs runs in EVERY battle, so the player's row belongs
|
||||
@@ -5330,6 +5331,11 @@ function BattleState:drawTextArea()
|
||||
Font.drawBox(0, 12, 20, 6)
|
||||
Font.draw(Strings("BALLx"), 16, 112); Font.draw(Strings("BAIT"), 112, 112)
|
||||
Font.draw(Strings("THROW ROCK"), 16, 128); Font.draw(Strings("RUN"), 112, 128)
|
||||
-- DisplayBattleMenu .safariLeftColumn / .safariRightColumn print
|
||||
-- wNumSafariBalls at hlcoord 7,14 with `lb bc, 1, 2` -- one byte, two
|
||||
-- digits, space padded -- right after the "BALLx" label at columns
|
||||
-- 2..6 (engine/battle/core.asm:2074-2079, 2107-2112) (#540)
|
||||
Font.draw(("%2d"):format(self.safari.balls), 56, 112)
|
||||
Font.drawCode(0xED, (col == 0 and 8 or 104), 112 + row * 16)
|
||||
else
|
||||
-- BATTLE_MENU_TEMPLATE: box (8,12)-(19,17), "FIGHT <PK><MN> /
|
||||
|
||||
@@ -435,8 +435,18 @@ local function drainHalf(text)
|
||||
end
|
||||
end
|
||||
|
||||
-- fixed damage still respects type immunity (AdjustDamageForMoveType
|
||||
-- flags the miss before the special-damage override)
|
||||
-- OHKO is the only "damage but not through normal calculations" family
|
||||
-- that still runs the type chart. CalculateDamage hands OHKO_EFFECT to
|
||||
-- JumpToOHKOMoveEffect (engine/battle/core.asm:4329) and, when the effect
|
||||
-- did not set wMoveMissed, execution falls through to
|
||||
-- AdjustDamageForMoveType (core.asm:3147), which multiplies the 65535 by
|
||||
-- the 0 matchup and flags the miss. Fixed damage and Super Fang do not:
|
||||
-- they are the SetDamageEffects table (data/battle/set_damage_effects.asm)
|
||||
-- and core.asm:3139 jumps straight to MoveHitTest, skipping
|
||||
-- CalculateDamage, AdjustDamageForMoveType and RandomizeDamage, while
|
||||
-- ApplyAttackToEnemyPokemon (core.asm:4612) writes wDamage with no
|
||||
-- effectiveness step. So in Gen 1 NIGHT_SHADE hits Normal-types and
|
||||
-- SUPER_FANG hits Ghosts, and only OHKO_EFFECT calls this (#616).
|
||||
local function immuneMsg(ctx)
|
||||
if TypeChart.effectiveness(ctx.move.type, ctx.target.curTypes) == 0 then
|
||||
return Strings("It doesn't affect\n%s!", displayName(ctx.target))
|
||||
@@ -466,8 +476,7 @@ MoveEffects.full = {
|
||||
|
||||
SPECIAL_DAMAGE_EFFECT = {
|
||||
chooseDamage = function(ctx)
|
||||
local blocked = immuneMsg(ctx)
|
||||
if blocked then return nil, blocked end
|
||||
-- no immunity check: SetDamageEffects skips AdjustDamageForMoveType (#616)
|
||||
local dmg = fixedDamageFor(ctx)
|
||||
if not dmg then return nil, "But, it failed!" end
|
||||
return dmg, plainInfo()
|
||||
@@ -475,8 +484,7 @@ MoveEffects.full = {
|
||||
},
|
||||
SUPER_FANG_EFFECT = {
|
||||
chooseDamage = function(ctx)
|
||||
local blocked = immuneMsg(ctx)
|
||||
if blocked then return nil, blocked end
|
||||
-- also SetDamageEffects: halves a Ghost's HP in Gen 1 (#616)
|
||||
return math.max(1, math.floor(ctx.target.mon.hp / 2)), plainInfo()
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -134,12 +134,13 @@ local function drawHUDs(battle, slide)
|
||||
drawStatusPanel(battle, battle.enemy, 0, 0, false)
|
||||
end
|
||||
|
||||
if battle.safari then
|
||||
Font.drawBox(23, 7, 15, 4)
|
||||
love.graphics.setColor(0, 0, 0, 1)
|
||||
Font.draw(("BALLx%2d"):format(battle.safari.balls), 200, 72)
|
||||
elseif battle.player and not battle.demo and not battle.showPlayerBack
|
||||
and slide == 0 then
|
||||
-- No player status panel in a safari / old-man battle: no mon of the
|
||||
-- player's is out. Nothing replaces it either -- the ball count is a menu
|
||||
-- item, not a HUD element (DisplayBattleMenu prints wNumSafariBalls inside
|
||||
-- the battle menu box, engine/battle/core.asm:2074-2079), so it rides in
|
||||
-- drawCommandMenu below like the classic layout's (#540).
|
||||
if not battle.safari and battle.player and not battle.demo
|
||||
and not battle.showPlayerBack and slide == 0 then
|
||||
drawStatusPanel(battle, battle.player, 184, 56, true)
|
||||
end
|
||||
drawIntroBalls(battle)
|
||||
@@ -172,6 +173,9 @@ local function drawCommandMenu(battle)
|
||||
Font.drawBox(0, 13, 38, 5)
|
||||
love.graphics.setColor(0, 0, 0, 1)
|
||||
Font.draw(Strings("BALLx"), 16, 112)
|
||||
-- wNumSafariBalls immediately after the label, as at hlcoord 7,14
|
||||
-- (engine/battle/core.asm:2074-2079) (#540)
|
||||
Font.draw(("%2d"):format(battle.safari.balls), 56, 112)
|
||||
Font.draw(Strings("BAIT"), 168, 112)
|
||||
Font.draw(Strings("THROW ROCK"), 16, 128)
|
||||
Font.draw(Strings("RUN"), 168, 128)
|
||||
|
||||
Reference in New Issue
Block a user