The Dink Network

Reply to Re: How to check what hit it

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
September 20th 2006, 10:56 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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.