Back to index

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