From f1ece16c08d8c01e1d49a25f0314a96c021e73cb Mon Sep 17 00:00:00 2001 From: Jan <> Date: Fri, 10 Jul 2015 18:11:22 +0200 Subject: r0.921 --- TemplePushing.c4s/System.c4g/CurseFall.c | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 TemplePushing.c4s/System.c4g/CurseFall.c (limited to 'TemplePushing.c4s/System.c4g/CurseFall.c') diff --git a/TemplePushing.c4s/System.c4g/CurseFall.c b/TemplePushing.c4s/System.c4g/CurseFall.c new file mode 100644 index 0000000..3b8c451 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/CurseFall.c @@ -0,0 +1,43 @@ +/*-- Kill tracking falling curse --*/ + +#strict 2 +#appendto CFAL + +protected func FxCurseFallingStart(pClonk, iEffectNumber, iTemp, iX, iY, pCaller) +{ + EffectVar(6, pClonk, iEffectNumber) = GetController(pCaller); + return _inherited(pClonk, iEffectNumber, iTemp, iX, iY, pCaller); +} + +protected func FxCurseFallingTimer(pClonk, iEffectNumber, iEffectTime) +{ + var rval = FxCurseTimer(pClonk, iEffectNumber, iEffectTime); + if (rval != FX_OK) return rval; + if (FxCurseIsActive(pClonk, iEffectNumber)) + { + var killer = EffectVar(6, pClonk, iEffectNumber); + // Bei Bedarf stolpern + if(pClonk->GetContact(0, -1, 8)) + { + if(GetXDir(pClonk) || GetAction(pClonk) != "Walk" ) + { + if(WildcardMatch(GetAction(pClonk), "*Magic") || WildcardMatch(GetAction(pClonk), "*Cast")) + { + // Bei Magie-Aktion nicht so häufig stören + if(!Random(120)) { ObjectSetAction(pClonk, "FlatUp"); SetXDir(0, pClonk); SetKiller(killer, pClonk); } + } + else + { + if(!Random(60)) { ObjectSetAction(pClonk, "KneelDown"); SetXDir(0, pClonk); SetKiller(killer, pClonk); } + if(!Random(60)) { ObjectSetAction(pClonk, "FlatUp"); SetXDir(0, pClonk); SetKiller(killer, pClonk); } + } + } + } + // In Flug nur Tumble + else + { + if(!Random(50)) { ObjectSetAction(pClonk, "Tumble"); SetKiller(killer, pClonk); } + } + } + return FX_OK; +} -- cgit v1.2.3-54-g00ecf