Back to index

freedink-data  1.08.20080920
item-fst.c
Go to the documentation of this file.
00001 //item fists
00002 
00003 void use( void )
00004 {
00005 //disallow diagonal punches
00006 
00007 if (sp_dir(1, -1) == 1)
00008     sp_dir(1, 2);
00009 if (sp_dir(1, -1) == 3)
00010     sp_dir(1, 2);
00011 if (sp_dir(1, -1) == 7)
00012     sp_dir(1, 8);
00013 if (sp_dir(1, -1) == 9)
00014     sp_dir(1, 8);
00015 
00016 &basehit = sp_dir(1, -1);
00017 &basehit += 100; //100 is the 'base' for the hit animations, we just add
00018 //the direction
00019 sp_seq(1, &basehit);
00020 sp_frame(1, 1); //reset seq to 1st frame
00021 sp_kill_wait(1); //make sure dink will punch right away
00022 sp_nocontrol(1, 1); //dink can't move until anim is done!
00023 wait(1);
00024 playsound(8, 8000,0,0,0);
00025 
00026 }
00027 
00028 void disarm(void)
00029 {
00030 debug("Killed fists");
00031 
00032 kill_this_task();
00033 }
00034 
00035 void arm(void)
00036 {
00037 sp_attack_hit_sound(1, 0);
00038 init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9");
00039 init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9");
00040 init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9");
00041 init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9");
00042 
00043 init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9");
00044 init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10");
00045 init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9");
00046 init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9");
00047 
00048 init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9");
00049 init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9");
00050 init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9");
00051 init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9");
00052 
00053 init("load_sequence_now graphics\dink\hit\normal\ds-h2- 102 75 60 72 -19 -9 19 9");
00054 init("load_sequence_now graphics\dink\hit\normal\ds-h4- 104 75 61 73 -19 -10 19 10");
00055 init("load_sequence_now graphics\dink\hit\normal\ds-h6- 106 75 58 71 -18 -10 18 10");
00056 init("load_sequence_now graphics\dink\hit\normal\ds-h8- 108 75 61 71 -19 -10 19 10");
00057 debug("fists armed");
00058 
00059 
00060 int &basehit;
00061 }
00062 
00063 void pickup(void)
00064 {
00065 Debug("Player now owns this item.");
00066 kill_this_task();
00067 }
00068 
00069 void drop(void)
00070 {
00071 Debug("Item dropped.");
00072 kill_this_task();
00073 }
00074 
00075