Burn Up And Purify

This commit is contained in:
DizzyEggg 2020-04-17 21:14:26 +02:00
parent 01b6b63e99
commit 34f5d9e2ae
9 changed files with 77 additions and 4 deletions

View File

@ -1688,6 +1688,11 @@
.4byte \ptr
.endm
.macro losetype battler:req, type:req
various \battler, VARIOUS_LOSE_TYPE
.byte \type
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7

View File

@ -357,6 +357,55 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectBugBite
.4byte BattleScript_EffectStrengthSap
.4byte BattleScript_EffectMindBlown
.4byte BattleScript_EffectPurify
.4byte BattleScript_EffectBurnUp
BattleScript_EffectBurnUp:
attackcanceler
attackstring
ppreduce
jumpiftype BS_ATTACKER, TYPE_FIRE, BattleScript_BurnUpWorks
goto BattleScript_ButItFailed
BattleScript_BurnUpWorks:
accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE
critcalc
damagecalc
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
losetype BS_ATTACKER, TYPE_FIRE
printstring STRINGID_ATTACKERLOSTFIRETYPE
waitmessage 0x40
tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd
BattleScript_EffectPurify:
attackcanceler
attackstring
ppreduce
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
typecalc
jumpifmovehadnoeffect BattleScript_NotAffected
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_PurifyWorks
goto BattleScript_ButItFailed
BattleScript_PurifyWorks:
attackanimation
waitanimation
curestatus BS_TARGET
updatestatusicon BS_TARGET
printstring STRINGID_ATTACKERCUREDTARGETSTATUS
waitmessage 0x40
tryhealhalfhealth BattleScript_AlreadyAtFullHp, BS_ATTACKER
goto BattleScript_RestoreHp
BattleScript_EffectStrengthSap:
setstatchanger STAT_ATK, 1, TRUE
@ -2552,6 +2601,7 @@ BattleScript_EffectRestoreHp::
tryhealhalfhealth BattleScript_AlreadyAtFullHp, BS_ATTACKER
attackanimation
waitanimation
BattleScript_RestoreHp:
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER

View File

@ -345,5 +345,7 @@
#define EFFECT_BUG_BITE 339
#define EFFECT_STRENGTH_SAP 340
#define EFFECT_MIND_BLOWN 341
#define EFFECT_PURIFY 342
#define EFFECT_BURN_UP 343
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -148,6 +148,7 @@
#define VARIOUS_HANDLE_FORM_CHANGE 85
#define VARIOUS_GET_STAT_VALUE 86
#define VARIOUS_JUMP_IF_FULL_HP 87
#define VARIOUS_LOSE_TYPE 88
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -540,7 +540,9 @@
#define STRINGID_INCINERATEBURN 536
#define STRINGID_BUGBITE 537
#define STRINGID_ILLUSIONWOREOFF 538
#define STRINGID_ATTACKERCUREDTARGETSTATUS 539
#define STRINGID_ATTACKERLOSTFIRETYPE 540
#define BATTLESTRINGS_COUNT 539
#define BATTLESTRINGS_COUNT 541
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H

View File

@ -661,9 +661,13 @@ static const u8 sText_AirBalloonPop[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_IT
static const u8 sText_IncinerateBurn[] = _("{B_EFF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nwas burnt up!");
static const u8 sText_BugBite[] = _("{B_ATK_NAME_WITH_PREFIX} stole and ate\n{B_EFF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!");
static const u8 sText_IllusionWoreOff[] = _("{B_DEF_NAME_WITH_PREFIX}'s Illusion wore off!");
static const u8 sText_AttackerCuredTargetStatus[] = _("{B_ATK_NAME_WITH_PREFIX} cured\n{B_DEF_NAME_WITH_PREFIX}'s problem!");
static const u8 sText_AttackerLostFireType[] = _("{B_ATK_NAME_WITH_PREFIX} burned itself out!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_ATTACKERLOSTFIRETYPE - 12] = sText_AttackerLostFireType,
[STRINGID_ATTACKERCUREDTARGETSTATUS - 12] = sText_AttackerCuredTargetStatus,
[STRINGID_ILLUSIONWOREOFF - 12] = sText_IllusionWoreOff,
[STRINGID_BUGBITE - 12] = sText_BugBite,
[STRINGID_INCINERATEBURN - 12] = sText_IncinerateBurn,

View File

@ -7575,6 +7575,14 @@ static void Cmd_various(void)
else
gBattlescriptCurrInstr += 7;
return;
case VARIOUS_LOSE_TYPE:
for (i = 0; i < 3; i++)
{
if (*(u8*)(&gBattleMons[gActiveBattler].type1 + i) == gBattlescriptCurrInstr[3])
*(u8*)(&gBattleMons[gActiveBattler].type1 + i) = TYPE_MYSTERY;
}
gBattlescriptCurrInstr += 4;
return;
case VARIOUS_PSYCHO_SHIFT:
i = TRUE;
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS)

View File

@ -2379,7 +2379,8 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_THAW: // move thawing
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)
{
if (gBattleMoves[gCurrentMove].effect == EFFECT_THAW_HIT)
if (gBattleMoves[gCurrentMove].effect == EFFECT_THAW_HIT
|| (gBattleMoves[gCurrentMove].effect == EFFECT_BURN_UP && IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
{
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor();

View File

@ -9054,7 +9054,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_BURN_UP] =
{
.effect = EFFECT_PLACEHOLDER,
.effect = EFFECT_BURN_UP,
.power = 130,
.type = TYPE_FIRE,
.accuracy = 100,
@ -9096,7 +9096,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_PURIFY] =
{
.effect = EFFECT_PLACEHOLDER,
.effect = EFFECT_PURIFY,
.power = 0,
.type = TYPE_POISON,
.accuracy = 0,