Back to index

freedink-data  1.08.20080920
S7-SLAY.c
Go to the documentation of this file.
00001 //slayer
00002 
00003 void main( void )
00004 {
00005 int &mcounter;
00006 screenlock(1);
00007 sp_brain(&current_sprite, 9);
00008 sp_speed(&current_sprite, 1);
00009 sp_distance(&current_sprite, 60);
00010 sp_range(&current_sprite, 45);
00011 sp_frame_delay(&current_sprite, 45);
00012 sp_timing(&current_sprite, 0);
00013 sp_exp(&current_sprite, 200);
00014 sp_base_walk(&current_sprite, 640);
00015 //sp_base_death(&current_sprite, 680);
00016 sp_base_attack(&current_sprite, 630);
00017 sp_defense(&current_sprite, 5);
00018 sp_strength(&current_sprite, 20);
00019 sp_touch_damage(&current_sprite, 10);
00020 sp_hitpoints(&current_sprite, 100);
00021 preload_seq(632);
00022 preload_seq(634);
00023 preload_seq(636);
00024 preload_seq(638);
00025 
00026 preload_seq(641);
00027 preload_seq(643);
00028 preload_seq(647);
00029 preload_seq(649);
00030 
00031 }
00032 
00033 
00034 void hit( void )
00035 {
00036 sp_target(&current_sprite, &enemy_sprite);
00037 //lock on to the guy who just hit us
00038 //playsound
00039 playsound(28, 22050,0,&current_sprite, 0);
00040 
00041 }
00042 
00043 void die( void )
00044 {
00045 if (get_sprite_with_this_brain(9, &current_sprite) == 0)
00046  {
00047   //no more brain 9 monsters here, lets unlock the screen
00048 
00049   screenlock(0);
00050   playsound(43, 22050,0,0,0);
00051 
00052  }
00053 
00054 
00055 
00056 
00057   int &hold = sp_editor_num(&current_sprite);
00058   if (&hold != 0)
00059   editor_type(&hold, 6); 
00060 
00061 
00062 
00063 &save_x = sp_x(&current_sprite, -1);
00064 &save_y = sp_y(&current_sprite, -1);
00065 external("emake","xlarge");
00066 
00067 }
00068 void attack( void )
00069 {
00070 playsound(27, 22050,0,&current_sprite, 0);
00071 &mcounter = random(4000,0);
00072 sp_attack_wait(&current_sprite, &mcounter);
00073 }
00074 
00075