summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/System.c4g/Stoneshield.c
blob: 885b921ef2277f22e8a4c9b095973c425b851ee8 (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
/*-- Show selector, but only if targets are available --*/
#strict 2
#appendto MSSH

func Activate(pCaster,pRealcaster)
{
	var pClonk=pRealcaster;
	if(!pClonk) pClonk=pCaster;

	var pCombo;
	// Stein verlängert die Wirkungsdauer
	if (pCombo = FindContents(ROCK, pCaster))
	{
		fRock = true;
		RemoveObject(pCombo);
	}

	// Auswählen wenn möglich
	var selector;
	if ((selector = pClonk->~DoSpellSelect(this,300,pCaster)) && (selector->CountTargets() > 1 || !SelectorTarget(pClonk))) return 1;
	if (selector) RemoveObject(selector);

	// Clonk kann nicht auswählen: Clonk bekommst selbst ein Schild
	if (SelectorTarget(pClonk))
		return(ActivateTarget(pClonk, pClonk));

	// ansonsten geth nich
	RemoveObject();
	return(0);
}