diff options
| author | Mittendrein Markus <maxmitti@gmx.net> | 2016-03-03 14:12:32 +0100 |
|---|---|---|
| committer | Mittendrein Markus <maxmitti@gmx.net> | 2016-03-03 14:12:32 +0100 |
| commit | 03d817ec64a7fb7e8f88f18796df79cfd7273cb0 (patch) | |
| tree | 497099f4b51943a5f8317a796bd118f29733b5db /TemplePushing.c4s/System.c4g | |
| parent | 2cd381b339ac1186bc426817e33ec3a99a3a99c2 (diff) | |
| download | tempelschubsen-03d817ec64a7fb7e8f88f18796df79cfd7273cb0.tar.gz tempelschubsen-03d817ec64a7fb7e8f88f18796df79cfd7273cb0.zip | |
Let magic lightning hit targets from the beginning on
Diffstat (limited to 'TemplePushing.c4s/System.c4g')
| -rw-r--r-- | TemplePushing.c4s/System.c4g/MagicLightning.c | 12 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/MagicLightningBolt.c | 25 |
2 files changed, 26 insertions, 11 deletions
diff --git a/TemplePushing.c4s/System.c4g/MagicLightning.c b/TemplePushing.c4s/System.c4g/MagicLightning.c index ebed7a5..59aacf9 100644 --- a/TemplePushing.c4s/System.c4g/MagicLightning.c +++ b/TemplePushing.c4s/System.c4g/MagicLightning.c @@ -17,8 +17,18 @@ func Activate(pCaster,pRealcaster) { // Blitz erzeugen var obj = CreateObject(LGTS, -GetX(), -GetY(), GetOwner(pClonk)); - obj->Launch(GetX(pCaster)+GetVertex(0, VTX_X, pCaster), GetY(pCaster)+GetVertex(0, VTX_Y, pCaster), (!GetDir(pCaster))*1800); + obj->Launch(pCaster, GetX(pCaster)+GetVertex(0, VTX_X, pCaster), GetY(pCaster)+GetVertex(0, VTX_Y, pCaster), (!GetDir(pCaster))*1800); Sound("Thunder*"); RemoveObject(); return(1); } + +public func ActivateAngle(object pCaller, int iAngle) +{ + var obj = CreateObject(LGTS, -GetX(), -GetY(), GetOwner(pCaller)); + obj->Launch(pCaller, GetX(pCaller), GetY(pCaller), (900-iAngle*10)); + Sound("Thunder*"); + + RemoveObject(); + return(1); +} diff --git a/TemplePushing.c4s/System.c4g/MagicLightningBolt.c b/TemplePushing.c4s/System.c4g/MagicLightningBolt.c index bd94dd9..9b77ef0 100644 --- a/TemplePushing.c4s/System.c4g/MagicLightningBolt.c +++ b/TemplePushing.c4s/System.c4g/MagicLightningBolt.c @@ -4,6 +4,8 @@ #appendto LGTS +local caster; + private func Advance() { var obj; @@ -23,7 +25,7 @@ private func Advance() if (GBackLiquid(iVtxX-GetX(), iVtxY-GetY() )) { // Alle Lebewesen in der Nähe bekommen was ab - for (obj in FindObjects(Find_InRect(iVtxX-GetX()-400, iVtxY-GetY()-400, 800, 800), Find_Or(Find_OCF(OCF_Alive), Find_Func("IsForceField")), Find_NoContainer(), Find_Layer(GetObjectLayer()) )) + for (obj in FindObjects(Find_InRect(iVtxX-GetX()-400, iVtxY-GetY()-400, 800, 800), Find_Or(Find_OCF(OCF_Alive), Find_Func("IsForceField")), Find_NoContainer(), Find_Layer(GetObjectLayer()), Find_Exclude(caster))) { if(!PathFree(iVtxX, iVtxY, GetX(obj), GetY(obj))) continue; if(!GBackLiquid(GetX(obj)-GetX(), GetY(obj)-GetY())) continue; @@ -44,16 +46,13 @@ private func Advance() // Objektanziehung iVtx = GetVertexNum()-1; iVtxX = GetVertex(iVtx, 0); iVtxY = GetVertex(iVtx, 1); - if (iVtx>7) + for (var obj in FindObjects( Find_AtRect(iVtxX-GetX()-13, iVtxY-GetY()-13, 26, 26), Find_Or(Find_OCF(OCF_Alive), Find_Func("IsForceField")), Find_Layer(GetObjectLayer()), Find_NoContainer(), Find_Exclude(caster) ) ) { - for (var obj in FindObjects( Find_AtRect(iVtxX-GetX()-13, iVtxY-GetY()-13, 26, 26), Find_Or(Find_OCF(OCF_Alive), Find_Func("IsForceField")), Find_Layer(GetObjectLayer()), Find_NoContainer() ) ) - { - if(!PathFree(iVtxX, iVtxY, GetX(obj), GetY(obj))) continue; - Attraction(obj); - break; - } + if(!PathFree(iVtxX, iVtxY, GetX(obj), GetY(obj))) continue; + Attraction(obj); + break; } - for(obj in FindObjects(Find_ID(GetID()), Find_Distance(35,iVtxX-GetX(), iVtxY-GetY()), Find_Layer(GetObjectLayer()), Find_Exclude(this()))) + for(obj in FindObjects(Find_ID(GetID()), Find_Distance(35,iVtxX-GetX(), iVtxY-GetY()), Find_Layer(GetObjectLayer()), Find_Exclude(this()), Find_Exclude(caster))) { AttractionLightning(obj); break; @@ -62,4 +61,10 @@ private func Advance() Timer(); // Weiter return; -}
\ No newline at end of file +} + +public func Launch(object caller) +{ + caster = caller; + return _inherited(...); +} |
