Back to index

freedink-data  1.08.20080920
ITEM-SW1.c
Go to the documentation of this file.
00001 //item sword1
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(200);
00024 playsound(8, 8000,0,0,0);
00025 
00026 }
00027 
00028 void disarm(void)
00029 {
00030 sp_attack_hit_sound(1, 0);
00031 
00032 &strength -= 4;
00033 sp_distance(1, 0);
00034 sp_range(1, 0);
00035 kill_this_task();
00036 }
00037 
00038 void arm(void)
00039 {
00040 //sword range
00041 sp_distance(1, 50);
00042 sp_range(1, 40);
00043 //sword strength added
00044 &strength += 4;
00045 
00046 sp_attack_hit_sound(1, 10);
00047 sp_attack_hit_sound_speed(1, 8000);
00048 init("load_sequence_now graphics\dink\sword\walk\d-sw1- 71 43 64 69 -14 -10 14 10");
00049 init("load_sequence_now graphics\dink\sword\walk\d-sw2- 72 43 35 70 -21 -10 19 10");
00050 init("load_sequence_now graphics\dink\sword\walk\d-sw3- 73 43 28 69 -13 -9 13 9");
00051 init("load_sequence_now graphics\dink\sword\walk\d-sw4- 74 43 66 75 -14 -12 20 12");
00052 
00053 init("load_sequence_now graphics\dink\sword\walk\d-sw6- 76 43 27 69 -23 -10 23 10");
00054 init("load_sequence_now graphics\dink\sword\walk\d-sw7- 77 43 38 94 -20 -10 20 10");
00055 init("load_sequence_now graphics\dink\sword\walk\d-sw8- 78 43 30 96 -15 -12 15 12");
00056 init("load_sequence_now graphics\dink\sword\walk\d-sw9- 79 43 31 80 -13 -9 13 9");
00057 
00058 init("load_sequence_now graphics\dink\sword\idle\d-si2- 12 250 74 73 -17 -12 16 9");
00059 init("load_sequence_now graphics\dink\sword\idle\d-si4- 14 250 57 103 -11 -12 16 10");
00060 init("load_sequence_now graphics\dink\sword\idle\d-si6- 16 250 30 92 -15 -9 11 9");
00061 init("load_sequence_now graphics\dink\sword\idle\d-si8- 18 250 35 106 -15 -12 15 9");
00062 
00063 init("load_sequence_now graphics\dink\sword\hit\d-sa2- 102 75 52 92 -23 -12 24 11");
00064 init("load_sequence_now graphics\dink\sword\hit\d-sa4- 104 75 74 90 -23 -13 23 14");
00065 init("load_sequence_now graphics\dink\sword\hit\d-sa6- 106 75 33 92 -18 -14 18 10");
00066 init("load_sequence_now graphics\dink\sword\hit\d-sa8- 108 75 46 109 -17 -16 17 10");
00067 int &basehit;
00068 }
00069 
00070 void pickup(void)
00071 {
00072 Debug("Player now owns this item.");
00073 kill_this_task();
00074 }
00075 
00076 void holdingdrop( void )
00077 {
00078  //this is run if the item is dropped while it is armed
00079 init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9");
00080 init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9");
00081 init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9");
00082 init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9");
00083 
00084 init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9");
00085 init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10");
00086 init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9");
00087 init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9");
00088 
00089 init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9");
00090 init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9");
00091 init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9");
00092 init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9");
00093 
00094 }
00095 
00096 void drop(void)
00097 {
00098 Debug("Item dropped.");
00099 kill_this_task();
00100 }
00101 
00102