Back to index

freedink-data  1.08.20080920
S1-CAVEM.c
Go to the documentation of this file.
00001 void main( void )
00002 {
00003 debug("Wizard see is &wizard_see..");
00004 
00005  if(&wizard_see < 2)
00006  {
00007   sp_active(&current_sprite, 0);
00008   return;
00009  }
00010  //fixed Pap's error here!!!
00011 
00012  if(&wizard_see > 2)
00013  {
00014 
00015   sp_active(&current_sprite, 0);
00016   return;
00017  }
00018  int &mcounter;
00019  int &bot;
00020  preload_seq(541);
00021  preload_seq(543);
00022  preload_seq(547);
00023  preload_seq(549);
00024  preload_seq(531);
00025  preload_seq(533);
00026  preload_seq(537);
00027  preload_seq(539);
00028  sp_distance(&current_sprite, 50);
00029  sp_base_attack(&current_sprite, 540);
00030  sp_base_walk(&current_sprite, 530);
00031  sp_strength(&current_sprite, 5);
00032  sp_touch_damage(&current_sprite, 2);
00033  sp_hitpoints(&current_sprite, 35);
00034  sp_exp(&current_sprite, 100);
00035  int &mcrap = sp(36);
00036  if (&mcrap > 0)
00037          {
00038          //duck is still alive, lets have the monster target it for fun     
00039          sp_target(&current_sprite, &mcrap);
00040          } else
00041          {
00042          //if no duck, Dink becomes the new target!
00043           sp_target(&current_sprite, 1);
00044          }
00045 
00046  playmidi("battle.mid");
00047  &bot = random(2,1);
00048  if (&bot == 1)
00049  {
00050   &bot = random(3,1);
00051   if (&bot == 1)
00052   {
00053    say_stop("`3Who dares enter my cave?", &current_sprite);
00054   }
00055   if (&bot == 2)
00056   {
00057    say_stop("`3I sense someone in my domain.", &current_sprite);
00058   }
00059   if (&bot == 3)
00060   {
00061    say_stop("`3I feel I'm threatened ...", &current_sprite);
00062   }
00063  }
00064 }
00065 
00066 void die( void )
00067 {
00068 freeze(&current_sprite);
00069 sp_seq(&current_sprite, 0);
00070 &wizard_see = 3;
00071 playsound(29, 17050,0,0, 0);
00072 //make mini explosions?
00073 playmidi("wanderer.mid");
00074 
00075 wait(2000);
00076 //draw dead body
00077 //kill_this_task();
00078 }
00079 
00080 void hit( void )
00081 {
00082 playsound(29, 22050,0,&current_sprite, 0);
00083 }
00084 
00085 void attack( void )
00086 {
00087 playsound(31, 22050,0,&current_sprite, 0);
00088 &mcounter = random(4000,0);
00089 sp_attack_wait(&current_sprite, &mcounter);
00090 }
00091