diff options
| author | Mittendrein Markus <maxmitti@gmx.net> | 2015-07-30 17:53:37 +0200 |
|---|---|---|
| committer | Mittendrein Markus <maxmitti@gmx.net> | 2015-07-31 15:55:27 +0200 |
| commit | 9808345d95abd6587f5e72a8b904370f98770666 (patch) | |
| tree | ad19f6453b57e5d8a9e4990a6db76ca9a93329c9 /TemplePushing.c4s | |
| parent | af236597f7b3a41f0241b59ad710eca521edc0e2 (diff) | |
| download | tempelschubsen-9808345d95abd6587f5e72a8b904370f98770666.tar.gz tempelschubsen-9808345d95abd6587f5e72a8b904370f98770666.zip | |
Clean and improve float-spell
Diffstat (limited to 'TemplePushing.c4s')
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/Brick.c4d/Script.c | 2 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Gravity.c | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/TemplePushing.c4s/Misc.c4d/Brick.c4d/Script.c b/TemplePushing.c4s/Misc.c4d/Brick.c4d/Script.c index 4a70dd2..3f9cdc5 100644 --- a/TemplePushing.c4s/Misc.c4d/Brick.c4d/Script.c +++ b/TemplePushing.c4s/Misc.c4d/Brick.c4d/Script.c @@ -27,3 +27,5 @@ func CheckHit() if (GetY() >= yMax) ContactBottom(); if (GetY() <= yMin) ContactTop(); } + +protected func IgnoreFloatSpell() { return true; } diff --git a/TemplePushing.c4s/System.c4g/Gravity.c b/TemplePushing.c4s/System.c4g/Gravity.c new file mode 100644 index 0000000..f20b898 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Gravity.c @@ -0,0 +1,48 @@ +/*-- Neues Script --*/
+
+#strict 2
+#appendto GVTY
+
+func FxFloatPSpellTimer(pClonk, iEffectNumber, iEffectTime)
+{
+ if(!EffectVar(0,pClonk,iEffectNumber)) return -1;
+ if(!EffectVar(1,pClonk,iEffectNumber)) return -1;
+ EffectVar(0,pClonk,iEffectNumber)--;
+
+ var iSearchRadius = GetRange();
+ var pObj;
+ CreateParticle("Aura",GetX(pClonk),GetY(pClonk), RandomX(-1,1),RandomX(-1,1), 12*iSearchRadius,RGB(50,255,180));
+ var i=2;
+ while(i--)
+ {
+ var angle = RandomX(-180, 180);
+ CreateParticle("PSpark",GetX(pClonk)+Sin(angle, iSearchRadius),GetY(pClonk)-Cos(angle, iSearchRadius),
+ -Sin(angle, iSearchRadius/3),Cos(angle, iSearchRadius/3),RandomX(50,70),
+ RGBa(150,155,80, 75),pClonk);
+ }
+ CastParticles("PSpark", 3, iSearchRadius/3, GetX(pClonk), GetY(pClonk)+8, 50, 70, RGBa(150,155,80, 75), RGBa(150,155,80, 75), pClonk);
+
+ // Find objects and stop them
+ for(var obj in FindObjects(Find_Distance(iSearchRadius, GetX(pClonk), GetY(pClonk)), Find_Not(Find_Func("IgnoreFloatSpell")), Find_Not(Find_OCF(OCF_CrewMember)), Find_Not(Find_Effect("StopNSpell")), Find_NoContainer())) EffectVar(1,pClonk,iEffectNumber)->~DoStop(obj, pClonk);
+
+ return 1;
+}
+
+func FxStopNSpellTimer(pTarget, iNumber, iEffectTime)
+{
+ if(iEffectTime>600) return -1;
+
+ SetXDir(0,pTarget);
+ SetYDir(-2 * GetGravity(),pTarget,1000);
+
+ if (!FindObject2(Find_ID(GVTY), Find_Distance(GetRange(), GetX(pTarget), GetY(pTarget)))) return -1;
+}
+
+func DoStop(object pObj, object pCaller)
+{
+ if(GetEffect("StopNSpell", pObj)) return;
+ pObj->~MagicStop(pCaller);
+ AddEffect("StopNSpell", pObj, 200, 1, 0, GVTY);
+
+ return 0;
+}
|
