Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
state.c File Reference
#include "engine/game.h"
#include "field/field_map.h"
Include dependency graph for state.c:

Go to the source code of this file.

Functions

void newGame (void)
 Clears the save data and sets up a new game.
 
void commitMode (void)
 Makes the requested mode current (main calls it before recreating the mode task)
 
s32 getPrevMode (void)
 The game mode before the current one.
 
s32 getMode (void)
 The current game mode.
 
s32 getModeArg (void)
 The argument the current mode was requested with.
 
void requestMode (s32 mode, s32 arg)
 Asks for a mode change, applied when main recreates the mode task.
 
s32 isModeChangePending (void)
 Whether a mode change was requested.
 

Variables

GameState GAME
 The save data, the game mode and the methods.
 

Function Documentation

◆ newGame()

void newGame ( void  )

Clears the save data and sets up a new game.

< CNTY_SEL, where the European version starts

< CNTY_SEL, where the European version starts

Definition at line 5 of file state.c.

Here is the call graph for this function:

◆ commitMode()

void commitMode ( void  )

Makes the requested mode current (main calls it before recreating the mode task)

Definition at line 26 of file state.c.

◆ getPrevMode()

s32 getPrevMode ( void  )

The game mode before the current one.

Definition at line 38 of file state.c.

◆ getMode()

s32 getMode ( void  )

The current game mode.

Definition at line 43 of file state.c.

◆ getModeArg()

s32 getModeArg ( void  )

The argument the current mode was requested with.

Definition at line 48 of file state.c.

◆ requestMode()

void requestMode ( s32  mode,
s32  arg 
)

Asks for a mode change, applied when main recreates the mode task.

Definition at line 53 of file state.c.

◆ isModeChangePending()

s32 isModeChangePending ( void  )

Whether a mode change was requested.

Definition at line 59 of file state.c.

Variable Documentation

◆ GAME

GameState GAME
Initial value:
= {
.funcs = {
},
}
s32 addPartnerEntry(s32 partner, s32 id)
Gives a partner Digimon id at level 1; 0 if it has it already or has no room.
Definition partner.c:74
PartnerStats * getPartnerStats(s32 partner)
A partner's name, stats and Digimon.
Definition partner.c:117
s32 getPartnerSlots(s32 partner, s16 *out)
Copies the ids of the Digimon a partner takes to battle; returns how many there are.
Definition partner.c:19
s32 listPartnerEntries(s32 partner, u16 *out)
Copies the ids of a partner's Digimon, zero-filled; returns how many there are.
Definition partner.c:55
void setPartnerSlots(s32 partner, s16 *ids)
Picks the Digimon a partner takes to battle (-1 for ids it does not have)
Definition partner.c:40
s32 setPartnerEntry(s32 partner, s32 id, PartnerEntry *in)
Overwrites a partner's Digimon id; returns its index, or -1.
Definition partner.c:107
s32 getPartnerEntry(s32 partner, s32 id, PartnerEntry *out)
Copies a partner's Digimon id; returns its index, or -1.
Definition partner.c:97
void newGame(void)
Clears the save data and sets up a new game.
Definition state.c:5
void requestMode(s32 mode, s32 arg)
Asks for a mode change, applied when main recreates the mode task.
Definition state.c:53
s32 getPrevMode(void)
The game mode before the current one.
Definition state.c:38
s32 getMode(void)
The current game mode.
Definition state.c:43
s32 isModeChangePending(void)
Whether a mode change was requested.
Definition state.c:59
void commitMode(void)
Makes the requested mode current (main calls it before recreating the mode task)
Definition state.c:26
s32 getModeArg(void)
The argument the current mode was requested with.
Definition state.c:48
s32 getPartyPartner(u32 index)
The partner id of party member index (its unlocked value - 3), or -1.
Definition stats.c:5
void computeStats(s32 partner, PartnerTotals *out)
A partner's stats with its equipment (and its equipment set bonus) added.
Definition stats.c:65
void addStat(s32 partner, u32 stat, s32 delta)
Adds to a partner's stat, kept within the same limits as setStat.
Definition stats.c:39
void setStat(s32 partner, u32 stat, s16 value)
Sets a partner's stat, kept within 0-99 (level, TP), 0-9999 (HP, MP) or 0-999.
Definition stats.c:13
void addCards(s32 card, s32 count)
Gives count copies of a card (up to CARD_COPIES_MAX) and marks it seen.
Definition party.c:63
void giveStarterDeck(void)
Gives the starter deck's cards and puts them in every deck.
Definition party.c:72
s32 getPartyMember(u32 index)
The partner index of party member index, or -1.
Definition party.c:42
void setParty(s32 set)
Gives the party STARTER_PARTIES[set], unlocking its partners.
Definition party.c:50
void resetPlayTime(void)
Sets the play time to zero.
Definition play_time.c:5
void updatePlayTime(void)
Turns the vsync-counted frames into seconds, minutes and hours, stopping at 999:59:59.
Definition play_time.c:14

The save data, the game mode and the methods.

Definition at line 64 of file state.c.

Referenced by addCards(), addFighters(), addPartnerEntry(), addStat(), applyAction(), CARDGAME_createDeckWindow(), CARDGAME_updateBattle(), CARDGAME_updateDeckWindow(), CARDGAME_updateScene(), changeCard(), changeItem(), checkCard(), checkCondition(), checkFlagCount(), checkItem(), checkItemSet(), checkMoney(), checkPartner(), checkPartyStat(), checkProgress(), checkProgressRange(), checkWarpArg(), chooseFieldMenuOption(), chooseInnAnswer(), CNTY_SEL_tickMenu(), commitMode(), computeStats(), createParty(), createTalkBox(), drawEntryPanel(), drawFrame(), drawTimer(), editParty(), editProgress(), endEvent0(), endEvent1(), endEvent1035(), endEvent1080(), endEvent1500(), endEvent152(), endEvent171(), endEvent205(), endEvent230(), endEvent261(), endEvent273(), endEvent300(), endEvent352(), endEvent370(), endEvent413(), endEvent431(), endEvent5(), endEvent511(), endEvent52(), endEvent531(), endEvent534(), endEvent551(), endEvent560(), endEvent661(), endEvent685(), endEvent690(), endEvent695(), endEvent71(), endEvent711(), endEvent743(), endEvent751(), endEvent760(), endEvent781(), endEvent820(), endEvent886(), endEvent893(), endEvent895(), endEvent90(), endEvent901(), endEvent911(), endEvent922(), endEvent935(), endEvent961(), endEvent982(), endEvents10To12(), FIELDSTG_checkFlightProbe(), FIELDSTG_closeField(), FIELDSTG_controlFlight(), FIELDSTG_countBattleSteps(), FIELDSTG_createActor(), FIELDSTG_createActorIcon(), FIELDSTG_createHiddenSpots(), FIELDSTG_createLaunch(), FIELDSTG_getWalkStep(), FIELDSTG_hidePrize(), FIELDSTG_keepsFileCache(), FIELDSTG_offerTrigger(), FIELDSTG_pickStage(), FIELDSTG_playBattleTransition(), FIELDSTG_requestInnNames(), FIELDSTG_rollBattleSteps(), FIELDSTG_runActorAction(), FIELDSTG_runGauge(), FIELDSTG_runStoryEvents(), FIELDSTG_scrollCamera(), FIELDSTG_setFirstMap(), FIELDSTG_setMap(), FIELDSTG_setOffTrigger(), FIELDSTG_setupField(), FIELDSTG_showAreaName(), FIELDSTG_startEncounter(), FIELDSTG_updateActor(), FIELDSTG_updateRoot(), FIGHTSTG_computeStats(), FIGHTSTG_createSwitchInMenu(), FIGHTSTG_drawHud(), FIGHTSTG_getGaugeGain(), FIGHTSTG_getPairDigimon(), FIGHTSTG_getTechCost(), FIGHTSTG_raiseAllStatus(), FIGHTSTG_raiseEachStatus(), FIGHTSTG_raiseOneStatus(), FIGHTSTG_setConfusedName(), FIGHTSTG_setMessageName(), FIGHTSTG_showDigivolveNames(), FIGHTSTG_showFighterNames(), FIGHTSTG_showFightersMessage(), FIGHTSTG_showItemPage(), FIGHTSTG_showSwitchFighters(), FIGHTSTG_updateDigivolveMenu(), FIGHTSTG_updateItem(), FIGHTSTG_updatePartnerInfo(), FIGHTSTG_updateRoot(), FIGHTSTG_updateTechMenu(), fillGauge(), findPartnerEntry(), getFieldZone(), getMode(), getModeArg(), getPartnerEntry(), getPartnerSlots(), getPartnerStats(), getPartyMember(), getPartyPartner(), getPrevMode(), giveDigimonExp(), giveItem(), giveMoney(), giveNextSkill(), giveStarterDeck(), healParty(), initNewGameData(), isModeChangePending(), learnNextDigimon(), listItems(), listPartnerEntries(), listSlotTechs(), listSwitchInDigimon(), loadChosenDeck(), loadModeOverlay(), loadSlotScreen(), main(), markNextSkillKnown(), measureText(), moveTransitionTile(), newGame(), openFieldMenu(), openFieldMenu(), pickBattleDigivolve(), pickEvenFighterPrize(), pickMember(), pickOddFighterPrize(), pickPartner(), putPickedEntry(), raisePartnerLevel(), requestMode(), resetPlayTime(), reviveParty(), runDigivolveMenu(), setBattleKind(), setPartnerEntry(), setPartnerSlots(), setParty(), setStat(), setUpBattle(), setupStage(), SHOCKTST_updateLoader(), showFieldMenuMoney(), showPartnerPage(), showRecipeTitle(), sleepAtInn(), SOUNDTST_updateScene(), SOUNDTST_updateSoundTest(), STAGSLCT_startStageSelect(), STAGSLCT_updateStageSelect(), startEvent9000(), startEvent9001(), startField(), STCRDABM_drawCards(), STCRDABM_drawTurningSlots(), STCRDABM_findPageCards(), STCRDABM_pageHasCards(), STCRDABM_showCardInfo(), STCRDABM_updateAlbum(), STCRDDEK_buildCardList(), STCRDDEK_chooseListCard(), STCRDDEK_countCardKinds(), STCRDDEK_drawDeckCards(), STCRDDEK_drawEditor(), STCRDDEK_loadNextCard(), STCRDDEK_openChosen(), STCRDDEK_showDeckRow(), STCRDDEK_showEditorWindows(), STCRDDEK_sortDeck(), STCRDDEK_updateScreen(), STCRDSHP_chooseBuyCard(), STCRDSHP_confirmBuyCard(), STCRDSHP_createShop(), STCRDSHP_openPack(), STCRDSHP_runPackOpen(), STCRDSHP_showBuyCard(), STCRDSHP_showMoney(), STCRDSHP_showPack(), STCRDSHP_showPackCard(), STCRDSHP_showTitle(), STCRDSHP_updateShop(), STDGNAME_drawMenu(), STDGNAME_showMenuWindow(), STDGNAME_stepScreen(), STDGNAME_updateMenu(), STDGNAME_updateScreen(), STDWTITL_leaveTitle(), STDWTITL_tickMovie(), STDWTITL_tickScreen(), STDWTITL_tickSplash(), stealEnemyItem(), stepFieldMenuFade(), STFGTREP_addDigimonExp(), STFGTREP_addExp(), STFGTREP_addSkill(), STFGTREP_boostExp(), STFGTREP_drawPartner(), STFGTREP_fillPartnerWindows(), STFGTREP_getDigimonExp(), STFGTREP_learnDigimon(), STFGTREP_learnSkill(), STFGTREP_raiseStats(), STFGTREP_runPartner(), STFGTREP_updatePartner(), STFGTREP_updateReport(), STGDGLAB_drawEntryList(), STGDGLAB_drawMenu(), STGDGLAB_drawPartyScreen(), STGDGLAB_packParty(), STGDGLAB_runMenu(), STGDGLAB_runPartyScreen(), STGDGLAB_runSlotScreen(), STGDGLAB_showEntryList(), STGDGLAB_showEntryPanel(), STGDGLAB_showMenuPage(), STGDGLAB_showPartyPage(), STGDGLAB_showSlotScreen(), STGDGLAB_updateEntryList(), STGDGLAB_updateEntryPanel(), STGDGLAB_updateLab(), STGDGLAB_updatePartyScreen(), STGDGLAB_updateRecipeScreen(), STGDGLAB_updateSkillPanel(), STGMCARD_createScreen(), STGMCARD_fillSave(), STGMCARD_updateScreen(), STGTRAIN_answerToTrain(), STGTRAIN_createResult(), STGTRAIN_createScreen(), STGTRAIN_drawScreen(), STGTRAIN_getAccessoryBonus(), STGTRAIN_lowerStat(), STGTRAIN_pickIntensity(), STGTRAIN_raiseMaxHpMp(), STGTRAIN_raiseResistance(), STGTRAIN_raiseStat(), STGTRAIN_runScreen(), STGTRAIN_showBattleStats(), STGTRAIN_showStatChanges(), STGTRAIN_showTp(), STGTRAIN_showVitals(), STGTRAIN_startBonusTry(), STGTRAIN_takeBonusTry(), STGTRAIN_updateMenu(), STGTRAIN_updateResult(), STGTRAIN_updateScreen(), STITSHOP_chooseBuyQuantity(), STITSHOP_chooseEquipPartner(), STITSHOP_closeSellTotal(), STITSHOP_compareEquip(), STITSHOP_computeStats(), STITSHOP_confirmBuy(), STITSHOP_confirmSell(), STITSHOP_createShop(), STITSHOP_drawStatsPage(), STITSHOP_endBuyTotal(), STITSHOP_endEquipped(), STITSHOP_equip(), STITSHOP_fillPartnerRows(), STITSHOP_openSellQuantity(), STITSHOP_pickBuyItem(), STITSHOP_runShop(), STITSHOP_showEquipMarker(), STITSHOP_showItemRows(), STITSHOP_showMoney(), STITSHOP_showPartnerStats(), STITSHOP_startBuyQuantity(), STITSHOP_updateInfo(), STITSHOP_updateShop(), STPLNMET_stepScreen(), STPLNMET_updateScreen(), STSTATUS_animateItemPortraits(), STSTATUS_animateSortPortraits(), STSTATUS_animateTechPortraits(), STSTATUS_answerDigivolveQuestion(), STSTATUS_chooseDemoOption(), STSTATUS_createEquipPanel(), STSTATUS_drawCardScreen(), STSTATUS_drawDemoScreen(), STSTATUS_drawDigivolvePanel(), STSTATUS_drawEquipPanel(), STSTATUS_drawItemScreen(), STSTATUS_drawMapScreen(), STSTATUS_drawSortScreen(), STSTATUS_drawStatusScreen(), STSTATUS_drawTechScreen(), STSTATUS_endCardScreen(), STSTATUS_equip(), STSTATUS_getArea(), STSTATUS_getChosenTech(), STSTATUS_getGameHalf(), STSTATUS_getTechHealing(), STSTATUS_listFieldTechs(), STSTATUS_previewStats(), STSTATUS_runDigivolvePanel(), STSTATUS_runStatusChoice(), STSTATUS_showBattleMessage(), STSTATUS_showCardPage(), STSTATUS_showChosenItem(), STSTATUS_showChosenPage(), STSTATUS_showDemoChoices(), STSTATUS_showDemoPage(), STSTATUS_showDigivolveChoices(), STSTATUS_showDigivolveSlots(), STSTATUS_showDigivolveStats(), STSTATUS_showEquipList(), STSTATUS_showEquipment(), STSTATUS_showItemPage(), STSTATUS_showMoney(), STSTATUS_showPartnerEquipment(), STSTATUS_showPartnerSlots(), STSTATUS_showPartnerStats(), STSTATUS_showPartnerTech(), STSTATUS_showSlotItem(), STSTATUS_showSortPage(), STSTATUS_showStatusPage(), STSTATUS_showTechCost(), STSTATUS_showTechPage(), STSTATUS_swapMembers(), STSTATUS_updateCardScreen(), STSTATUS_updateDemoScreen(), STSTATUS_updateDigivolvePanel(), STSTATUS_updateItemScreen(), STSTATUS_updateSortScreen(), STSTATUS_updateStatusScreen(), STSTATUS_updateTechScreen(), STSTATUS_useItem(), STSTATUS_useTech(), takePartyDepth(), textCodePlayerName(), textWindowInsertPlayerName(), unequipItem(), updateDarkness(), updateEvent9015(), updateGlow(), updateInn(), updateInnMenu(), updateModeFlags(), updateModeTask(), updatePlayTime(), updateStage(), updateStage(), updateTimer(), vsyncCallback(), warpAway(), WFIGHTMN_blast(), WFIGHTMN_cancelBlast(), WFIGHTMN_chargeGauge(), WFIGHTMN_checkEquip(), WFIGHTMN_digidevolve(), WFIGHTMN_endAutoRecover(), WFIGHTMN_endBattle(), WFIGHTMN_initFighters(), WFIGHTMN_markFought(), WFIGHTMN_markPicked(), WFIGHTMN_rollAmbush(), and WFIGHTMN_tag().