summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/System.c4g/ShootInventory.c
blob: f2636dd8b538ea76ad57e24e8438d239600efc0d (plain)
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
/*-- Shoot inventory object --*/

#strict 2

#appendto AXE1
#appendto EGBL
#appendto EFLN
#appendto GBLT
#appendto ROCK
#appendto SWOR

protected func Activate(object clonk)
{
	[$Shoot$|Image=GNPW]

	// Sound
	if (GetID() == EGBL)
	{
		Sound("Crystal3");
	}
	else if (GetID() == GBLT)
	{
		Sound("Crystal3");
	}
	else
	{
		Sound("Blast2");
	}

	// Make shooting clonk responsible for possible kill
	SetController(clonk->GetOwner());

	// Shoot
	if (GetID() == EGBL)
	{
		Exit(0, -20 + 40 * clonk->GetDir());
		SetXDir(-100 + 200 * clonk->GetDir());
	}
	else if (GetID() == ROCK)
	{
		Exit(0, -15 + 30 * clonk->GetDir());
		SetXDir(-100 + 200 * clonk->GetDir());
	}
	else
	{
		Exit(0, -10 + 20 * clonk->GetDir());
		SetXDir(-80 + 160 * clonk->GetDir());
	}

	SetYDir(-10);

	return 1;
}