summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s
diff options
context:
space:
mode:
Diffstat (limited to 'TemplePushing.c4s')
-rw-r--r--TemplePushing.c4s/System.c4g/MagicLightning.c12
-rw-r--r--TemplePushing.c4s/System.c4g/MagicLightningBolt.c25
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(...);
+}