Back to index

freedink-data  1.08.20080920
DAM-SFB.c
Go to the documentation of this file.
00001 //script for individual super fireball
00002 void main( void )
00003 {
00004         int &mcrap;
00005         int &scrap;
00006         int &crapx;
00007         int &crapy;
00008        int &junk;
00009 
00010 }
00011 
00012 void damage( void )
00013 {
00014         playsound(18, 8000,0,0,0);
00015         
00016         &crapx = sp_x(&current_sprite, -1);
00017         &crapy = sp_y(&current_sprite, -1);
00018 
00019         if (&missile_target == 0)
00020         {
00021         kill_shadow(&current_sprite);
00022         sp_active(&current_sprite, 0);
00023         }
00024 
00025         if (sp_brain(&missile_target, -1) == 0)
00026         {
00027         kill_shadow(&current_sprite);
00028         sp_active(&current_sprite, 0);
00029         }
00030         if (sp_brain(&missile_target, -1) == 6)
00031         {
00032         kill_shadow(&current_sprite);
00033         sp_active(&current_sprite, 0);
00034         }
00035 
00036 
00037         &scrap = create_sprite(&crapx , &crapy, 0 , 167, 1);
00038         sp_seq(&scrap, 167);
00039         sp_pseq(&scrap, 167);
00040         sp_frame(&scrap, 1);
00041         sp_brain(&scrap, 7);
00042         sp_nohit(&scrap, 1);  
00043 
00044         &mcrap = sp_y(&scrap, -1);
00045         &mcrap -= 35;
00046         sp_y(&scrap, &mcrap);
00047 
00048  &mcrap = sp_pseq(&missile_target, -1);
00049  &scrap = sp_pframe(&missile_target, -1);
00050 
00051   if (&mcrap == 32)
00052   {
00053 
00054    if (&scrap == 1)
00055    {
00056    //they hit a tree, lets burn the thing
00057   int &hold = sp_editor_num(&missile_target);
00058    sp_hard(&missile_target, 1);
00059    draw_hard_sprite(&missile_target);
00060 
00061   &junk = is_script_attached(&missile_target);
00062   if (&junk > 0)
00063   {
00064  //Script is attached to this tree!  Let's run it's die script
00065   run_script_by_number(&junk, "DIE");
00066    return;
00067   }
00068 
00069 
00070 
00071   if (&hold != 0)
00072     {
00073      //this was placed by the editor, lets make the tree stay burned
00074      editor_type(&hold, 4); 
00075      editor_seq(&hold, 20);
00076      editor_frame(&hold, 29);
00077      //type means show this seq/frame combo as background in the future
00078     }
00079 
00080     sp_pseq(&missile_target, 20);
00081     sp_pframe(&missile_target, 29);
00082     sp_hard(&missile_target, 0);
00083     draw_hard_sprite(&missile_target);
00084     sp_seq(&missile_target, 20);
00085     playsound(6, 10000,0,&missile_target,0);
00086   
00087    }
00088   }
00089 
00090 }