summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TemplePushing.c4s/System.c4g/Clonk.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c
index 3ac40a0..a951e0b 100644
--- a/TemplePushing.c4s/System.c4g/Clonk.c
+++ b/TemplePushing.c4s/System.c4g/Clonk.c
@@ -7,6 +7,12 @@
local rotateInJump;
local removeOnDeath;
+protected func Initialize()
+{
+ AddEffect("CheckStuck2", this, 20, 1, this);
+ return _inherited(...);
+}
+
/*
protected func ControlThrow(object byObj)
{
@@ -50,7 +56,6 @@ protected func ControlSpecial()
return 1;
}
-
protected func ControlLeft()
{
if (rotateInJump && GetAction() == "Jump" || GetAction() == "Tumble") SetDir(DIR_Left);
@@ -73,4 +78,18 @@ protected func Death(int killedBy)
public func QueryCatchBlow(object arrow)
{
return arrow->GetOwner() == GetOwner();
-} \ No newline at end of file
+}
+
+private func FxCheckStuck2Timer(object pTarget, int iEffectNumber, int iEffectTime)
+{
+ if (GetAction(pTarget) != "Walk") return;
+
+ var d = GetDir(pTarget)*2 - 1;
+ if (!pTarget->GBackSolid(0, 4) && !pTarget->GBackSolid(d, 3) && pTarget->GBackSolid(d, 4))
+ {
+ SetPosition(GetX(pTarget), GetY(pTarget) - 1, pTarget);
+ ObjectSetAction(pTarget, "KneelDown");
+ pTarget->Schedule("SetXDir(0)", 1);
+ if ((d == -1 && GetComDir(pTarget) != COMD_Left) || (d == 1 && GetComDir(pTarget) != COMD_Right)) SetComDir(COMD_Up, pTarget);
+ }
+}