Back to index

freedink-data  1.08.20080920
S3-CH1.c
Go to the documentation of this file.
00001 //script for chest with all magic potion, special mod to make it invisible
00002 
00003 void main( void)
00004 {
00005 preload_seq(175);
00006 sp_nodraw(&current_sprite, 1);
00007 sp_brain(&current_sprite, 0);
00008 sp_hitpoints(&current_sprite, 0);
00009 }
00010 
00011 void hit ( void )
00012  {
00013   //play noise
00014   int &hold = sp_editor_num(&current_sprite);
00015 
00016   if (&hold != 0)
00017     {
00018      //this was placed by the editor, lets make the chest stay open
00019      editor_type(&hold, 4); 
00020      editor_seq(&hold, 175);
00021      editor_frame(&hold, 4);
00022      //type means show this seq/frame combo as background in the future
00023     }
00024   &save_x = sp_x(&current_sprite, -1);
00025   &save_y = sp_y(&current_sprite, -1);
00026   external("make", "apotion");
00027 
00028   sp_seq(&current_sprite, 175);
00029  sp_script(&current_sprite, "");
00030   sp_notouch(&current_sprite, 1);
00031   sp_nohit(&current_sprite, 1);
00032  sp_script(&current_sprite, "");
00033  }