Back to index

freedink-data  1.08.20080920
LGOLD.c
Go to the documentation of this file.
00001 //this script fills life up, touch_damage must be set to -1. (run script mode)
00002 
00003 void main( )
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 //create shiny thingie
00012 &save_x = sp_x(&current_sprite, -1);
00013 &save_y = sp_y(&current_sprite, -1);
00014 &save_y += random(5,1);
00015 int &startframe = random(5,1);
00016 int &spark = create_sprite(&save_x, &save_y, 15, 165, 1);
00017 sp_seq(&spark, 165);
00018 sp_nohit(&spark, 1);
00019 sp_frame(&spark, &startframe);
00020 sp_brain_parm(&spark, &current_sprite);
00021 
00022 }
00023 
00024 void touch( void )
00025 {
00026 int &mcrap = random(25,50);
00027 &gold += &mcrap;
00028 say("I found &mcrap 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 }