From 95353fdefa95440eba012509722f2058739d45fe Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 13 Feb 2021 19:48:34 -0500 Subject: Identify hUILayoutFlags --- engine/battle/core.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 417516ae..433c62df 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2472,13 +2472,13 @@ MoveSelectionMenu: .writemoves ld de, wMovesString - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] set 2, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a call PlaceString - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] res 2, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a ret .regularmenu @@ -2598,10 +2598,10 @@ SelectMenuItem: call AddNTimes ld [hl], "▷" .select - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags set 1, [hl] call HandleMenuInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags res 1, [hl] bit BIT_D_UP, a jp nz, SelectMenuItem_CursorUp -- cgit v1.2.3 From 5c9c7bf3625cfa4a4bf68ef27b5671cba5fc5d1d Mon Sep 17 00:00:00 2001 From: dannye <33dannye@gmail.com> Date: Sun, 21 Feb 2021 11:43:38 -0600 Subject: Clean up handling of extra effective status effects --- engine/battle/effects.asm | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index f455a407..d9690f27 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -211,12 +211,13 @@ FreezeBurnParalyzeEffect: cp b ; do target type 2 and move type match? ret z ; return if they match ld a, [wPlayerMoveEffect] - cp PARALYZE_SIDE_EFFECT1 + 1 ; 10% status effects are 04, 05, 06 so 07 will set carry for those - ld b, $1a ; 0x1A/0x100 or 26/256 = 10.2%~ chance - jr c, .next1 ; branch ahead if this is a 10% chance effect.. - ld b, $4d ; else use 0x4D/0x100 or 77/256 = 30.1%~ chance - sub $1e ; subtract $1E to map to equivalent 10% chance effects -.next1 + cp PARALYZE_SIDE_EFFECT1 + 1 + ld b, 10 percent + 1 + jr c, .regular_effectiveness +; extra effectiveness + ld b, 30 percent + 1 + sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on +.regular_effectiveness push af call BattleRandom ; get random 8bit value for probability test cp b @@ -264,11 +265,12 @@ FreezeBurnParalyzeEffect: ret z ld a, [wEnemyMoveEffect] cp PARALYZE_SIDE_EFFECT1 + 1 - ld b, $1a - jr c, .next2 - ld b, $4d - sub $1e -.next2 + ld b, 10 percent + 1 + jr c, .regular_effectiveness2 +; extra effectiveness + ld b, 30 percent + 1 + sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on +.regular_effectiveness2 push af call BattleRandom cp b -- cgit v1.2.3