Routines |
Prev: 883C | Up: Map | Next: 896C |
Used by the routines at ChooseLocationOrTakeJob and Handler_SubGame.
|
||||||||
Check_AffordToFly | 894F | LD L,(IX+$08) | Fetch the players current location and store it in HL. | |||||
8952 | LD H,(IX+$09) | |||||||
8955 | LD DE,$0006 | Move HL by 0006 to point to the destination cost. | ||||||
8958 | ADD HL,DE | |||||||
8959 | LD E,(HL) | Load the cost of this destination into DE. | ||||||
895A | INC HL | |||||||
895B | LD D,(HL) | |||||||
895C | LD L,(IX+$0D) | Loads the active players cash balance into HL. | ||||||
895F | LD H,(IX+$0E) | |||||||
8962 | AND A | Subtract the cost of the destination from the active players cash balance. | ||||||
8963 | SBC HL,DE | |||||||
8965 | LD HL,$EFFA | Return if the player can afford the "cheapest" destination. | ||||||
8968 | RET NC | |||||||
Else, the player is stuck in their current destination. Set the flag for this.
|
||||||||
8969 | SET 5,(HL) | Set bit 5 ("Can't Afford To Fly") of *GameState_1. | ||||||
896B | RET | Return. |
Prev: 883C | Up: Map | Next: 896C |