The Dink Network

Reply to Problem with hitting

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:
 
 
October 6th 2011, 12:35 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
I borrowed the Dink boss script from Cloud Castle 2 and changed it into Dark Dink. I also changed the sword into plain fist. After some fiddling, it's working almost perfectly. However, whenever Dark Dink tries to punch me, he always misses. He might punch around a hundred times and should definitely hit me, but however, he never does, and I can't figure out why. No sound, no blood, no damage, absolutely nothing happens when he punches around. Can anybody help me with this, cause I can't see what's wrong with it. Here's the script:

// Dark Dink

void main( void )
{
screenlock(1);
playmidi("4.mid");
  int &mcounter;
  int &junk;
  sp_base_walk(&current_sprite, 940);
  sp_brain(&current_sprite, 9);
  sp_timing(&current_sprite, 1);
  sp_speed(&current_sprite, 2);
  sp_hitpoints(&current_sprite, 2000);
  sp_touch_damage(&current_sprite, 10);
  sp_strength(&current_sprite, 15);
SP_DEFENSE(&current_sprite, 5);
  sp_base_attack(&current_sprite, 950);
  sp_distance(&current_sprite, 70);
  sp_range(&current_sprite, 60);
  sp_target(&current_sprite, 1);
sp_exp(&current_sprite, 0);
  int &dinkx;
  int &dinky;
  int &knitx;
  int &knity;
  int &diff;
int &delay = 8000;
loop:
  wait(100);  
  &delay -= 100;
  if (&delay > 0)
    goto loop;
  &delay = 8000;

  &junk = random(500, 500);
  wait(&junk);
  if (&life < 1)
    goto loop;

  &dinkx = sp_x(&current_sprite, -1);
  &dinky = sp_y(&current_sprite, -1);
  &knitx = sp_x(1, -1);
  &knity = sp_y(1, -1);

  &junk = 0;

  &diff = &dinky;
  &diff -= &knity;
  if (&diff < 0)
    &diff *= -1; 
  if (&diff < 50)
  {
    if (&knitx > &dinkx>
    {
freeze(&current_sprite);
      sp_seq(&current_sprite, 966);
      sp_frame(&current_sprite, 1);
      sp_kill_wait(&current_sprite);
      sp_nocontrol(&current_sprite, 1);
      wait(100);
unfreeze(&current_sprite);
      &dinkx += 30;
      &junk = create_sprite(&dinkx, &dinky, 11, 516, 1);
      sp_seq(&junk, 506); 
      sp_dir(&junk, 6);
    } else
    {
freeze(&current_sprite);
      sp_seq(&current_sprite, 964);
      sp_frame(&current_sprite, 1);
      sp_kill_wait(&current_sprite);
      sp_nocontrol(&current_sprite, 1);
      wait(100);
unfreeze(&current_sprite);
      &dinkx -= 30;
      &junk = create_sprite(&dinkx, &dinky, 11, 514, 1);
      sp_seq(&junk, 504); 
      sp_dir(&junk, 4);
    }
  }
  
  if (&junk < 1)
  {
    &diff = &dinkx;
    &diff -= &knitx;
    if (&diff < 0)
      &diff *= -1; 
    if (&diff < 50)
    {
      if (&knity > &dinky>
      {
freeze(&current_sprite);
        sp_seq(&current_sprite, 962);
        sp_frame(&current_sprite, 1);
        sp_kill_wait(&current_sprite);
        sp_nocontrol(&current_sprite, 1);
        wait(100);
unfreeze(&current_sprite);
        &junk = create_sprite(&dinkx, &dinky, 11, 512, 1);
        sp_seq(&junk, 502); 
        sp_dir(&junk, 2);
      } else
      {
freeze(&current_sprite);
        sp_seq(&current_sprite, 968);
        sp_frame(&current_sprite, 1);
        sp_kill_wait(&current_sprite);
        sp_nocontrol(&current_sprite, 1);
        wait(100);
unfreeze(&current_sprite);
        &junk = create_sprite(&dinkx, &dinky, 11, 518, 1);
        sp_seq(&junk, 508); 
        sp_dir(&junk, 8);
      }
    }
  }

  if (&junk > 0)
  {
    playsound(17, 8000, 0, &junk ,0);
    sp_timing(&junk, 0);
    sp_speed(&junk, 6);
    sp_strength(&junk, 20);
    sp_flying(&junk, 1);
    sp_range(&junk, 20);
    sp_script(&junk, "dam-sfb");
    &mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
    sp_brain_parm(&mshadow, &junk);
    sp_que(&mshadow, -500);
    sp_nohit(&mshadow, 1);
    sp_brain_parm(&junk, &current_sprite);
    wait(500);
  }

  goto loop;
}

void hit( void )
{
oneloop:
int &klife = sp_hitpoints (&current_sprite, -1);
if (&klife < 1401)
{
freeze(1);
freeze(&current_sprite);
sp_touch_damage(&current_sprite, -1);
move_stop(&current_sprite, 8, 150, 1);
move_stop(&current_sprite, 2, 150, 1);
move_stop(&current_sprite, 4, 170, 1);
move_stop(&current_sprite, 6, 170, 1);
sp_dir(&current_sprite, 6);
say_stop("`%This isn't over!", &current_sprite);
wait(500);
	 int &flame = create_sprite(170, 150, 7, 167, 1);
	 sp_seq(&flame, 167);
	 playsound(24, 22052, 0, 0, 0);
	 int &flame = create_sprite(170, 150, 7, 167, 1);
	 sp_seq(&flame, 167);
	 playsound(24, 22052, 0, 0, 0);
  //remove rocks hardness and sprite
  sp_hard(&current_sprite, 1);
  draw_hard_map(&current_sprite);
  sp_active(&current_sprite, 0);
int &hold = sp_editor_num(&current_sprite);
  if (&hold != 0)
    {
     //this was placed by the editor, lets make it not come back
     editor_type(&hold, 1); 
     //kill food forever
    }
  //remove the cracks as well, as they would look silly now
sp_dir(1, 2);
say_stop("You can bet it ain't!", 1);
wait(1500);
say_stop("What was that all about?", 1);
wait(1500);
say_stop("Anyway, I gotta get to those blue knights and rescue Libby!", 1);
wait(500);
say_stop("I hope the word has spread about me rescuing the girls", 1);
say_stop("so that the guard will let me see the king.", 1);
&events = 4;
&exp += 200;
say("`%200 EXP GAINED", 1);
screenlock(0);
unfreeze(1);
}
else
{
playmidi("4.mid");
goto mainloop;
}
}

void attack( void )
{
  playsound(8, 8000, 0, 0, 0);
&mcounter = random(4000,0);
sp_attack_wait(&current_sprite, &mcounter);
  goto loop;
}