Prev: 27770 Up: Map Next: 27815
27784: 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 27784 LD A,(24367) Fetch the number of ingredients which the active player needs.
27787 SUB B Subtract the number of ingredients taken.
27788 JR C,TakeIngredients_None Jump to TakeIngredients_None if more are being taken away than are needed.
27790 DAA Adjust A to BCD.
27791 LD (24367),A Update the number of ingredients needed (ActivePlayer_IngredientsNeeded).
27794 AND A Are there any more ingredients needed?
27795 CALL Z,ConvertActors Call ConvertActors if there are not, to clear away the actors.
TakeIngredients_Print 27798 LD HL,20652 Point HL at the screen address in the mixing bowl.
27801 LD DE,24367 Point DE at ActivePlayer_IngredientsNeeded.
27804 LD B,1 Set the number of bytes to print to 1.
27806 JP PrintScore_Loop Print the number using PrintScore_Loop.
TakeIngredients_None 27809 XOR A Set the number of ingredients needed to 0.
This entry point is used by the routine at CatchNasty.
TakeIngredients_Store 27810 LD (24367),A Update the number of ingredients needed (ActivePlayer_IngredientsNeeded).
27813 JR TakeIngredients_Print Jump to TakeIngredients_Print.
Prev: 27770 Up: Map Next: 27815