Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
computer.c File Reference

The fourth object of CARDGAME.PRO (see effect_script.c), from CARDGAME_checkComputerCondition (USA): its rodata starts at 0x80083294, 4 bytes past a multiple of 8. More...

Include dependency graph for computer.c:

Go to the source code of this file.

Functions

static s32 lastPlayColor (CardBattle *battle)
 The colour of the last card played.
 
s32 CARDGAME_checkComputerCondition (CardBattle *battle, CardScreen *screen, s32 id)
 Checks the condition id (0x70 to 0x96) of a card for the computer; returns 1 if it holds.
 
s32 CARDGAME_scoreHand (CardBattle *battle, s32 side, s32 mask)
 Scores the cards in a side's slots, counting runs of the same card.
 
void CARDGAME_keepLowestSlot (CardBattle *battle, s32 side)
 Keeps the flag (effectStep.eligible) only on side's flagged slot that CARDGAME_scoreHand rates lowest.
 
s32 CARDGAME_targetFlaggedSlot (CardBattle *battle, s32 side)
 The next play targets (target) side's first flagged slot; whether there is one.
 
s32 CARDGAME_targetColor3Slot (CardBattle *battle, s32 side)
 CARDGAME_targetFlaggedSlot among side's flagged slots of colour 3.
 
s32 CARDGAME_targetColor4Slot (CardBattle *battle, s32 side)
 CARDGAME_targetFlaggedSlot among side's flagged slots of colour 4.
 
s32 CARDGAME_isSlotWithin (CardBattle *battle, s32 side, s32 index, s32 value)
 Whether side's slot index is flagged and its hp is at most value.
 
s32 CARDGAME_unflagSlotsOver (CardBattle *battle, s32 side, s32 value, s32 keep)
 Unflags side's slots whose hp is over value; when none is left, 1 (and the last one flagged again, unless keep)
 
s32 CARDGAME_pickLowestOpponentCard (CardBattle *battle)
 Picks the opponent's flagged card with the lowest CardImage.rank, the strongest; 1 if there is one.
 
s32 CARDGAME_getCardLimit (CardBattle *battle, s32 id)
 The limit card id sets for CARDGAME_compareCards (0 for most)
 
s32 CARDGAME_getCardBonus (CardBattle *battle, s32 id)
 The bonus card id gives in CARDGAME_compareCards (0 for most)
 
s32 CARDGAME_pickComputerTarget (CardBattle *battle, CardScreen *screen, s32 id)
 The computer's target for card id: a slot picked by the card's rule; 1 once there is one.
 
s32 CARDGAME_compareCards (CardBattle *battle, s32 id1, s32 id2, s32 flip)
 Compares two cards by the rule of the current play; returns 1 if the second one wins.
 
s32 CARDGAME_findOpponentHandKind (CardBattle *battle, s32 kind)
 The index of the first card of the opponent's hand of opponentPlans kind (its count when none)
 
s32 CARDGAME_pickComputerCard (CardBattle *battle, CardScreen *screen)
 Picks the computer's next card, flagging it in effectStep.marked; returns 1 if one was found.
 

Detailed Description

The fourth object of CARDGAME.PRO (see effect_script.c), from CARDGAME_checkComputerCondition (USA): its rodata starts at 0x80083294, 4 bytes past a multiple of 8.

Definition in file computer.c.

Function Documentation

◆ lastPlayColor()

static s32 lastPlayColor ( CardBattle *  battle)
inlinestatic

The colour of the last card played.

Definition at line 7 of file computer.c.

Referenced by CARDGAME_checkComputerCondition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_checkComputerCondition()

s32 CARDGAME_checkComputerCondition ( CardBattle *  battle,
CardScreen *  screen,
s32  id 
)

Checks the condition id (0x70 to 0x96) of a card for the computer; returns 1 if it holds.

Definition at line 17 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_scoreHand()

s32 CARDGAME_scoreHand ( CardBattle *  battle,
s32  side,
s32  mask 
)

Scores the cards in a side's slots, counting runs of the same card.

Definition at line 143 of file computer.c.

Referenced by CARDGAME_createBattle(), CARDGAME_keepLowestSlot(), and CARDGAME_pickComputerCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_keepLowestSlot()

void CARDGAME_keepLowestSlot ( CardBattle *  battle,
s32  side 
)

Keeps the flag (effectStep.eligible) only on side's flagged slot that CARDGAME_scoreHand rates lowest.

Definition at line 243 of file computer.c.

Referenced by CARDGAME_compareCards(), and CARDGAME_pickComputerTarget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_targetFlaggedSlot()

s32 CARDGAME_targetFlaggedSlot ( CardBattle *  battle,
s32  side 
)

The next play targets (target) side's first flagged slot; whether there is one.

Definition at line 272 of file computer.c.

Referenced by CARDGAME_compareCards(), CARDGAME_pickComputerTarget(), CARDGAME_targetColor3Slot(), and CARDGAME_targetColor4Slot().

Here is the caller graph for this function:

◆ CARDGAME_targetColor3Slot()

s32 CARDGAME_targetColor3Slot ( CardBattle *  battle,
s32  side 
)

CARDGAME_targetFlaggedSlot among side's flagged slots of colour 3.

Definition at line 293 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_targetColor4Slot()

s32 CARDGAME_targetColor4Slot ( CardBattle *  battle,
s32  side 
)

CARDGAME_targetFlaggedSlot among side's flagged slots of colour 4.

Definition at line 315 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_isSlotWithin()

s32 CARDGAME_isSlotWithin ( CardBattle *  battle,
s32  side,
s32  index,
s32  value 
)

Whether side's slot index is flagged and its hp is at most value.

Definition at line 337 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the caller graph for this function:

◆ CARDGAME_unflagSlotsOver()

s32 CARDGAME_unflagSlotsOver ( CardBattle *  battle,
s32  side,
s32  value,
s32  keep 
)

Unflags side's slots whose hp is over value; when none is left, 1 (and the last one flagged again, unless keep)

Definition at line 348 of file computer.c.

Referenced by CARDGAME_compareCards(), and CARDGAME_pickComputerTarget().

Here is the caller graph for this function:

◆ CARDGAME_pickLowestOpponentCard()

s32 CARDGAME_pickLowestOpponentCard ( CardBattle *  battle)

Picks the opponent's flagged card with the lowest CardImage.rank, the strongest; 1 if there is one.

Definition at line 386 of file computer.c.

Referenced by CARDGAME_pickComputerTarget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_getCardLimit()

s32 CARDGAME_getCardLimit ( CardBattle *  battle,
s32  id 
)

The limit card id sets for CARDGAME_compareCards (0 for most)

Definition at line 413 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the caller graph for this function:

◆ CARDGAME_getCardBonus()

s32 CARDGAME_getCardBonus ( CardBattle *  battle,
s32  id 
)

The bonus card id gives in CARDGAME_compareCards (0 for most)

Definition at line 435 of file computer.c.

Referenced by CARDGAME_compareCards().

Here is the caller graph for this function:

◆ CARDGAME_pickComputerTarget()

s32 CARDGAME_pickComputerTarget ( CardBattle *  battle,
CardScreen *  screen,
s32  id 
)

The computer's target for card id: a slot picked by the card's rule; 1 once there is one.

Definition at line 461 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_compareCards()

s32 CARDGAME_compareCards ( CardBattle *  battle,
s32  id1,
s32  id2,
s32  flip 
)

Compares two cards by the rule of the current play; returns 1 if the second one wins.

Definition at line 517 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CARDGAME_findOpponentHandKind()

s32 CARDGAME_findOpponentHandKind ( CardBattle *  battle,
s32  kind 
)

The index of the first card of the opponent's hand of opponentPlans kind (its count when none)

Definition at line 603 of file computer.c.

Referenced by CARDGAME_pickComputerCard().

Here is the caller graph for this function:

◆ CARDGAME_pickComputerCard()

s32 CARDGAME_pickComputerCard ( CardBattle *  battle,
CardScreen *  screen 
)

Picks the computer's next card, flagging it in effectStep.marked; returns 1 if one was found.

Definition at line 615 of file computer.c.

Referenced by playComputerTurn().

Here is the call graph for this function:
Here is the caller graph for this function: