summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d
diff options
context:
space:
mode:
authorMittendrein Markus <maxmitti@gmx.net>2016-02-14 17:06:53 +0100
committerMittendrein Markus <maxmitti@gmx.net>2016-02-14 17:16:34 +0100
commit33fc980e1ef5b82787f9687abe77d44f75d5a343 (patch)
treea78ad01ebbe9871ee2c346c5bd2df0db1062c36c /TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d
parent0a963831a8e4c58b0562c30b0afbe3ffaa889181 (diff)
downloadtempelschubsen-33fc980e1ef5b82787f9687abe77d44f75d5a343.tar.gz
tempelschubsen-33fc980e1ef5b82787f9687abe77d44f75d5a343.zip
Cleanup Crystal Spikes. Crystal Spikes heal allied clonks
Diffstat (limited to 'TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d')
-rw-r--r--TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/ActMap.txt2
-rw-r--r--TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/Script.c161
2 files changed, 75 insertions, 88 deletions
diff --git a/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/ActMap.txt b/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/ActMap.txt
index 5611746..6d2de21 100644
--- a/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/ActMap.txt
+++ b/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/ActMap.txt
@@ -13,7 +13,7 @@ EndCall=SoundBamm
Name=Exist
Procedure=NONE
Length=1
-Delay=1
+Delay=5
Facet=216,0,24,58
NextAction=Exist
EndCall=ExistTimer
diff --git a/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/Script.c b/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/Script.c
index 1d25b23..2f5cc9b 100644
--- a/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/Script.c
+++ b/TemplePushing.c4s/Misc.c4d/AdditionalSpells.c4d/CrystalSpikes.c4d/Kristall.c4d/Script.c
@@ -1,109 +1,96 @@
/*-- Crystal Spike --*/
-#strict
+#strict 2
local iMaxTime;
-local iExtra;
+public func IsBigCrystal() { return 1; }
-public func IsBigCrystal(){ return(1); }
-
-func Initialize() {
- var Randi = RandomX(1,4);
- if(Randi == 1) SetGraphics("A",this(), GetID(), 1,GFXOV_MODE_ExtraGraphics);
- if(Randi == 2) SetGraphics("B",this(), GetID(), 1,GFXOV_MODE_ExtraGraphics);
- if(Randi == 3) SetGraphics("C",this(), GetID(), 1,GFXOV_MODE_ExtraGraphics);
- if(Randi == 4) SetGraphics("D",this(), GetID(), 1,GFXOV_MODE_ExtraGraphics);
- SetAction("Bohr");
- return(1);
+func Initialize()
+{
+ SetGraphics(["A", "B", "C", "D"][Random(4)], this, GetID(), 1, GFXOV_MODE_ExtraGraphics);
+ SetAction("Bohr");
+ return 1;
}
-public func Set(inMaxTime, int iMetl){
- iMaxTime = inMaxTime;
- if(iMetl){ iExtra = iMetl;
- SetGraphics("Metl",this(), GetID(), 1,GFXOV_MODE_ExtraGraphics);
- }
- return(1);
+
+public func Set(int inMaxTime)
+{
+ iMaxTime = inMaxTime;
+ return 1;
}
-func StossEffect() {
-for(var pClonk in FindObjects(Find_Distance(20), Find_OCF(OCF_Living), Find_NoContainer ())){
- if(GetAlive(pClonk)) {
- if(!GetEffect("NoCrystallAttack",pClonk))
- HitObject(pClonk);
- }
- }
-for(var pDing in FindObjects(Find_Distance(30), Find_Category(C4D_Object), Find_NoContainer ())){
- HitDing(pDing);
- }
-
-if(!Random(1)) {CreateParticle("Smoke",0,+21,RandomX(-4,4),-5,80,RGB(120,120,120)); }
-if(!Random(2)) {
-var ebk = CreateObject(1EBK,0,+21,GetOwner());
-if(ebk) SetSpeed(RandomX(-5,5),RandomX(-40,-80),ebk);
- }
+func StossEffect()
+{
+ for (var pClonk in FindObjects(Find_Distance(20), Find_OCF(OCF_Living), Find_NoContainer(), Find_Hostile(GetOwner())))
+ {
+ if (GetAlive(pClonk))
+ {
+ if (!GetEffect("NoCrystalAttack", pClonk)) HitObject(pClonk);
+ }
+ }
+ for (var pDing in FindObjects(Find_Distance(30), Find_Category(C4D_Object), Find_NoContainer(), Find_Not(Find_ID(QBCY))))
+ {
+ HitDing(pDing);
+ }
+
+ CreateParticle("Smoke", 0, +21, RandomX(-4, 4), -5, 80, RGB(120, 120, 120));
}
-func ExistTimer() {
-if(!Random(20)) Sound("Sparkle");
-if(!Random(4)) {
-CreateParticle("NoGravSpark",RandomX(-8,8),RandomX(-28,26),0,-5,RandomX(10,30),GetTeamColor(GetPlayerTeam(GetOwner())));
- }
+func ExistTimer()
+{
+ if (!Random(4)) Sound("Sparkle");
+ CreateParticle("NoGravSpark", RandomX(-8, 8), RandomX(-28, 26), 0, -5, RandomX(10, 30), GetTeamColor(GetPlayerTeam(GetOwner())));
-for(var pClonk in FindObjects(Find_Distance(40), Find_OCF(OCF_Living), Find_NoContainer ())){
- if(GetAlive(pClonk)) if(!Random(20)) EffectObject(pClonk);
- }
+ for (var pClonk in FindObjects(Find_Distance(40), Find_OCF(OCF_Living), Find_NoContainer()))
+ {
+ if (GetAlive(pClonk)) EffectObject(pClonk);
+ }
-if(iMaxTime > 0){
-if(GetActTime() > iMaxTime) SetAction("Remove");
- }
+ if (iMaxTime > 0)
+ {
+ if (GetActTime() > iMaxTime) SetAction("Remove");
+ }
}
-global func CreateBigCrystal(int iX,int iY, int iCon, int iMTime, int iOwner) { // Erstell an der Position ein großen Kristall
-var pCrys = CreateObject(QBCY,iX,iY,iOwner);
-pCrys->Set(iMTime);
-SetCon(iCon,pCrys);
-return(pCrys);
-}
-func HitObject(object pClonk) {
-if(!pClonk) return(0);
-Sound("Crystal2",0,pClonk);
-if(!FindObject(NTMG)){
- if(!Hostile(GetOwner(),GetOwner(pClonk))) return(0);
- }
-if(GetAction(pClonk) ne "Tumble"){
-DoEnergy(RandomX(-10,-20)+iExtra,pClonk);
-Fling(pClonk, RandomX(-4,4), RandomX(-5,-9));
- AddEffect("NoCrystallAttack",pClonk,100,1,pClonk);
- }
+global func CreateBigCrystal(int iX, int iY, int iCon, int iMTime, int iOwner)
+{
+ var pCrys = CreateObject(QBCY, iX, iY, iOwner);
+ pCrys->Set(iMTime);
+ SetCon(iCon, pCrys);
+ return pCrys;
}
-func HitDing(object pDing) {
-if(GetID(pDing) == QBCY) return(0);
-if(pDing){ SetSpeed(RandomX(-4,4),RandomX(-20,-40),pDing);
-pDing->~Hit(); }
+
+func HitObject(object pClonk)
+{
+ Sound("Crystal2", 0, pClonk);
+ DoEnergy(-20, pClonk);
+ Fling(pClonk, RandomX(-4, 4), RandomX(-5, -9));
+ AddEffect("NoCrystalAttack", pClonk, 100, 20, pClonk);
}
-func EffectObject(object pClonk) {
-if(!FindObject(NTMG)){
- if(!Hostile(GetOwner(),GetOwner(pClonk))) return(0);
- }
-CreateParticle("NoGravSpark",GetX()-GetX(pClonk)+RandomX(-8,8),GetY()-GetY()+RandomX(-12,12),0,-5,RandomX(10,20),GetColorDw (this()));
-if(!Random(2))
-DoEnergy(-7,pClonk);
+func HitDing(object pDing)
+{
+ if (pDing)
+ {
+ SetSpeed(RandomX(-4, 4), RandomX(-20, -40), pDing);
+ pDing->~Hit();
+ }
}
-func RemoveMe(){
-RemoveObject(this());
+
+func EffectObject(object pClonk)
+{
+ CreateParticle("NoGravSpark", GetX() - GetX(pClonk) + RandomX(-8, 8), GetY() - GetY() + RandomX(-12, 12), 0, -5, RandomX(10, 20), GetColorDw(this));
+ if (!Hostile(GetOwner(), GetOwner(pClonk))) DoEnergy(1, pClonk);
+ else DoEnergy(-2, pClonk);
}
-func SoundBamm(){
- Sound("RockBreak*");
- Sound("Blast2",0,0,50);
-for(var i = 0; i < 5; i++){
-var ebk = CreateObject(1EBK,0,+21,GetOwner());
-if(ebk) SetSpeed(RandomX(-5,5),RandomX(-40,-80),ebk);
- }
+
+func RemoveMe()
+{
+ RemoveObject(this);
}
-global func FxNoCrystallAttackTimer(object pTarget, int iIndex, int iTime)
+
+func SoundBamm()
{
- if(!pTarget) return (false);
- if(iTime >= 20) return (-1);
- return (true);
-} \ No newline at end of file
+ Sound("RockBreak*");
+ Sound("Blast2", 0, 0, 50);
+}