The Dink Network

Reply to Re: Immunity to Certain Weapons?

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:
 
 
February 6th 2009, 09:54 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Through testing this, I've noticed that if you punch the target too fast it can be locked in at 0 hitpoints. To avoid this, spawning another script to wait() and reset the hitpoints should do the trick.

You should also check for &missle_source as well so your projectile spells will be effective even when fists are equipped.


//enemy script
void hit ()
{
if (&cur_weapon == 1)
{
if (&missle_source == 1)
{
&save_x = &current_sprite;
&save_y = sp_hitpoints(&current_sprite,-1);
spawn("script");
}
}
}

//spawned script
void main ()
{
int &en = &save_x;
int &hp = &save_y;
sp_hitpoints(&en,0);
wait(1);
wait(1);
sp_hitpoints(&en,&hp);
}