Skip to Content
The Alchemy Project

include/game/main_routine_state.h

The values MainRoutineStateWork's fields hold. More…

Included by battle_internal.h, field_engine_internal.h, field_psynergy_internal.h, script_commands_internal.h, menu_internal.h, world_map_objects.c, shop_internal.h, window_internal.h, scene_tables.h, inventory.h, jupiter_lighthouse_aerie.h, mars_lighthouse_shared.h, trial_road.h and tundaria_tower.h.

Macros

NameDescription
#defineBATTLE_OUTCOME_LOST -1btRun's results in MainRoutineStateWork.engineResult besides the number of enemies defeated.
#defineBATTLE_OUTCOME_FLED 999
#defineCOIN_MAX 999999The most coins the party carries, and the most shop credit.
#defineHAZARD_DAMAGE_PERCENT 0x100MainRoutineStateWork.hazardDamage's bit 8: its low byte is a percentage of maximum HP rather than HP.
#defineSHOP_GIFTS_MAX 28The most Game Tickets counted in MAIN_ROUTINE_STATE.shopGifts, the last of ShopGameTicketCreditCosts' prices that is used.
#defineDJINNI_BATTLE_SCRIPT_FIRST 300The first pending Djinni battle script: DJINNI_BATTLE_SCRIPT_FIRST plus the Djinni's number (fdRequestDjinnBattle).
#defineSET_BATTLE_TYPE (mode)Sets how the next battle starts (an BATTLE_TYPE).

Enumerations

NameDescription
enumSCENE_TYPE { SCENE_TYPE_OTHER, SCENE_TYPE_TOWN }A scene's type (SCENE.sceneType, copied to MAIN_ROUTINE_STATE.sceneType).
enumBATTLE_TYPE { BATTLE_TYPE_NORMAL, BATTLE_TYPE_NO_ESCAPE, BATTLE_TYPE_LINK, … }MainRoutineStateWork.battleType: how the next battle starts; it is set back to BATTLE_TYPE_NORMAL as the battle ends.
enumHAZARD_MODE { HAZARD_COUNT_ON_METATILES, HAZARD_COUNT_TICKS }MainRoutineStateWork.hazardMode: what advances the hazard count (fdUpdateWalking).
enumDIFFICULTY { DIFFICULTY_NORMAL, DIFFICULTY_EASY, DIFFICULTY_HARD }MainRoutineStateWork.difficulty: the level chosen on starting again from a cleared game.
enumLUCKY_WHEELS_PRIZES_MARK { WHEELS_PRIZES_END, WHEELS_PRIZES_NONE_TO_HAND_OUT }What MAIN_ROUTINE_STATE.wheelsPrizes holds in place of a first prize, as Lucky Wheels and its attendant leave it: no icon matched (also the list's end), or none to hand out, the player having quit while betting or the prizes having been given.
enumTELEPORT_STATE { TELEPORT_NONE, TELEPORT_CHOSEN, TELEPORT_ARRIVING }Teleport's steps (MAIN_ROUTINE_STATE.teleportState): a place was chosen and the scene it lands in is loading, then the party arrives in it.
enumLINK_TALLY { LINK_TALLY_MONSTER_WINS, LINK_TALLY_MONSTER_LOSSES, LINK_TAL … }MAIN_ROUTINE_STATE.linkTallies, as the Link Lobby keeps them.

Description

The values MainRoutineStateWork's fields hold. The structure, the game's state a save file keeps, is the system library's (system/definitions.h), as the variable is.

Macros in detail

BATTLE_OUTCOME_LOST

#define BATTLE_OUTCOME_LOST -1

btRun's results in MainRoutineStateWork.engineResult besides the number of enemies defeated.

Referenced by btRun(), gmReturnFromEngine(), scJupiterLighthouseJennaJoinsTheFight() and scJupiterLighthouseShebaJoinsTheFight().

Definition at line 38 of file main_routine_state.h.

BATTLE_OUTCOME_FLED

#define BATTLE_OUTCOME_FLED 999

Referenced by btRun() and fdDjinnResolvePending().

Definition at line 39 of file main_routine_state.h.

COIN_MAX

#define COIN_MAX 999999

The most coins the party carries, and the most shop credit.

Referenced by gmPartyAddIsaacsParty(), gmPartyAdjustCoins(), scContigoOfferLuckyDice() and scContigoOfferSuperLuckyDice().

Definition at line 42 of file main_routine_state.h.

HAZARD_DAMAGE_PERCENT

#define HAZARD_DAMAGE_PERCENT 0x100

MainRoutineStateWork.hazardDamage's bit 8: its low byte is a percentage of maximum HP rather than HP.

Referenced by fdUpdateWalking().

Definition at line 56 of file main_routine_state.h.

SHOP_GIFTS_MAX

#define SHOP_GIFTS_MAX 28

The most Game Tickets counted in MAIN_ROUTINE_STATE.shopGifts, the last of ShopGameTicketCreditCosts' prices that is used.

Referenced by mnShopOpenDebugShop().

Definition at line 60 of file main_routine_state.h.

DJINNI_BATTLE_SCRIPT_FIRST

#define DJINNI_BATTLE_SCRIPT_FIRST 300

The first pending Djinni battle script: DJINNI_BATTLE_SCRIPT_FIRST plus the Djinni's number (fdRequestDjinnBattle).

Referenced by fdDjinnResolvePending(), fdDjinnRestoreActorAfterBattle() and fdRequestDjinnBattle().

Definition at line 64 of file main_routine_state.h.

SET_BATTLE_TYPE

#define SET_BATTLE_TYPE(mode)

Sets how the next battle starts (an BATTLE_TYPE).

Referenced by btRun(), scAnemosInnerSanctumDullahanShadowChallenges(), scChampaCliffCavesFightAvimander(), scGabombaCatacombsUncoverMadPlant(), scGaiaRockInsideChallengeSerpent(), scGaiaRockInsideCycloneMadPlant(), scIsletCaveSentinelAwaits(), scJupiterLighthouseBeaconIsLit(), scJupiterLighthouseIsaacAndIvanAreHurt(), scJupiterLighthouseJennaJoinsTheFight(), scJupiterLighthouseShebaJoinsTheFight(), scJupiterLighthouseUncoverMadPlant(), scKandoreanTempleFightChestbeaters(), scShamanVillageCaveFightGladiators(), scShamanVillageCaveMeetGladiators(), scSuhallaGateFightPunchAnt(), scSuhallaGateRuffianSpotsParty(), scTaopoSwampStartMadPlantBattle(), scTreasureIsleMeetStarMagician(), scTrialRoadChallengeMoapa(), scTrialRoadScatterWeedsHidingMadPlant(), scVenusLighthouseEntranceRuffianWaitsForBackup(), scWorldMapFightBanditAndThieves() and scYampiDesertCaveMeetGuardianOfFire().

Definition at line 110 of file main_routine_state.h.

Enumerations in detail

SCENE_TYPE

enum SCENE_TYPE

A scene's type (SCENE.sceneType, copied to MAIN_ROUTINE_STATE.sceneType).

EnumeratorValueDescription
SCENE_TYPE_OTHER1every other scene: dungeons, the world map
SCENE_TYPE_TOWN2Towns and their rooms, and the prologue's Venus Lighthouse scenes: FLAG_IN_TOWN is set there (gmArrive).

Definition at line 14 of file main_routine_state.h.

BATTLE_TYPE

enum BATTLE_TYPE

MainRoutineStateWork.battleType: how the next battle starts; it is set back to BATTLE_TYPE_NORMAL as the battle ends.

EnumeratorValueDescription
BATTLE_TYPE_NORMAL0
BATTLE_TYPE_NO_ESCAPE2A battle the party cannot run from: a Mimic's, a hidden Mad Plant's and the bosses'.
BATTLE_TYPE_LINK4A link battle, from the lobby.
BATTLE_TYPE_DEBUG5The debug battle menu's mark.
BATTLE_TYPE_LOST6A battle the party is meant to lose: it is caught off guard and every hit downs its target, as when Karst and Agatio fight Isaac and Ivan.

Definition at line 24 of file main_routine_state.h.

HAZARD_MODE

enum HAZARD_MODE

MainRoutineStateWork.hazardMode: what advances the hazard count (fdUpdateWalking).

EnumeratorValueDescription
HAZARD_COUNT_ON_METATILES0The distance the leader walks on MAP_METATILE_HAZARD ground.
HAZARD_COUNT_TICKS1One each tick the field engine runs; no code in the game sets it.

Definition at line 46 of file main_routine_state.h.

DIFFICULTY

enum DIFFICULTY

MainRoutineStateWork.difficulty: the level chosen on starting again from a cleared game.

EnumeratorValueDescription
DIFFICULTY_NORMAL0"Play on Normal level? (Default difficulty)"
DIFFICULTY_EASY1"Play on EASY level? (Characters start at Lost Age Clear Data levels)"
DIFFICULTY_HARD2"Play on HARD level? (Monsters are stronger)"

Definition at line 68 of file main_routine_state.h.

LUCKY_WHEELS_PRIZES_MARK

enum LUCKY_WHEELS_PRIZES_MARK

What MAIN_ROUTINE_STATE.wheelsPrizes holds in place of a first prize, as Lucky Wheels and its attendant leave it: no icon matched (also the list's end), or none to hand out, the player having quit while betting or the prizes having been given.

EnumeratorValueDescription
WHEELS_PRIZES_END-1
WHEELS_PRIZES_NONE_TO_HAND_OUT-2

Definition at line 80 of file main_routine_state.h.

TELEPORT_STATE

enum TELEPORT_STATE

Teleport's steps (MAIN_ROUTINE_STATE.teleportState): a place was chosen and the scene it lands in is loading, then the party arrives in it.

EnumeratorValueDescription
TELEPORT_NONE
TELEPORT_CHOSEN
TELEPORT_ARRIVING

Definition at line 88 of file main_routine_state.h.

enum LINK_TALLY

MAIN_ROUTINE_STATE.linkTallies, as the Link Lobby keeps them.

EnumeratorValueDescription
LINK_TALLY_MONSTER_WINS0
LINK_TALLY_MONSTER_LOSSES1
LINK_TALLY_MONSTER_BEST_STREAK2the most won in a row
LINK_TALLY_MONSTER_STREAK3those won in the current series
LINK_TALLY_LINKED_WINS4
LINK_TALLY_LINKED_LOSSES5
LINK_TALLY_LINKED_BEST_STREAK6The most linked battles won in a row, on the wall board
LINK_TALLY_LINKED_STREAK7those won in a row now

Definition at line 96 of file main_routine_state.h.