summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-06-20 10:07:50 -0400
committerscnorton <scnorton@biociphers.org>2017-06-20 10:07:50 -0400
commitc54e2be332b56395ae2e913bd2d3bb3d25cc3336 (patch)
tree104d7378adf815cce05650414d36eea394847d21 /src
parent5aeef909084e6dd8ea75cfc34cdd2601cab1de39 (diff)
Up through GetLeadMonFriendshipScore
Diffstat (limited to 'src')
-rwxr-xr-xsrc/field_specials.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/field_specials.c b/src/field_specials.c
index ed2718d3d..0bee955c2 100755
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -17,6 +17,7 @@
#include "text.h"
#include "wallclock.h"
#include "tv.h"
+#include "rtc.h"
#include "link.h"
#include "songs.h"
#include "sound.h"
@@ -672,3 +673,60 @@ u8 sub_810E300(void)
{
return gUnknown_02024D26;
}
+
+void CableCarWarp(void)
+{
+ if (gSpecialVar_0x8004 != 0)
+ {
+ warp1_set(MAP_GROUP_ROUTE112_CABLE_CAR_STATION, MAP_ID_ROUTE112_CABLE_CAR_STATION, -1, 6, 4);
+ }
+ else
+ {
+ warp1_set(MAP_GROUP_MT_CHIMNEY_CABLE_CAR_STATION, MAP_ID_MT_CHIMNEY_CABLE_CAR_STATION, -1, 6, 4);
+ }
+}
+
+void SetFlagInVar(void)
+{
+ FlagSet(gSpecialVar_0x8004);
+}
+
+u16 GetWeekCount(void)
+{
+ u16 weekCount = gLocalTime.days / 7;
+ if (weekCount > 9999)
+ {
+ weekCount = 9999;
+ }
+ return weekCount;
+}
+
+u8 GetLeadMonFriendshipScore(void)
+{
+ struct Pokemon *pokemon = &gPlayerParty[GetLeadMonIndex()];
+ if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) == 255)
+ {
+ return 6;
+ }
+ if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 200)
+ {
+ return 5;
+ }
+ if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 150)
+ {
+ return 4;
+ }
+ if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 100)
+ {
+ return 3;
+ }
+ if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 50)
+ {
+ return 2;
+ }
+ if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 1)
+ {
+ return 1;
+ }
+ return 0;
+}