diff options
Diffstat (limited to 'TemplePushing.c4s/System.c4g')
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Arrowpack.c | 43 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Bounce.c | 9 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Clonk.c | 27 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Invisibility.c | 18 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/LavaRain.c | 18 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/MagicFlint.c | 6 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Meteor.c | 2 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Plague.c | 33 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Scroll.c | 8 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/ShootInventory.c | 53 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Vanish.c | 28 |
11 files changed, 226 insertions, 19 deletions
diff --git a/TemplePushing.c4s/System.c4g/Arrowpack.c b/TemplePushing.c4s/System.c4g/Arrowpack.c new file mode 100644 index 0000000..e046e4c --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Arrowpack.c @@ -0,0 +1,43 @@ +/*-- Arrow packs shoot arrows --*/ + +#strict 2 + +#appendto ARWP + +local coolingDown; + +protected func Initialize() +{ + iUsedItems = Random(MaxPackCount() - 1); +} + +private func CooledDown() +{ + return !coolingDown; +} + +protected func Activate(object clonk) +{ + [$Shoot$|Image=BOW1|Condition=CooledDown] + + if (!CooledDown()) return 0; + + // Extract an arrow from the pack + var arrow = GetItem(); + + // Make shooting clonk responsible for possible kill and owner of the arrow + arrow->SetOwner(clonk->GetOwner()); + arrow->SetController(clonk->GetOwner()); + + // Shoot + // Do not launch fire arrows too close to the clonk to prevent incineration when launched while climbing + var arrowPosX = IIf(arrow->GetID() == FARW, -10 + 20 * clonk->GetDir(), -3 + 6 * clonk->GetDir()); + arrow->Exit(0, arrowPosX, 5, -90 + 180 * clonk->GetDir(), -8 + 16 * clonk->GetDir(), -2); + arrow->~Launch(); + + // Start cooldown + coolingDown = true; + Schedule("coolingDown = false", RandomX(1, 20)); + + return 1; +}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Bounce.c b/TemplePushing.c4s/System.c4g/Bounce.c index e52c395..e2cee50 100644 --- a/TemplePushing.c4s/System.c4g/Bounce.c +++ b/TemplePushing.c4s/System.c4g/Bounce.c @@ -2,13 +2,18 @@ #strict 2 +#appendto ROCK +#appendto SWOR #appendto AXE1 +#appendto ARWP +#appendto SFLN +#appendto FLNT +#appendto EGBL #appendto EFLN -#appendto SWOR protected func Hit() { - if (Random(2)) return _inherited(); + if (Random(10)) return _inherited(); SetYDir(-20); Sound("Boing"); diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c index 8c395b4..c934938 100644 --- a/TemplePushing.c4s/System.c4g/Clonk.c +++ b/TemplePushing.c4s/System.c4g/Clonk.c @@ -1,11 +1,25 @@ /* Clonk */ #strict 2 + #appendto CLNK local rotateInJump; local removeOnDeath; +protected func ControlThrow(object byObj) +{ + // First check if the clonk already handles the throw control + var ret = _inherited(byObj); + if (ret) return ret; + + // Launch arrow from pack in inventory + var arrowPack = Contents(); + if (!arrowPack || !arrowPack->~IsArrowPack()) return 0; + arrowPack->Activate(this); + return 1; +} + protected func ControlSpecial() { [$Push$|Image=CXIV] @@ -21,8 +35,7 @@ protected func ControlSpecial() Find_ID(CLNK), Find_InRect(-10 + GetDir() * 20, 0, 10, 10), Find_OCF(OCF_Alive), - // Only include allied players' clonks if "friendly pushing" rule is present - Find_Or(Find_Func(FindObject(FYPG)), Find_Hostile(GetOwner()))); + Find_Hostile(GetOwner())); if (GetLength(clonks) == 0) return 0; @@ -34,15 +47,16 @@ protected func ControlSpecial() return 1; } + protected func ControlLeft() { - if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Left); + if (rotateInJump && GetAction() == "Jump" || GetAction() == "Tumble") SetDir(DIR_Left); return _inherited(); } protected func ControlRight() { - if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Right); + if (rotateInJump && GetAction() == "Jump" || GetAction() == "Tumble") SetDir(DIR_Right); return _inherited(); } @@ -51,4 +65,9 @@ protected func Death(int killedBy) var ret = _inherited(killedBy); if (removeOnDeath) RemoveObject(); return ret; +} + +public func QueryCatchBlow(object arrow) +{ + return arrow->GetOwner() == GetOwner(); }
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Invisibility.c b/TemplePushing.c4s/System.c4g/Invisibility.c new file mode 100644 index 0000000..28bba9d --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Invisibility.c @@ -0,0 +1,18 @@ +/*-- Shorten Invisibilty --*/ + +#strict 2 + +#appendto MINV + +public func Activate(object pCaster, object pCaster2) +{ + // Zauberer ermitteln + if (pCaster2) pCaster = pCaster2; + // Magie kann man hoeren, ganz klar ;) + Sound("Magic*"); + // Zauberer unsichtbar machen (20sec) + AddEffect("InvisPSpell", pCaster, 200, 700, 0, GetID()); + // Fertig - das Zauberobjekt wird nun nicht mehr gebraucht + RemoveObject(); + return 1; +}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/LavaRain.c b/TemplePushing.c4s/System.c4g/LavaRain.c new file mode 100644 index 0000000..22369e0 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/LavaRain.c @@ -0,0 +1,18 @@ +/*-- Lavaregen --*/ + +#strict 2 + +global func FxLavaRainStart() +{ + SoundLevel("Rain", 10); + return 1; +} + +global func FxLavaRainTimer() +{ + for (var i; i < 5; ++i) + { + CreateParticle("LavaRaindrop", Random(LandscapeWidth()), 0, 0, 200, Random(300), RGB(255, 255, 0)); + } + return 1; +} diff --git a/TemplePushing.c4s/System.c4g/MagicFlint.c b/TemplePushing.c4s/System.c4g/MagicFlint.c index a158248..0fc5506 100644 --- a/TemplePushing.c4s/System.c4g/MagicFlint.c +++ b/TemplePushing.c4s/System.c4g/MagicFlint.c @@ -17,10 +17,10 @@ public func Activate(object caster, object realcaster) CreateParticle("MSpark", 0,0, 1000, RGBa(255,50,50,150)); if (realcaster) caster = realcaster; - - var flints = [FLNT, SFLN, EFLN]; + + var flints = [SFLN, EFLN]; caster->CreateContents(flints[Random(GetLength(flints))]); - + RemoveObject(); return 1; } diff --git a/TemplePushing.c4s/System.c4g/Meteor.c b/TemplePushing.c4s/System.c4g/Meteor.c index af1d3e8..9eb75b1 100644 --- a/TemplePushing.c4s/System.c4g/Meteor.c +++ b/TemplePushing.c4s/System.c4g/Meteor.c @@ -4,6 +4,6 @@ protected func Hit() { - if (FindObject(RCKF)) Explode(Random(75)); + if (FindObject(RCKF)) Explode(Random(50)); Explode(explosion_base + Random(12)); } diff --git a/TemplePushing.c4s/System.c4g/Plague.c b/TemplePushing.c4s/System.c4g/Plague.c new file mode 100644 index 0000000..ea80c2e --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Plague.c @@ -0,0 +1,33 @@ +/*-- Plague --*/ + +#strict + +#appendto MGPL + +func FxPoisonTimer(pClonk, iEffectNumber, iEffectTime) +{ + if(iEffectTime >= 1200) return(-1); + var fSnake = EffectVar(1, pClonk, iEffectNumber); + var idType = GetID(pClonk); + CreateParticle("PoisonWave", GetX(pClonk), GetY(pClonk), 0, -1, EffectVar(0, pClonk, iEffectNumber)*5+50, RGBa(fSnake*200, 255, 0), pClonk, 1); + CreateParticle("PSpark", GetX(pClonk), GetY(pClonk), 0, -1, EffectVar(0, pClonk, iEffectNumber)*5+50, RGBa(fSnake*55, 55, 0), pClonk, 1); + if(GBackLiquid(GetX(pClonk), GetY(pClonk))) return(-1); + + if(!Random(7)) DoEnergy(-2, pClonk); + var obj; + var iRadius = EffectCall(pClonk,iEffectNumber,"MaxRange"); + while(obj = FindObject(0, -iRadius+GetX(pClonk),-iRadius+GetY(pClonk),iRadius*2,iRadius*2, OCF_Alive(),0,0, NoContainer(), obj)) + { + if(!GetEffect("Poison", obj)) + { + if(!GetAction(obj)S="Field") + { + AddEffect("Poison",obj,182,10,0,MGPL,fSnake); + } + } + } + return(1); +} + +func FxPoisonMaxRange() { return(100); } + diff --git a/TemplePushing.c4s/System.c4g/Scroll.c b/TemplePushing.c4s/System.c4g/Scroll.c index 07a55d6..076c30b 100644 --- a/TemplePushing.c4s/System.c4g/Scroll.c +++ b/TemplePushing.c4s/System.c4g/Scroll.c @@ -4,7 +4,13 @@ func Initialize() { - var spells = [ABLA, MBOT, MFRB, MDBT, GVTY, MMTR, MLGT, CFAL, MSSH, MINV, MQKE, MARK, MFWV, MGFL]; + if (mode == MODE_Festive) + { + var spells = [ABLA, MFWV, MICS, MLGT, MGPL]; SetSpell(spells[Random(GetLength(spells))]); + } + else var spells = [ABLA, MBOT, MFRB, MDBT, GVTY, MMTR, MLGT, CFAL, MSSH, MINV, MQKE, MARK, MFWV, MGFL, LAVS, MGPL]; + SetSpell(spells[Random(GetLength(spells))]); + return _inherited(); } diff --git a/TemplePushing.c4s/System.c4g/ShootInventory.c b/TemplePushing.c4s/System.c4g/ShootInventory.c index f2636dd..20bfef3 100644 --- a/TemplePushing.c4s/System.c4g/ShootInventory.c +++ b/TemplePushing.c4s/System.c4g/ShootInventory.c @@ -4,10 +4,13 @@ #appendto AXE1 #appendto EGBL +#appendto SFLN #appendto EFLN #appendto GBLT #appendto ROCK #appendto SWOR +#appendto SPER +#appendto TSWB protected func Activate(object clonk) { @@ -16,38 +19,72 @@ protected func Activate(object clonk) // Sound if (GetID() == EGBL) { + Sound("Blast*"); Sound("Crystal3"); } + else if (GetID() == SPER) + { + Sound("Arrow"); + } + else if (GetID() == TSWB) + { + Sound("Arrow"); + } else if (GetID() == GBLT) { + Sound("Blast*"); Sound("Crystal3"); } + else if (GetID() == SWOR) + { + Sound("Blast*"); + Sound("SwordHit*"); + } + else if (GetID() == AXE1) + { + Sound("Blast*"); + Sound("AxeHit*"); + } else { - Sound("Blast2"); + Sound("Blast*"); } - // Make shooting clonk responsible for possible kill + // Make shooting clonk responsible for possible kill and owner of object to be shot SetController(clonk->GetOwner()); + SetOwner(clonk->GetOwner()); // Shoot if (GetID() == EGBL) { - Exit(0, -20 + 40 * clonk->GetDir()); + Exit(0, -10 + 20 * clonk->GetDir()); + SetYDir(-10); SetXDir(-100 + 200 * clonk->GetDir()); } else if (GetID() == ROCK) { - Exit(0, -15 + 30 * clonk->GetDir()); + Exit(0, -10 + 20 * clonk->GetDir()); + SetYDir(-15); SetXDir(-100 + 200 * clonk->GetDir()); } + else if (GetID() == TSWB) + { + Exit(0, -5 + 10 * clonk->GetDir()); + SetYDir(-30); + SetXDir(-50 + 100 * clonk->GetDir()); + } + else if (GetID() == SPER) + { + Exit(0, -10 + 20 * clonk->GetDir(), -4, 0 + 180 * clonk->GetDir(), -150 + 300 * clonk->GetDir(), -7); + SetYDir(-7); + SetXDir(-175 + 350 * clonk->GetDir()); + } else { - Exit(0, -10 + 20 * clonk->GetDir()); + Exit(0, -10 + 20 * clonk->GetDir(), 0, 0 + 180 * clonk->GetDir(), -80 + 160 * clonk->GetDir(), -15); + SetYDir(-15); SetXDir(-80 + 160 * clonk->GetDir()); } - - SetYDir(-10); - + return 1; }
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Vanish.c b/TemplePushing.c4s/System.c4g/Vanish.c new file mode 100644 index 0000000..37d1d78 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Vanish.c @@ -0,0 +1,28 @@ +/*-- Make certain items vanish --*/ + +#strict 2 + +#appendto ARRW +#appendto FARW +#appendto TSWB +#appendto SPER + +protected func Hit() +{ + if (GetID() == FARW) + { + Schedule("RemoveObject()", 80, 0, 0); + } + else if (GetID() == SPER) + { + Schedule("RemoveObject()", 50, 0, 0); + } + else + { + CastParticles("MSpark", 20,5, 0,0, 25, 30, RGBa(128,128,255,0), RGBa(255,255,255,127)); + RemoveObject(); + return 1; + } +} + + |
