summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/System.c4g/Icestrike.c
blob: ccff6a9de9a8d735607b13848b9ccd9a92242b95 (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
/*-- Icestrike --*/

#strict 2

#appendto MICS

func Activate(pCaller, pRealcaller)
{
	var pClonk;
	if(pRealcaller) pClonk=pRealcaller;
	else pClonk=pCaller;

	// Effekt prüfen
	var iResult;
	if (iResult = CheckEffect("IcestrikeNSpell", 0, 125)) return(iResult!=-1 && RemoveObject());

	// Zauber
	Sound("Magic*");
	var iX, iY;
	iX=AbsX(GetX(pCaller)-25+50*GetDir(pCaller));
	iY=AbsY(GetY(pCaller));
	pBall=CreateObject(ICEB, AbsX(GetX(pCaller)-25+50*GetDir(pCaller)), AbsY(GetY(pCaller)), GetOwner(pCaller));
	pBall->SetCaster(pCaller);

	// Zielen wenn möglich
	if (pClonk->~DoSpellAim(this(), pCaller)) return(1);
	return(1);
}

// Aktivierung nach Zielen (iAngle: -90=links; 0=oben; +90=rechts)
public func ActivateAngle(object pCaller, int iAngle)
{
	// Eisball freigeben (wenn noch existent)
	if (pBall) pBall->SetAngle(iAngle);
	
	// Objekt löschen
	return(RemoveObject());
}