~ubuntu-branches/ubuntu/utopic/frogatto-data/utopic

« back to all changes in this revision

Viewing changes to data/objects/props-interactive/treasure_chest.cfg

  • Committer: Bazaar Package Importer
  • Author(s): Dmitry E. Oboukhov
  • Date: 2010-07-16 12:14:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100716121411-tobhfbyxrrz46dwz
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
        [object_type]
 
2
        id=treasure_chest
 
3
        zorder=-1
 
4
 
 
5
        [editor_info]
 
6
        category=props
 
7
                        [var]
 
8
                        name=spawn_type
 
9
                        type=text
 
10
                        value="'points_cube'"
 
11
                        [/var]
 
12
                        [var]
 
13
                        name=event_name
 
14
                        type=text
 
15
                        value="''"
 
16
                        [/var]
 
17
                        [var]
 
18
                        name=acquirable_child
 
19
                        type=boolean
 
20
                        value="1"
 
21
                        [/var]
 
22
        [/editor_info]
 
23
        
 
24
        [vars]
 
25
        acquirable_child=1
 
26
        [/vars]
 
27
        [tmp]
 
28
                loot="[]"
 
29
        [/tmp]
 
30
 
 
31
        on_create="animation('normal')"
 
32
        on_interact="[animation('opening'),sound('DoorOpen.ogg'),fire_event(level.player, 'start_interact')]"
 
33
 
 
34
        on_end_normal_anim="animation('normal')"
 
35
        on_end_opening_anim="[animation('open'),fire_event(level.player, 'end_interact'),fire_event('treasure_give'),schedule(50, fire_event('force_loot_acquire'))]"
 
36
        on_end_open_anim="animation('open')"
 
37
 
 
38
 
 
39
        ###We must put this in a separate function, because loot only exists *after* the treasure_give event has fired.  If we called it above, it would have no target.
 
40
        on_force_loot_acquire="if(tmp.loot.size > 0,fire_event(tmp.loot[0],'acquired'))"
 
41
        on_child_spawned="[if(vars.acquirable_child, set(child.collide_dimensions_in, [])),
 
42
                           set(tmp.loot, tmp.loot + [child])]"
 
43
 
 
44
 
 
45
        on_treasure_give="if((not event_name in level.player.vars.triggered_events),[ spawn(spawn_type,midpoint_x,y-50,facing,[set(velocity_y,-1000),set(accel_y,40),set(zorder,12)]),set(level.player.vars.triggered_events, level.player.vars.triggered_events + [event_name])] )"
 
46
 
 
47
        solid_dimensions=npc
 
48
        solid_area=16,16,47,47
 
49
                [base:animation]
 
50
                image=props/interactive-props.png
 
51
                [/animation]
 
52
 
 
53
                [animation]
 
54
                id=normal
 
55
                rect=0,0,63,48
 
56
                duration=200
 
57
                interact_area=all
 
58
                [/animation]
 
59
 
 
60
                [animation]
 
61
                id=opening
 
62
                rect=0,0,63,48
 
63
                frames=6
 
64
                frames_per_row=3
 
65
                pad=0
 
66
                duration=5
 
67
                [/animation]
 
68
                
 
69
                [animation]
 
70
                id=open
 
71
                rect=128,49,191,97
 
72
                duration=200
 
73
                [/animation]
 
74
                
 
75
                
 
76
                
 
77
        [/object_type]