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.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c
index 2308576..8c395b4 100644
--- a/TemplePushing.c4s/System.c4g/Clonk.c
+++ b/TemplePushing.c4s/System.c4g/Clonk.c
@@ -1,6 +1,11 @@
+/* Clonk */
+
#strict 2
#appendto CLNK
+local rotateInJump;
+local removeOnDeath;
+
protected func ControlSpecial()
{
[$Push$|Image=CXIV]
@@ -22,6 +27,28 @@ protected func ControlSpecial()
if (GetLength(clonks) == 0) return 0;
// Randomly select clonk to be pushed
- Fling(clonks[Random(GetLength(clonks))], -1 + GetDir() * 2, -1);
+ var target = clonks[Random(GetLength(clonks))];
+ Fling(target, -1 + GetDir() * 2, -1);
+ target->SetKiller(GetOwner());
+
return 1;
}
+
+protected func ControlLeft()
+{
+ if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Left);
+ return _inherited();
+}
+
+protected func ControlRight()
+{
+ if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Right);
+ return _inherited();
+}
+
+protected func Death(int killedBy)
+{
+ var ret = _inherited(killedBy);
+ if (removeOnDeath) RemoveObject();
+ return ret;
+} \ No newline at end of file