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

« back to all changes in this revision

Viewing changes to data/compiled/objects/key_red.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
collide_dimensions="~key"
 
3
friction="1000"
 
4
id="key_red"
 
5
mass="5"
 
6
on_collide="set(velocity_x, -(velocity_x*70)/100)"
 
7
on_collide_feet="[set(velocity_x, (velocity_x*50)/100), if(abs(velocity_x) < 50, set(velocity_x, 0)), set(velocity_y, if(abs(velocity_y) > 50, -velocity_y/2, 0))]"
 
8
on_collide_head="set(velocity_y, -velocity_y)"
 
9
on_collide_object_body="if(collide_with_area = 'attack', get_hit_by(collide_with))"
 
10
on_enter_water="[
 
11
                add_wave(midpoint_x, y2, -2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
 
12
                add_wave(midpoint_x, y2, 2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
 
13
                add_wave(midpoint_x, y2, -1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
 
14
                add_wave(midpoint_x, y2, 1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
 
15
                add_wave(midpoint_x, y2, -500, 2*velocity_y/2, 10*velocity_y, 100, 100),
 
16
                add_wave(midpoint_x, y2, 500, 2*velocity_y/2, 10*velocity_y, 100, 100)
 
17
        ]"
 
18
on_hurtflicker="if(green = 100,[set(green, 255), set(blue, 255)],[set(green, 100), set(blue, 100)])"
 
19
on_leave_hurt_anim="[set(green, 255), set(blue, 255)]"
 
20
solid_area="0,0,15,15"
 
21
solid_dimensions="thrown"
 
22
tags="swallowable"
 
23
zorder="-1"
 
24
        [properties]
 
25
        get_hit_by="def(collide_with) execute(me,
 
26
                     if(not (me in collide_with.tmp.already_hit), [
 
27
                                set(collide_with.tmp, 'already_hit', collide_with.tmp.already_hit + [me]),
 
28
                                if((not is_invincible_posthit) and (collide_with.vars.damage > 0),
 
29
                                        if(collide_with.vars.damage > consts.armor,
 
30
                                          [
 
31
                                           if(me.hitpoints > collide_with.vars.damage,
 
32
                                                [
 
33
                                                  if(collide_with.vars.damage <= consts.flinch_threshold,
 
34
                                                        schedule(4, [set(me.green, 255), set(me.blue, 255)]),
 
35
                                                        set(me.animation, 'hurt')),
 
36
                                                  set(me.green, 100), set(me.blue, 100)
 
37
                                                ]),
 
38
                                           set(me.hitpoints, me.hitpoints - collide_with.vars.damage),
 
39
                                           set(tmp.time_last_hit, me.cycle)
 
40
                                          ])),
 
41
                                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))),
 
42
                                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)))]))"
 
43
        hurt_velocity_x="400"
 
44
        hurt_velocity_y="-800"
 
45
        is_invincible_posthit="if(tmp.time_last_hit and (abs(tmp.time_last_hit - me.cycle) < consts.posthit_invicibility_period), 1, 0)"
 
46
        [/properties]
 
47
 
 
48
        [tmp]
 
49
        time_last_hit="0"
 
50
        [/tmp]
 
51
 
 
52
        [vars]
 
53
        damage="1"
 
54
        [/vars]
 
55
 
 
56
        [properties]
 
57
        get_hit_by="def(collide_with)  null()"
 
58
        [/properties]
 
59
 
 
60
        [animation]
 
61
        accel_y="80"
 
62
        body_area="all"
 
63
        frame_info="0,0,0,0,612,400,16,16"
 
64
        id="normal"
 
65
        image="compiled-0.png"
 
66
        rect="612,400,627,415"
 
67
        [/animation]
 
68
 
 
69
        [animation]
 
70
        accel_y="80"
 
71
        body_area="all"
 
72
        frame_info="0,0,0,0,612,400,16,16"
 
73
        id="thrown"
 
74
        image="compiled-0.png"
 
75
        rect="612,400,627,415"
 
76
        [/animation]
 
77
 
 
78
[/prototype]
 
79