summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKDLPro <38602758+KDLPro@users.noreply.github.com>2021-09-13 17:30:58 +0800
committerKDLPro <38602758+KDLPro@users.noreply.github.com>2021-09-13 17:30:58 +0800
commit77027cc7ae6680091007ee93e73c3fb260c57bbb (patch)
treefe82046b1c72f0cc206e382d0cabab765f5a2b1d
parent5ae3ccf19c6e37e44f086a2a2966cb6afc13fcce (diff)
Created Make new text to distinguish status move misses and fails (markdown)
-rw-r--r--Make-new-text-to-distinguish-status-move-misses-and-fails.md208
1 files changed, 208 insertions, 0 deletions
diff --git a/Make-new-text-to-distinguish-status-move-misses-and-fails.md b/Make-new-text-to-distinguish-status-move-misses-and-fails.md
new file mode 100644
index 0000000..d3c0ae4
--- /dev/null
+++ b/Make-new-text-to-distinguish-status-move-misses-and-fails.md
@@ -0,0 +1,208 @@
+In Generation 2, it is hard to know if the status move missed or can't affect the opponent (either due to being statused already or status immunity) due to the ambiguity of the move failure text. With this tutorial, we can fix this.
+
+## Contents
+
+1. [Make a separate prompt for move misses because of attack fail or Protect](#1-make-a-separate-prompt-for-move-misses-because-of-attack-fail-or-protect)
+2. [Add text if the target for status conditions has a status already](#2-add-text-if-the-target-for-status-conditions-has-a-status-already)
+
+
+## 1. Make a separate prompt for move misses because of attack fail or Protect
+
+First, edit [data/text/battle.asm](../blob/master/data/text/battle.asm):
+
+```diff
+...
+
+AttackMissed2Text:
+ text "<USER>'s"
+ line "attack missed!"
+ prompt
+
++AvoidStatusText:
++ text "<TARGET>"
++ line "avoided the"
++ cont "attack!"
++ prompt
+
+...
+```
+
+You may not add this separate text for missing status moves. Just remember to use either `AttackMissedText` or `AttackMissed2Text` when `AvoidStatusText` is used in this tutorial. They are identical anyway.
+
+Next, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm):
+
+```
+...
+
+BattleCommand_Poison:
+; poison
+
+...
+
+.do_poison
+- ld hl, DidntAffect1Text
++ ld hl, AvoidStatusText
+
+...
+
+PrintDidntAffect2:
+ call AnimateFailedMove
+- ld hl, DidntAffect1Text ; 'it didn't affect'
++ ld hl, AvoidStatusText ; 'it didn't affect'
+- ld de, DidntAffect2Text ; 'it didn't affect'
++ ld de, ProtectingItselfText ; Protect Text
+ jp FailText_CheckOpponentProtect
+```
+
+
+## 2. Add text if the target for status conditions has a status already
+
+First, edit [data/text/battle.asm](../blob/master/data/text/battle.asm) again:
+
+```diff
+...
+
++AlreadyBurnedText:
++ text "<TARGET>'s"
++ line "already burned!"
++ autodone
++
++AlreadyFrozenText:
++ text "<TARGET>'s"
++ line "already frozen!"
++ autodone
+```
+
+Next, edit [engine/battle/effect_commands.asm](../blob/master/engine/battle/effect_commands.asm):
+
+```
+...
+
+UpdateMoveData:
+ ld a, BATTLE_VARS_MOVE_ANIM
+ call GetBattleVarAddr
+ ld d, h
+ ld e, l
+
+ ld a, BATTLE_VARS_MOVE
+ call GetBattleVar
+ ld [wCurSpecies], a
+ ld [wNamedObjectIndex], a
+
+ dec a
+ call GetMoveData
+ call GetMoveName
+ jp CopyName1
+
++CheckForStatusIfAlreadyHasAny:
++ ld a, BATTLE_VARS_STATUS_OPP
++ call GetBattleVar
++ and SLP
++ ld hl, AlreadyAsleepText
++ ret nz
++
++ ld a, BATTLE_VARS_STATUS_OPP
++ call GetBattleVar
++ bit FRZ, a
++ ld hl, AlreadyFrozenText
++ ret nz
++
++ bit PAR, a
++ ld hl, AlreadyParalyzedText
++ ret nz
++
++ bit PSN, a
++ ld hl, AlreadyPoisonedText
++ ret nz
++
++ bit BRN, a
++ ld hl, AlreadyBurnedText
++ ret
+
+BattleCommand_SleepTarget:
+
+...
+
+.not_protected_by_item
++ call CheckForStatusIfAlreadyHasAny
++ jr nz, .fail
+
+ld a, BATTLE_VARS_STATUS_OPP
+ call GetBattleVarAddr
+ ld d, h
+ ld e, l
+- ld a, [de]
+- and SLP
+- ld hl, AlreadyAsleepText
+ jr nz, .fail
+
+ ld a, [wAttackMissed]
+ and a
+ jp nz, PrintDidntAffect2
+
+ ld hl, DidntAffect1Text
+ call .CheckAIRandomFail
+ jr c, .fail
+
+- ld a, [de]
+- and a
+- jr nz, .fail
+
+BattleCommand_Poison:
+
+...
+
+ call CheckIfTargetIsPoisonType
+ jp z, .failed
+
+- ld a, BATTLE_VARS_STATUS_OPP
+- call GetBattleVar
+- ld b, a
+- ld hl, AlreadyPoisonedText
+- and 1 << PSN
++ call CheckForStatusIfAlreadyHasAny
+ jp nz, .failed
+
+...
+
+.do_poison
+- ld hl, DidntAffect1Text
+- ld a, BATTLE_VARS_STATUS_OPP
+- call GetBattleVar
+- and a
+- jr nz, .failed
+-
+
+...
+
+BattleCommand_Paralyze:
+; paralyze
+
+- ld a, BATTLE_VARS_STATUS_OPP
+- call GetBattleVar
+- bit PAR, a
+- jr nz, .paralyzed
++ call CheckForStatusIfAlreadyHasAny
+ jr nz, .hasstatus
+
+...
+
+
+.dont_sample_failure
+- ld a, BATTLE_VARS_STATUS_OPP
+- call GetBattleVarAddr
+- and a
+- jr nz, .failed
+
+-.paralyzed
++.hasstatus
++ push hl
+ call AnimateFailedMove
+- ld hl, AlreadyParalyzedText
++ pop hl
+ jp StdBattleTextbox
+```
+
+That's it! Now we can know if the status move missed or can't affect the opponent (either due to being statused already or status immunity)!
+
+![Status move fail display](https://user-images.githubusercontent.com/38602758/133059918-6b29fd48-44bf-49e9-98fd-b8e3245a9fd3.png) \ No newline at end of file