Prev: CF9E Up: Map Next: CFD2
CFB2: Test Projectile Hit
Used by the routine at RunHelperSource.
Tests if either of the two projectiles of the player touches an object.
Input
IX Record of the object
Output
F Zero flag set if a projectile touches the object
Test the first projectile.
TestProjectileHit CFB2 LD D,$01 Set the result to 01, as nothing has been hit.
CFB4 LD IY,$A7AF Start with the first of the projectiles, ObjectsTable_Projectiles.
CFB8 LD A,(IY+$00) Fetch the type of the projectile.
CFBB AND %11111000 Keep only the bits of the type that tell the kinds of object apart.
CFBD CALL TestCreatureHit_Projectile Call TestCreatureHit_Projectile to test it, as long as there is a projectile.
CFC0 LD A,D Fetch the result.
CFC1 AND A Return if the projectile touches the object.
CFC2 RET Z
Test the second projectile.
CFC3 LD IY,$A7CF Move on to the second of the projectiles, ObjectsTable_SecondProjectile.
CFC7 LD A,(IY+$00) Fetch the type of the projectile.
CFCA AND %11111000 Keep only the bits of the type that tell the kinds of object apart.
CFCC CALL TestCreatureHit_Test Call TestCreatureHit_Test to test it.
CFCF LD A,D Fetch the result.
CFD0 AND A Test it.
CFD1 RET Return.
Prev: CF9E Up: Map Next: CFD2