diff options
| author | Mittendrein Markus <maxmitti@gmx.net> | 2015-07-29 20:16:14 +0200 |
|---|---|---|
| committer | Mittendrein Markus <maxmitti@gmx.net> | 2015-07-29 20:16:14 +0200 |
| commit | 85def752866d7de925f7fdedba6fac4229aa3cfc (patch) | |
| tree | 1ecf2b43165ba12b483b8bffa851f75431c4432a /TemplePushing.c4s/System.c4g/Clonk.c | |
| parent | 070efdaa1839f28d1ca93c33945930539d0d2158 (diff) | |
| download | tempelschubsen-85def752866d7de925f7fdedba6fac4229aa3cfc.tar.gz tempelschubsen-85def752866d7de925f7fdedba6fac4229aa3cfc.zip | |
Added CheckStuck2-Effect to Clonk.c to try to avoid stucking in a corner while walking.
Diffstat (limited to 'TemplePushing.c4s/System.c4g/Clonk.c')
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Clonk.c | 23 |
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); + } +} |
