summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/System.c4g/Clonk.c
diff options
context:
space:
mode:
Diffstat (limited to 'TemplePushing.c4s/System.c4g/Clonk.c')
-rw-r--r--TemplePushing.c4s/System.c4g/Clonk.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c
index adc3c41..9753271 100644
--- a/TemplePushing.c4s/System.c4g/Clonk.c
+++ b/TemplePushing.c4s/System.c4g/Clonk.c
@@ -39,11 +39,14 @@ protected func ControlThrow(object byObj)
}
*/
-protected func ControlSpecial()
+protected func CanPush()
{
- [$Push$|Image=CXIV]
+ return GetAction() == "Walk";
+}
- if (GetAction() != "Walk") return 0;
+func ExecutePush()
+{
+ if (!CanPush()) return 0;
// Use action "Throw" starting with phase 3
SetAction("Throw");
@@ -52,10 +55,10 @@ protected func ControlSpecial()
// Find clonks in range
var clonks = FindObjects(
Find_ID(CLNK),
- Find_InRect(-20 + GetDir() * 29, 0, 12, 10),
- Find_OCF(OCF_Alive),
- Find_Hostile(GetOwner()),
- Find_Not(Find_Action("Tumble")));
+ Find_InRect(-20 + GetDir() * 29, 0, 12, 10),
+ Find_OCF(OCF_Alive),
+ Find_Hostile(GetOwner()),
+ Find_Not(Find_Action("Tumble")));
if (GetLength(clonks) == 0) return 0;
@@ -71,7 +74,15 @@ protected func ControlSpecial()
Fling(target, -1 + GetDir() * 2, -1);
target->SetKiller(GetOwner());
}
+}
+
+protected func ControlSpecial()
+{
+ [$Push$|Image=CXIV|Condition=CanPush]
+
+ if (!CanPush()) return 0;
+ PushExecuter->RequestPush(this);
return 1;
}