The Dink Network

Reply to Re: Help Needed With D-MOd!!!

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:
 
 
November 14th 2009, 10:10 PM
pq_knight.gif
ExDeathEvn
Peasant He/Him New Zealand rumble
"Skinny Legend" 
Hang on, this would be easier.

void main(void)
{
 //lock the screen straight up when the player enters
 screenlock(1);

 //set the brain and speed of the pillbug
 sp_brain(&current_sprite, 9);
 sp_speed(&current_sprite, 1);

 //set the exp the player will receive when they kill it
 sp_exp(&current_sprite, 5);

 //set the base walk and base death
 sp_base_walk(&current_sprite, 130);
 sp_base_death(&current_sprite, 140);

 //set the touch damage of the pillbug
 sp_touch_damage(&current_sprite, 1);

 //set the hitpoints of the pillbug
 sp_hitpoints(&current_sprite, 8);

 //preload the pillbugs graphics
 preload_seq(131);
 preload_seq(133);
 preload_seq(141);
 preload_seq(143);

 //give a random chance of the pillbug locking onto the player straight up
 if (random(2,1) == 1)
 {
 sp_target(&current_sprite, 1);
 }
}

void hit(void)
{
 //This is the hit sequence, it is run when something hits me
 //Lock onto the dink that just hit the pillbug
 sp_target(&current_sprite, &enemy_sprite);

 //and play the pillbug sound
 playsound(30, 21050, 4000, &current_sprite, 0);
}

void die(void)
{
 //This is the die procedure, it is run when I die
 //let's check if there is any other brain 9 monsters left on the screen
 if (get_sprite_with_this_brain(9, &current_sprite) == 0)
 {
  //there isn't, so let's unlock the screen
  screenlock(0);

  //and play the unlock screen sound
  playsound(43, 22050,0,0,0);

  //Now if you want Dink to say something when the screen is unlocked, add it here
freeze(1);
say_stop("MAKE ME SAY SOMETHING!!", 1);
unfreeze(1);
 }

 //This make me appear back after 5 minutes, yay
 int &hold = sp_editor_num(&current_sprite);
 if (&hold != 0)
 editor_type(&hold, 6); 

 //this will randomly choose a small reward to appear, like a small heart
 &save_x = sp_x(&current_sprite, -1);
 &save_y = sp_y(&current_sprite, -1);
 external("emake","small");
}


You'd just need to have a second version of this script without the speech part in there if you wanted to use this to screenlock any other pillbug screens.