The Dink Network

PaladinEmet's Profile

knightg.gif
PaladinEmet
Peasant He/Him United States
The Truth is out there 
Emet: Paladin of Truth

Private Message

2009-12-31 13:32:24
knightg.gif
PaladinEmet
Peasant He/Him United States
The Truth is out there 
heres the script: (edef)

void main(void)
{
int &htarg = get_rand_sprite_with_this_brain(9, ¤t_sprite);
if (&htarg = 0)
{
&htarg = get_rand_sprite_with_this_brain(10, ¤t_sprite);
}
int &targ = 0;
sp_custom("lvl", ¤t_sprite, 9)
int &lvl = sp_custom("lvl", ¤t_sprite, -1)
int &var1 = 0;
//basic stats
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 1);
sp_target(¤t_sprite, &htarg);
sp_nohit(¤t_sprite, 0);
sp_distance(¤t_sprite, 60);
sp_timing(¤t_sprite, 0);
//power stats
int &stat = &lvl;
&stat /= 2;
int &mhp = 10
&mhp *= &lvl;
int &hp = &mhp
sp_custom("mhp", ¤t_sprite, &mhp)
sp_defense(¤t_sprite, &stat);
sp_strength(¤t_sprite, &stat);
sp_hitpoints(¤t_sprite, &mhp);
//spells
spells:
set_callback_random("close", 500, 1000);
set_callback_random("range", 500, 2000);
}

void close(void)
{
int &add = &stat;
&add += &lvl;
//action
heal();
if (&lvl > 2)
{
heal();
}
if (&lvl > 5)
{
heal();
}
if (&lvl > 8)
{
heal();
}
}

void heal(void)
{
&targ = ¤t_sprite;
if (&htarg > 1)
{
&var1 = random(2, 1);
if (&var1 == 1)
{
&targ = ¤t_sprite;
}
if (&var1 == 2)
{
&targ = &htarg
}
}
&var1 = sp_custom("mhp", &targ, -1);
&var1 *= 10
int &hp = sp_hitpoints(&targ, -1)
&hp += &add;
//avoid going over maxlife
if (&hp > &var1)
{
&hp = &var1;
}
sp_hitpoints(&targ, &hp)
}

void range(void)
{

&mholdx = sp_x(¤t_sprite, -1);
&mholdy = sp_y(¤t_sprite, -1);


&mholdx += 30;
&junk = create_sprite(&mholdx, &mholdy, 11, 163, 1);

int &str = &lvl
&str += &stat
int &mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
sp_brain_parm(&mshadow, &junk);
sp_que(&mshadow, -500);
sp_strength(&junk, &str)
sp_brain_parm(&junk, 1);
sp_brain_parm2(&junk, &mshadow);
sp_script(&junk, "scope")

}

void hit(void)
{
&hp = sp_hitpoints(¤t_sprite, -1)
say("&hp hp", ¤t_sprite)
goto spells;
}

it should at least be healing itself, but it doesn't
'scope' is the script used to target and guide the missile. I applied it to an axe and it works. I adapted it from mousdink's homing fireballs.

scope also handles detting dink's xy, getting targets xy, etc.

it's as if my set_callback_random is being completely ignored