The Dink Network

Reply to Re: Missile brain Question

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:
 
 
December 21st 2009, 01:34 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Now I've got problems again. Is there any way of hurting all monsters? I was thinking about counting the number of monster with brain 9 and then doing some loop which run the hurt that number of times... But I need some way of detecting which monsters that I've already cast the spell on.

Here's the script, if anyone could think of a way to damage all monsters, please tell me. Oh, and the high damage is temporary... And the skill will be disabled while fighting bosses.

void use(void)
{
	// Dink's cordinates
	&dx = sp_x(1, -1);
	&dy = sp_y(1, -1);
	//Create animation for effect only:
	&ani = create_sprite(&dx, &dy, 7, 899, 1);
	sp_seq(&ani, 899);
	//Set the damage
	&damage = 1000;
	&tar = get_sprite_with_this_brain(9, &current_sprite);
	// Target's cordinates
	&tarx = sp_x(&tar, -1);
	&tary = sp_y(&tar, -1);
	//Now, is the spirite left or right of dink?
	If(&tarx > &dx)
	{
		//sprite is right of dink
		//How far?
		&tarx -= &dx;
		//Now, let's lower the damgae by that!
		&damage -= &tarx;
	}
	else
	{
		//sprite is left of dink
		&dx -= &tarx;
		&damage -= &dx;
	}
	//So far, so good, Let's fix the Y-Cordinates too.
	If(&tary > &dy)
	{
		//sprite is under dink.
		&tary -= &dy;
		&damage -= &tary;
	}
	else
	{
		//sprite is over Dink
		&dy -= &tary;
		&damage -= &dy;
	}
	//Now let's set a minimum damage,
	If(&damage < &magic)
	{
		&damage = &magic;
	}
	//And... Hurt him!
	hurt(&tar, &damage);
	&magic_level -= 500;
	draw_status();						
}
void arm(void)
{
	preload_seq(899);
	&magic_cost = 1000;
	int &dis;
	int &tar;
	int &tarx;
	int &tary;
	int &dx;
	int &dy;
	int &damage;
	int &ani;
}
void disarm(void)
{
&magic_level = 0;
kill_this_task();
}
void pickup(void)
{
Debug("Player now owns this item.");
kill_this_task();
}

void drop(void)
{
Debug("Item dropped.");
kill_this_task();
}