Skip to content

Commit

Permalink
Merge branch '_RHH/master' into _RHH/upcoming
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo committed Jan 21, 2025
2 parents a3ce3a5 + b2f2a8c commit ed505cf
Show file tree
Hide file tree
Showing 27 changed files with 170 additions and 132 deletions.
2 changes: 0 additions & 2 deletions docs/tutorials/how_to_new_move.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ Each move can have up to 15 additional effects, allowing you to construct monstr
.moveEffect = MOVE_EFFECT_ALL_STATS_UP,
.chance = 40,
.self = TRUE,
},{
.moveEffect = MOVE_EFFECT_RAPID_SPIN,
},{
.moveEffect = MOVE_EFFECT_DEF_MINUS_2,
.chance = 50,
Expand Down
Binary file added graphics/pokemon/clodsire/anim_front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/clodsire/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed graphics/pokemon/clodsire/front.png
Binary file not shown.
28 changes: 14 additions & 14 deletions graphics/pokemon/clodsire/normal.pal
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
JASC-PAL
0100
16
152 208 160
64 60 48
128 108 96
153 211 165
248 141 165
176 90 105
105 54 57
184 160 162
152 122 126
86 71 72
128 109 102
96 80 72
48 40 32
69 60 50
51 41 36
46 39 36
16 16 16
184 160 160
208 208 208
40 36 32
152 120 120
80 68 72
104 52 56
176 88 104
248 140 160
0 0 0
0 0 0
215 189 217
152 116 156
91 67 108
24 changes: 12 additions & 12 deletions graphics/pokemon/clodsire/shiny.pal
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
JASC-PAL
0100
16
152 208 160
74 67 90
153 211 165
248 141 142
176 94 90
105 62 54
160 158 197
127 127 157
87 85 112
127 116 143
107 97 124
74 67 90
49 43 62
46 40 44
16 16 16
160 158 197
205 180 170
40 36 32
127 127 157
87 85 112
104 52 56
176 88 104
248 140 160
0 0 0
0 0 0
230 209 181
201 159 123
99 63 59
Binary file modified graphics/pokemon/grookey/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/pokemon/grookey/overworld.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions include/battle_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ struct DamageCalculationData
u32 updateFlags:1;
u32 padding:2;
};
STATIC_ASSERT(sizeof(struct DamageCalculationData) <= 4, StructExceedsFourBytes);

enum SleepClauseBlock
{
Expand Down
109 changes: 54 additions & 55 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,61 +364,60 @@ enum BattleWeather
#define MOVE_EFFECT_PREVENT_ESCAPE 33
#define MOVE_EFFECT_NIGHTMARE 34
#define MOVE_EFFECT_ALL_STATS_UP 35
#define MOVE_EFFECT_RAPID_SPIN 36
#define MOVE_EFFECT_REMOVE_STATUS 37
#define MOVE_EFFECT_ATK_DEF_DOWN 38
#define MOVE_EFFECT_ATK_PLUS_2 39
#define MOVE_EFFECT_DEF_PLUS_2 40
#define MOVE_EFFECT_SPD_PLUS_2 41
#define MOVE_EFFECT_SP_ATK_PLUS_2 42
#define MOVE_EFFECT_SP_DEF_PLUS_2 43
#define MOVE_EFFECT_ACC_PLUS_2 44
#define MOVE_EFFECT_EVS_PLUS_2 45
#define MOVE_EFFECT_ATK_MINUS_2 46
#define MOVE_EFFECT_DEF_MINUS_2 47
#define MOVE_EFFECT_SPD_MINUS_2 48
#define MOVE_EFFECT_SP_ATK_MINUS_2 49
#define MOVE_EFFECT_SP_DEF_MINUS_2 50
#define MOVE_EFFECT_ACC_MINUS_2 51
#define MOVE_EFFECT_EVS_MINUS_2 52
#define MOVE_EFFECT_SCALE_SHOT 53
#define MOVE_EFFECT_THRASH 54
#define MOVE_EFFECT_KNOCK_OFF 55
#define MOVE_EFFECT_DEF_SPDEF_DOWN 56
#define MOVE_EFFECT_CLEAR_SMOG 57
#define MOVE_EFFECT_SMACK_DOWN 58
#define MOVE_EFFECT_FLAME_BURST 59
#define MOVE_EFFECT_FEINT 60
#define MOVE_EFFECT_SPECTRAL_THIEF 61
#define MOVE_EFFECT_V_CREATE 62
#define MOVE_EFFECT_HAPPY_HOUR 63
#define MOVE_EFFECT_CORE_ENFORCER 64
#define MOVE_EFFECT_THROAT_CHOP 65
#define MOVE_EFFECT_INCINERATE 66
#define MOVE_EFFECT_BUG_BITE 67
#define MOVE_EFFECT_RECOIL_HP_25 68
#define MOVE_EFFECT_TRAP_BOTH 69
#define MOVE_EFFECT_ROUND 70
#define MOVE_EFFECT_STOCKPILE_WORE_OFF 71
#define MOVE_EFFECT_DIRE_CLAW 72
#define MOVE_EFFECT_STEALTH_ROCK 73
#define MOVE_EFFECT_SPIKES 74
#define MOVE_EFFECT_SYRUP_BOMB 75
#define MOVE_EFFECT_FLORAL_HEALING 76
#define MOVE_EFFECT_SECRET_POWER 77
#define MOVE_EFFECT_PSYCHIC_NOISE 78
#define MOVE_EFFECT_TERA_BLAST 79
#define MOVE_EFFECT_ORDER_UP 80
#define MOVE_EFFECT_ION_DELUGE 81
#define MOVE_EFFECT_AROMATHERAPY 82 // No functionality yet
#define MOVE_EFFECT_HAZE 83
#define MOVE_EFFECT_LEECH_SEED 84
#define MOVE_EFFECT_REFLECT 85
#define MOVE_EFFECT_LIGHT_SCREEN 86
#define MOVE_EFFECT_SALT_CURE 87
#define MOVE_EFFECT_EERIE_SPELL 88

#define NUM_MOVE_EFFECTS 89
#define MOVE_EFFECT_REMOVE_STATUS 36
#define MOVE_EFFECT_ATK_DEF_DOWN 37
#define MOVE_EFFECT_ATK_PLUS_2 38
#define MOVE_EFFECT_DEF_PLUS_2 39
#define MOVE_EFFECT_SPD_PLUS_2 40
#define MOVE_EFFECT_SP_ATK_PLUS_2 41
#define MOVE_EFFECT_SP_DEF_PLUS_2 42
#define MOVE_EFFECT_ACC_PLUS_2 43
#define MOVE_EFFECT_EVS_PLUS_2 44
#define MOVE_EFFECT_ATK_MINUS_2 45
#define MOVE_EFFECT_DEF_MINUS_2 46
#define MOVE_EFFECT_SPD_MINUS_2 47
#define MOVE_EFFECT_SP_ATK_MINUS_2 48
#define MOVE_EFFECT_SP_DEF_MINUS_2 49
#define MOVE_EFFECT_ACC_MINUS_2 50
#define MOVE_EFFECT_EVS_MINUS_2 51
#define MOVE_EFFECT_SCALE_SHOT 52
#define MOVE_EFFECT_THRASH 53
#define MOVE_EFFECT_KNOCK_OFF 54
#define MOVE_EFFECT_DEF_SPDEF_DOWN 55
#define MOVE_EFFECT_CLEAR_SMOG 56
#define MOVE_EFFECT_SMACK_DOWN 57
#define MOVE_EFFECT_FLAME_BURST 58
#define MOVE_EFFECT_FEINT 59
#define MOVE_EFFECT_SPECTRAL_THIEF 60
#define MOVE_EFFECT_V_CREATE 61
#define MOVE_EFFECT_HAPPY_HOUR 62
#define MOVE_EFFECT_CORE_ENFORCER 63
#define MOVE_EFFECT_THROAT_CHOP 64
#define MOVE_EFFECT_INCINERATE 65
#define MOVE_EFFECT_BUG_BITE 66
#define MOVE_EFFECT_RECOIL_HP_25 67
#define MOVE_EFFECT_TRAP_BOTH 68
#define MOVE_EFFECT_ROUND 69
#define MOVE_EFFECT_STOCKPILE_WORE_OFF 70
#define MOVE_EFFECT_DIRE_CLAW 71
#define MOVE_EFFECT_STEALTH_ROCK 72
#define MOVE_EFFECT_SPIKES 73
#define MOVE_EFFECT_SYRUP_BOMB 74
#define MOVE_EFFECT_FLORAL_HEALING 75
#define MOVE_EFFECT_SECRET_POWER 76
#define MOVE_EFFECT_PSYCHIC_NOISE 77
#define MOVE_EFFECT_TERA_BLAST 78
#define MOVE_EFFECT_ORDER_UP 79
#define MOVE_EFFECT_ION_DELUGE 80
#define MOVE_EFFECT_AROMATHERAPY 81 // No functionality yet
#define MOVE_EFFECT_HAZE 82
#define MOVE_EFFECT_LEECH_SEED 83
#define MOVE_EFFECT_REFLECT 84
#define MOVE_EFFECT_LIGHT_SCREEN 85
#define MOVE_EFFECT_SALT_CURE 86
#define MOVE_EFFECT_EERIE_SPELL 87

#define NUM_MOVE_EFFECTS 88

#define MOVE_EFFECT_AFFECTS_USER 0x2000
#define MOVE_EFFECT_CERTAIN 0x4000
Expand Down
1 change: 1 addition & 0 deletions include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ enum {
EFFECT_GUARDIAN_OF_ALOLA,
EFFECT_SHELL_SIDE_ARM,
EFFECT_ORDER_UP,
EFFECT_RAPID_SPIN,
NUM_BATTLE_MOVE_EFFECTS,
};

Expand Down
1 change: 1 addition & 0 deletions include/constants/battle_script_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ enum MoveEndEffects
MOVEEND_MULTIHIT_MOVE,
MOVEEND_DEFROST,
MOVEEND_RECOIL,
MOVEEND_RAPID_SPIN,
MOVEEND_ITEM_EFFECTS_ATTACKER,
MOVEEND_MAGICIAN, // Occurs after final multi-hit strike, and after other items/abilities would activate
MOVEEND_RED_CARD, // Red Card triggers before Eject Pack
Expand Down
35 changes: 20 additions & 15 deletions src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3091,7 +3091,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case EFFECT_ENTRAINMENT:
if (partnerHasBadAbility && IsAbilityOfRating(aiData->abilities[battlerAtk], 0))
{
RETURN_SCORE_PLUS(WEAK_EFFECT);
RETURN_SCORE_PLUS(DECENT_EFFECT);
}
break;
case EFFECT_SOAK:
Expand Down Expand Up @@ -3642,7 +3642,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
case EFFECT_LEECH_SEED:
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS)
|| gStatuses3[battlerDef] & STATUS3_LEECHSEED
|| HasMoveWithAdditionalEffect(battlerDef, MOVE_EFFECT_RAPID_SPIN)
|| HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN)
|| aiData->abilities[battlerDef] == ABILITY_LIQUID_OOZE
|| aiData->abilities[battlerDef] == ABILITY_MAGIC_GUARD)
break;
Expand Down Expand Up @@ -4198,9 +4198,13 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
case EFFECT_ENTRAINMENT:
if (GetActiveGimmick(battlerDef) == GIMMICK_DYNAMAX)
break;
else if ((IsAbilityOfRating(aiData->abilities[battlerDef], 5) || gAbilitiesInfo[aiData->abilities[battlerAtk]].aiRating <= 0)
&& (aiData->abilities[battlerDef] != aiData->abilities[battlerAtk] && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID)))
ADJUST_SCORE(DECENT_EFFECT);
if (aiData->abilities[battlerDef] != aiData->abilities[battlerAtk] && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID))
{
if (gAbilitiesInfo[aiData->abilities[battlerAtk]].aiRating <= 0)
ADJUST_SCORE(DECENT_EFFECT);
else if (IsAbilityOfRating(aiData->abilities[battlerDef], 5) && gAbilitiesInfo[aiData->abilities[battlerAtk]].aiRating <= 3)
ADJUST_SCORE(WEAK_EFFECT);
}
break;
case EFFECT_IMPRISON:
if (predictedMove != MOVE_NONE && HasMove(battlerAtk, predictedMove))
Expand Down Expand Up @@ -4557,6 +4561,12 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
|| gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & STATUS1_ANY)
ADJUST_SCORE(GOOD_EFFECT);
break;
case EFFECT_RAPID_SPIN:
if ((gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_HAZARDS_ANY && CountUsablePartyMons(battlerAtk) != 0)
|| (gStatuses3[battlerAtk] & STATUS3_LEECHSEED || gBattleMons[battlerAtk].status2 & STATUS2_WRAPPED))
ADJUST_SCORE(GOOD_EFFECT);
break;

} // move effect checks

u32 additionalEffectCount = GetMoveAdditionalEffectCount(move);
Expand Down Expand Up @@ -4601,11 +4611,6 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
case MOVE_EFFECT_EVS_PLUS_2:
ADJUST_SCORE(IncreaseStatUpScore(battlerAtk, battlerDef, STAT_CHANGE_EVASION));
break;
case MOVE_EFFECT_RAPID_SPIN:
if ((gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_HAZARDS_ANY && CountUsablePartyMons(battlerAtk) != 0)
|| (gStatuses3[battlerAtk] & STATUS3_LEECHSEED || gBattleMons[battlerAtk].status2 & STATUS2_WRAPPED))
ADJUST_SCORE(GOOD_EFFECT);
break;
}
}
else
Expand Down Expand Up @@ -4800,7 +4805,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
}
break;
case MOVE_EFFECT_WRAP:
if (!HasMoveWithAdditionalEffect(battlerDef, MOVE_EFFECT_RAPID_SPIN) && ShouldTrap(battlerAtk, battlerDef, move))
if (!HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN) && ShouldTrap(battlerAtk, battlerDef, move))
ADJUST_SCORE(BEST_EFFECT);
break;
case MOVE_EFFECT_SALT_CURE:
Expand Down Expand Up @@ -5470,6 +5475,10 @@ static s32 AI_PredictSwitch(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
if (opposingHazardFlags != 0)
ADJUST_SCORE(GOOD_EFFECT);
break;
case EFFECT_RAPID_SPIN:
if (aiHazardFlags != 0)
ADJUST_SCORE(BEST_EFFECT);
break;
case EFFECT_DEFOG:
if (aiHazardFlags != 0)
ADJUST_SCORE(GOOD_EFFECT);
Expand Down Expand Up @@ -5525,10 +5534,6 @@ static s32 AI_PredictSwitch(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case MOVE_EFFECT_WRAP:
ADJUST_SCORE(-GOOD_EFFECT);
break;
case MOVE_EFFECT_RAPID_SPIN:
if (aiHazardFlags != 0)
ADJUST_SCORE(BEST_EFFECT);
break;
case MOVE_EFFECT_FEINT:
ADJUST_SCORE(-BEST_EFFECT);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ static bool32 CanMonSurviveHazardSwitchin(u32 battler)
{
aiMove = GetMonData(&party[i], MON_DATA_MOVE1 + j, NULL);
u32 aiEffect = GetMoveEffect(aiMove);
if (MoveHasAdditionalEffectSelf(aiMove, MOVE_EFFECT_RAPID_SPIN)
if (aiEffect == EFFECT_RAPID_SPIN
|| (B_DEFOG_EFFECT_CLEARING >= GEN_6 && aiEffect == EFFECT_DEFOG)
|| aiEffect == EFFECT_TIDY_UP)
{
Expand Down
2 changes: 1 addition & 1 deletion src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -4123,7 +4123,7 @@ bool32 AI_ShouldSetUpHazards(u32 battlerAtk, u32 battlerDef, struct AiLogicData
{
if (aiData->abilities[battlerDef] == ABILITY_MAGIC_BOUNCE
|| CountUsablePartyMons(battlerDef) == 0
|| HasMoveWithAdditionalEffect(battlerDef, MOVE_EFFECT_RAPID_SPIN)
|| HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN)
|| HasMoveEffect(battlerDef, EFFECT_DEFOG))
return FALSE;

Expand Down
16 changes: 11 additions & 5 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -3795,10 +3795,6 @@ void SetMoveEffect(bool32 primary, bool32 certain)
gBattlescriptCurrInstr = BattleScript_AllStatsUp;
}
break;
case MOVE_EFFECT_RAPID_SPIN:
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_RapidSpinAway;
break;
case MOVE_EFFECT_ATK_DEF_DOWN: // SuperPower
if (!NoAliveMonsForEitherParty())
{
Expand Down Expand Up @@ -6138,6 +6134,17 @@ static void Cmd_moveend(void)
gBattleScripting.moveendState++;
break;
}
case MOVEEND_RAPID_SPIN:
if (gMovesInfo[gCurrentMove].effect == EFFECT_RAPID_SPIN
&& !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
&& IsBattlerTurnDamaged(gBattlerTarget))
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_RapidSpinAway;
effect = TRUE;
}
gBattleScripting.moveendState++;
break;
case MOVEEND_ITEM_EFFECTS_ATTACKER:
if (ItemBattleEffects(ITEMEFFECT_MOVE_END, gBattlerAttacker, FALSE))
effect = TRUE;
Expand Down Expand Up @@ -14416,7 +14423,6 @@ static void Cmd_setcharge(void)
gDisableStructs[battler].chargeTimer = 2;
else
gDisableStructs[battler].chargeTimer = 0;
gBattlescriptCurrInstr++;
gBattlescriptCurrInstr = cmd->nextInstr;
}

Expand Down
2 changes: 1 addition & 1 deletion src/battle_tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3)
// Various cases to add/remove points
if (GetMoveRecoil(arg2) > 0)
baseFromEffect++; // Recoil moves
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_RAPID_SPIN))
if (gMovesInfo[arg2].effect == EFFECT_RAPID_SPIN)
baseFromEffect++;
if (MoveHasAdditionalEffect(arg2, MOVE_EFFECT_SP_ATK_MINUS_2) || MoveHasAdditionalEffect(arg2, MOVE_EFFECT_ATK_DEF_DOWN))
baseFromEffect += 2; // Overheat, Superpower, etc.
Expand Down
6 changes: 6 additions & 0 deletions src/data/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -2240,4 +2240,10 @@ const struct BattleMoveEffect gBattleMoveEffects[NUM_BATTLE_MOVE_EFFECTS] =
.battleScript = BattleScript_EffectHit,
.battleTvScore = 0, // TODO: Assign points
},

[EFFECT_RAPID_SPIN] =
{
.battleScript = BattleScript_EffectHit,
.battleTvScore = 0, // TODO: Assign points
},
};
2 changes: 1 addition & 1 deletion src/data/graphics/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -7696,7 +7696,7 @@ const u32 gObjectEventPic_Substitute[] = INCBIN_COMP("graphics/pokemon/question_
#endif //OW_PKMN_OBJECTS_SHARE_PALETTES
#endif //OW_POKEMON_OBJECT_EVENTS

const u32 gMonFrontPic_Clodsire[] = INCBIN_U32("graphics/pokemon/clodsire/front.4bpp.lz");
const u32 gMonFrontPic_Clodsire[] = INCBIN_U32("graphics/pokemon/clodsire/anim_front.4bpp.lz");
const u32 gMonPalette_Clodsire[] = INCBIN_U32("graphics/pokemon/clodsire/normal.gbapal.lz");
const u32 gMonBackPic_Clodsire[] = INCBIN_U32("graphics/pokemon/clodsire/back.4bpp.lz");
const u32 gMonShinyPalette_Clodsire[] = INCBIN_U32("graphics/pokemon/clodsire/shiny.gbapal.lz");
Expand Down
Loading

0 comments on commit ed505cf

Please sign in to comment.