The Dink Network

Reply to Re: attacking

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:
 
 
May 22nd 2003, 04:08 PM
old.gif
You mean when the enemies attack dink but also hit another one near dink?

Here is a little script to prevent that...

( put it into the creatures script )

void main(void)
{
int &calc;
int &calcb;
//THE REST
}

void hit(void)
{
&calc = sp_strength(&current_sprite, -1);

if (&enemy_sprite == 1) goto skip;

&calcb = sp_hitpoints(&current_sprite, -1);
&calcb += &calc;
sp_hitpoints(&current_sprite, &calcb);

SKIP;
}

When bonca A hits bonca B, then the damage of bonca A is added to bonca B's health. So he is healed....

I use this in "War Planet" when the enemy shoots with mortars and other bombs.