diff options
| author | Jan <> | 2015-07-10 18:11:22 +0200 |
|---|---|---|
| committer | Jan <_> | 2015-07-10 18:47:01 +0200 |
| commit | f1ece16c08d8c01e1d49a25f0314a96c021e73cb (patch) | |
| tree | 9bc9f547f2524dee8e62f168f317df465a6cbcdd /TemplePushing.c4s/System.c4g/CurseFall.c | |
| parent | 80b15646d73587f4e15a2897314692b58aa1a47f (diff) | |
| download | tempelschubsen-f1ece16c08d8c01e1d49a25f0314a96c021e73cb.tar.gz tempelschubsen-f1ece16c08d8c01e1d49a25f0314a96c021e73cb.zip | |
r0.921
Diffstat (limited to 'TemplePushing.c4s/System.c4g/CurseFall.c')
| -rw-r--r-- | TemplePushing.c4s/System.c4g/CurseFall.c | 43 |
1 files changed, 43 insertions, 0 deletions
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; +} |
