Merge pull request #1928 from kittenchilly/friendship
Add friendship evo threshold constant
This commit is contained in:
@@ -48,11 +48,13 @@
|
|||||||
#include "constants/trainers.h"
|
#include "constants/trainers.h"
|
||||||
#include "constants/union_room.h"
|
#include "constants/union_room.h"
|
||||||
|
|
||||||
#define DAY_EVO_HOUR_BEGIN 12
|
#define DAY_EVO_HOUR_BEGIN 12
|
||||||
#define DAY_EVO_HOUR_END HOURS_PER_DAY
|
#define DAY_EVO_HOUR_END HOURS_PER_DAY
|
||||||
|
|
||||||
#define NIGHT_EVO_HOUR_BEGIN 0
|
#define NIGHT_EVO_HOUR_BEGIN 0
|
||||||
#define NIGHT_EVO_HOUR_END 12
|
#define NIGHT_EVO_HOUR_END 12
|
||||||
|
|
||||||
|
#define FRIENDSHIP_EVO_THRESHOLD 220
|
||||||
|
|
||||||
struct SpeciesItem
|
struct SpeciesItem
|
||||||
{
|
{
|
||||||
@@ -5499,17 +5501,17 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem)
|
|||||||
switch (gEvolutionTable[species][i].method)
|
switch (gEvolutionTable[species][i].method)
|
||||||
{
|
{
|
||||||
case EVO_FRIENDSHIP:
|
case EVO_FRIENDSHIP:
|
||||||
if (friendship >= 220)
|
if (friendship >= FRIENDSHIP_EVO_THRESHOLD)
|
||||||
targetSpecies = gEvolutionTable[species][i].targetSpecies;
|
targetSpecies = gEvolutionTable[species][i].targetSpecies;
|
||||||
break;
|
break;
|
||||||
case EVO_FRIENDSHIP_DAY:
|
case EVO_FRIENDSHIP_DAY:
|
||||||
RtcCalcLocalTime();
|
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;
|
targetSpecies = gEvolutionTable[species][i].targetSpecies;
|
||||||
break;
|
break;
|
||||||
case EVO_FRIENDSHIP_NIGHT:
|
case EVO_FRIENDSHIP_NIGHT:
|
||||||
RtcCalcLocalTime();
|
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;
|
targetSpecies = gEvolutionTable[species][i].targetSpecies;
|
||||||
break;
|
break;
|
||||||
case EVO_LEVEL:
|
case EVO_LEVEL:
|
||||||
|
|||||||
Reference in New Issue
Block a user