Back to index

freedink-data  1.08.20080920
GOLD500.c
Go to the documentation of this file.
00001 //this script is for 500 gold
00002 
00003 void main(void )
00004 {
00005         sp_pseq(&current_sprite, 178);
00006         sp_frame(&current_sprite, 4); //so the seq will start
00007    //     sp_brain(&current_sprite, 6);
00008         sp_touch_damage(&current_sprite, -1);
00009         sp_nohit(&current_sprite, 1);
00010 
00011 
00012 //create shiny thingie
00013 &save_x = sp_x(&current_sprite, -1);
00014 &save_y = sp_y(&current_sprite, -1);
00015 &save_y += random(5,1);
00016 int &startframe = random(5,1);
00017 int &spark = create_sprite(&save_x, &save_y, 15, 165, 1);
00018 sp_seq(&spark, 165);
00019 sp_nohit(&spark, 1);
00020 sp_frame(&spark, &startframe);
00021 sp_brain_parm(&spark, &current_sprite);
00022 
00023 }
00024 
00025 void touch( void )
00026 {
00027 &gold += 500;
00028 say("I found 500 gold.",1);
00029 sp_brain_parm(&current_sprite, 10);
00030 sp_brain(&current_sprite, 12);
00031 sp_touch_damage(&current_sprite, 0);
00032 sp_timing(&current_sprite, 0);
00033 
00034   //kill this item so it doesn't show up again for this player
00035   int &hold = sp_editor_num(&current_sprite);
00036   if (&hold != 0)
00037   editor_type(&hold, 1); 
00038 
00039 }