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

« back to all changes in this revision

Viewing changes to data/objects/fish/fish_blue_darter.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=fish_blue_darter
 
4
        prototype=hittable
 
5
        hitpoints=3
 
6
        traction_in_water=1000
 
7
        traction_in_air=0
 
8
        friction=1000
 
9
        has_feet=no
 
10
 
 
11
        [editor_info]
 
12
        category=fish
 
13
                [var]
 
14
                name=x_bound
 
15
                type=x
 
16
                value="x - 200"
 
17
                [/var]
 
18
                [var]
 
19
                name=x2_bound
 
20
                type=x
 
21
                value="x2 + 200"
 
22
                [/var]
 
23
                [var]
 
24
                name=desired_height
 
25
                type=y
 
26
                value="y"
 
27
                [/var]
 
28
        [/editor_info]
 
29
 
 
30
 
 
31
        [vars]
 
32
                team="'evil'"
 
33
                points_value="5"
 
34
                damage=1
 
35
        [/vars]
 
36
        
 
37
        [properties]
 
38
                player_within="def(distance) if((level.player.midpoint_x > midpoint_x - distance) and (level.player.midpoint_x < midpoint_x + distance) and (level.player.midpoint_y > midpoint_y - distance) and (level.player.midpoint_y < midpoint_y + distance), 1, 0)"
 
39
                
 
40
                ideal_x="def() ((vars.x2_bound + vars.x_bound) / 2)"
 
41
                
 
42
                inside_aggro_range="def(distance) if(abs(ideal_x() - midpoint_x) < distance, 1, 0)"
 
43
                
 
44
                target_y="def() (vars.desired_height)"
 
45
        [/properties]
 
46
        
 
47
        mass=6
 
48
 
 
49
        on_hit_by_player="die()"
 
50
        on_die="[score(level,20), spawn_item(me), spawn('die_cloud', midpoint_x, midpoint_y, facing)]"
 
51
 
 
52
        timer_frequency=10
 
53
        on_timer="if(solid(level, front + facing*90, y, 1, y2 - y),
 
54
                    [facing(-facing)])"
 
55
                    
 
56
        on_end_anim="[set(tmp.already_hit, [])]"
 
57
 
 
58
        on_end_hurt_anim="set(animation, 'swim')"
 
59
 
 
60
        on_end_swim_anim="if(facing < 0 and x < vars.x_bound or
 
61
                        facing > 0 and x2 > vars.x2_bound,
 
62
                                        [facing(-facing), animation('swim')],
 
63
                                        animation('swim'))"
 
64
                                        
 
65
                                        
 
66
                                
 
67
        on_collide="[set(velocity_x, 0), facing(-facing)]"
 
68
        on_change_animation_failure="die()"
 
69
        on_exit_water="die()"
 
70
 
 
71
        
 
72
 
 
73
        on_process_swim="if(abs(y - target_y()) > 10, set(accel_y, (20*if(target_y() < y, -1, 1))), [set(accel_y,0)])"
 
74
 
 
75
solid_area=3,3,27,19
 
76
                [base:animation]
 
77
                image=enemies/fish-blue-darter.png
 
78
                pad=3
 
79
                body_area=all
 
80
                attack_area=all
 
81
                [/animation]
 
82
 
 
83
                [animation]
 
84
                id=swim
 
85
                duplicates=6
 
86
                rect=2,1,42,29
 
87
                frames=4
 
88
                duration=6
 
89
                accel_x=40
 
90
                [/animation]
 
91
 
 
92
                [animation]
 
93
                id=swim         #blink variant
 
94
                rect=2,33,42,61
 
95
                frames=4
 
96
                duration=6
 
97
                accel_x=20
 
98
                [/animation]
 
99
 
 
100
                [animation]
 
101
                id=startle
 
102
                rect=2,65,42,93
 
103
                frames=1
 
104
                duration=10
 
105
                [/animation]
 
106
 
 
107
                [animation]
 
108
                id=hurt
 
109
                rect=90,65,130,93
 
110
                frames=1
 
111
                duration=10
 
112
                [/animation]
 
113
 
 
114
                [animation]
 
115
                id=swimMad
 
116
                rect=2,97,42,125
 
117
                frames=4
 
118
                duration=6
 
119
                accel_x=30
 
120
                [/animation]
 
121
 
 
122
        [/object_type]