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 17, 2025
2 parents 3b19f69 + 21d2e40 commit cacd07d
Show file tree
Hide file tree
Showing 16 changed files with 1,456 additions and 1,264 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<!--- Provide a general summary of your changes in the Title above -->

<!--- Before submitting, please make sure your pull request meets the scope guidelines. If unsure, please open a thread in #pr-discussions.-->
<!--- Scope Guidelines: https://github.com/rh-hideout/pokeemerald-expansion/blob/master/docs/scope.md -->
<!--- Scope Guidelines: https://github.com/rh-hideout/pokeemerald-expansion/blob/master/docs/team_procedures/scope.md -->
<!--- #pr-discussions: https://discord.com/channels/419213663107416084/1102784418369785948 -->

## Description
<!--- Describe your changes in detail -->
<!--- If you believe this PR qualifies as a "Big Feature" as defined in docs/team_procedures/schedule.md, please let a Maintainer know! -->

## Images
<!-- Please provide with relevant GIFs or images to make it easier for reviewers to accept your PR quicker.-->
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ $(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt)
$(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt
$(RAMSCRGEN) ewram_data $< ENGLISH > $@

# NOTE: Depending on event_scripts.o is hacky, but we want to depend on everything event_scripts.s depends on without having to alter scaninc
$(DATA_SRC_SUBDIR)/pokemon/teachable_learnsets.h: $(DATA_ASM_BUILDDIR)/event_scripts.o
TEACHABLE_DEPS := $(shell find data/ -type f -name '*.inc') $(INCLUDE_DIRS)/constants/tms_hms.h $(C_SUBDIR)/pokemon.c
$(DATA_SRC_SUBDIR)/pokemon/teachable_learnsets.h: $(TEACHABLE_DEPS)
python3 $(TOOLS_DIR)/learnset_helpers/teachable.py

# Linker script
Expand Down
3 changes: 2 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@
- [Version 0.9.0](changelogs/0.9.x/0.9.0.md)
- [Team Procedures]()
- [How to make an Expansion version](team_procedures/expansion_versions.md)
- [Scope Guidelines](scope.md)
- [Release Schedule and Process](team_procedures/schedule.md)
- [Scope Guidelines](team_procedures/scope.md)
51 changes: 51 additions & 0 deletions docs/team_procedures/schedule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Release Schedule and Process

## Version Lifecycle

### Minor Release (90 days to next Minor Release)
`upcoming` and `master` are synchronized. Minor Release should occur once every three months. Maintainers can vote to do extra Minor Releases for special cases, but this should be considered highly irregular.

### Patch Release (60 / 30 days to the next Minor Release)
Releases that focus primarily on bugfixes or improvements to the test system. Patch Releases should occur AT LEAST once a month, but can be more frequent than that.

### Big Feature Freeze (30 days to the next Minor Release)
PRs with the Github label [`type: big feature`](https://github.com/rh-hideout/pokeemerald-expansion/issues?q=sort%3Aupdated-desc+is%3Aopen+label%3A%22type%3A+big+feature%22) will NOT be merged until after the next Minor Release.

### Merge Freeze (14 days to the next Minor Release)
PRs that DO NOT have the Github labels [`bugfix`](https://github.com/rh-hideout/pokeemerald-expansion/issues?q=sort%3Aupdated-desc+label%3Abugfix) or [`type: cleanup`](https://github.com/rh-hideout/pokeemerald-expansion/issues?q=sort%3Aupdated-desc+label%3A%22type%3A+cleanup%22+) will NOT be merged until after the next Minor Release.


### Sample Schedule
| Major | Minor | Patch | Type | Goal Date |
| ----- | ----- | ----- | ------------------ | ----------- |
| 2 | 1 | 0 | Minor | Dec 1 2025 |
| 2 | 1 | 1 | Patch | Dec 31 2025 |
| 2 | 1 | 2 | Patch | Jan 30 2026 |
| 2 | 1 | 2 | Big Feature Freeze | Jan 30 2026 |
| 2 | 1 | 2 | Merge Freeze | Feb 15 2026 |
| 2 | 1 | 3 | Patch | Mar 1 2026 |
| 2 | 2 | 0 | Minor | Mar 1 2026 |

---

## What is a "Big Feature"?
* If the original owner of the PR thinks a feature should be labeled a Big Feature, it is, no questions asked
* If a reviewer thinks a PR is a Big Feature, then it is
* If the two disagree, it can be discussed in a PR thread, and can ultimately be resolved with a Maintainer vote.

### How To Identify a Big Feature
* **Big diffs**: It's easy for something to go unnoticed in review when it's a tiny part of a massive diff.
* **High-impact**: High-impact changes are harder to review because they often have consequences that aren't obvious to the reviewer. We catch these consequences from users who use upcoming reporting them.
* **Subjective**: Subjective changes are more likely to have differences of opinions between senate members.
* **Pervasive**: The PR touches several different parts of the codebase or is involved in several different parts of the codebase, even if those elements are small.

---

## Release Blocking and Milestones
When an issue or PR is assigned to a [milestone on Github](https://github.com/rh-hideout/pokeemerald-expansion/milestones) by a Maintainer, that means it is "Blocking". If another Maintainer agrees with this, then that version cannot be released until that issue is resolved or PR is merged.

This designation should be reserved for instances where an existing feature on `upcoming` or `master` is broken and causing problems for users or players.

Blocking issues or PRs can be deferred to future releases but should be discussed with the Maintainers that assigned the designation in the first place.

If a version's milestone does not have any issues or PRs assigned to it, that version should be [released](https://github.com/rh-hideout/pokeemerald-expansion/blob/master/docs/team_procedures/expansion_versions.md) as close to the goal date as possible.
14 changes: 13 additions & 1 deletion docs/scope.md → docs/team_procedures/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,22 @@ A pull request meets the scope criteria if:

## Discussion Required Categories

Pull Requests that fall into this category should be brought up to maintainers, who will discuss and vote as to whether or not the feature is considered in scope. Considerations for acceptance may include invasiveness of implementation, popularity, ease of maintenance, etc.
Pull Requests that fall into this category are not in scope by default and should be brought up to maintainers, who will discuss and vote as to whether or not the feature is considered in scope. Considerations for acceptance may include invasiveness of implementation, popularity, ease of maintenance, etc.

1. **Developer Ease of Use**: Lowers barrier of entry for developers to use existing behavior
2. **Fangame Features**: Adds a popular feature from other fangames
3. **Popular Non-SS Features**: Exceptions can be made for uniquely popular or requested features (Drowsy, PLA Legend Plate, etc.)
4. **External Program**: External programs like poryscript, porymoves, etc.

## Workflow for Proposed Feature Scope Discussion
For the contributor:
- Make a thread for the feature on Discord
- Describe how the feature fits into this scope document, and why you feel it should be considered
- Optionally include either a draft PR or describe in some detail the proposed implementation. Non-mandatory, but implementation invasiveness, maintenance cost, etc. are major considerations, so use your judgement. The senate may ask for this information during discussion.

For the senate:
- Make a senate thread for the discussion
- Make and pin a two-week voting poll
- Discuss, conclude, and cast votes before the two-week deadline
- Inform contributor as to the results and reasons in their thread
- Amend this scope document if necessary
1 change: 1 addition & 0 deletions include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
#define B_SYMBIOSIS_GEMS GEN_LATEST // In Gen7+, Symbiosis passes an item after a gem-boosted attack. Previously, items are passed before the gem-boosted attack hits, making the item effect apply.
#define B_ABSORBING_ABILITY_STRING GEN_LATEST // In Gen5+, the abilities that absorb moves of a certain type use a generic string for stat increases and decreases.
#define B_REDIRECT_ABILITY_IMMUNITY GEN_LATEST // In Gen5+, Pokémon with Lightning Rod/Storm Drain become immune to Electric/Water-type moves and increase their Sp. Attack by 1 stage on top of the redirecting effect.
#define B_REDIRECT_ABILITY_ALLIES GEN_LATEST // In Gen4+, Lightning Rod/Storm Drain redirect ally's moves as well.
#define B_LEAF_GUARD_PREVENTS_REST GEN_LATEST // In Gen5+, Leaf Guard prevents the use of Rest in harsh sunlight.
#define B_SNOW_WARNING GEN_LATEST // In Gen9+, Snow Warning will summon snow instead of hail.
#define B_TRANSISTOR_BOOST GEN_LATEST // In Gen9+, Transistor will only boost Electric-type moves by 1.3x as opposed to 1.5x.
Expand Down
5 changes: 3 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,8 +1876,8 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec

return critChance;
}
#undef CRIT_BLOCKED
#undef ALWAYS_CRITS
#undef CRITICAL_HIT_BLOCKED
#undef CRITICAL_HIT_ALWAYS

s32 CalcCritChanceStage(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordAbility)
{
Expand Down Expand Up @@ -6073,6 +6073,7 @@ static void Cmd_moveend(void)
break;
case MOVEEND_DEFROST: // defrosting check
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE
&& IsBattlerTurnDamaged(gBattlerTarget)
&& IsBattlerAlive(gBattlerTarget)
&& gBattlerAttacker != gBattlerTarget
&& (moveType == TYPE_FIRE || CanBurnHitThaw(gCurrentMove))
Expand Down
4 changes: 2 additions & 2 deletions src/battle_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1742,8 +1742,8 @@ static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u

for (i = 0; i <= REMATCH_SPECIAL_TRAINER_START; i++)
{
if (DoesCurrentMapMatchRematchTrainerMap(i,table,mapGroup,mapNum) && !IsRematchForbidden(i))
continue;
if (!DoesCurrentMapMatchRematchTrainerMap(i,table,mapGroup,mapNum) || IsRematchForbidden(i))
continue; // Only check permitted trainers within the current map.

if (gSaveBlock1Ptr->trainerRematches[i] != 0)
{
Expand Down
59 changes: 38 additions & 21 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move)
// Functions
void HandleAction_UseMove(void)
{
u32 battler, i, side, moveType, var = 4;
u32 battler, i, side, moveType, ability, var = MAX_BATTLERS_COUNT;
u16 moveTarget;

gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
Expand Down Expand Up @@ -326,6 +326,7 @@ void HandleAction_UseMove(void)

// choose target
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
ability = GetBattlerAbility(gBattleStruct->moveTarget[gBattlerAttacker]);
if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove)
&& moveTarget == MOVE_TARGET_SELECTED
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget))
Expand All @@ -336,16 +337,18 @@ void HandleAction_UseMove(void)
&& gSideTimers[side].followmeTimer == 0
&& !gBattleStruct->battlerState[*(gBattleStruct->moveTarget + gBattlerAttacker)].pursuitTarget
&& (!IsBattleMoveStatus(gCurrentMove) || (moveTarget != MOVE_TARGET_USER && moveTarget != MOVE_TARGET_ALL_BATTLERS))
&& ((GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|| (GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_STORM_DRAIN && moveType == TYPE_WATER)))
&& ((ability != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|| (ability != ABILITY_STORM_DRAIN && moveType == TYPE_WATER)))
{
side = GetBattlerSide(gBattlerAttacker);
// Find first battler that redirects the move (in turn order)
for (battler = 0; battler < gBattlersCount; battler++)
{
if (side != GetBattlerSide(battler)
&& *(gBattleStruct->moveTarget + gBattlerAttacker) != battler
&& ((GetBattlerAbility(battler) == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|| (GetBattlerAbility(battler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER))
ability = GetBattlerAbility(battler);
if ((B_REDIRECT_ABILITY_ALLIES >= GEN_4 || !IsAlly(gBattlerAttacker, battler))
&& battler != gBattlerAttacker
&& gBattleStruct->moveTarget[gBattlerAttacker] != battler
&& ((ability == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|| (ability == ABILITY_STORM_DRAIN && moveType == TYPE_WATER))
&& GetBattlerTurnOrderNum(battler) < var
&& moveEffect != EFFECT_SNIPE_SHOT
&& moveEffect != EFFECT_PLEDGE
Expand All @@ -355,7 +358,7 @@ void HandleAction_UseMove(void)
var = GetBattlerTurnOrderNum(battler);
}
}
if (var == 4)
if (var == MAX_BATTLERS_COUNT)
{
if (moveTarget & MOVE_TARGET_RANDOM)
{
Expand Down Expand Up @@ -8543,22 +8546,36 @@ u32 GetBattleMoveTarget(u16 move, u8 setTarget)
}
else
{
u32 battlerAbilityOnField = 0;

targetBattler = SetRandomTarget(gBattlerAttacker);
if (moveType == TYPE_ELECTRIC
&& IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_LIGHTNING_ROD)
&& GetBattlerAbility(targetBattler) != ABILITY_LIGHTNING_ROD)
if (moveType == TYPE_ELECTRIC && GetBattlerAbility(targetBattler) != ABILITY_LIGHTNING_ROD)
{
targetBattler ^= BIT_FLANK;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE;
if (B_REDIRECT_ABILITY_ALLIES >= GEN_4)
battlerAbilityOnField = IsAbilityOnField(ABILITY_LIGHTNING_ROD);
else
battlerAbilityOnField = IsAbilityOnOpposingSide(targetBattler, ABILITY_LIGHTNING_ROD);

if (battlerAbilityOnField > 0)
{
targetBattler = battlerAbilityOnField - 1;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE;
}
}
else if (moveType == TYPE_WATER
&& IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_STORM_DRAIN)
&& GetBattlerAbility(targetBattler) != ABILITY_STORM_DRAIN)
else if (moveType == TYPE_WATER && GetBattlerAbility(targetBattler) != ABILITY_STORM_DRAIN)
{
targetBattler ^= BIT_FLANK;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].stormDrainRedirected = TRUE;
if (B_REDIRECT_ABILITY_ALLIES >= GEN_4)
battlerAbilityOnField = IsAbilityOnField(ABILITY_STORM_DRAIN);
else
battlerAbilityOnField = IsAbilityOnOpposingSide(targetBattler, ABILITY_STORM_DRAIN);

if (battlerAbilityOnField > 0)
{
targetBattler = battlerAbilityOnField - 1;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE;
}
}
}
break;
Expand Down
Loading

0 comments on commit cacd07d

Please sign in to comment.