1 //script for chest with all magic potion
2
main(void)3 void main( void)
4 {
5 preload_seq(175);
6 preload_seq(56);
7 sp_brain(¤t_sprite, 0);
8 sp_hitpoints(¤t_sprite, 0);
9 }
10
hit(void)11 void hit ( void )
12 {
13 //play noise
14 int &hold = sp_editor_num(¤t_sprite);
15
16 if (&hold != 0)
17 {
18 //this was placed by the editor, lets make the chest stay open
19 editor_type(&hold, 4);
20 editor_seq(&hold, 175);
21 editor_frame(&hold, 4);
22 //type means show this seq/frame combo as background in the future
23 }
24 &save_x = sp_x(¤t_sprite, -1);
25 &save_y = sp_y(¤t_sprite, -1);
26 external("make", "rpotion");
27
28 sp_seq(¤t_sprite, 175);
29 sp_script(¤t_sprite, "");
30 sp_notouch(¤t_sprite, 1);
31 sp_nohit(¤t_sprite, 1);
32 sp_script(¤t_sprite, "");
33 kill_this_task();
34 }
35