Reply to Re: How to check what hit it
If you don't have an account, just leave the password field blank.
Cheap hack, I'm sure there are more stylish ways of doing it.
void hit( void )
{
int &crap = sp_pseq(&missle_source, -1);
if (&crap == &arrow_seq)
{
//Replace &arrow_seq by the seq number of the arrow
say("Eeek! An arrow!");
}
}
}
This will also react to arrows shot by enemies. Maybe &enemy_sprite can fix that up. The DinkC reference says it's 1 when hit by a missile. I have no idea if it's also 1 when hit by a missile made by an enemy (the 'owner' of the missile is usually in sp_brain_parm())
I don't know how FIAT does it, but it has a script that checks if it got hit by an arrow, then does something; or hit by an axe, then does something else.
void hit( void )
{
int &crap = sp_pseq(&missle_source, -1);
if (&crap == &arrow_seq)
{
//Replace &arrow_seq by the seq number of the arrow
say("Eeek! An arrow!");
}
}
}
This will also react to arrows shot by enemies. Maybe &enemy_sprite can fix that up. The DinkC reference says it's 1 when hit by a missile. I have no idea if it's also 1 when hit by a missile made by an enemy (the 'owner' of the missile is usually in sp_brain_parm())
I don't know how FIAT does it, but it has a script that checks if it got hit by an arrow, then does something; or hit by an axe, then does something else.







