From 83f7d224c8c784deccc0b9ea49c833899efe0197 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 13 Feb 2021 19:32:43 -0500 Subject: Remove .gitmodules --- .gitmodules | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29b..00000000 -- cgit v1.2.3 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 ++++++------ engine/gfx/hp_bar.asm | 2 +- engine/items/item_effects.asm | 16 ++++++++-------- engine/link/cable_club.asm | 8 ++++---- engine/menus/party_menu.asm | 8 ++++---- engine/menus/save.asm | 8 ++++---- engine/pokemon/learn_move.asm | 12 ++++++------ engine/pokemon/status_screen.asm | 2 +- home/text.asm | 2 +- home/window.asm | 4 ++-- hram.asm | 2 +- 11 files changed, 38 insertions(+), 38 deletions(-) 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 diff --git a/engine/gfx/hp_bar.asm b/engine/gfx/hp_bar.asm index b7bd97f2..e4de0b95 100644 --- a/engine/gfx/hp_bar.asm +++ b/engine/gfx/hp_bar.asm @@ -213,7 +213,7 @@ UpdateHPBar_PrintHPNumber: ld a, [wHPBarOldHP + 1] ld [wHPBarTempHP], a push hl - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] bit 0, a jr z, .asm_fb15 ld de, $9 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index d4164332..804a316d 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1051,15 +1051,15 @@ ItemUseMedicine: call AddNTimes ; calculate coordinates of HP bar of pokemon that used Softboiled ld a, SFX_HEAL_HP call PlaySoundWaitForCurrent - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] set 0, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a ld a, $02 ld [wHPBarType], a predef UpdateHPBar2 ; animate HP bar decrease of pokemon that used Softboiled - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] res 0, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a pop af ld b, a ; store heal amount (1/5 of max HP) ld hl, wHPBarOldHP + 1 @@ -1201,15 +1201,15 @@ ItemUseMedicine: jr z, .playStatusAilmentCuringSound ld a, SFX_HEAL_HP call PlaySoundWaitForCurrent - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] set 0, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a ld a, $02 ld [wHPBarType], a predef UpdateHPBar2 ; animate the HP bar lengthening - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] res 0, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a ld a, REVIVE_MSG ld [wPartyMenuTypeOrMessageID], a ld a, [wcf91] diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index 71afde1e..b6389fe3 100644 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -338,10 +338,10 @@ TradeCenter_SelectMon: ld a, 1 ld [wTopMenuItemX], a .enemyMonMenu_HandleInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags set 1, [hl] call HandleMenuInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags res 1, [hl] and a jp z, .getNewInput @@ -403,10 +403,10 @@ TradeCenter_SelectMon: lb bc, 6, 1 call ClearScreenArea .playerMonMenu_HandleInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags set 1, [hl] call HandleMenuInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags res 1, [hl] and a ; was anything pressed? jr nz, .playerMonMenu_SomethingPressed diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index 6648ab54..ddb92f75 100644 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -69,14 +69,14 @@ RedrawPartyMenu_:: pop hl push hl ld bc, SCREEN_WIDTH + 1 ; down 1 row and right 1 column - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] set 0, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a add hl, bc predef DrawHP2 ; draw HP bar and prints current / max HP - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] res 0, a - ldh [hFlagsFFF6], a + ldh [hUILayoutFlags], a call SetPartyMenuHPBarColor ; color the HP bar (on SGB) pop hl jr .printLevel diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 194fb810..dc2e27c2 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -351,10 +351,10 @@ ChangeBox:: call z, EmptyAllSRAMBoxes ; if so, empty all boxes in SRAM call DisplayChangeBoxMenu call UpdateSprites - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags set 1, [hl] call HandleMenuInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags res 1, [hl] bit 1, a ; pressed b ret nz @@ -445,12 +445,12 @@ DisplayChangeBoxMenu: ld b, 12 ld c, 7 call TextBoxBorder - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags set 2, [hl] ld de, BoxNames hlcoord 13, 1 call PlaceString - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags res 2, [hl] ld a, [wCurrentBoxNum] and $7f diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index 8e852fd4..4deb3f0b 100644 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -126,13 +126,13 @@ TryingToLearn: call TextBoxBorder hlcoord 6, 8 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 ld hl, wTopMenuItemY ld a, 8 ld [hli], a ; wTopMenuItemY @@ -146,10 +146,10 @@ TryingToLearn: ld a, A_BUTTON | B_BUTTON ld [hli], a ; wMenuWatchedKeys ld [hl], 0 ; wLastMenuItem - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags set 1, [hl] call HandleMenuInput - ld hl, hFlagsFFF6 + ld hl, hUILayoutFlags res 1, [hl] push af call LoadScreenTilesFromBuffer1 diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm index 33fef9e4..ac03514a 100644 --- a/engine/pokemon/status_screen.asm +++ b/engine/pokemon/status_screen.asm @@ -40,7 +40,7 @@ DrawHP_: push hl call DrawHPBar pop hl - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] bit 0, a jr z, .printFractionBelowBar ld bc, $9 ; right of bar diff --git a/home/text.asm b/home/text.asm index ad0c4fd8..244c6fdb 100644 --- a/home/text.asm +++ b/home/text.asm @@ -62,7 +62,7 @@ PlaceNextChar:: cp "" jr nz, .NotNext ld bc, 2 * SCREEN_WIDTH - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] bit 2, a jr z, .ok ld bc, SCREEN_WIDTH diff --git a/home/window.asm b/home/window.asm index f86e39c6..0182bdd3 100644 --- a/home/window.asm +++ b/home/window.asm @@ -136,7 +136,7 @@ PlaceMenuCursor:: and a ; was the previous menu id 0? jr z, .checkForArrow1 push af - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] bit 1, a ; is the menu double spaced? jr z, .doubleSpaced1 ld bc, 20 @@ -162,7 +162,7 @@ PlaceMenuCursor:: and a jr z, .checkForArrow2 push af - ldh a, [hFlagsFFF6] + ldh a, [hUILayoutFlags] bit 1, a ; is the menu double spaced? jr z, .doubleSpaced2 ld bc, 20 diff --git a/hram.asm b/hram.asm index 1d981ee6..0607a484 100644 --- a/hram.asm +++ b/hram.asm @@ -391,7 +391,7 @@ hClearLetterPrintingDelayFlags:: db ; bit 0: draw HP fraction to the right of bar instead of below (for party menu) ; bit 1: menu is double spaced -hFlagsFFF6:: db +hUILayoutFlags:: db hFieldMoveMonMenuTopMenuItemX:: db -- 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(-) 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