Merge pull request #534 from GriffinRichards/sync-scriptcmds
Sync script commands
This commit is contained in:
+10
-4
@@ -2378,7 +2378,13 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = {
|
||||
{PIXEL_FILL(0x1), 4, 0x00, 1, 0, 1, 1, 0x2, 0x1, 0x3}
|
||||
};
|
||||
|
||||
const u8 gUnknown_83FEC90[] = {0x04, 0x05, 0x02, 0x02};
|
||||
static const u8 sNpcTextColorToFont[] =
|
||||
{
|
||||
[NPC_TEXT_COLOR_MALE] = FONT_4,
|
||||
[NPC_TEXT_COLOR_FEMALE] = FONT_5,
|
||||
[NPC_TEXT_COLOR_MON] = FONT_2,
|
||||
[NPC_TEXT_COLOR_NEUTRAL] = FONT_2,
|
||||
};
|
||||
|
||||
// windowId: Upper 2 bits are text flags
|
||||
// x40: Use NPC context-defined font
|
||||
@@ -2388,15 +2394,15 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) {
|
||||
struct TextPrinterTemplate printerTemplate;
|
||||
u8 speed;
|
||||
int x;
|
||||
u8 context;
|
||||
u8 color;
|
||||
|
||||
u8 textFlags = windowId & 0xC0;
|
||||
windowId &= 0x3F;
|
||||
if (!(textFlags & 0x80))
|
||||
FillWindowPixelBuffer(windowId, sTextOnWindowsInfo_Normal[windowId].fillValue);
|
||||
if (textFlags & 0x40) {
|
||||
context = ContextNpcGetTextColor();
|
||||
printerTemplate.fontId = gUnknown_83FEC90[context];
|
||||
color = ContextNpcGetTextColor();
|
||||
printerTemplate.fontId = sNpcTextColorToFont[color];
|
||||
}
|
||||
else {
|
||||
printerTemplate.fontId = sTextOnWindowsInfo_Normal[windowId].fontId;
|
||||
|
||||
@@ -4,85 +4,87 @@
|
||||
|
||||
static EWRAM_DATA const u8 *sStringPointers[8] = {0};
|
||||
|
||||
#define COLORS(a, b)((a) | (b << 4))
|
||||
|
||||
static const u8 sTextColorTable[] =
|
||||
{
|
||||
// [LOW_NYBBLE / 2] = 0xXY, // HIGH_NYBBLE
|
||||
[OBJ_EVENT_GFX_RED_NORMAL / 2] = 0x00, // OBJ_EVENT_GFX_RED_BIKE
|
||||
[OBJ_EVENT_GFX_RED_SURF / 2] = 0x00, // OBJ_EVENT_GFX_RED_FIELD_MOVE
|
||||
[OBJ_EVENT_GFX_RED_FISH / 2] = 0x00, // OBJ_EVENT_GFX_RED_VS_SEEKER
|
||||
[OBJ_EVENT_GFX_RED_VS_SEEKER_BIKE / 2] = 0x10, // OBJ_EVENT_GFX_GREEN_NORMAL
|
||||
[OBJ_EVENT_GFX_GREEN_BIKE / 2] = 0x11, // OBJ_EVENT_GFX_GREEN_SURF
|
||||
[OBJ_EVENT_GFX_GREEN_FIELD_MOVE / 2] = 0x11, // OBJ_EVENT_GFX_GREEN_FISH
|
||||
[OBJ_EVENT_GFX_GREEN_VS_SEEKER / 2] = 0x11, // OBJ_EVENT_GFX_GREEN_VS_SEEKER_BIKE
|
||||
[OBJ_EVENT_GFX_RS_BRENDAN / 2] = 0x10, // OBJ_EVENT_GFX_RS_MAY
|
||||
[OBJ_EVENT_GFX_LITTLE_BOY / 2] = 0x10, // OBJ_EVENT_GFX_LITTLE_GIRL
|
||||
[OBJ_EVENT_GFX_YOUNGSTER / 2] = 0x00, // OBJ_EVENT_GFX_BOY
|
||||
[OBJ_EVENT_GFX_BUG_CATCHER / 2] = 0x00, // OBJ_EVENT_GFX_SITTING_BOY
|
||||
[OBJ_EVENT_GFX_LASS / 2] = 0x11, // OBJ_EVENT_GFX_WOMAN_1
|
||||
[OBJ_EVENT_GFX_BATTLE_GIRL / 2] = 0x01, // OBJ_EVENT_GFX_MAN
|
||||
[OBJ_EVENT_GFX_ROCKER / 2] = 0x00, // OBJ_EVENT_GFX_FAT_MAN
|
||||
[OBJ_EVENT_GFX_WOMAN_2 / 2] = 0x11, // OBJ_EVENT_GFX_BEAUTY
|
||||
[OBJ_EVENT_GFX_BALDING_MAN / 2] = 0x10, // OBJ_EVENT_GFX_WOMAN_3
|
||||
[OBJ_EVENT_GFX_OLD_MAN_1 / 2] = 0x00, // OBJ_EVENT_GFX_OLD_MAN_2
|
||||
[OBJ_EVENT_GFX_OLD_MAN_LYING_DOWN / 2] = 0x10, // OBJ_EVENT_GFX_OLD_WOMAN
|
||||
[OBJ_EVENT_GFX_TUBER_M_WATER / 2] = 0x10, // OBJ_EVENT_GFX_TUBER_F
|
||||
[OBJ_EVENT_GFX_TUBER_M_LAND / 2] = 0x00, // OBJ_EVENT_GFX_CAMPER
|
||||
[OBJ_EVENT_GFX_PICNICKER / 2] = 0x01, // OBJ_EVENT_GFX_COOLTRAINER_M
|
||||
[OBJ_EVENT_GFX_COOLTRAINER_F / 2] = 0x01, // OBJ_EVENT_GFX_SWIMMER_M_WATER
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_WATER / 2] = 0x01, // OBJ_EVENT_GFX_SWIMMER_M_LAND
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_LAND / 2] = 0x01, // OBJ_EVENT_GFX_WORKER_M
|
||||
[OBJ_EVENT_GFX_WORKER_F / 2] = 0x01, // OBJ_EVENT_GFX_ROCKET_M
|
||||
[OBJ_EVENT_GFX_ROCKET_F / 2] = 0x01, // OBJ_EVENT_GFX_GBA_KID
|
||||
[OBJ_EVENT_GFX_SUPER_NERD / 2] = 0x00, // OBJ_EVENT_GFX_BIKER
|
||||
[OBJ_EVENT_GFX_BLACKBELT / 2] = 0x00, // OBJ_EVENT_GFX_SCIENTIST
|
||||
[OBJ_EVENT_GFX_HIKER / 2] = 0x00, // OBJ_EVENT_GFX_FISHER
|
||||
[OBJ_EVENT_GFX_CHANNELER / 2] = 0x01, // OBJ_EVENT_GFX_CHEF
|
||||
[OBJ_EVENT_GFX_POLICEMAN / 2] = 0x00, // OBJ_EVENT_GFX_GENTLEMAN
|
||||
[OBJ_EVENT_GFX_SAILOR / 2] = 0x00, // OBJ_EVENT_GFX_CAPTAIN
|
||||
[OBJ_EVENT_GFX_NURSE / 2] = 0x11, // OBJ_EVENT_GFX_CABLE_CLUB_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_UNION_ROOM_RECEPTIONIST / 2] = 0x01, // OBJ_EVENT_GFX_UNUSED_MALE_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_CLERK / 2] = 0x00, // OBJ_EVENT_GFX_MG_DELIVERYMAN
|
||||
[OBJ_EVENT_GFX_TRAINER_TOWER_DUDE / 2] = 0x00, // OBJ_EVENT_GFX_PROF_OAK
|
||||
[OBJ_EVENT_GFX_BLUE / 2] = 0x00, // OBJ_EVENT_GFX_BILL
|
||||
[OBJ_EVENT_GFX_LANCE / 2] = 0x10, // OBJ_EVENT_GFX_AGATHA
|
||||
[OBJ_EVENT_GFX_DAISY / 2] = 0x11, // OBJ_EVENT_GFX_LORELEI
|
||||
[OBJ_EVENT_GFX_MR_FUJI / 2] = 0x00, // OBJ_EVENT_GFX_BRUNO
|
||||
[OBJ_EVENT_GFX_BROCK / 2] = 0x10, // OBJ_EVENT_GFX_MISTY
|
||||
[OBJ_EVENT_GFX_LT_SURGE / 2] = 0x10, // OBJ_EVENT_GFX_ERIKA
|
||||
[OBJ_EVENT_GFX_KOGA / 2] = 0x10, // OBJ_EVENT_GFX_SABRINA
|
||||
[OBJ_EVENT_GFX_BLAINE / 2] = 0x00, // OBJ_EVENT_GFX_GIOVANNI
|
||||
[OBJ_EVENT_GFX_MOM / 2] = 0x01, // OBJ_EVENT_GFX_CELIO
|
||||
[OBJ_EVENT_GFX_TEACHY_TV_HOST / 2] = 0x00, // OBJ_EVENT_GFX_GYM_GUY
|
||||
[OBJ_EVENT_GFX_ITEM_BALL / 2] = 0x33, // OBJ_EVENT_GFX_TOWN_MAP
|
||||
[OBJ_EVENT_GFX_POKEDEX / 2] = 0x33, // OBJ_EVENT_GFX_CUT_TREE
|
||||
[OBJ_EVENT_GFX_ROCK_SMASH_ROCK / 2] = 0x33, // OBJ_EVENT_GFX_PUSHABLE_BOULDER
|
||||
[OBJ_EVENT_GFX_FOSSIL / 2] = 0x33, // OBJ_EVENT_GFX_RUBY
|
||||
[OBJ_EVENT_GFX_SAPPHIRE / 2] = 0x33, // OBJ_EVENT_GFX_OLD_AMBER
|
||||
[OBJ_EVENT_GFX_GYM_SIGN / 2] = 0x33, // OBJ_EVENT_GFX_SIGN
|
||||
[OBJ_EVENT_GFX_TRAINER_TIPS / 2] = 0x33, // OBJ_EVENT_GFX_CLIPBOARD
|
||||
[OBJ_EVENT_GFX_METEORITE / 2] = 0x33, // OBJ_EVENT_GFX_LAPRAS_DOLL
|
||||
[OBJ_EVENT_GFX_SEAGALLOP / 2] = 0x23, // OBJ_EVENT_GFX_SNORLAX
|
||||
[OBJ_EVENT_GFX_SPEAROW / 2] = 0x22, // OBJ_EVENT_GFX_CUBONE
|
||||
[OBJ_EVENT_GFX_POLIWRATH / 2] = 0x22, // OBJ_EVENT_GFX_CLEFAIRY
|
||||
[OBJ_EVENT_GFX_PIDGEOT / 2] = 0x22, // OBJ_EVENT_GFX_JIGGLYPUFF
|
||||
[OBJ_EVENT_GFX_PIDGEY / 2] = 0x22, // OBJ_EVENT_GFX_CHANSEY
|
||||
[OBJ_EVENT_GFX_OMANYTE / 2] = 0x22, // OBJ_EVENT_GFX_KANGASKHAN
|
||||
[OBJ_EVENT_GFX_PIKACHU / 2] = 0x22, // OBJ_EVENT_GFX_PSYDUCK
|
||||
[OBJ_EVENT_GFX_NIDORAN_F / 2] = 0x22, // OBJ_EVENT_GFX_NIDORAN_M
|
||||
[OBJ_EVENT_GFX_NIDORINO / 2] = 0x22, // OBJ_EVENT_GFX_MEOWTH
|
||||
[OBJ_EVENT_GFX_SEEL / 2] = 0x22, // OBJ_EVENT_GFX_VOLTORB
|
||||
[OBJ_EVENT_GFX_SLOWPOKE / 2] = 0x22, // OBJ_EVENT_GFX_SLOWBRO
|
||||
[OBJ_EVENT_GFX_MACHOP / 2] = 0x22, // OBJ_EVENT_GFX_WIGGLYTUFF
|
||||
[OBJ_EVENT_GFX_DODUO / 2] = 0x22, // OBJ_EVENT_GFX_FEAROW
|
||||
[OBJ_EVENT_GFX_MACHOKE / 2] = 0x22, // OBJ_EVENT_GFX_LAPRAS
|
||||
[OBJ_EVENT_GFX_ZAPDOS / 2] = 0x22, // OBJ_EVENT_GFX_MOLTRES
|
||||
[OBJ_EVENT_GFX_ARTICUNO / 2] = 0x22, // OBJ_EVENT_GFX_MEWTWO
|
||||
[OBJ_EVENT_GFX_MEW / 2] = 0x22, // OBJ_EVENT_GFX_ENTEI
|
||||
[OBJ_EVENT_GFX_SUICUNE / 2] = 0x22, // OBJ_EVENT_GFX_RAIKOU
|
||||
[OBJ_EVENT_GFX_LUGIA / 2] = 0x22, // OBJ_EVENT_GFX_HO_OH
|
||||
[OBJ_EVENT_GFX_CELEBI / 2] = 0x22, // OBJ_EVENT_GFX_KABUTO
|
||||
[OBJ_EVENT_GFX_DEOXYS_D / 2] = 0x22, // OBJ_EVENT_GFX_DEOXYS_A
|
||||
[OBJ_EVENT_GFX_DEOXYS_N / 2] = 0x32, // OBJ_EVENT_GFX_SS_ANNE
|
||||
[OBJ_EVENT_GFX_RED_NORMAL / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_RED_BIKE
|
||||
[OBJ_EVENT_GFX_RED_SURF / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_RED_FIELD_MOVE
|
||||
[OBJ_EVENT_GFX_RED_FISH / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_RED_VS_SEEKER
|
||||
[OBJ_EVENT_GFX_RED_VS_SEEKER_BIKE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_NORMAL
|
||||
[OBJ_EVENT_GFX_GREEN_BIKE / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_SURF
|
||||
[OBJ_EVENT_GFX_GREEN_FIELD_MOVE / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_FISH
|
||||
[OBJ_EVENT_GFX_GREEN_VS_SEEKER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_GREEN_VS_SEEKER_BIKE
|
||||
[OBJ_EVENT_GFX_RS_BRENDAN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_RS_MAY
|
||||
[OBJ_EVENT_GFX_LITTLE_BOY / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_LITTLE_GIRL
|
||||
[OBJ_EVENT_GFX_YOUNGSTER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BOY
|
||||
[OBJ_EVENT_GFX_BUG_CATCHER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SITTING_BOY
|
||||
[OBJ_EVENT_GFX_LASS / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_WOMAN_1
|
||||
[OBJ_EVENT_GFX_BATTLE_GIRL / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_MAN
|
||||
[OBJ_EVENT_GFX_ROCKER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_FAT_MAN
|
||||
[OBJ_EVENT_GFX_WOMAN_2 / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_BEAUTY
|
||||
[OBJ_EVENT_GFX_BALDING_MAN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_WOMAN_3
|
||||
[OBJ_EVENT_GFX_OLD_MAN_1 / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_OLD_MAN_2
|
||||
[OBJ_EVENT_GFX_OLD_MAN_LYING_DOWN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_OLD_WOMAN
|
||||
[OBJ_EVENT_GFX_TUBER_M_WATER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_TUBER_F
|
||||
[OBJ_EVENT_GFX_TUBER_M_LAND / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CAMPER
|
||||
[OBJ_EVENT_GFX_PICNICKER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_COOLTRAINER_M
|
||||
[OBJ_EVENT_GFX_COOLTRAINER_F / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SWIMMER_M_WATER
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_WATER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SWIMMER_M_LAND
|
||||
[OBJ_EVENT_GFX_SWIMMER_F_LAND / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_WORKER_M
|
||||
[OBJ_EVENT_GFX_WORKER_F / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_ROCKET_M
|
||||
[OBJ_EVENT_GFX_ROCKET_F / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GBA_KID
|
||||
[OBJ_EVENT_GFX_SUPER_NERD / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BIKER
|
||||
[OBJ_EVENT_GFX_BLACKBELT / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_SCIENTIST
|
||||
[OBJ_EVENT_GFX_HIKER / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_FISHER
|
||||
[OBJ_EVENT_GFX_CHANNELER / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CHEF
|
||||
[OBJ_EVENT_GFX_POLICEMAN / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GENTLEMAN
|
||||
[OBJ_EVENT_GFX_SAILOR / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CAPTAIN
|
||||
[OBJ_EVENT_GFX_NURSE / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_CABLE_CLUB_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_UNION_ROOM_RECEPTIONIST / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_UNUSED_MALE_RECEPTIONIST
|
||||
[OBJ_EVENT_GFX_CLERK / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_MG_DELIVERYMAN
|
||||
[OBJ_EVENT_GFX_TRAINER_TOWER_DUDE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_PROF_OAK
|
||||
[OBJ_EVENT_GFX_BLUE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BILL
|
||||
[OBJ_EVENT_GFX_LANCE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_AGATHA
|
||||
[OBJ_EVENT_GFX_DAISY / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_LORELEI
|
||||
[OBJ_EVENT_GFX_MR_FUJI / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_BRUNO
|
||||
[OBJ_EVENT_GFX_BROCK / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_MISTY
|
||||
[OBJ_EVENT_GFX_LT_SURGE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_ERIKA
|
||||
[OBJ_EVENT_GFX_KOGA / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_FEMALE), // OBJ_EVENT_GFX_SABRINA
|
||||
[OBJ_EVENT_GFX_BLAINE / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GIOVANNI
|
||||
[OBJ_EVENT_GFX_MOM / 2] = COLORS(NPC_TEXT_COLOR_FEMALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_CELIO
|
||||
[OBJ_EVENT_GFX_TEACHY_TV_HOST / 2] = COLORS(NPC_TEXT_COLOR_MALE, NPC_TEXT_COLOR_MALE), // OBJ_EVENT_GFX_GYM_GUY
|
||||
[OBJ_EVENT_GFX_ITEM_BALL / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_TOWN_MAP
|
||||
[OBJ_EVENT_GFX_POKEDEX / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_CUT_TREE
|
||||
[OBJ_EVENT_GFX_ROCK_SMASH_ROCK / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_PUSHABLE_BOULDER
|
||||
[OBJ_EVENT_GFX_FOSSIL / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_RUBY
|
||||
[OBJ_EVENT_GFX_SAPPHIRE / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_OLD_AMBER
|
||||
[OBJ_EVENT_GFX_GYM_SIGN / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_SIGN
|
||||
[OBJ_EVENT_GFX_TRAINER_TIPS / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_CLIPBOARD
|
||||
[OBJ_EVENT_GFX_METEORITE / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_LAPRAS_DOLL
|
||||
[OBJ_EVENT_GFX_SEAGALLOP / 2] = COLORS(NPC_TEXT_COLOR_NEUTRAL, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_SNORLAX
|
||||
[OBJ_EVENT_GFX_SPEAROW / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_CUBONE
|
||||
[OBJ_EVENT_GFX_POLIWRATH / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_CLEFAIRY
|
||||
[OBJ_EVENT_GFX_PIDGEOT / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_JIGGLYPUFF
|
||||
[OBJ_EVENT_GFX_PIDGEY / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_CHANSEY
|
||||
[OBJ_EVENT_GFX_OMANYTE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_KANGASKHAN
|
||||
[OBJ_EVENT_GFX_PIKACHU / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_PSYDUCK
|
||||
[OBJ_EVENT_GFX_NIDORAN_F / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_NIDORAN_M
|
||||
[OBJ_EVENT_GFX_NIDORINO / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_MEOWTH
|
||||
[OBJ_EVENT_GFX_SEEL / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_VOLTORB
|
||||
[OBJ_EVENT_GFX_SLOWPOKE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_SLOWBRO
|
||||
[OBJ_EVENT_GFX_MACHOP / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_WIGGLYTUFF
|
||||
[OBJ_EVENT_GFX_DODUO / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_FEAROW
|
||||
[OBJ_EVENT_GFX_MACHOKE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_LAPRAS
|
||||
[OBJ_EVENT_GFX_ZAPDOS / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_MOLTRES
|
||||
[OBJ_EVENT_GFX_ARTICUNO / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_MEWTWO
|
||||
[OBJ_EVENT_GFX_MEW / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_ENTEI
|
||||
[OBJ_EVENT_GFX_SUICUNE / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_RAIKOU
|
||||
[OBJ_EVENT_GFX_LUGIA / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_HO_OH
|
||||
[OBJ_EVENT_GFX_CELEBI / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_KABUTO
|
||||
[OBJ_EVENT_GFX_DEOXYS_D / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_MON), // OBJ_EVENT_GFX_DEOXYS_A
|
||||
[OBJ_EVENT_GFX_DEOXYS_N / 2] = COLORS(NPC_TEXT_COLOR_MON, NPC_TEXT_COLOR_NEUTRAL), // OBJ_EVENT_GFX_SS_ANNE
|
||||
};
|
||||
|
||||
void DynamicPlaceholderTextUtil_Reset(void)
|
||||
|
||||
@@ -23,7 +23,7 @@ void Task_WaitPlayerStopMoving(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
bool8 NativeScript_WaitPlayerStopMoving(void)
|
||||
bool8 IsFreezePlayerFinished(void)
|
||||
{
|
||||
if (FuncIsActiveTask(Task_WaitPlayerStopMoving))
|
||||
return FALSE;
|
||||
@@ -34,7 +34,7 @@ bool8 NativeScript_WaitPlayerStopMoving(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptFreezeObjectEvents(void)
|
||||
void FreezeObjects_WaitForPlayer(void)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
CreateTask(Task_WaitPlayerStopMoving, 80);
|
||||
@@ -60,7 +60,7 @@ void Task_WaitPlayerAndTargetNPCStopMoving(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
bool8 NativeScript_WaitPlayerAndTargetNPCStopMoving(void)
|
||||
bool8 IsFreezeSelectedObjectAndPlayerFinished(void)
|
||||
{
|
||||
if (FuncIsActiveTask(Task_WaitPlayerAndTargetNPCStopMoving))
|
||||
return FALSE;
|
||||
@@ -71,7 +71,7 @@ bool8 NativeScript_WaitPlayerAndTargetNPCStopMoving(void)
|
||||
}
|
||||
}
|
||||
|
||||
void LockSelectedObjectEvent(void)
|
||||
void FreezeObjects_WaitForPlayerAndSelected(void)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
|
||||
@@ -1715,7 +1715,7 @@ u8 AddPseudoObjectEvent(u16 graphicsId, SpriteCallback callback, s16 x, s16 y, u
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction)
|
||||
u8 CreateVirtualObject(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Sprite *sprite;
|
||||
@@ -2069,7 +2069,7 @@ static void SetObjectEventDynamicGraphicsId(struct ObjectEvent *objectEvent)
|
||||
}
|
||||
}
|
||||
|
||||
void ShowOrHideObjectByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 state)
|
||||
void SetObjectInvisibility(u8 localId, u8 mapNum, u8 mapGroup, u8 state)
|
||||
{
|
||||
u8 objectEventId;
|
||||
|
||||
@@ -2099,7 +2099,7 @@ void EnableObjectGroundEffectsByXY(s16 x, s16 y)
|
||||
}
|
||||
}
|
||||
|
||||
void SetObjectPriorityByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority)
|
||||
void SetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup, u8 subpriority)
|
||||
{
|
||||
u8 objectEventId;
|
||||
struct ObjectEvent *objectEvent;
|
||||
@@ -2114,7 +2114,7 @@ void SetObjectPriorityByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup, u8 sub
|
||||
}
|
||||
}
|
||||
|
||||
void UnfixObjectPriorityByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
void ResetObjectSubpriority(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
u8 objectEventId;
|
||||
struct ObjectEvent *objectEvent;
|
||||
@@ -9252,7 +9252,7 @@ static int GetObjectEventSpriteId(u8 objectEventId)
|
||||
return MAX_SPRITES;
|
||||
}
|
||||
|
||||
void TurnObjectEvent(u8 objectEventId, u8 direction)
|
||||
void TurnVirtualObject(u8 objectEventId, u8 direction)
|
||||
{
|
||||
u8 animNum;
|
||||
u8 spriteId = GetObjectEventSpriteId(objectEventId);
|
||||
|
||||
+12
-4
@@ -1542,18 +1542,26 @@ void SetSeenMon(void)
|
||||
void ResetContextNpcTextColor(void)
|
||||
{
|
||||
gSelectedObjectEvent = 0;
|
||||
gSpecialVar_TextColor = 0xFF;
|
||||
gSpecialVar_TextColor = NPC_TEXT_COLOR_DEFAULT;
|
||||
}
|
||||
|
||||
u8 ContextNpcGetTextColor(void)
|
||||
{
|
||||
u8 gfxId;
|
||||
if (gSpecialVar_TextColor != 0xFF)
|
||||
if (gSpecialVar_TextColor != NPC_TEXT_COLOR_DEFAULT)
|
||||
{
|
||||
// A text color has been specified, use that
|
||||
return gSpecialVar_TextColor;
|
||||
}
|
||||
else if (gSelectedObjectEvent == 0)
|
||||
return 3;
|
||||
{
|
||||
// No text color specified and no object selected, use neutral
|
||||
return NPC_TEXT_COLOR_NEUTRAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// An object is selected and no color has been specified.
|
||||
// Use the text color normally associated with this object's sprite.
|
||||
gfxId = gObjectEvents[gSelectedObjectEvent].graphicsId;
|
||||
if (gfxId >= OBJ_EVENT_GFX_VAR_0)
|
||||
gfxId = VarGetObjectEventGraphicsId(gfxId - OBJ_EVENT_GFX_VAR_0);
|
||||
@@ -2419,7 +2427,7 @@ static void MoveDeoxysObject(u8 num)
|
||||
else
|
||||
gFieldEffectArguments[5] = 5;
|
||||
FieldEffectStart(FLDEFF_MOVE_DEOXYS_ROCK);
|
||||
Overworld_SetMapObjTemplateCoords(1, sDeoxysCoords[num][0], sDeoxysCoords[num][1]);
|
||||
SetObjEventTemplateCoords(1, sDeoxysCoords[num][0], sDeoxysCoords[num][1]);
|
||||
}
|
||||
|
||||
static void Task_WaitDeoxysFieldEffect(u8 taskId)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
static u8 TranslateWeatherNum(u8 weather);
|
||||
static void UpdateRainCounter(u8 newWeather, u8 oldWeather);
|
||||
|
||||
void SetSav1Weather(u32 weather)
|
||||
void SetSavedWeather(u32 weather)
|
||||
{
|
||||
u8 oldWeather = gSaveBlock1Ptr->weather;
|
||||
gSaveBlock1Ptr->weather = TranslateWeatherNum(weather);
|
||||
@@ -18,7 +18,7 @@ u8 GetSav1Weather(void)
|
||||
return gSaveBlock1Ptr->weather;
|
||||
}
|
||||
|
||||
void SetSav1WeatherFromCurrMapHeader(void)
|
||||
void SetSavedWeatherFromCurrMapHeader(void)
|
||||
{
|
||||
u8 oldWeather = gSaveBlock1Ptr->weather;
|
||||
gSaveBlock1Ptr->weather = TranslateWeatherNum(gMapHeader.weather);
|
||||
@@ -27,13 +27,13 @@ void SetSav1WeatherFromCurrMapHeader(void)
|
||||
|
||||
void SetWeather(u32 weather)
|
||||
{
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
SetNextWeather(GetSav1Weather());
|
||||
}
|
||||
|
||||
void SetWeather_Unused(u32 weather)
|
||||
{
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
SetCurrentAndNextWeather(GetSav1Weather());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -241,7 +241,7 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity_p, u16 qmax)
|
||||
|
||||
u8 GetDialogBoxFontId(void)
|
||||
{
|
||||
if (!ContextNpcGetTextColor())
|
||||
if (ContextNpcGetTextColor() == NPC_TEXT_COLOR_MALE)
|
||||
return FONT_4;
|
||||
else
|
||||
return FONT_5;
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@ static u32 common_mainseq_4(struct mevent_srv_common * svr)
|
||||
break;
|
||||
case 28:
|
||||
AGB_ASSERT_EX(cmd->flag == FALSE && cmd->parameter == NULL, ABSPATH("mevent_server.c"), 517);
|
||||
svr->sendBuffer1 = sub_8069E48();
|
||||
svr->sendBuffer1 = GetSavedRamScriptIfValid();
|
||||
break;
|
||||
case 29:
|
||||
mevent_srv_common_init_send(svr, 0x1b, cmd->parameter, cmd->flag);
|
||||
|
||||
@@ -425,16 +425,16 @@ u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed
|
||||
|
||||
void AddTextPrinterDiffStyle(bool8 allowSkippingDelayWithButtonPress)
|
||||
{
|
||||
u8 result;
|
||||
u8 color;
|
||||
void *nptr = NULL;
|
||||
|
||||
gTextFlags.canABSpeedUpPrint = allowSkippingDelayWithButtonPress;
|
||||
result = ContextNpcGetTextColor();
|
||||
if (result == 0)
|
||||
color = ContextNpcGetTextColor();
|
||||
if (color == NPC_TEXT_COLOR_MALE)
|
||||
AddTextPrinterParameterized2(0, FONT_4, gStringVar4, GetTextSpeedSetting(), nptr, TEXT_COLOR_BLUE, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
else if (result == 1)
|
||||
else if (color == NPC_TEXT_COLOR_FEMALE)
|
||||
AddTextPrinterParameterized2(0, FONT_5, gStringVar4, GetTextSpeedSetting(), nptr, TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
else
|
||||
else // NPC_TEXT_COLOR_MON / NPC_TEXT_COLOR_NEUTRAL
|
||||
AddTextPrinterParameterized2(0, FONT_2, gStringVar4, GetTextSpeedSetting(), nptr, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -438,7 +438,7 @@ static void LoadSaveblockObjEventScripts(void)
|
||||
}
|
||||
}
|
||||
|
||||
void Overworld_SetMapObjTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
void SetObjEventTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
{
|
||||
int i;
|
||||
struct ObjectEventTemplate * savObjTemplates = gSaveBlock1Ptr->objectEventTemplates;
|
||||
@@ -453,7 +453,7 @@ void Overworld_SetMapObjTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
}
|
||||
}
|
||||
|
||||
void Overworld_SetObjEventTemplateMovementType(u8 localId, u8 movementType)
|
||||
void SetObjEventTemplateMovementType(u8 localId, u8 movementType)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -756,7 +756,7 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
MapResetTrainerRematches(mapGroup, mapNum);
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
Overworld_ClearSavedMusic();
|
||||
@@ -791,7 +791,7 @@ static void LoadMapFromWarp(bool32 unused)
|
||||
ResetCyclingRoadChallengeData();
|
||||
RestartWildEncounterImmunitySteps();
|
||||
MapResetTrainerRematches(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum);
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
if (isOutdoors)
|
||||
FlagClear(FLAG_SYS_FLASH_ACTIVE);
|
||||
@@ -813,7 +813,7 @@ static void sub_80559A8(void)
|
||||
LoadObjEventTemplatesFromHeader();
|
||||
isOutdoors = IsMapTypeOutdoors(gMapHeader.mapType);
|
||||
TrySetMapSaveWarpStatus();
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
sub_8110920();
|
||||
@@ -956,7 +956,7 @@ static void SetDefaultFlashLevel(void)
|
||||
gSaveBlock1Ptr->flashLevel = gMaxFlashLevel;
|
||||
}
|
||||
|
||||
void Overworld_SetFlashLevel(s32 flashLevel)
|
||||
void SetFlashLevel(s32 flashLevel)
|
||||
{
|
||||
if (flashLevel < 0 || flashLevel > gMaxFlashLevel)
|
||||
flashLevel = 0;
|
||||
|
||||
@@ -439,7 +439,7 @@ void CreateGroupMemberObjectsInvisible(u8 * sprite_ids, s32 group)
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
s32 obj_id = 5 * group + i;
|
||||
sprite_ids[obj_id] = sprite_new(OBJ_EVENT_GFX_MAN, obj_id - 0x38, sUnionPartnerCoords[group][0] + sFacingDirectionOffsets[i][0], sUnionPartnerCoords[group][1] + sFacingDirectionOffsets[i][1], 3, 1);
|
||||
sprite_ids[obj_id] = CreateVirtualObject(OBJ_EVENT_GFX_MAN, obj_id - 0x38, sUnionPartnerCoords[group][0] + sFacingDirectionOffsets[i][0], sUnionPartnerCoords[group][1] + sFacingDirectionOffsets[i][1], 3, 1);
|
||||
RfuUnionObjectToggleInvisibility(obj_id - 0x38, TRUE);
|
||||
}
|
||||
}
|
||||
@@ -653,7 +653,7 @@ bool32 RfuUnionTool_GetGroupAndMemberInFrontOfPlayer(struct UnkStruct_Main0 *mai
|
||||
|
||||
static void UnionPartnerObjectSetFacing(s32 member, s32 group, u8 direction)
|
||||
{
|
||||
TurnObjectEvent(5 * group - 0x38 + member, direction);
|
||||
TurnVirtualObject(5 * group - 0x38 + member, direction);
|
||||
}
|
||||
|
||||
void UpdateUnionGroupMemberFacing(u32 member, u32 group, struct UnkStruct_Main0 *main0_p)
|
||||
|
||||
+156
-165
@@ -9,6 +9,7 @@
|
||||
#include "field_screen_effect.h"
|
||||
#include "quest_log.h"
|
||||
#include "map_preview_screen.h"
|
||||
#include "fieldmap.h"
|
||||
#include "field_weather.h"
|
||||
#include "field_tasks.h"
|
||||
#include "field_fadetransition.h"
|
||||
@@ -34,6 +35,7 @@
|
||||
#include "fieldmap.h"
|
||||
#include "field_door.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/sound.h"
|
||||
|
||||
extern u16 (*const gSpecials[])(void);
|
||||
@@ -44,12 +46,12 @@ extern const u8 *const gStdScriptsEnd[];
|
||||
static bool8 ScriptContext_NextCommandEndsScript(struct ScriptContext * ctx);
|
||||
static u8 ScriptContext_GetQuestLogInput(struct ScriptContext * ctx);
|
||||
|
||||
static EWRAM_DATA ptrdiff_t gVScriptOffset = 0;
|
||||
static EWRAM_DATA ptrdiff_t sAddressOffset = 0; // For relative addressing in vgoto etc., used by saved scripts (e.g. Mystery Event)
|
||||
static EWRAM_DATA u8 sQuestLogWaitButtonPressTimer = 0;
|
||||
static EWRAM_DATA u16 sPauseCounter = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcId = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapBank = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapId = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapGroup = 0;
|
||||
static EWRAM_DATA u16 sMovingNpcMapNum = 0;
|
||||
static EWRAM_DATA u16 sFieldEffectScriptId = 0;
|
||||
|
||||
struct ScriptContext * sQuestLogScriptContextPtr;
|
||||
@@ -95,7 +97,7 @@ bool8 ScrCmd_gotonative(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_special(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 (*const *specialPtr)(void) = gSpecials + ScriptReadHalfword(ctx);
|
||||
u16 (*const *specialPtr)(void) = &gSpecials[ScriptReadHalfword(ctx)];
|
||||
if (specialPtr < gSpecialsEnd)
|
||||
(*specialPtr)();
|
||||
else
|
||||
@@ -106,7 +108,7 @@ bool8 ScrCmd_special(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_specialvar(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 * varPtr = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
u16 (*const *specialPtr)(void) = gSpecials + ScriptReadHalfword(ctx);
|
||||
u16 (*const *specialPtr)(void) = &gSpecials[ScriptReadHalfword(ctx)];
|
||||
if (specialPtr < gSpecialsEnd)
|
||||
*varPtr = (*specialPtr)();
|
||||
else
|
||||
@@ -170,28 +172,28 @@ bool8 ScrCmd_setvaddress(struct ScriptContext * ctx)
|
||||
u32 addr1 = (u32)ctx->scriptPtr - 1;
|
||||
u32 addr2 = ScriptReadWord(ctx);
|
||||
|
||||
gVScriptOffset = addr2 - addr1;
|
||||
sAddressOffset = addr2 - addr1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vgoto(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx);
|
||||
ScriptJump(ctx, scrptr - gVScriptOffset);
|
||||
ScriptJump(ctx, scrptr - sAddressOffset);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vcall(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx);
|
||||
ScriptCall(ctx, scrptr - gVScriptOffset);
|
||||
ScriptCall(ctx, scrptr - sAddressOffset);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vgoto_if(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 condition = ScriptReadByte(ctx);
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - gVScriptOffset;
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - sAddressOffset;
|
||||
if (sScriptConditionTable[condition][ctx->comparisonResult] == 1)
|
||||
ScriptJump(ctx, scrptr);
|
||||
return FALSE;
|
||||
@@ -200,7 +202,7 @@ bool8 ScrCmd_vgoto_if(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_vcall_if(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 condition = ScriptReadByte(ctx);
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - gVScriptOffset;
|
||||
const u8 * scrptr = (const u8 *)ScriptReadWord(ctx) - sAddressOffset;
|
||||
if (sScriptConditionTable[condition][ctx->comparisonResult] == 1)
|
||||
ScriptCall(ctx, scrptr);
|
||||
return FALSE;
|
||||
@@ -209,7 +211,7 @@ bool8 ScrCmd_vcall_if(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_gotostd(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stdIdx = ScriptReadByte(ctx);
|
||||
const u8 *const * script = gStdScripts + stdIdx;
|
||||
const u8 *const * script = &gStdScripts[stdIdx];
|
||||
if (script < gStdScriptsEnd)
|
||||
ScriptJump(ctx, *script);
|
||||
return FALSE;
|
||||
@@ -218,7 +220,7 @@ bool8 ScrCmd_gotostd(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_callstd(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stdIdx = ScriptReadByte(ctx);
|
||||
const u8 *const * script = gStdScripts + stdIdx;
|
||||
const u8 *const * script = &gStdScripts[stdIdx];
|
||||
if (script < gStdScriptsEnd)
|
||||
ScriptCall(ctx, *script);
|
||||
return FALSE;
|
||||
@@ -250,13 +252,13 @@ bool8 ScrCmd_callstd_if(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_gotoram(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_returnram(struct ScriptContext * ctx)
|
||||
{
|
||||
ScriptJump(ctx, gRAMScriptPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_killscript(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_endram(struct ScriptContext * ctx)
|
||||
{
|
||||
ClearRamScript();
|
||||
StopScript(ctx);
|
||||
@@ -269,9 +271,9 @@ bool8 ScrCmd_setmysteryeventstatus(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_execram(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_trywondercardscript(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 * script = sub_8069E48();
|
||||
const u8 * script = GetSavedRamScriptIfValid();
|
||||
if (script != NULL)
|
||||
{
|
||||
gRAMScriptPtr = ctx->scriptPtr;
|
||||
@@ -282,19 +284,19 @@ bool8 ScrCmd_execram(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_loadword(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
ctx->data[which] = ScriptReadWord(ctx);
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
ctx->data[index] = ScriptReadWord(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_loadbytefromaddr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_loadbytefromptr(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
ctx->data[which] = *(const u8 *)ScriptReadWord(ctx);
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
ctx->data[index] = *(const u8 *)ScriptReadWord(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_writebytetoaddr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setptr(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 value = ScriptReadByte(ctx);
|
||||
*(u8 *)ScriptReadWord(ctx) = value;
|
||||
@@ -303,23 +305,23 @@ bool8 ScrCmd_writebytetoaddr(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_loadbyte(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
ctx->data[which] = ScriptReadByte(ctx);
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
ctx->data[index] = ScriptReadByte(ctx);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setptrbyte(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 which = ScriptReadByte(ctx);
|
||||
*(u8 *)ScriptReadWord(ctx) = ctx->data[which];
|
||||
u8 index = ScriptReadByte(ctx);
|
||||
*(u8 *)ScriptReadWord(ctx) = ctx->data[index];
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_copylocal(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 whichDst = ScriptReadByte(ctx);
|
||||
u8 whichSrc = ScriptReadByte(ctx);
|
||||
ctx->data[whichDst] = ctx->data[whichSrc];
|
||||
u8 destIndex = ScriptReadByte(ctx);
|
||||
u8 srcIndex = ScriptReadByte(ctx);
|
||||
ctx->data[destIndex] = ctx->data[srcIndex];
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -352,69 +354,67 @@ bool8 ScrCmd_setorcopyvar(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 compare_012(u16 left, u16 right)
|
||||
static u8 Compare(u16 a, u16 b)
|
||||
{
|
||||
if (left < right)
|
||||
if (a < b)
|
||||
return 0;
|
||||
else if (left == right)
|
||||
else if (a == b)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
|
||||
// comparelocaltolocal
|
||||
bool8 ScrCmd_compare_local_to_local(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = ctx->data[ScriptReadByte(ctx)];
|
||||
const u8 value2 = ctx->data[ScriptReadByte(ctx)];
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// comparelocaltoimm
|
||||
bool8 ScrCmd_compare_local_to_value(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = ctx->data[ScriptReadByte(ctx)];
|
||||
const u8 value2 = ScriptReadByte(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_local_to_addr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_local_to_ptr(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = ctx->data[ScriptReadByte(ctx)];
|
||||
const u8 value2 = *(const u8 *)ScriptReadWord(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_addr_to_local(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_ptr_to_local(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = *(const u8 *)ScriptReadWord(ctx);
|
||||
const u8 value2 = ctx->data[ScriptReadByte(ctx)];
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_addr_to_value(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_ptr_to_value(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = *(const u8 *)ScriptReadWord(ctx);
|
||||
const u8 value2 = ScriptReadByte(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_compare_addr_to_addr(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_compare_ptr_to_ptr(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 value1 = *(const u8 *)ScriptReadWord(ctx);
|
||||
const u8 value2 = *(const u8 *)ScriptReadWord(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ bool8 ScrCmd_compare_var_to_value(struct ScriptContext * ctx)
|
||||
const u16 value1 = *GetVarPointer(ScriptReadHalfword(ctx));
|
||||
const u16 value2 = ScriptReadHalfword(ctx);
|
||||
|
||||
ctx->comparisonResult = compare_012(value1, value2);
|
||||
ctx->comparisonResult = Compare(value1, value2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -432,10 +432,11 @@ bool8 ScrCmd_compare_var_to_var(struct ScriptContext * ctx)
|
||||
const u16 *ptr1 = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
const u16 *ptr2 = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
|
||||
ctx->comparisonResult = compare_012(*ptr1, *ptr2);
|
||||
ctx->comparisonResult = Compare(*ptr1, *ptr2);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Note: addvar doesn't support adding from a variable in vanilla.
|
||||
bool8 ScrCmd_addvar(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx));
|
||||
@@ -521,7 +522,7 @@ bool8 ScrCmd_checkpcitem(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_givedecoration(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_adddecoration(struct ScriptContext * ctx)
|
||||
{
|
||||
u32 decorId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
@@ -529,7 +530,7 @@ bool8 ScrCmd_givedecoration(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_takedecoration(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_removedecoration(struct ScriptContext * ctx)
|
||||
{
|
||||
u32 decorId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
@@ -577,7 +578,7 @@ bool8 ScrCmd_incrementgamestat(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_comparestattoword(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_comparestat(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 statIdx = ScriptReadByte(ctx);
|
||||
u32 value = ScriptReadWord(ctx);
|
||||
@@ -607,11 +608,9 @@ bool8 ScrCmd_animateflash(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setflashradius(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setflashlevel(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 flashLevel = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
Overworld_SetFlashLevel(flashLevel);
|
||||
SetFlashLevel(VarGet(ScriptReadHalfword(ctx)));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -642,9 +641,7 @@ bool8 ScrCmd_fadescreenspeed(struct ScriptContext * ctx)
|
||||
|
||||
static bool8 RunPauseTimer(void)
|
||||
{
|
||||
sPauseCounter--;
|
||||
|
||||
if (sPauseCounter == 0)
|
||||
if (--sPauseCounter == 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -666,7 +663,7 @@ bool8 ScrCmd_initclock(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_dodailyevents(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_dotimebasedevents(struct ScriptContext * ctx)
|
||||
{
|
||||
// DoTimeBasedEvents();
|
||||
return FALSE;
|
||||
@@ -688,13 +685,13 @@ bool8 ScrCmd_setweather(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 weather = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
SetSav1Weather(weather);
|
||||
SetSavedWeather(weather);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_resetweather(struct ScriptContext * ctx)
|
||||
{
|
||||
SetSav1WeatherFromCurrMapHeader();
|
||||
SetSavedWeatherFromCurrMapHeader();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -768,10 +765,10 @@ bool8 ScrCmd_warphole(struct ScriptContext * ctx)
|
||||
u16 y;
|
||||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (mapGroup == 0xFF && mapNum == 0xFF)
|
||||
SetWarpDestinationToFixedHoleWarp(x - 7, y - 7);
|
||||
if (mapGroup == MAP_GROUP(UNDEFINED) && mapNum == MAP_NUM(UNDEFINED))
|
||||
SetWarpDestinationToFixedHoleWarp(x - MAP_OFFSET, y - MAP_OFFSET);
|
||||
else
|
||||
SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7);
|
||||
SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x - MAP_OFFSET, y - MAP_OFFSET);
|
||||
DoFallWarp();
|
||||
ResetInitialPlayerAvatarState();
|
||||
return TRUE;
|
||||
@@ -791,7 +788,7 @@ bool8 ScrCmd_warpteleport(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_warpteleport2(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_warpspinenter(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
@@ -922,11 +919,11 @@ bool8 ScrCmd_waitfanfare(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_playbgm(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 songId = ScriptReadHalfword(ctx);
|
||||
bool8 val = ScriptReadByte(ctx);
|
||||
bool8 save = ScriptReadByte(ctx);
|
||||
|
||||
if (QL_IS_PLAYBACK_STATE)
|
||||
return FALSE;
|
||||
if (val == TRUE)
|
||||
if (save == TRUE)
|
||||
Overworld_SetSavedMusic(songId);
|
||||
PlayNewMapMusic(songId);
|
||||
return FALSE;
|
||||
@@ -992,7 +989,7 @@ bool8 ScrCmd_applymovement(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_applymovement_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_applymovementat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
const void *movementScript = (const void *)ScriptReadWord(ctx);
|
||||
@@ -1006,7 +1003,7 @@ bool8 ScrCmd_applymovement_at(struct ScriptContext * ctx)
|
||||
|
||||
static bool8 WaitForMovementFinish(void)
|
||||
{
|
||||
return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapId, sMovingNpcMapBank);
|
||||
return ScriptMovement_IsObjectMovementFinished(sMovingNpcId, sMovingNpcMapNum, sMovingNpcMapGroup);
|
||||
}
|
||||
|
||||
bool8 ScrCmd_waitmovement(struct ScriptContext * ctx)
|
||||
@@ -1015,13 +1012,13 @@ bool8 ScrCmd_waitmovement(struct ScriptContext * ctx)
|
||||
|
||||
if (localId != 0)
|
||||
sMovingNpcId = localId;
|
||||
sMovingNpcMapBank = gSaveBlock1Ptr->location.mapGroup;
|
||||
sMovingNpcMapId = gSaveBlock1Ptr->location.mapNum;
|
||||
sMovingNpcMapGroup = gSaveBlock1Ptr->location.mapGroup;
|
||||
sMovingNpcMapNum = gSaveBlock1Ptr->location.mapNum;
|
||||
SetupNativeScript(ctx, WaitForMovementFinish);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_waitmovement_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_waitmovementat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapBank;
|
||||
@@ -1031,8 +1028,8 @@ bool8 ScrCmd_waitmovement_at(struct ScriptContext * ctx)
|
||||
sMovingNpcId = localId;
|
||||
mapBank = ScriptReadByte(ctx);
|
||||
mapId = ScriptReadByte(ctx);
|
||||
sMovingNpcMapBank = mapBank;
|
||||
sMovingNpcMapId = mapId;
|
||||
sMovingNpcMapGroup = mapBank;
|
||||
sMovingNpcMapNum = mapId;
|
||||
SetupNativeScript(ctx, WaitForMovementFinish);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1045,7 +1042,7 @@ bool8 ScrCmd_removeobject(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_removeobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_removeobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 objectId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
@@ -1063,7 +1060,7 @@ bool8 ScrCmd_addobject(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_addobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_addobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 objectId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
@@ -1089,11 +1086,11 @@ bool8 ScrCmd_setobjectxyperm(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
Overworld_SetMapObjTemplateCoords(localId, x, y);
|
||||
SetObjEventTemplateCoords(localId, x, y);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_copyobjectxytoperm(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
@@ -1101,44 +1098,44 @@ bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_showobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_showobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
ShowOrHideObjectByLocalIdAndMap(localId, mapNum, mapGroup, 0);
|
||||
SetObjectInvisibility(localId, mapNum, mapGroup, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_hideobject_at(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_hideobjectat(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
ShowOrHideObjectByLocalIdAndMap(localId, mapNum, mapGroup, 1);
|
||||
SetObjectInvisibility(localId, mapNum, mapGroup, TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setobjectpriority(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setobjectsubpriority(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
u8 priority = ScriptReadByte(ctx);
|
||||
|
||||
SetObjectPriorityByLocalIdAndMap(localId, mapNum, mapGroup, priority + 83);
|
||||
SetObjectSubpriority(localId, mapNum, mapGroup, priority + 83);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_resetobjectpriority(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_resetobjectsubpriority(struct ScriptContext * ctx)
|
||||
{
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 mapGroup = ScriptReadByte(ctx);
|
||||
u8 mapNum = ScriptReadByte(ctx);
|
||||
|
||||
UnfixObjectPriorityByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
ResetObjectSubpriority(localId, mapNum, mapGroup);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1166,32 +1163,34 @@ bool8 ScrCmd_setobjectmovementtype(struct ScriptContext * ctx)
|
||||
u16 localId = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 movementType = ScriptReadByte(ctx);
|
||||
|
||||
Overworld_SetObjEventTemplateMovementType(localId, movementType);
|
||||
SetObjEventTemplateMovementType(localId, movementType);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_createvobject(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 graphicsId = ScriptReadByte(ctx);
|
||||
u8 v2 = ScriptReadByte(ctx);
|
||||
u8 virtualObjId = ScriptReadByte(ctx);
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u32 y = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 elevation = ScriptReadByte(ctx);
|
||||
u8 direction = ScriptReadByte(ctx);
|
||||
|
||||
sprite_new(graphicsId, v2, x, y, elevation, direction);
|
||||
CreateVirtualObject(graphicsId, virtualObjId, x, y, elevation, direction);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_turnvobject(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 v1 = ScriptReadByte(ctx);
|
||||
u8 virtualObjId = ScriptReadByte(ctx);
|
||||
u8 direction = ScriptReadByte(ctx);
|
||||
|
||||
TurnObjectEvent(v1, direction);
|
||||
TurnVirtualObject(virtualObjId, direction);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// lockall freezes all object events except the player immediately.
|
||||
// The player is frozen after waiting for their current movement to finish.
|
||||
bool8 ScrCmd_lockall(struct ScriptContext * ctx)
|
||||
{
|
||||
if (IsUpdateLinkStateCBActive())
|
||||
@@ -1200,8 +1199,8 @@ bool8 ScrCmd_lockall(struct ScriptContext * ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptFreezeObjectEvents();
|
||||
SetupNativeScript(ctx, NativeScript_WaitPlayerStopMoving);
|
||||
FreezeObjects_WaitForPlayer();
|
||||
SetupNativeScript(ctx, IsFreezePlayerFinished);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1216,13 +1215,13 @@ bool8 ScrCmd_lock(struct ScriptContext * ctx)
|
||||
{
|
||||
if (gObjectEvents[gSelectedObjectEvent].active)
|
||||
{
|
||||
LockSelectedObjectEvent();
|
||||
SetupNativeScript(ctx, NativeScript_WaitPlayerAndTargetNPCStopMoving);
|
||||
FreezeObjects_WaitForPlayerAndSelected();
|
||||
SetupNativeScript(ctx, IsFreezeSelectedObjectAndPlayerFinished);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptFreezeObjectEvents();
|
||||
SetupNativeScript(ctx, NativeScript_WaitPlayerStopMoving);
|
||||
FreezeObjects_WaitForPlayer();
|
||||
SetupNativeScript(ctx, IsFreezePlayerFinished);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1429,7 +1428,7 @@ bool8 ScrCmd_multichoice(struct ScriptContext * ctx)
|
||||
u8 left = ScriptReadByte(ctx);
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
@@ -1448,7 +1447,7 @@ bool8 ScrCmd_multichoicedefault(struct ScriptContext * ctx)
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 defaultChoice = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_MultichoiceWithDefault(left, top, multichoiceId, ignoreBPress, defaultChoice) == TRUE)
|
||||
{
|
||||
@@ -1478,7 +1477,7 @@ bool8 ScrCmd_multichoicegrid(struct ScriptContext * ctx)
|
||||
u8 top = ScriptReadByte(ctx);
|
||||
u8 multichoiceId = ScriptReadByte(ctx);
|
||||
u8 numColumns = ScriptReadByte(ctx);
|
||||
u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
if (ScriptMenu_MultichoiceGrid(left, top, multichoiceId, ignoreBPress, numColumns) == TRUE)
|
||||
{
|
||||
@@ -1498,7 +1497,7 @@ bool8 ScrCmd_erasebox(struct ScriptContext * ctx)
|
||||
u8 right = ScriptReadByte(ctx);
|
||||
u8 bottom = ScriptReadByte(ctx);
|
||||
|
||||
// MenuZeroFillWindowRect(left, top, right, bottom);
|
||||
// Menu_EraseWindowRect(left, top, right, bottom);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1507,7 +1506,7 @@ bool8 ScrCmd_drawboxtext(struct ScriptContext * ctx)
|
||||
// u8 left = ScriptReadByte(ctx);
|
||||
// u8 top = ScriptReadByte(ctx);
|
||||
// u8 multichoiceId = ScriptReadByte(ctx);
|
||||
// u8 ignoreBPress = ScriptReadByte(ctx);
|
||||
// bool8 ignoreBPress = ScriptReadByte(ctx);
|
||||
|
||||
/*if (Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
|
||||
{
|
||||
@@ -1530,7 +1529,9 @@ bool8 ScrCmd_showmonpic(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_hidemonpic(struct ScriptContext * ctx)
|
||||
{
|
||||
bool8 (*func)(void) = ScriptMenu_GetPicboxWaitFunc();
|
||||
// The hide function returns a pointer to a function
|
||||
// that returns true once the pic is hidden
|
||||
bool8 (*func)(void) = ScriptMenu_HidePokemonPic();
|
||||
|
||||
if (func == NULL)
|
||||
return FALSE;
|
||||
@@ -1538,48 +1539,48 @@ bool8 ScrCmd_hidemonpic(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_showcontestwinner(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_showcontestpainting(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 v1 = ScriptReadByte(ctx);
|
||||
|
||||
u8 contestWinnerId = ScriptReadByte(ctx);
|
||||
/*
|
||||
if (v1)
|
||||
sub_812FDA8(v1);
|
||||
ShowContestWinner();
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
*/
|
||||
// Artist's painting is temporary and already has its data loaded
|
||||
if (contestWinnerId != CONTEST_WINNER_ARTIST)
|
||||
SetContestWinnerForPainting(contestWinnerId);
|
||||
|
||||
ShowContestPainting();
|
||||
ScriptContext1_Stop()
|
||||
return TRUE;
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_braillemessage(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 *ptr = (u8 *)ScriptReadWord(ctx);
|
||||
if (ptr == NULL)
|
||||
ptr = (u8 *)ctx->data[0];
|
||||
u8 *msg = (u8 *)ScriptReadWord(ctx);
|
||||
if (msg == NULL)
|
||||
msg = (u8 *)ctx->data[0];
|
||||
|
||||
LoadStdWindowFrameGfx();
|
||||
DrawDialogueFrame(0, 1);
|
||||
AddTextPrinterParameterized(0, FONT_6, ptr, 0, 1, 0, NULL);
|
||||
AddTextPrinterParameterized(0, FONT_BRAILLE, msg, 0, 1, 0, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_getbraillestringwidth(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 *ptr = (u8 *)ScriptReadWord(ctx);
|
||||
if (ptr == NULL)
|
||||
ptr = (u8 *)ctx->data[0];
|
||||
u8 *msg = (u8 *)ScriptReadWord(ctx);
|
||||
if (msg == NULL)
|
||||
msg = (u8 *)ctx->data[0];
|
||||
|
||||
gSpecialVar_0x8004 = GetStringWidth(FONT_6, ptr, -1);
|
||||
gSpecialVar_0x8004 = GetStringWidth(FONT_BRAILLE, msg, -1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vmessage(struct ScriptContext * ctx)
|
||||
{
|
||||
u32 v1 = ScriptReadWord(ctx);
|
||||
u32 msg = ScriptReadWord(ctx);
|
||||
|
||||
ShowFieldMessage((u8 *)(v1 - gVScriptOffset));
|
||||
ShowFieldMessage((u8 *)(msg - sAddressOffset));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1629,8 +1630,8 @@ bool8 ScrCmd_bufferitemname(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const u8 gUnknown_83A72A0[] = _("S");
|
||||
const u8 gUnknown_83A72A2[] = _("IES");
|
||||
static const u8 sText_S[] = _("S");
|
||||
static const u8 sText_IES[] = _("IES");
|
||||
|
||||
bool8 ScrCmd_bufferitemnameplural(struct ScriptContext * ctx)
|
||||
{
|
||||
@@ -1640,15 +1641,15 @@ bool8 ScrCmd_bufferitemnameplural(struct ScriptContext * ctx)
|
||||
|
||||
CopyItemName(itemId, sScriptStringVars[stringVarIndex]);
|
||||
if (itemId == ITEM_POKE_BALL && quantity >= 2)
|
||||
StringAppend(sScriptStringVars[stringVarIndex], gUnknown_83A72A0);
|
||||
else if (itemId >= ITEM_CHERI_BERRY && itemId < ITEM_ENIGMA_BERRY && quantity >= 2)
|
||||
StringAppend(sScriptStringVars[stringVarIndex], sText_S);
|
||||
else if (itemId >= FIRST_BERRY_INDEX && itemId < LAST_BERRY_INDEX && quantity >= 2)
|
||||
{
|
||||
u16 strlength = StringLength(sScriptStringVars[stringVarIndex]);
|
||||
if (strlength != 0)
|
||||
{
|
||||
u8 * endptr = sScriptStringVars[stringVarIndex] + strlength;
|
||||
endptr[-1] = EOS;
|
||||
StringAppend(sScriptStringVars[stringVarIndex], gUnknown_83A72A2);
|
||||
StringAppend(sScriptStringVars[stringVarIndex], sText_IES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1676,10 +1677,10 @@ bool8 ScrCmd_buffermovename(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_buffernumberstring(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
u16 v1 = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 v2 = CountDigits(v1);
|
||||
u16 num = VarGet(ScriptReadHalfword(ctx));
|
||||
u8 numDigits = CountDigits(num);
|
||||
|
||||
ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], v1, 0, v2);
|
||||
ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], num, STR_CONV_MODE_LEFT_ALIGN, numDigits);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1692,17 +1693,6 @@ bool8 ScrCmd_bufferstdstring(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
bool8 ScrCmd_buffercontesttype(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
u16 index = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
sub_818E868(sScriptStringVars[stringVarIndex], index);
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
bool8 ScrCmd_bufferstring(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
@@ -1712,9 +1702,9 @@ bool8 ScrCmd_bufferstring(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_vloadword(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_vbuffermessage(struct ScriptContext * ctx)
|
||||
{
|
||||
const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - gVScriptOffset);
|
||||
const u8 *ptr = (u8 *)(ScriptReadWord(ctx) - sAddressOffset);
|
||||
|
||||
StringExpandPlaceholders(gStringVar4, ptr);
|
||||
return FALSE;
|
||||
@@ -1725,7 +1715,7 @@ bool8 ScrCmd_vbufferstring(struct ScriptContext * ctx)
|
||||
u8 stringVarIndex = ScriptReadByte(ctx);
|
||||
u32 addr = ScriptReadWord(ctx);
|
||||
|
||||
const u8 *src = (u8 *)(addr - gVScriptOffset);
|
||||
const u8 *src = (u8 *)(addr - sAddressOffset);
|
||||
u8 *dest = sScriptStringVars[stringVarIndex];
|
||||
StringCopy(dest, src);
|
||||
return FALSE;
|
||||
@@ -1964,6 +1954,7 @@ bool8 ScrCmd_pokemartdecoration(struct ScriptContext * ctx)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Changes clerk dialogue slightly from above. See MART_TYPE_DECOR2
|
||||
bool8 ScrCmd_pokemartdecoration2(struct ScriptContext * ctx)
|
||||
{
|
||||
const void *ptr = (void *)ScriptReadWord(ctx);
|
||||
@@ -1989,13 +1980,13 @@ bool8 ScrCmd_setberrytree(struct ScriptContext * ctx)
|
||||
// u8 growthStage = ScriptReadByte(ctx);
|
||||
//
|
||||
// if (berry == 0)
|
||||
// PlantBerryTree(treeId, 0, growthStage, FALSE);
|
||||
// PlantBerryTree(treeId, berry, growthStage, FALSE);
|
||||
// else
|
||||
// PlantBerryTree(treeId, berry, growthStage, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_getpricereduction(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_getpokenewsactive(struct ScriptContext * ctx)
|
||||
{
|
||||
// u16 value = VarGet(ScriptReadHalfword(ctx));
|
||||
//
|
||||
@@ -2005,7 +1996,7 @@ bool8 ScrCmd_getpricereduction(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_choosecontestmon(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_81B9404();
|
||||
// ChooseContestMon();
|
||||
ScriptContext1_Stop();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2013,7 +2004,7 @@ bool8 ScrCmd_choosecontestmon(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_startcontest(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_80F840C();
|
||||
// StartContest();
|
||||
// ScriptContext1_Stop();
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
@@ -2021,7 +2012,7 @@ bool8 ScrCmd_startcontest(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_showcontestresults(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_80F8484();
|
||||
// ShowContestResults();
|
||||
// ScriptContext1_Stop();
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
@@ -2029,7 +2020,7 @@ bool8 ScrCmd_showcontestresults(struct ScriptContext * ctx)
|
||||
|
||||
bool8 ScrCmd_contestlinktransfer(struct ScriptContext * ctx)
|
||||
{
|
||||
// sub_80F84C4(gSpecialVar_ContestCategory);
|
||||
// ContestLinkTransfer(gSpecialVar_ContestCategory);
|
||||
// ScriptContext1_Stop();
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
@@ -2044,7 +2035,7 @@ bool8 ScrCmd_dofieldeffect(struct ScriptContext * ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_setfieldeffectarg(struct ScriptContext * ctx)
|
||||
bool8 ScrCmd_setfieldeffectargument(struct ScriptContext * ctx)
|
||||
{
|
||||
u8 argNum = ScriptReadByte(ctx);
|
||||
|
||||
@@ -2101,11 +2092,11 @@ bool8 ScrCmd_setmetatile(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 tileId = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 v8 = VarGet(ScriptReadHalfword(ctx));
|
||||
bool16 isImpassable = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
if (!v8)
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
if (!isImpassable)
|
||||
MapGridSetMetatileIdAt(x, y, tileId);
|
||||
else
|
||||
MapGridSetMetatileIdAt(x, y, tileId | METATILE_COLLISION_MASK);
|
||||
@@ -2117,8 +2108,8 @@ bool8 ScrCmd_opendoor(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
PlaySE(GetDoorSoundEffect(x, y));
|
||||
FieldAnimateDoorOpen(x, y);
|
||||
return FALSE;
|
||||
@@ -2129,8 +2120,8 @@ bool8 ScrCmd_closedoor(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
FieldAnimateDoorClose(x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2154,8 +2145,8 @@ bool8 ScrCmd_setdooropen(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
FieldSetDoorOpened(x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2165,8 +2156,8 @@ bool8 ScrCmd_setdoorclosed(struct ScriptContext * ctx)
|
||||
u16 x = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 y = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
x += 7;
|
||||
y += 7;
|
||||
x += MAP_OFFSET;
|
||||
y += MAP_OFFSET;
|
||||
FieldSetDoorClosed(x, y);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2202,9 +2193,9 @@ bool8 ScrCmd_addcoins(struct ScriptContext * ctx)
|
||||
u16 coins = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
if (AddCoins(coins) == TRUE)
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_Result = FALSE;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_Result = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2213,9 +2204,9 @@ bool8 ScrCmd_removecoins(struct ScriptContext * ctx)
|
||||
u16 coins = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
if (RemoveCoins(coins) == TRUE)
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_Result = FALSE;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_Result = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -523,7 +523,7 @@ bool32 ValidateRamScript(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
u8 *sub_8069E48(void)
|
||||
u8 *GetSavedRamScriptIfValid(void)
|
||||
{
|
||||
struct RamScriptData *scriptData = &gSaveBlock1Ptr->ramScript.data;
|
||||
if (!ValidateReceivedWonderCard())
|
||||
|
||||
+1
-1
@@ -1048,7 +1048,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void)
|
||||
bool8 (*ScriptMenu_HidePokemonPic(void))(void)
|
||||
{
|
||||
u8 taskId = FindTaskIdByFunc(Task_ScriptShowMonPic);
|
||||
if (taskId == 0xFF)
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ static u8 CreateShopMenu(u8 a0)
|
||||
{
|
||||
gShopData.martType = GetMartTypeFromItemList(a0);
|
||||
gShopData.selectedRow = 0;
|
||||
if (ContextNpcGetTextColor() == 0)
|
||||
if (ContextNpcGetTextColor() == NPC_TEXT_COLOR_MALE)
|
||||
gShopData.fontId = FONT_4;
|
||||
else
|
||||
gShopData.fontId = FONT_5;
|
||||
|
||||
+1
-1
@@ -4657,7 +4657,7 @@ static void HandleCancelTrade(bool32 unlockObjs)
|
||||
static void UR_EnableScriptContext2AndFreezeObjectEvents(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
ScriptFreezeObjectEvents();
|
||||
FreezeObjects_WaitForPlayer();
|
||||
}
|
||||
|
||||
static u8 GetSinglePartnerSpriteGenderParam(s32 linkPlayer)
|
||||
|
||||
Reference in New Issue
Block a user