Prev: 6C7A Up: Map Next: 6CA7
6C88: Take Ingredients
Used by the routine at DrawPantry.
Takes some away from the number of ingredients which are needed, and shows the new number in the mixing bowl. The number is never less than zero. When it reaches zero the actors which are left are cleared away (see ConvertActors).
Input
B Number of ingredients to take away
TakeIngredients 6C88 LD A,($5F2F) Fetch the number of ingredients which the active player needs.
6C8B SUB B Subtract the number of ingredients taken.
6C8C JR C,TakeIngredients_None Jump to TakeIngredients_None if more are being taken away than are needed.
6C8E DAA Adjust A to BCD.
6C8F LD ($5F2F),A Update the number of ingredients needed (ActivePlayer_IngredientsNeeded).
6C92 AND A Are there any more ingredients needed?
6C93 CALL Z,ConvertActors Call ConvertActors if there are not, to clear away the actors.
TakeIngredients_Print 6C96 LD HL,$50AC Point HL at the screen address in the mixing bowl.
6C99 LD DE,$5F2F Point DE at ActivePlayer_IngredientsNeeded.
6C9C LD B,$01 Set the number of bytes to print to 01.
6C9E JP PrintScore_Loop Print the number using PrintScore_Loop.
TakeIngredients_None 6CA1 XOR A Set the number of ingredients needed to 00.
This entry point is used by the routine at CatchNasty.
TakeIngredients_Store 6CA2 LD ($5F2F),A Update the number of ingredients needed (ActivePlayer_IngredientsNeeded).
6CA5 JR TakeIngredients_Print Jump to TakeIngredients_Print.
Prev: 6C7A Up: Map Next: 6CA7