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

« back to all changes in this revision

Viewing changes to data/compiled/objects/helicopter_plant.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
[prototype]
 
2
feet_width="4"
 
3
friction="1000"
 
4
has_feet="no"
 
5
hitpoints="1"
 
6
id="helicopter_plant"
 
7
mass="5"
 
8
on_bounced_on="[if(jumped_on_by.mass >= 1000, die(), animation('spring'))]"
 
9
on_child_spawned="if((not vars.rotor), set(vars.rotor, child))"
 
10
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack', get_hit_by(collide_with))"
 
11
on_create="[facing(1), spawn('helicopter_plant.rotor', midpoint_x, y-6, facing), set(accel_y,40), set(target_y, y)]"
 
12
on_die="[[score(level,points_value), spawn_item(self), spawn('die_cloud', midpoint_x, midpoint_y, facing)], set(vars.rotor.hitpoints, 0)]"
 
13
on_end_chargeup_anim="if(tmp.anim_repeat >= consts.chargeup_repeat, animation('shoot'), [animation('chargeup'), add(tmp.anim_repeat, 1)])"
 
14
on_end_hurt_anim="animation('normal')"
 
15
on_end_normal_anim="[animation('windup'),
 
16
                 set(tmp.spawn_velocity_x, 10*(90-rotate)),
 
17
                 set(tmp.spawn_velocity_y, 10*(90 - abs(90-rotate)))
 
18
        
 
19
        ]"
 
20
on_end_shoot_anim="animation('normal')"
 
21
on_end_windup_anim="[animation('chargeup'), set(tmp.anim_repeat, 0)]"
 
22
on_enter_anim="set(tmp, 'already_hit', [])"
 
23
on_enter_spring_anim="die()"
 
24
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
 
25
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
 
26
on_process="[set(vars.rotor.midpoint_x, midpoint_x), set(vars.rotor.midpoint_y, y-6)]"
 
27
on_process_normal="set(rotate, min(rotate+3, max(rotate-3, if(level.player.midpoint_x < midpoint_x, 180 - target, target))))
 
28
                       where target =
 
29
                          min(90, max(0, (((level.player.midpoint_y - 40) - midpoint_y)*25)/max(2, abs(level.player.midpoint_x - midpoint_x))))"
 
30
on_shoot="[spawn('pollen_ball', midpoint_x, midpoint_y, facing,
 
31
                    [
 
32
                     set(zorder, zorder-1),
 
33
                                 set(velocity_x, tmp.spawn_velocity_x),
 
34
                                 set(velocity_y, tmp.spawn_velocity_y),
 
35
                                ]), sound('FlowerShot.ogg')]"
 
36
on_surface_damage="die()"
 
37
on_swallowed="[set(vars.rotor.hitpoints, 0), animation('normal'), set(rotate, 0), set(type, 'shooting_plant')]"
 
38
on_timer="if(y < target_y, set(accel_y, 30), set(accel_y, -10))"
 
39
solid_area="5,4,10,10"
 
40
springiness="100"
 
41
tags="swallowable"
 
42
timer_frequency="5"
 
43
traction="1000"
 
44
traction_in_air="1000"
 
45
zorder="0"
 
46
        [properties]
 
47
        get_hit_by="def(collide_with) execute(me,
 
48
                     if(not (me in collide_with.tmp.already_hit), [
 
49
                                set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
 
50
                                if((not is_invincible_posthit) and (collide_with.vars.damage > 0),
 
51
                                        if(collide_with.vars.damage > consts.armor,
 
52
                                          [
 
53
                                           if(me.hitpoints > collide_with.vars.damage,
 
54
                                                [
 
55
                                                  if(collide_with.vars.damage <= consts.flinch_threshold,
 
56
                                                        schedule(4, [set(me.green, 255), set(me.blue, 255)]),
 
57
                                                        set(me.animation, 'hurt')),
 
58
                                                  set(me.green, 100), set(me.blue, 100)
 
59
                                                ]),
 
60
                                           set(me.hitpoints, me.hitpoints - collide_with.vars.damage),
 
61
                                           set(tmp.time_last_hit, me.cycle)
 
62
                                          ])),
 
63
                                if(collide_with.vars.damage > consts.flinch_threshold and me.hurt_velocity_y and (not collide_with.tmp.no_flinch_attack), set(me.velocity_y,(me.hurt_velocity_y))),
 
64
                                if(collide_with.vars.damage > consts.flinch_threshold and me.hurt_velocity_x and (not collide_with.tmp.no_flinch_attack), set(me.velocity_x, ((me.hurt_velocity_x * collide_with.facing + collide_with.velocity_x/2)*collide_with.mass*if(collide_with.attack_force, collide_with.attack_force, 100))/(me.mass*100)))]))"
 
65
        hurt_velocity_x="400"
 
66
        hurt_velocity_y="-800"
 
67
        is_invincible_posthit="if(tmp.time_last_hit and (abs(tmp.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
 
68
        [/properties]
 
69
 
 
70
        [tmp]
 
71
        anim_repeat="0"
 
72
        spawn_velocity_x="0"
 
73
        spawn_velocity_y="0"
 
74
        time_last_hit="0"
 
75
        [/tmp]
 
76
 
 
77
        [vars]
 
78
        damage="1"
 
79
        points_value="100"
 
80
        rotor="null()"
 
81
        target_y="0"
 
82
        team="'evil'"
 
83
        [/vars]
 
84
 
 
85
        [properties]
 
86
        hurt_velocity_x="0"
 
87
        hurt_velocity_y="0"
 
88
        [/properties]
 
89
 
 
90
        [animation]
 
91
        body_area="all"
 
92
        duration="50"
 
93
        frame_info="0,0,0,0,340,442,16,15"
 
94
        frames="1"
 
95
        frames_per_row="1"
 
96
        id="normal"
 
97
        image="compiled-2.png"
 
98
        rect="340,442,355,456"
 
99
        [/animation]
 
100
 
 
101
        [animation]
 
102
        body_area="all"
 
103
        duration="50"
 
104
        frame_info="0,0,0,0,340,442,16,15"
 
105
        frames="1"
 
106
        frames_per_row="1"
 
107
        id="spring"
 
108
        image="compiled-2.png"
 
109
        rect="340,442,355,456"
 
110
        [/animation]
 
111
 
 
112
        [animation]
 
113
        body_area="all"
 
114
        duration="6"
 
115
        frame_info="1,0,2,0,906,400,13,16"
 
116
        frames="1"
 
117
        frames_per_row="1"
 
118
        id="windup"
 
119
        image="compiled-0.png"
 
120
        rect="905,400,920,415"
 
121
        [/animation]
 
122
 
 
123
        [animation]
 
124
        body_area="all"
 
125
        duration="6"
 
126
        frame_info="2,0,3,0,253,425,11,17,2,0,3,0,264,425,11,17"
 
127
        frames="2"
 
128
        frames_per_row="1"
 
129
        id="chargeup"
 
130
        image="compiled-2.png"
 
131
        rect="251,425,266,441"
 
132
        [/animation]
 
133
 
 
134
        [animation]
 
135
        body_area="all"
 
136
        duration="20"
 
137
        events="10:shoot"
 
138
        frame_info="1,0,1,0,109,458,18,13"
 
139
        frames="1"
 
140
        frames_per_row="1"
 
141
        id="shoot"
 
142
        image="compiled-2.png"
 
143
        rect="108,458,127,470"
 
144
        [/animation]
 
145
 
 
146
        [animation]
 
147
        duration="18"
 
148
        events="6:12:18:hurtflicker"
 
149
        frames="1"
 
150
        id="hurt"
 
151
        [/animation]
 
152
 
 
153
        [consts]
 
154
        chargeup_repeat="2"
 
155
        springiness="160"
 
156
        [/consts]
 
157
 
 
158
        [object_type]
 
159
        id="rotor"
 
160
        on_end_normal_anim="animation('normal')"
 
161
                [animation]
 
162
                duration="4"
 
163
                frames="4"
 
164
                frames_per_row="1"
 
165
                id="normal"
 
166
                image="enemies/helicopter-plant.png"
 
167
                rect="70,14,93,21"
 
168
                [/animation]
 
169
 
 
170
        [/object_type]
 
171
 
 
172
[/prototype]
 
173