From ca61c54b9bd69af897e4cc9d4385137fb56fd11a Mon Sep 17 00:00:00 2001 From: Jan <> Date: Mon, 2 Feb 2015 17:58:18 +0100 Subject: TemplePushingBeta.c4s --- TemplePushing.c4s/System.c4g/Clonk.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'TemplePushing.c4s/System.c4g/Clonk.c') diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c index 8c395b4..c934938 100644 --- a/TemplePushing.c4s/System.c4g/Clonk.c +++ b/TemplePushing.c4s/System.c4g/Clonk.c @@ -1,11 +1,25 @@ /* Clonk */ #strict 2 + #appendto CLNK local rotateInJump; local removeOnDeath; +protected func ControlThrow(object byObj) +{ + // First check if the clonk already handles the throw control + var ret = _inherited(byObj); + if (ret) return ret; + + // Launch arrow from pack in inventory + var arrowPack = Contents(); + if (!arrowPack || !arrowPack->~IsArrowPack()) return 0; + arrowPack->Activate(this); + return 1; +} + protected func ControlSpecial() { [$Push$|Image=CXIV] @@ -21,8 +35,7 @@ protected func ControlSpecial() Find_ID(CLNK), Find_InRect(-10 + GetDir() * 20, 0, 10, 10), Find_OCF(OCF_Alive), - // Only include allied players' clonks if "friendly pushing" rule is present - Find_Or(Find_Func(FindObject(FYPG)), Find_Hostile(GetOwner()))); + Find_Hostile(GetOwner())); if (GetLength(clonks) == 0) return 0; @@ -34,15 +47,16 @@ protected func ControlSpecial() return 1; } + protected func ControlLeft() { - if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Left); + if (rotateInJump && GetAction() == "Jump" || GetAction() == "Tumble") SetDir(DIR_Left); return _inherited(); } protected func ControlRight() { - if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Right); + if (rotateInJump && GetAction() == "Jump" || GetAction() == "Tumble") SetDir(DIR_Right); return _inherited(); } @@ -51,4 +65,9 @@ protected func Death(int killedBy) var ret = _inherited(killedBy); if (removeOnDeath) RemoveObject(); return ret; +} + +public func QueryCatchBlow(object arrow) +{ + return arrow->GetOwner() == GetOwner(); } \ No newline at end of file -- cgit v1.2.3-54-g00ecf