File: metal_barrel.cfg

package info (click to toggle)
frogatto-data 1.0-2
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze
  • size: 155,116 kB
  • sloc: makefile: 1
file content (48 lines) | stat: -rw-r--r-- 1,836 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
[object_type]
	always_active=true
	[vars]
		points_value="1"
		damage=1
		mass=200
	[/vars]
	id=metal_barrel
	zorder=-1
	object_level_collisions=yes
	solid_area=0,0,27,27
	
	on_create="set(tmp.cld, 1)"
	
	on_process="[
		# Set according to slope (may need tweaking) and kill velocity if underwater. #
		set(velocity_x, 
			(((velocity_x + (slope_standing_on / 2)) * 997) / 1000) 
			- (underwater * (velocity_x * 2) / 10) 
			+ ((velocity_x^2 < 15000) * (slope_standing_on = 0) * ((velocity_x < 0)*60 - (velocity_x > 0)*60))),
		set(velocity_y, ((velocity_y * 997) / 1000) + underwater * (((velocity_y * 9) / 10) - velocity_y + 80)),
		if (midpoint_y > 4000, die()) #That should be OK for now, untill we have a level that reaches 5000. Should be bottom of level - 100.#
	]"
	
	on_collide="[	set(velocity_x, if(collide_with and collide_with != null and tmp.cld = 1, collide_with.velocity_x, (-velocity_x*70)/100)),
					#if (collide_with and collide_with != null, if(tmp.cld = 1, [set(collide_with.tmp.cld, 0)])),#
					if (collide_with and collide_with != null and tmp.cld = 1, [set(collide_with.tmp.cld, 0), set(collide_with.velocity_x, velocity_x)]),
	#collided yet?#	set(tmp.cld, 1)]"
	
	on_enter_water="[
		add_wave(midpoint_x, y2, -2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
		add_wave(midpoint_x, y2, 2000, 5*velocity_y/2, 30*velocity_y, 300, 300),
		add_wave(midpoint_x, y2, -1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
		add_wave(midpoint_x, y2, 1000, 3*velocity_y/2, 20*velocity_y, 200, 200),
		add_wave(midpoint_x, y2, -500, 2*velocity_y/2, 10*velocity_y, 100, 100),
		add_wave(midpoint_x, y2, 500, 2*velocity_y/2, 10*velocity_y, 100, 100)
	]"
	
	[animation]
		id=normal
		image=props/barrel.png
		rect=9,38,33,64
		collide=0,0,27,27
		attack_area=0,0,27,27
		body_area=all	
		accel_y=60
	[/animation]
[/object_type]