Back to index

freedink-data  1.08.20080920
EN-BONG.c
Go to the documentation of this file.
00001 //Bonca..strong 
00002 
00003 void main( void )
00004 {
00005 //can't get out of screen until this dude is DEAD
00006 int &mcounter;
00007 
00008 sp_brain(&current_sprite, 9);
00009 sp_speed(&current_sprite, 2);
00010 sp_nohit(&current_sprite, 0);
00011 sp_distance(&current_sprite, 50);
00012 sp_frame_delay(&current_sprite, 30);
00013 sp_range(&current_sprite, 30);
00014 sp_timing(&current_sprite, 0);
00015 sp_exp(&current_sprite, 120);
00016 sp_base_walk(&current_sprite, 600);
00017 sp_base_death(&current_sprite, 550);
00018 sp_base_attack(&current_sprite, 590);
00019 sp_defense(&current_sprite, 0);
00020 sp_strength(&current_sprite, 10);
00021 sp_touch_damage(&current_sprite, 5);
00022 sp_hitpoints(&current_sprite, 40);
00023 preload_seq(601);
00024 preload_seq(603);
00025 preload_seq(607);
00026 preload_seq(609);
00027 
00028 preload_seq(551);
00029 preload_seq(553);
00030 preload_seq(557);
00031 preload_seq(559);
00032 
00033 
00034 preload_seq(592);
00035 preload_seq(594);
00036 preload_seq(596);
00037 preload_seq(598);
00038 
00039 wait(500);
00040 int &mtarget = get_sprite_with_this_brain(9, &current_sprite);
00041 if (&mtarget > 0)
00042   {
00043    sp_target(&current_sprite, &mtarget);
00044   }
00045 
00046 set_callback_random("target",2000,0);
00047 
00048 }
00049 
00050 
00051 void target( void )
00052 {
00053 &mtarget = sp_target(&current_sprite, -1);
00054 
00055 if (&mtarget == 0)
00056    {
00057     //get new target
00058 
00059         &mtarget = get_sprite_with_this_brain(9, &current_sprite);
00060         if (&mtarget > 0)
00061           {
00062            sp_target(&current_sprite, &mtarget);
00063           }
00064 
00065    }
00066 
00067 }
00068 
00069 void hit( void )
00070 {
00071 playsound(29, 18050,0,&current_sprite, 0);
00072 
00073 sp_target(&current_sprite, &enemy_sprite);
00074 //lock on to the guy who just hit us
00075 //playsound
00076 
00077 }
00078 
00079 void die( void )
00080 {
00081 
00082 
00083   int &hold = sp_editor_num(&current_sprite);
00084   if (&hold != 0)
00085   editor_type(&hold, 6); 
00086 
00087 &save_x = sp_x(&current_sprite, -1);
00088 &save_y = sp_y(&current_sprite, -1);
00089 external("emake","large");
00090 }
00091 
00092 void attack( void )
00093 {
00094 playsound(31, 18050,0,&current_sprite, 0);
00095 &mcounter = random(2000,0);
00096 sp_attack_wait(&current_sprite, &mcounter);
00097 
00098 }
00099 
00100