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

« back to all changes in this revision

Viewing changes to data/objects/machines/aiming_cannon.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
 
 
2
        [object_type]
 
3
        id=aiming_cannon
 
4
 
 
5
 
 
6
        [editor_info]
 
7
        category=machines
 
8
                [var]
 
9
                name=loading_time
 
10
                value="10"
 
11
                [/var]
 
12
        [/editor_info]
 
13
 
 
14
        [vars]
 
15
                load=0
 
16
        [/vars]
 
17
 
 
18
 
 
19
        on_shoot_horz="[
 
20
           spawn('missile', midpoint_x + facing*20, midpoint_y, facing,
 
21
                 [set(velocity_x, 800*facing)]),
 
22
        spawn('explosion_spark', midpoint_x + facing*40, midpoint_y-10, facing)]"
 
23
        on_shoot_diag="[
 
24
            spawn('missile', midpoint_x + facing*20, midpoint_y - 20, facing,
 
25
                      [set(velocity_x, 500*facing),
 
26
                           set(velocity_y, -500),
 
27
                           set(rotate, -facing*45)]),
 
28
        spawn('explosion_spark', midpoint_x + facing*30, midpoint_y-40, facing)]"
 
29
        on_shoot_vert="[spawn('missile', midpoint_x, y - 15, facing,
 
30
                        [set(velocity_y, -800), set(rotate, 90)]),
 
31
        spawn('explosion_spark', midpoint_x, midpoint_y-40, facing)]"
 
32
 
 
33
        on_end_anim="switch(animation,
 
34
                'fire_horz', animation('aim_horz'),
 
35
                'fire_diag', animation('aim_diag'),
 
36
            'fire_vert', animation('aim_vert'),
 
37
        
 
38
            [if(preferred_aim = current_aim, [animation(animation)],
 
39
                 switch(if(preferred_aim < current_aim, current_aim - 1,
 
40
                                                                current_aim + 1),
 
41
                                        0, [facing(-1), animation('aim_horz')],
 
42
                                        1, [facing(-1), animation('aim_diag')],
 
43
                                        2, [facing(-1), animation('aim_vert')],
 
44
                                        3, [facing(1), animation('aim_diag')],
 
45
                                        4, [facing(1), animation('aim_horz')])),
 
46
                      if(vars.load >= vars.loading_time, [set_var('load', 0),
 
47
                                      animation(switch(animation,
 
48
                                                           'aim_horz', 'fire_horz',
 
49
                                                           'aim_diag', 'fire_diag',
 
50
                                                           'aim_vert', 'fire_vert'))
 
51
                                                    ],
 
52
                                                    set_var('load', vars.load + 1))]
 
53
                                                                )
 
54
           where preferred_aim =
 
55
             if(level.player.y2 > y, if(level.player.x < x, 0, 4),
 
56
                    if(level.player.x2 > x and level.player.x < x2, 2,
 
57
                             if(level.player.x < x, 1, 3))),
 
58
                     current_aim = switch(animation,
 
59
                           'aim_vert', 2,
 
60
                           'aim_diag', if(facing < 0, 1, 3),
 
61
                           'aim_horz', if(facing < 0, 0, 4))"
 
62
 
 
63
        solid_area=9,10,25,32
 
64
 
 
65
                [animation]
 
66
                id=aim_horz
 
67
                image=enemies/cannon.png
 
68
                rect=3,77,36,110
 
69
                duration=10
 
70
                [/animation]
 
71
                [animation]
 
72
                id=aim_diag
 
73
                image=enemies/cannon.png
 
74
                rect=40,77,73,110
 
75
                duration=10
 
76
                [/animation]
 
77
                [animation]
 
78
                id=aim_vert
 
79
                image=enemies/cannon.png
 
80
                rect=77,77,110,110
 
81
                duration=10
 
82
                [/animation]
 
83
 
 
84
                [animation]
 
85
                id=fire_horz
 
86
                image=enemies/cannon.png
 
87
                rect=3,3,36,36
 
88
                duration=6
 
89
                pad=3
 
90
                frames=2
 
91
                frames_per_row=1
 
92
                events="5:shoot_horz"
 
93
                sound=cannon.ogg
 
94
                [/animation]
 
95
                [animation]
 
96
                id=fire_diag
 
97
                image=enemies/cannon.png
 
98
                rect=40,3,73,36
 
99
                duration=6
 
100
                pad=3
 
101
                frames=2
 
102
                frames_per_row=1
 
103
                events="5:shoot_diag"
 
104
                sound=cannon.ogg
 
105
                [/animation]
 
106
                [animation]
 
107
                id=fire_vert
 
108
                image=enemies/cannon.png
 
109
                rect=77,3,110,36
 
110
                duration=6
 
111
                pad=3
 
112
                frames=2
 
113
                frames_per_row=1
 
114
                events="5:shoot_vert"
 
115
                sound=cannon.ogg
 
116
                [/animation]
 
117
        [/object_type]
 
118