mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-29 14:53:55 +01:00
Clarify stages
This commit is contained in:
parent
49184cd799
commit
048d1ffbdb
@ -1,8 +1,6 @@
|
|||||||
#ifndef GUARD_BERRY_H
|
#ifndef GUARD_BERRY_H
|
||||||
#define GUARD_BERRY_H
|
#define GUARD_BERRY_H
|
||||||
|
|
||||||
#define NUM_BERRY_STAGES 4
|
|
||||||
|
|
||||||
void ClearEnigmaBerries(void);
|
void ClearEnigmaBerries(void);
|
||||||
void SetEnigmaBerry(u8 *src);
|
void SetEnigmaBerry(u8 *src);
|
||||||
bool32 IsEnigmaBerryValid(void);
|
bool32 IsEnigmaBerryValid(void);
|
||||||
|
@ -25,4 +25,11 @@
|
|||||||
#define BERRY_STAGE_BERRIES 5
|
#define BERRY_STAGE_BERRIES 5
|
||||||
#define BERRY_STAGE_SPARKLING 255
|
#define BERRY_STAGE_SPARKLING 255
|
||||||
|
|
||||||
|
// Berries can be watered in the following stages:
|
||||||
|
// - BERRY_STAGE_PLANTED
|
||||||
|
// - BERRY_STAGE_SPROUTED
|
||||||
|
// - BERRY_STAGE_TALLER
|
||||||
|
// - BERRY_STAGE_FLOWERING
|
||||||
|
#define NUM_WATER_STAGES 4
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_BERRY_H
|
#endif // GUARD_CONSTANTS_BERRY_H
|
||||||
|
@ -1225,10 +1225,10 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water)
|
|||||||
rand = randMin + Random() % (randMax - randMin + 1);
|
rand = randMin + Random() % (randMax - randMin + 1);
|
||||||
|
|
||||||
// Round upwards
|
// Round upwards
|
||||||
if ((rand % NUM_BERRY_STAGES) >= NUM_BERRY_STAGES / 2)
|
if ((rand % NUM_WATER_STAGES) >= NUM_WATER_STAGES / 2)
|
||||||
extraYield = rand / NUM_BERRY_STAGES + 1;
|
extraYield = rand / NUM_WATER_STAGES + 1;
|
||||||
else
|
else
|
||||||
extraYield = rand / NUM_BERRY_STAGES;
|
extraYield = rand / NUM_WATER_STAGES;
|
||||||
return extraYield + min;
|
return extraYield + min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user