-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds moves Matcha Gotcha, Syrup Bomb and Ivy Cudgel #3402
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,6 +438,48 @@ gBattleScriptsForMoveEffects:: | |
.4byte BattleScript_EffectHit @ EFFECT_GIGATON_HAMMER | ||
.4byte BattleScript_EffectSaltCure @ EFFECT_SALT_CURE | ||
|
||
.4byte BattleScript_EffectMatchaGotcha @ EFFECT_MATCHA_GOTCHA | ||
.4byte BattleScript_EffectSyrupBomb @ EFFECT_SYRUP_BOMB | ||
.4byte BattleScript_EffectHit @ EFFECT_IVY_CUDGEL | ||
|
||
BattleScript_EffectSyrupBomb:: | ||
setmoveeffect MOVE_EFFECT_SYRUP_BOMB | ||
call BattleScript_EffectHit_Ret | ||
seteffectwithchance | ||
tryfaintmon BS_TARGET | ||
printstring STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP | ||
waitmessage B_WAIT_TIME_LONG | ||
goto BattleScript_MoveEnd | ||
|
||
BattleScript_SyrupBombEndTurn:: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copy how Octolock is done. That way you don't need to add duplicate code that checks for these Abilities again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be better to do it the other way around because I think Octolock is currently not entirely accurate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can simplify it by doing something like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would the fail instruction in Though this looks much cleaner and overall better to understand, thank you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the CFRU I have |
||
setbyte sSTAT_ANIM_PLAYED, FALSE | ||
copybyte sBATTLER, gBattlerTarget | ||
jumpifholdeffect BS_TARGET, HOLD_EFFECT_CLEAR_AMULET, BattleScript_SyrupBombItemNoStatLoss | ||
jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_SyrupBombAbilityNoStatLoss | ||
jumpifability BS_TARGET, ABILITY_FULL_METAL_BODY, BattleScript_SyrupBombAbilityNoStatLoss | ||
jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_SyrupBombAbilityNoStatLoss | ||
jumpifstat BS_TARGET, CMP_GREATER_THAN, BIT_SPEED, MIN_STAT_STAGE, BattleScript_SyrupBombLowerSpeed | ||
goto BattleScript_SyrupBombEnd2 | ||
BattleScript_SyrupBombLowerSpeed: | ||
playstatchangeanimation BS_ATTACKER, BIT_SPEED, STAT_CHANGE_NEGATIVE | ||
AsparagusEduardo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
setbyte sSTAT_ANIM_PLAYED, TRUE | ||
setstatchanger STAT_SPEED, 1, TRUE | ||
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_SyrupBombEnd2 | ||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SyrupBombEnd2 | ||
printfromtable gStatDownStringIds | ||
waitmessage B_WAIT_TIME_LONG | ||
BattleScript_SyrupBombItemNoStatLoss:: | ||
call BattleScript_ItemNoStatLoss | ||
goto BattleScript_SyrupBombEnd2 | ||
BattleScript_SyrupBombAbilityNoStatLoss:: | ||
call BattleScript_AbilityNoStatLoss | ||
BattleScript_SyrupBombEnd2:: | ||
end2 | ||
|
||
BattleScript_EffectMatchaGotcha:: | ||
setmoveeffect MOVE_EFFECT_BURN | ||
goto BattleScript_EffectAbsorb | ||
|
||
BattleScript_EffectSaltCure: | ||
call BattleScript_EffectHit_Ret | ||
tryfaintmon BS_TARGET | ||
|
@@ -3333,6 +3375,7 @@ BattleScript_EffectPoisonHit: | |
|
||
BattleScript_EffectAbsorb:: | ||
call BattleScript_EffectHit_Ret | ||
seteffectwithchance | ||
jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock | ||
setdrainedhp | ||
manipulatedamage DMG_BIG_ROOT | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3681,6 +3681,19 @@ void SetMoveEffect(bool32 primary, u32 certain) | |
gBattlescriptCurrInstr++; | ||
} | ||
} | ||
|
||
break; | ||
case MOVE_EFFECT_SYRUP_BOMB: | ||
if (gStatuses4[gEffectBattler] & STATUS4_SYRUP_BOMB) | ||
{ | ||
gBattlescriptCurrInstr++; | ||
} | ||
else | ||
{ | ||
gStatuses4[gEffectBattler] |= STATUS4_SYRUP_BOMB; | ||
gDisableStructs[gBattlerTarget].syrupBombTimer = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gEffectBattler |
||
gBattlescriptCurrInstr++; | ||
} | ||
break; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2541,6 +2541,7 @@ enum | |
ENDTURN_PLASMA_FISTS, | ||
ENDTURN_CUD_CHEW, | ||
ENDTURN_SALT_CURE, | ||
ENDTURN_SYRUP_BOMB, | ||
ENDTURN_BATTLER_COUNT | ||
}; | ||
|
||
|
@@ -3116,6 +3117,30 @@ u8 DoBattlerEndTurnEffects(void) | |
} | ||
gBattleStruct->turnEffectsTracker++; | ||
break; | ||
case ENDTURN_SYRUP_BOMB: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way you have this set up now will lower speed twice and then kill the effect.
I noticed the way you currently have it is how it's implemented on Showdown, but this goes against the move description and what Bulbapedia says is supposed to happen. This definitely warrants an in-game test. If Showdown is correct, then Bulbapedia should be updated to specify that it only lowers speed twice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, you are correct. I followed showdown. I don't have SV so this was by best option but I see if I can get someone to test it in-game. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like Showdown is wrong. Speed drop goes on for three turns and there is no message at the end that mentions the effected target was freed from Syrup Bomb. Recording: https://streamable.com/0eqvcz There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should open a bug on Showdown then and update Bulbapedia to mention it just ends with no text. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already at the PR stage smogon/pokemon-showdown#9836, |
||
if ((gStatuses4[battler] & STATUS4_SYRUP_BOMB) && (gBattleMons[battler].hp != 0)) | ||
{ | ||
u16 battlerAbility = GetBattlerAbility(battler); | ||
u32 battlerHoldEffect = GetBattlerHoldEffect(battler, TRUE); | ||
|
||
gDisableStructs[battler].syrupBombTimer--; | ||
if (gDisableStructs[battler].syrupBombTimer == 0) | ||
{ | ||
gStatuses4[battler] &= ~STATUS4_SYRUP_BOMB; | ||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SYRUP_BOMB); | ||
gBattlescriptCurrInstr = BattleScript_WrapEnds; | ||
} | ||
else if (gDisableStructs[battler].syrupBombTimer != 0) | ||
{ | ||
gBattlerTarget = battler; | ||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SYRUP_BOMB); | ||
gBattlescriptCurrInstr = BattleScript_SyrupBombEndTurn; | ||
} | ||
BattleScriptExecute(gBattlescriptCurrInstr); | ||
effect++; | ||
} | ||
gBattleStruct->turnEffectsTracker++; | ||
break; | ||
case ENDTURN_BATTLER_COUNT: // done | ||
gBattleStruct->turnEffectsTracker = 0; | ||
gBattleStruct->turnEffectsBattlerId++; | ||
|
@@ -11230,7 +11255,7 @@ bool32 IsGen6ExpShareEnabled(void) | |
|
||
|
||
u8 GetBattlerType(u32 battler, u8 typeIndex) | ||
{ | ||
{ | ||
u16 types[3] = {0}; | ||
types[0] = gBattleMons[battler].type1; | ||
types[1] = gBattleMons[battler].type2; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
SINGLE_BATTLE_TEST("Ivy Gudgel changes the move type depending on the mask the user holds") | ||
{ | ||
u16 species; | ||
u16 item; | ||
|
||
PARAMETRIZE { species = SPECIES_BLASTOISE; item = ITEM_NONE; } | ||
PARAMETRIZE { species = SPECIES_CHARIZARD; item = ITEM_CORNERSTONE_MASK; } | ||
PARAMETRIZE { species = SPECIES_CHARIZARD; item = ITEM_WELLSPRING_MASK; } | ||
PARAMETRIZE { species = SPECIES_VENUSAUR; item = ITEM_HEARTHFLAME_MASK; } | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET) { Item(item); } | ||
OPPONENT(species); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_IVY_CUDGEL); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_IVY_CUDGEL, player); | ||
HP_BAR(opponent); | ||
MESSAGE("It's super effective!"); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(gBattleMoves[MOVE_MATCHA_GOTCHA].effect == EFFECT_MATCHA_GOTCHA); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Matcha Gotcha inflicts burn 20% of the time") | ||
{ | ||
PASSES_RANDOMLY(20, 100, RNG_SECONDARY_EFFECT); | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, MOVE_MATCHA_GOTCHA); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MATCHA_GOTCHA, player); | ||
HP_BAR(opponent); | ||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponent); | ||
STATUS_ICON(opponent, burn: TRUE); | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Matcha Gatcha can burn both targets") | ||
{ | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET) { HP(1); } | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerLeft, MOVE_MATCHA_GOTCHA); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MATCHA_GOTCHA, playerLeft); | ||
HP_BAR(opponentLeft); | ||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponentLeft); | ||
STATUS_ICON(opponentLeft, burn: TRUE); | ||
HP_BAR(opponentRight); | ||
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponentRight); | ||
STATUS_ICON(opponentRight, burn: TRUE); | ||
} | ||
} | ||
|
||
DOUBLE_BATTLE_TEST("Matcha Gatcha recovers 50% of the damage dealt from both targets") | ||
{ | ||
s16 damageLeft; | ||
s16 damageRight; | ||
s16 healedLeft; | ||
s16 healedRight; | ||
|
||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET) { HP(1); } | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(playerLeft, MOVE_MATCHA_GOTCHA); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, MOVE_MATCHA_GOTCHA, playerLeft); | ||
HP_BAR(opponentLeft, captureDamage: &damageLeft); | ||
HP_BAR(playerLeft, captureDamage: &healedLeft); | ||
HP_BAR(opponentRight, captureDamage: &damageRight); | ||
HP_BAR(playerLeft, captureDamage: &healedRight); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't supposed to print each turn if the effect is already active. It would be better to create a new move effect and call a battle script to print this string when the effect is set itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix in a follow up PR