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

Add friendship evo threshold constant #1928

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@
#include "constants/trainers.h"
#include "constants/union_room.h"

#define DAY_EVO_HOUR_BEGIN 12
#define DAY_EVO_HOUR_END HOURS_PER_DAY
#define DAY_EVO_HOUR_BEGIN 12
#define DAY_EVO_HOUR_END HOURS_PER_DAY

#define NIGHT_EVO_HOUR_BEGIN 0
#define NIGHT_EVO_HOUR_END 12
#define NIGHT_EVO_HOUR_BEGIN 0
#define NIGHT_EVO_HOUR_END 12

#define FRIENDSHIP_EVO_THRESHOLD 220

struct SpeciesItem
{
Expand Down Expand Up @@ -5499,17 +5501,17 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem)
switch (gEvolutionTable[species][i].method)
{
case EVO_FRIENDSHIP:
if (friendship >= 220)
if (friendship >= FRIENDSHIP_EVO_THRESHOLD)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_DAY:
RtcCalcLocalTime();
if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= 220)
if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_NIGHT:
RtcCalcLocalTime();
if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= 220)
if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= FRIENDSHIP_EVO_THRESHOLD)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL:
Expand Down