Skip to content
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

Implemented Ice Face #2255

Merged
merged 8 commits into from
Jan 9, 2023
Merged

Conversation

LOuroboros
Copy link
Collaborator

Description

Supersedes #1846.
Special thanks to Benício Gonçalves#3454 who provided a base to work with.

Discord contact info

Lunos#4026

Thanks to Benício Gonçalves#3454 who provided a base to work with.
@AsparagusEduardo AsparagusEduardo changed the base branch from master to dev September 10, 2022 01:33
@AsparagusEduardo AsparagusEduardo added category: battle-mechanic Pertains to battle mechanics and removed category: battle-mechanic Pertains to battle mechanics labels Sep 16, 2022
@AsparagusEduardo AsparagusEduardo changed the base branch from dev to dev_1.x September 16, 2022 17:30
@AsparagusEduardo AsparagusEduardo linked an issue Oct 1, 2022 that may be closed by this pull request
@LOuroboros LOuroboros mentioned this pull request Nov 2, 2022
@LOuroboros
Copy link
Collaborator Author

Merge conflicts solved, ready for a review 👀

@LOuroboros
Copy link
Collaborator Author

Turning this into a draft until #2473 is merged.

@LOuroboros LOuroboros marked this pull request as draft January 3, 2023 07:27
@LOuroboros LOuroboros marked this pull request as ready for review January 9, 2023 18:25
@LOuroboros
Copy link
Collaborator Author

Ready for review 👀

@LOuroboros
Copy link
Collaborator Author

I could get rid of the BattleScript_TargetFormChangeWithString and BattleScript_BattlerFormChangeWithStringEnd3 I added here if I overwrite the gBattlerAttacker in the instances where they're called and instead called the already existing BattleScript_AttackerFormChangeMoveEffect and BattleScript_AttackerFormChange, thus saving on pointless additions to the codebase. Thoughts?

diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s
index de1aa536a..9e2d9acd3 100644
--- a/data/battle_scripts_1.s
+++ b/data/battle_scripts_1.s
@@ -7807,35 +7807,6 @@ BattleScript_TargetFormChange::
 	handleformchange BS_TARGET, 2
 	return
 
-BattleScript_TargetFormChangeWithString::
-	pause 5
-	copybyte gBattlerAbility, gBattlerTarget
-	call BattleScript_AbilityPopUp
-	printstring STRINGID_EMPTYSTRING3
-	waitmessage 1
-	handleformchange BS_TARGET, 0
-	handleformchange BS_TARGET, 1
-	playanimation BS_TARGET, B_ANIM_FORM_CHANGE, NULL
-	waitanimation
-	handleformchange BS_TARGET, 2
-	printstring STRINGID_PKMNTRANSFORMED
-	waitmessage B_WAIT_TIME_LONG
-	return
-
-BattleScript_BattlerFormChangeWithStringEnd3::
-	pause 5
-	call BattleScript_AbilityPopUp
-	printstring STRINGID_EMPTYSTRING3
-	waitmessage 1
-	handleformchange BS_SCRIPTING, 0
-	handleformchange BS_SCRIPTING, 1
-	playanimation BS_SCRIPTING, B_ANIM_FORM_CHANGE, NULL
-	waitanimation
-	handleformchange BS_SCRIPTING, 2
-	printstring STRINGID_PKMNTRANSFORMED
-	waitmessage B_WAIT_TIME_LONG
-	end3
-
 BattleScript_IllusionOff::
 	spriteignore0hp TRUE
 	playanimation BS_TARGET, B_ANIM_ILLUSION_OFF
@@ -8907,7 +8878,10 @@ BattleScript_IceFaceNullsDamage::
 	effectivenesssound
 	hitanimation BS_TARGET
 	waitstate
-	call BattleScript_TargetFormChangeWithString
+	savetarget
+	copybyte gBattlerAttacker, gBattlerTarget
+	call BattleScript_AttackerFormChange
+	restoretarget
 	goto BattleScript_MoveEnd
 
 BattleScript_DazzlingProtected::
diff --git a/src/battle_util.c b/src/battle_util.c
index b9b57f4eb..5dc5db939 100644
--- a/src/battle_util.c
+++ b/src/battle_util.c
@@ -5157,7 +5157,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
                 gBattleMons[gBattlerTarget].species = SPECIES_EISCUE_NOICE_FACE;
                 if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)
                     gHitMarker |= HITMARKER_NO_PPDEDUCT;
-                gBattleScripting.battler = gBattlerTarget; // For STRINGID_PKMNTRANSFORMED
                 gBattlescriptCurrInstr = BattleScript_IceFaceNullsDamage;
                 effect = 1;
             }
@@ -6189,7 +6188,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
             {
                 gBattleStruct->allowedToChangeFormInWeather[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)] = FALSE;
                 gBattleMons[battler].species = SPECIES_EISCUE;
-                BattleScriptPushCursorAndCallback(BattleScript_BattlerFormChangeWithStringEnd3);
+                gBattlerAttacker = battler;
+                BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect);
                 effect++;
             }
             break;

@ghoulslash ghoulslash merged commit 5eb6219 into rh-hideout:upcoming Jan 9, 2023
@LOuroboros LOuroboros deleted the iceFaceRedux branch January 10, 2023 05:52
@AsparagusEduardo AsparagusEduardo mentioned this pull request Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: battle-mechanic Pertains to battle mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ABILITY_ICE_FACE
3 participants