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

« back to all changes in this revision

Viewing changes to data/compiled/objects/milgram_block.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
hitpoints="5"
 
5
id="milgram_block"
 
6
mass="5"
 
7
on_add_object_fail="[if(collide_with.vars.team != vars.team and collide_with.get_hit_by, collide_with.get_hit_by(me)), die()]"
 
8
on_bounced_on="[if(animation = 'on_back', die(), animation('spring'))]"
 
9
on_change_animation_failure="[die()]"
 
10
on_change_solid_dimensions_fail="if(tmp.in_change_dimensions_fail or (not collide_with), die(),
 
11
                  [set(tmp.in_change_dimensions_fail, 1),
 
12
                           fire_event(collide_with, 'blocking_thrown_object'),
 
13
                           set(solid_dimensions_in, consts.solid_dimensions),
 
14
                           set(tmp.in_change_dimensions_fail, 0)
 
15
                          ])"
 
16
on_collide="if(animation in ['thrown', 'on_back'], set(velocity_x, -velocity_x/2), if(not (animation in ['hurt']), [set(facing, -facing),animation('turn'),set(velocity_x,0)]))"
 
17
on_collide_feet="[if(animation in ['thrown', 'on_back'] and collide_with and collide_with.get_hit_by and collide_with.vars.team != vars.team and vars.damage > 0, [collide_with.get_hit_by(me), die()]),
 
18
                   if(animation = 'thrown' and velocity_y + abs(velocity_x) > 600,
 
19
                            [set(velocity_y, -(velocity_y*3)/5 - (velocity_x*slope_standing_on)/90), set(velocity_x, (velocity_x*4)/5 + (velocity_y*slope_standing_on)/90)], if(animation = 'thrown', [set(tmp.on_back_count, 0), animation('on_back')], if(animation != 'on_back', animation('walk'))))]"
 
20
on_collide_head="set(velocity_y, -velocity_y/2)"
 
21
on_collide_object_body="if(collide_with.vars.team != vars.team and collide_with_area = 'attack', get_hit_by(collide_with))"
 
22
on_collide_object_thrown="[if(collide_with_area = 'body' and collide_with.vars.team != vars.team and vars.damage > 0,
 
23
                 [if(collide_with.get_hit_by, [collide_with.get_hit_by(me)]), die()])]"
 
24
on_die="[score(level,points_value), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
 
25
on_end_anim="if(animation in ['on_back', 'thrown'], [set(tmp.on_back_count, tmp.on_back_count+1), if(tmp.on_back_count > 10, [animation('walk'), set(tmp.on_back_count, 0)],
 
26
          if(CYCLE_THROWN_ANIM and (not is_standing), [set(tmp.cycle_thrown_anim, 1), animation('thrown')],
 
27
                                                        animation('on_back'))
 
28
           )], animation('walk'))"
 
29
on_end_hurt_anim="animation('walk')"
 
30
on_end_turn_anim="animation('walk')"
 
31
on_enter_anim="set(tmp.already_hit, [])"
 
32
on_enter_thrown_anim="[if((not tmp.cycle_thrown_anim), set(vars.damage, consts.thrown_damage), set(tmp.cycle_thrown_anim, 0))]"
 
33
on_enter_walk_anim="if(not is_standing, animation('stand'))"
 
34
on_enter_water="die()"
 
35
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
 
36
on_jumped_on="[if(jumped_on_by.mass >= 20, die())]"
 
37
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
 
38
on_leave_on_back_anim="set(brightness, 256)"
 
39
on_leave_thrown_anim="[set(solid_dimensions_in, consts.solid_dimensions), set(vars.team, 'evil'), set(vars.damage, consts.normal_damage)]"
 
40
on_process_on_back="if(tmp.on_back_count > 8, [if(tmp.on_back_count > 10 and time_in_animation > 7, set(velocity_y, velocity_y-300)), set(brightness, if(cycle%6 > 2, 256, 512))])"
 
41
on_process_stand="if(is_standing, animation('walk'))"
 
42
on_stomped_on="[add(hitpoints, -3), set(green, 0), set(blue, 0),
 
43
                        schedule(4, [set(green, 255), set(blue, 255)])]"
 
44
on_surface_damage="die()"
 
45
on_timer="if(not (animation in ['thrown', 'on_back']), [set(rotate, slope_standing_on), if(turns_at_cliffs and is_standing and animation = 'walk' and distance_to_cliff < DISTANCE_TO_CLIFF_CHECK,[set(facing, -facing),animation('turn')],null())])"
 
46
solid_area="2,9,22,25"
 
47
solid_dimensions="enemy,common"
 
48
tags="swallowable"
 
49
timer_frequency="5"
 
50
traction="1000"
 
51
        [properties]
 
52
        get_hit_by="def(collide_with) execute(me,
 
53
                     if(not (me in collide_with.tmp.already_hit), [
 
54
                                set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
 
55
                                if((not is_invincible_posthit) and (collide_with.vars.damage > 0),
 
56
                                        if(collide_with.vars.damage > consts.armor,
 
57
                                          [
 
58
                                           if(me.hitpoints > collide_with.vars.damage,
 
59
                                                [
 
60
                                                  if(collide_with.vars.damage <= consts.flinch_threshold,
 
61
                                                        schedule(4, [set(me.green, 255), set(me.blue, 255)]),
 
62
                                                        set(me.animation, 'hurt')),
 
63
                                                  set(me.green, 100), set(me.blue, 100)
 
64
                                                ]),
 
65
                                           set(me.hitpoints, me.hitpoints - collide_with.vars.damage),
 
66
                                           set(tmp.time_last_hit, me.cycle)
 
67
                                          ])),
 
68
                                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))),
 
69
                                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)))]))"
 
70
        hurt_velocity_x="400"
 
71
        hurt_velocity_y="-800"
 
72
        is_invincible_posthit="if(tmp.time_last_hit and (abs(tmp.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
 
73
        [/properties]
 
74
 
 
75
        [tmp]
 
76
        cycle_thrown_anim="0"
 
77
        on_back_count="0"
 
78
        time_last_hit="0"
 
79
        [/tmp]
 
80
 
 
81
        [vars]
 
82
        damage="1"
 
83
        points_value="5"
 
84
        team="'evil'"
 
85
        turns_at_cliffs="1"
 
86
        [/vars]
 
87
 
 
88
        [consts]
 
89
        CYCLE_THROWN_ANIM="0"
 
90
        DISTANCE_TO_CLIFF_CHECK="30"
 
91
        bounce_roundness="70"
 
92
        normal_damage="1"
 
93
        solid_dimensions="['enemy', 'common']"
 
94
        spring_amount="1200"
 
95
        springiness="0"
 
96
        thrown_damage="5"
 
97
        [/consts]
 
98
 
 
99
        [animation]
 
100
        accel_x="0"
 
101
        accel_y="80"
 
102
        attack_area="15,18,26,26"
 
103
        body_area="all"
 
104
        duration="6"
 
105
        frame_info="2,8,2,2,948,389,21,18"
 
106
        frames="1"
 
107
        id="stand"
 
108
        image="compiled-2.png"
 
109
        rect="946,381,970,408"
 
110
        rotate_on_slope="yes"
 
111
        [/animation]
 
112
 
 
113
        [animation]
 
114
        accel_x="0"
 
115
        accel_y="80"
 
116
        body_area="none"
 
117
        duration="60"
 
118
        frame_info="2,8,2,2,969,389,21,18"
 
119
        frames="1"
 
120
        id="thrown"
 
121
        image="compiled-2.png"
 
122
        rect="967,381,991,408"
 
123
        rotate_on_slope="yes"
 
124
        thrown_area="0,0,31,36"
 
125
        [/animation]
 
126
 
 
127
        [animation]
 
128
        accel_x="0"
 
129
        accel_y="80"
 
130
        body_area="all"
 
131
        duration="5"
 
132
        frame_info="2,8,2,2,80,407,21,18,2,8,2,2,101,407,21,18"
 
133
        frames="2"
 
134
        id="on_back"
 
135
        image="compiled-2.png"
 
136
        rect="78,399,102,426"
 
137
        rotate_on_slope="yes"
 
138
        [/animation]
 
139
 
 
140
        [animation]
 
141
        accel_x="200"
 
142
        accel_y="80"
 
143
        attack_area="15,18,26,26"
 
144
        body_area="all"
 
145
        duration="6"
 
146
        frame_info="2,8,2,2,232,407,21,18,2,9,2,2,253,407,21,17,2,8,2,2,274,407,21,18"
 
147
        frames="3"
 
148
        id="walk"
 
149
        image="compiled-2.png"
 
150
        rect="230,399,254,426"
 
151
        rotate_on_slope="yes"
 
152
        [/animation]
 
153
 
 
154
        [animation]
 
155
        accel_x="200"
 
156
        accel_y="80"
 
157
        attack_area="15,18,26,26"
 
158
        body_area="all"
 
159
        duplicates="6"
 
160
        duration="6"
 
161
        frame_info="2,8,2,2,295,407,21,18,2,9,2,2,316,407,21,17,2,8,2,2,337,407,21,18"
 
162
        frames="3"
 
163
        id="walk"
 
164
        image="compiled-2.png"
 
165
        rect="293,399,317,426"
 
166
        rotate_on_slope="yes"
 
167
        [/animation]
 
168
 
 
169
        [animation]
 
170
        accel_x="0"
 
171
        accel_y="80"
 
172
        body_area="all"
 
173
        duration="4"
 
174
        frame_info="1,13,1,2,545,458,23,13"
 
175
        frames="1"
 
176
        id="spring"
 
177
        image="compiled-2.png"
 
178
        rect="544,445,568,472"
 
179
        rotate_on_slope="yes"
 
180
        [/animation]
 
181
 
 
182
        [animation]
 
183
        accel_x="0"
 
184
        accel_y="80"
 
185
        attack_area="0,18,26,26"
 
186
        body_area="all"
 
187
        duration="4"
 
188
        frame_info="3,9,2,2,342,425,20,17,4,9,4,2,362,425,17,17,2,9,3,2,379,425,20,17"
 
189
        frames="3"
 
190
        id="turn"
 
191
        image="compiled-2.png"
 
192
        rect="339,416,363,443"
 
193
        rotate_on_slope="yes"
 
194
        [/animation]
 
195
 
 
196
        [animation]
 
197
        accel_x="0"
 
198
        accel_y="80"
 
199
        body_area="all"
 
200
        duration="18"
 
201
        events="6:12:18:hurtflicker"
 
202
        frame_info="2,8,3,1,755,369,20,19"
 
203
        frames="1"
 
204
        id="hurt"
 
205
        image="compiled-2.png"
 
206
        rect="753,361,777,388"
 
207
        rotate_on_slope="yes"
 
208
        [/animation]
 
209
 
 
210
[/prototype]
 
211