What is wrong with this script?
Basically, the i=1 to 4800 loop is failing.
Dink doesn't say anything after he is damaged, and he doen't lose health from the poison.
void main( void )
{
int &i;
//test for i being odd is taking 2 * (i / 2)
int &halfi;
//test of whether dink's been hit is checking if his health has changed
int &lifehold;
//"boolean"(0 or 1) poison variable
int &poisoned;
int &storyhold;
//borrowing a global for anti poison enemy bonuses
//some weapons scripts include:
//if (&story == 219) &strength += 10;
//and similar things
&storyhold = &story;
&story = 219;
&i = 1;
//Dink at beggining isn't damaged
&lifehold = &life;
//Dink at beggining isn't poisoned
&poisoned = 0;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 1);
sp_timing(¤t_sprite, 33);
sp_exp(¤t_sprite, 125);
sp_base_walk(¤t_sprite, 380);
sp_base_death(¤t_sprite, 380);
sp_defense(¤t_sprite, 3);
sp_touch_damage(¤t_sprite, 7);
sp_hitpoints(¤t_sprite, 70);
sp_target(¤t_sprite, 1);
freeze(¤t_sprite);
freeze(1);
say("'4I'm from the snake gang, and I want your money!", ¤t_sprite);
unfreeze(1);
unfreeze(¤t_sprite);
screenlock(1);
loophere:
if (&i < 999)
{
wait(250);
if (&life != &lifehold) &poisoned = 1;
if (&poisoned = 1)
{
&halfi = &i / 2;
&halfi *= 2;
//If dink is poisoned and i is even, take off life
if (&i == &halfi)
{
say("Argh, this poison is strong!", 1);
&life -= 1;
draw_status();
}
}
&i += 1;
goto loophere;
}
}
Dink doesn't say anything after he is damaged, and he doen't lose health from the poison.
void main( void )
{
int &i;
//test for i being odd is taking 2 * (i / 2)
int &halfi;
//test of whether dink's been hit is checking if his health has changed
int &lifehold;
//"boolean"(0 or 1) poison variable
int &poisoned;
int &storyhold;
//borrowing a global for anti poison enemy bonuses
//some weapons scripts include:
//if (&story == 219) &strength += 10;
//and similar things
&storyhold = &story;
&story = 219;
&i = 1;
//Dink at beggining isn't damaged
&lifehold = &life;
//Dink at beggining isn't poisoned
&poisoned = 0;
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 1);
sp_timing(¤t_sprite, 33);
sp_exp(¤t_sprite, 125);
sp_base_walk(¤t_sprite, 380);
sp_base_death(¤t_sprite, 380);
sp_defense(¤t_sprite, 3);
sp_touch_damage(¤t_sprite, 7);
sp_hitpoints(¤t_sprite, 70);
sp_target(¤t_sprite, 1);
freeze(¤t_sprite);
freeze(1);
say("'4I'm from the snake gang, and I want your money!", ¤t_sprite);
unfreeze(1);
unfreeze(¤t_sprite);
screenlock(1);
loophere:
if (&i < 999)
{
wait(250);
if (&life != &lifehold) &poisoned = 1;
if (&poisoned = 1)
{
&halfi = &i / 2;
&halfi *= 2;
//If dink is poisoned and i is even, take off life
if (&i == &halfi)
{
say("Argh, this poison is strong!", 1);
&life -= 1;
draw_status();
}
}
&i += 1;
goto loophere;
}
}