Back to index

freedink-data  1.08.20080920
ITEM-B2.c
Go to the documentation of this file.
00001 //item massive bow (+8)
00002 
00003 void use( void )
00004 {
00005         activate_bow();
00006         &mypower = get_last_bow_power();
00007 
00008          &mholdx = sp_x(1, -1);
00009          &mholdy = sp_y(1, -1);
00010 
00011         &mydir = sp_dir(1, -1);
00012 
00013 if (&mypower < 100)
00014 {
00015  return;
00016 }
00017 
00018 
00019 playsound(44, 22050,0,0,0);
00020 
00021 
00022   if (&mydir == 6)
00023   {
00024   &mholdx += 30;
00025   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 6);
00026   sp_dir(&junk, 6);
00027   }
00028 
00029   if (&mydir == 4)
00030   {
00031   &mholdx -= 30;
00032   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 4);
00033   sp_dir(&junk, 4);
00034   }
00035 
00036   if (&mydir == 2)
00037   {
00038   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 2);
00039   sp_dir(&junk, 2);
00040   }
00041 
00042   if (&mydir == 8)
00043   {
00044   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 8);
00045   sp_dir(&junk, 8);
00046   }
00047 
00048   if (&mydir == 9)
00049   {
00050   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 5);
00051   sp_dir(&junk, 9);
00052   }
00053   if (&mydir == 1)
00054   {
00055   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 1);
00056   sp_dir(&junk, 1);
00057   }
00058   if (&mydir == 7)
00059   {
00060   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 7);
00061   sp_dir(&junk, 7);
00062   }
00063 
00064   if (&mydir == 3)
00065   {
00066   &junk = create_sprite(&mholdx, &mholdy, 11, 25, 3);
00067   sp_dir(&junk, 3);
00068   }
00069 
00070   &mypower / 100;
00071   &temp = &strength;
00072   &temp / 5;
00073 
00074 
00075   if (&temp == 0)
00076     {
00077      &temp = 1;
00078     }
00079   &mypower * &temp;
00080   sp_timing(&junk, 0);
00081 
00082   if (&bowlore == 1)
00083 {
00084   &temp = random(2, 1);
00085 
00086   if (&temp == 1)
00087     {
00088      //critical hit
00089   &mypower * 3;
00090 playsound(44, 14050,0,0,0);
00091 
00092   say("`4* POWER SHOT *", 1);
00093     }
00094  }
00095   sp_speed(&junk, 6);
00096   
00097   sp_strength(&junk, &mypower);
00098   sp_range(&junk, 10);
00099   //this makes it easier to hit stuff
00100   sp_flying(&junk, 1);
00101   sp_script(&junk, "dam-a1");
00102   //when the fireball hits something, it will look to this script, this way
00103   //we can burn trees when appropriate
00104   &mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
00105   sp_brain_parm(&mshadow, &junk);
00106   sp_que(&mshadow, -500);
00107   sp_brain_parm(&junk, 1);
00108   sp_brain_parm2(&junk, &mshadow);
00109   sp_nohit(&mshadow, 1);
00110 
00111 
00112 return;
00113 }
00114 
00115 void disarm(void)
00116 {
00117 &strength -= 8;
00118 
00119 kill_this_task();
00120 }
00121 
00122 void arm(void)
00123 {
00124 &strength += 8;
00125 int &junk;
00126 int &mydir;
00127 int &mholdx;
00128 int &mholdy;
00129 int &mshadow;
00130 int &mypower;
00131 int &temp;
00132 init("load_sequence_now graphics\dink\bow\walk\d-bw1- 71 43 30 84 -14 -10 14 10");
00133 init("load_sequence_now graphics\dink\bow\walk\d-bw2- 72 43 29 86 -21 -10 19 10");
00134 init("load_sequence_now graphics\dink\bow\walk\d-bw3- 73 43 35 79 -13 -9 13 9");
00135 init("load_sequence_now graphics\dink\bow\walk\d-bw4- 74 43 41 79 -18 -12 20 12");
00136 
00137 init("load_sequence_now graphics\dink\bow\walk\d-bw6- 76 43 47 78 -23 -10 23 10");
00138 init("load_sequence_now graphics\dink\bow\walk\d-bw7- 77 43 46 71 -20 -10 20 10");
00139 init("load_sequence_now graphics\dink\bow\walk\d-bw8- 78 43 35 76 -15 -12 15 12");
00140 init("load_sequence_now graphics\dink\bow\walk\d-bw9- 79 43 46 78 -13 -9 13 9");
00141 
00142 init("load_sequence_now graphics\dink\bow\idle\d-bi2- 12 250 35 87 -17 -12 16 9");
00143 init("load_sequence_now graphics\dink\bow\idle\d-bi4- 14 250 37 77 -11 -12 16 10");
00144 init("load_sequence_now graphics\dink\bow\idle\d-bi6- 16 250 35 83 -15 -9 11 9");
00145 init("load_sequence_now graphics\dink\bow\idle\d-bi8- 18 250 33 70 -15 -12 15 9");
00146 
00147 init("load_sequence_now graphics\dink\bow\hit\d-ba2- 102 75 27 89 -23 -12 24 11");
00148 init("load_sequence_now graphics\dink\bow\hit\d-ba4- 104 75 76 79 -23 -13 23 14");
00149 init("load_sequence_now graphics\dink\bow\hit\d-ba6- 106 75 37 81 -14 -10 14 10");
00150 init("load_sequence_now graphics\dink\bow\hit\d-ba8- 108 75 31 89 -17 -16 17 10");
00151 
00152 //bow weapon diags
00153 
00154 init("load_sequence_now graphics\dink\bow\hit\d-ba1- 101 75 57 84 -20 -12 20 12");
00155 init("load_sequence_now graphics\dink\bow\hit\d-ba3- 103 75 33 86 -19 -13 19 13");
00156 init("load_sequence_now graphics\dink\bow\hit\d-ba7- 107 75 54 82 -19 -11 19 11");
00157 init("load_sequence_now graphics\dink\bow\hit\d-ba9- 109 75 37 78 -21 -10 21 10");
00158 preload_seq(25);
00159 }
00160 
00161 void pickup(void)
00162 {
00163 Debug("Player now owns this item.");
00164 kill_this_task();
00165 }
00166 
00167 void drop(void)
00168 {
00169 Debug("Item dropped.");
00170 kill_this_task();
00171 }
00172 
00173