Back to index

freedink-data  1.08.20080920
s7-boss.c
Go to the documentation of this file.
00001 //boss brain
00002 
00003 void main( void )
00004 {
00005 
00006 int &fsave_x;
00007 int &kcrap;
00008 int &dam;
00009 int &fsave_y;
00010 int &spark;
00011 int &speed = 1;
00012 int &resist;
00013 int &mcounter;
00014 int &mtarget;
00015 sp_brain(&current_sprite, 10);
00016 sp_timing(&current_sprite, 33);
00017 sp_speed(&current_sprite, 1);
00018 sp_nohit(&current_sprite, 0);
00019 sp_exp(&current_sprite, 0);
00020 sp_base_walk(&current_sprite, 580);
00021 sp_touch_damage(&current_sprite, 30);
00022 sp_hitpoints(&current_sprite, 300);
00023 sp_defense(&current_sprite, 25);
00024 
00025  sp_target(&current_sprite, 1);
00026 
00027 }
00028 
00029 void attack( void )
00030 {
00031     unfreeze(&current_sprite);
00032         &mcounter = random(4000,2000);
00033         sp_attack_wait(&current_sprite, &mcounter);
00034 
00035 
00036 
00037         &kcrap = sp_target(&current_sprite, -1);
00038 &fsave_x = sp_x(&kcrap, -1);
00039 &fsave_y = sp_y(&kcrap, -1);
00040 
00041 &resist = random(2, 1);
00042 if (&resist == 1)
00043   {
00044    //cast some kind of bomb
00045     freeze(&current_sprite);
00046     sp_speed(&current_sprite, 0);
00047 //    sp_dir(&current_sprite, 0);
00048       sp_seq(&current_sprite, 0);
00049       sp_frame(&current_sprite, 0);
00050       sp_pseq(&current_sprite, 580);
00051       sp_pframe(&current_sprite, 1);
00052       wait(500);
00053       &save_x = sp_x(1, -1);
00054       &save_y = sp_y(1, -1);
00055       sp_pseq(&current_sprite, 580);
00056       sp_pframe(&current_sprite, 2);
00057       wait(200);
00058       sp_pseq(&current_sprite, 580);
00059       sp_pframe(&current_sprite, 1);
00060       wait(200);
00061       sp_pseq(&current_sprite, 580);
00062       sp_pframe(&current_sprite, 2);
00063       wait(200);
00064       sp_pseq(&current_sprite, 580);
00065       sp_pframe(&current_sprite, 1);
00066       wait(200);      
00067         say("`4<Casts explosion>", &current_sprite);
00068         playsound(31, 12050,0,0, 0);
00069         spawn("dam-bom2");
00070     sp_brain(&current_sprite, 10);
00071     sp_speed(&current_sprite, &speed);
00072     unfreeze(&current_sprite);
00073 
00074   return;
00075   }
00076 &resist = random(40, 1);
00077 
00078 //if NPC, turn off resist option
00079 if (&kcrap != 1)
00080 &resist = 100000;
00081 
00082 if (&resist > &magic)
00083         {
00084         say("`4<Casts greater harm>", &current_sprite);
00085 
00086         playsound(31, 12050,0,0, 0);
00087         hurt(&kcrap, 30);
00088 
00089         &fsave_y -= 29;
00090         &spark = create_sprite(&fsave_x, &fsave_y, 7, 70, 1);
00091         sp_seq(&spark, 70);
00092         sp_que(&spark, -70);
00093         sp_speed(&spark, 5);
00094         return;
00095         }
00096 
00097         playsound(31, 44050,0,0, 0);
00098         &fsave_y -= 29;
00099         int &spark = create_sprite(&fsave_x, &fsave_y, 7, 166, 1);
00100         sp_seq(&spark, 166);
00101         sp_que(&spark, -70);
00102         say("Magic resisted.", &kcrap);
00103 }
00104 
00105 void hit( void )
00106 {
00107 playsound(46, 3050, 4000, &current_sprite, 0);
00108     sp_speed(&current_sprite, &speed);
00109 
00110     sp_brain(&current_sprite, 10);
00111    unfreeze(&current_sprite);
00112 
00113 
00114 &dam = sp_hitpoints(&current_sprite, -1);
00115 
00116 if (&dam < 270)
00117  {
00118   sp_timing(&current_sprite, 0);
00119    sp_speed(&current_sprite, 2);
00120    &speed = 2;
00121   sp_frame_delay(&current_sprite, 60);
00122  }
00123 
00124 
00125 if (&dam < 200)
00126  {
00127    &speed = 3;
00128    sp_speed(&current_sprite, 3);
00129   sp_frame_delay(&current_sprite, 50);
00130 
00131   }
00132 
00133 if (&dam < 100)
00134  {
00135    &speed = 4;
00136    sp_speed(&current_sprite, 4);
00137   sp_frame_delay(&current_sprite, 40);
00138 
00139   }
00140 
00141 if (&dam < 15)
00142  {
00143    &speed = 5;
00144    sp_speed(&current_sprite, 5);
00145   sp_frame_delay(&current_sprite, 30);
00146  
00147   }
00148 
00149 &dam = random(2,1);
00150 
00151         if (&dam == 1)
00152         return;
00153 
00154 &dam = sp_hitpoints(&current_sprite, -1);
00155 
00156 if (&dam < 6)
00157   {
00158    say("`%Watch Conan O'brien!", &CURRENT_SPRITE);
00159    return;
00160   }
00161 
00162 if (&dam < 15)
00163   {
00164    say("`%MOTHER!!!!!!!!!!", &CURRENT_SPRITE);
00165    return;
00166   }
00167 
00168 
00169 if (&dam < 50)
00170   {
00171    say("`%FEEL MY WRATH, SMALLWOOD!", &CURRENT_SPRITE);
00172    return;
00173   }
00174 
00175 if (&dam < 100)
00176   {
00177    say("`%I felt that.", &CURRENT_SPRITE);
00178   return;
00179   }
00180 
00181 
00182 
00183 if (&dam < 140)
00184   {
00185    say("`%Listen to the birds.. even they are calling for your heart.", &CURRENT_SPRITE);
00186   playsound(49, 22050, 0, &current_sprite, 0);
00187   return;
00188   }
00189 
00190 
00191 if (&dam < 160)
00192   {
00193    say("`%You'll be dead soon.", &CURRENT_SPRITE);
00194   return;
00195   }
00196 
00197 
00198 if (&dam < 180)
00199   {
00200    say("`%Nice shot.  It will be your last.", &CURRENT_SPRITE);
00201   return;
00202   }
00203 
00204 if (&dam < 200)
00205   {
00206    say("`%You are starting to annoy me now.", &CURRENT_SPRITE);
00207     return;
00208   }
00209 
00210 
00211 if (&dam < 240)
00212   {
00213    say("`%I could finish you now, but this rather amuses me.", &CURRENT_SPRITE);
00214   return;
00215   }
00216 
00217 
00218 if (&dam < 260)
00219   {
00220    say("`%It's kind of sad that you are going to die for nothing.", &CURRENT_SPRITE);
00221   return;
00222   }
00223 
00224 
00225 if (&dam < 280)
00226   {
00227    say("`%That kinda tickled.", &CURRENT_SPRITE);
00228   return;
00229   }
00230 
00231 
00232    say("`%You are just like me you know, Dink.", &CURRENT_SPRITE);
00233 
00234 //lock on to the guy who just hit us
00235 //playsound
00236 
00237 }
00238 
00239 void die( void )
00240 {
00241        //fix, must make it so that the monster isn't hit again.
00242         sp_nohit(&current_sprite, 1);
00243        
00244        &save_x = sp_x(&current_sprite, -1);
00245        &save_y = sp_y(&current_sprite, -1);
00246        say("EAT IT!", 1);
00247        add_exp(10000, &current_sprite);
00248        
00249        freeze(1);
00250        sp_brain(&current_sprite, 0);
00251        
00252        playsound(24, 22052, 0, 0, 0);
00253        int &mcrap = create_sprite(&save_x, &save_y, 7, 167, 1);
00254        sp_seq(&mcrap, 167);
00255        wait(100);
00256        
00257        
00258        playsound(24, 22052, 0, 0, 0);
00259        int &mcrap = create_sprite(&save_x, &save_y, 7, 167, 1);
00260        sp_seq(&mcrap, 167);
00261        wait(100);
00262        &save_x -= 40;
00263        &save_y -= 30;
00264        playsound(24, 22052, 0, 0, 0);
00265        int &mcrap = create_sprite(&save_x, &save_y, 7, 167, 1);
00266        sp_seq(&mcrap, 167);
00267        wait(100);
00268        
00269        &save_x += 80;
00270        &save_y += 60;
00271        
00272        playsound(24, 22052, 0, 0, 0);
00273        int &mcrap = create_sprite(&save_x, &save_y, 7, 167, 1);
00274        sp_seq(&mcrap, 167);
00275        wait(100);
00276        &save_x += 10;
00277        &save_y += 20;
00278        
00279        
00280        playsound(24, 22052, 0, 0, 0);
00281        int &mcrap = create_sprite(&save_x, &save_y, 7, 167, 1);
00282        sp_seq(&mcrap, 167);
00283        wait(100);
00284        &save_x -= 30;
00285        &save_y -= 60;
00286        
00287        playsound(24, 22052, 0, 0, 0);
00288        int &mcrap = create_sprite(&save_x, &save_y, 7, 167, 1);
00289        sp_seq(&mcrap, 167);
00290        wait(100);
00291        sp_brain_parm(&current_sprite, 5);
00292        sp_brain(&current_sprite, 12);
00293        script_attach(1000);
00294        wait(500);
00295        wait(2000);
00296 
00297        say_stop("Too bad I had to kill him, he seemed likable enough.", 1);
00298        wait(500);
00299        say_stop("My body is tingling!", 1);
00300        &life = &lifemax;
00301        wait(500);
00302        say_stop("I must now get back to Goodheart Castle and inform the King.", 1);
00303        unfreeze(1);
00304        &story = 15;
00305        
00306        //kill spawn from hell
00307        sp_kill(&current_sprite, 1);
00308        kill_this_task();
00309 }