File: fish.cfg

package info (click to toggle)
frogatto-data 1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy
  • size: 201,844 kB
  • sloc: python: 302; xml: 223; perl: 139; sh: 48; makefile: 13; ruby: 4
file content (90 lines) | stat: -rw-r--r-- 2,253 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
[prototype]
	prototype=hittable
	hitpoints=5
	traction_in_water=1000
	traction_in_air=0
 	friction=1000
 	has_feet=no
	solid_dimensions=enemy,common

	solid_area=3,3,27,19

	[vars]
		points_value="20"
	[/vars]

	[editor_info]
	category=animals
		[var]
		name=x_bound
		type=x
		value="x - 200"
		[/var]
		[var]
		name=x2_bound
		type=x
		value="x2 + 200"
		[/var]
		[var]
		name=desired_height
		type=y
		value="y"
		[/var]
	[/editor_info]
		
	[properties]
		team="'evil'"
		hurt_velocity_y=0
		hurt_velocity_x=0
		attack_damage=1

		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)"
		
		ideal_x="def() ((vars.x2_bound + vars.x_bound) / 2)"
		
		inside_aggro_range="def(distance) if(abs(ideal_x() - midpoint_x) < distance, 1, 0)"
		
		target_y="def() (vars.desired_height + (wave(cycle*10+1000)/15))"

	[/properties]
	

	
	on_die="[score(level,points_value), spawn_item(self), death_burst(self)]"
		
### collision handling:	
	on_collide_side="[set(velocity_x, 0), facing(-facing)]"
	
	on_surface_damage="die()"
	
	on_exit_water="die()"


### animation switching:
	on_end_hurt_anim="set(animation, 'swim')"

	on_end_swim_anim="if(facing < 0 and x < vars.x_bound or
	                facing > 0 and x2 > vars.x2_bound,
					[facing(-facing), animation('swim')],
					animation('swim'))"
					
	on_process_swim="if(abs(y - target_y()) > 10, set(accel_y, (20*if(target_y() < y, -1, 1))), [set(accel_y,0)])"

	timer_frequency=10
	on_timer="if(solid(level, front + facing*90, y, 1, y2 - y),
	            [facing(-facing)])"
	
	
### error condition handling:
	on_change_solid_dimensions_fail="if(tmp.in_change_dimensions_fail or (not collide_with), die(),
	          [set(tmp.in_change_dimensions_fail, 1),
			   fire_event(collide_with, 'blocking_thrown_object'),
			   set(solid_dimensions_in, consts.solid_dimensions),
			   set(tmp.in_change_dimensions_fail, 0)
			  ])"
	on_change_animation_failure="[die()]"
	on_add_object_fail="[if(collide_with.vars.team != vars.team and collide_with.get_hit_by, collide_with.get_hit_by(me)), die()]"



[/prototype]