Prev: 994B Up: Map Next: 9974
995B: Run Type 19 Behaviour
Behaviour code for objects of type 19 (see RunObjectBehaviour). Gives the object a random lifetime and, with a small chance, chases the player.
Input
IX Address of the object
RunType19Behaviour 995B LD A,($9BCB) Fetch the second byte of the random seed.
995E AND %00111111 Keep six bits.
9960 ADD A,$10 Add 10.
9962 LD (IX+$15),A Set the lifetime of the object.
9965 LD A,R Fetch a pseudo-random value from the refresh register.
9967 AND %00000011 Keep two bits.
9969 JP Z,ClearObjectSpeeds Jump to ClearObjectSpeeds if they are zero.
996C CALL ChasePlayer Chase the player.
996F RES 7,(IX+$16) Clear bit 7 of the third state byte of the object.
9973 RET Return.
Prev: 994B Up: Map Next: 9974