diff options
Diffstat (limited to 'TemplePushing.c4s/System.c4g')
| -rw-r--r-- | TemplePushing.c4s/System.c4g/ApocalypseEffects.c | 78 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Axe.c | 21 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Bounce.c | 17 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Clonk.c | 29 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/EmptyGoblet.c | 29 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/FireBomb.c | 21 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Flint.c | 21 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Frostwave.c | 7 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Goblet.c | 30 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Helpers.c | 15 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/MagicFlint.c | 26 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Meteor.c | 12 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Rain.c | 25 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Scroll.c | 12 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/ShootInventory.c | 53 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/StringTblDE.txt | 2 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/StringTblUS.txt | 2 | ||||
| -rw-r--r-- | TemplePushing.c4s/System.c4g/Sword.c | 21 |
18 files changed, 277 insertions, 144 deletions
diff --git a/TemplePushing.c4s/System.c4g/ApocalypseEffects.c b/TemplePushing.c4s/System.c4g/ApocalypseEffects.c new file mode 100644 index 0000000..cefa608 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/ApocalypseEffects.c @@ -0,0 +1,78 @@ +/*-- Apocalypse Effects --*/ + +#strict 2 + +global func FxCreateTeraFlintsTimer() +{ + for (var i = 0; i < GetPlayerCount(); ++i) + { + var clonk = GetCrew(GetPlayerByIndex(i)); + if (!clonk) continue; + + var teraflint = CreateObject(EFLN, 0, 0, NO_OWNER); + if (!clonk->Collect(teraflint)) teraflint->RemoveObject(); + } + + return 1; +} + +global func FxShakeScreenTimer() +{ + ShakeViewPort(10); + return 1; +} + +global func FxSkyAdjustStart(object target, int effectNumber) +{ + EffectVar(0, 0, effectNumber) = 255; + EffectVar(1, 0, effectNumber) = 1; + return 1; +} + +global func FxSkyAdjustTimer(object target, int effectNumber) +{ + var color = EffectVar(0, 0, effectNumber); + var decrease = EffectVar(1, 0, effectNumber); + + // Increase/decrease color value + if (decrease) + { + --color; + } + else + { + ++color; + } + + // Switch direction? + if (color <= 0) + { + color = 0; + decrease = false; + } + else if (color >= 255) + { + color = 255; + decrease = true; + } + + // Apply color + SetSkyAdjust(RGB(255, color / 2, color / 4), RGB(128, color / 2, color / 4)); + SetGamma(RGB(2, 0, 0), RGB(128, color / 2, color / 4), RGB(180, color /2 , color / 4)); + + EffectVar(0, 0, effectNumber) = color; + EffectVar(1, 0, effectNumber) = decrease; + + return 1; +} + +global func FxBottomTimer() +{ + for (var i = 0; i < GetPlayerCount(); ++i) + { + var clonk = GetCrew(GetPlayerByIndex(i)); + if (clonk && clonk->GetY() >= LandscapeHeight() - 20) clonk->SetPosition(clonk->GetX() + RandomX(-10, 10), 0); + } + + return 1; +}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Axe.c b/TemplePushing.c4s/System.c4g/Axe.c deleted file mode 100644 index a718d58..0000000 --- a/TemplePushing.c4s/System.c4g/Axe.c +++ /dev/null @@ -1,21 +0,0 @@ -#strict -#appendto AXE1 - -func Activate(pClonk) -{ - [$Shot$|Image=GNPW] - Sound("Blast2"); - Exit(this(),-10+20*GetDir(pClonk)); - SetXDir(-80+160*GetDir(pClonk)); - SetYDir(-10); - return(1); -} - -func Hit() -{ - if (Random(2)) return(_inherited()); - else - SetYDir(-20); - Sound("BOING"); - return(1); -} diff --git a/TemplePushing.c4s/System.c4g/Bounce.c b/TemplePushing.c4s/System.c4g/Bounce.c new file mode 100644 index 0000000..e52c395 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Bounce.c @@ -0,0 +1,17 @@ +/*-- Makes some objects bounce after hit --*/ + +#strict 2 + +#appendto AXE1 +#appendto EFLN +#appendto SWOR + +protected func Hit() +{ + if (Random(2)) return _inherited(); + SetYDir(-20); + + Sound("Boing"); + + return 1; +} diff --git a/TemplePushing.c4s/System.c4g/Clonk.c b/TemplePushing.c4s/System.c4g/Clonk.c index 2308576..8c395b4 100644 --- a/TemplePushing.c4s/System.c4g/Clonk.c +++ b/TemplePushing.c4s/System.c4g/Clonk.c @@ -1,6 +1,11 @@ +/* Clonk */ + #strict 2 #appendto CLNK +local rotateInJump; +local removeOnDeath; + protected func ControlSpecial() { [$Push$|Image=CXIV] @@ -22,6 +27,28 @@ protected func ControlSpecial() if (GetLength(clonks) == 0) return 0; // Randomly select clonk to be pushed - Fling(clonks[Random(GetLength(clonks))], -1 + GetDir() * 2, -1); + var target = clonks[Random(GetLength(clonks))]; + Fling(target, -1 + GetDir() * 2, -1); + target->SetKiller(GetOwner()); + return 1; } + +protected func ControlLeft() +{ + if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Left); + return _inherited(); +} + +protected func ControlRight() +{ + if (rotateInJump && GetAction() == "Jump") SetDir(DIR_Right); + return _inherited(); +} + +protected func Death(int killedBy) +{ + var ret = _inherited(killedBy); + if (removeOnDeath) RemoveObject(); + return ret; +}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/EmptyGoblet.c b/TemplePushing.c4s/System.c4g/EmptyGoblet.c deleted file mode 100644 index 655a1b3..0000000 --- a/TemplePushing.c4s/System.c4g/EmptyGoblet.c +++ /dev/null @@ -1,29 +0,0 @@ -#strict -#appendto EGBL - -func Activate(pClonk) -{ - [$Shot$|Image=GNPW] - Sound("Blast2"); - Exit(this(),-10+20*GetDir(pClonk)); - SetXDir(-80+160*GetDir(pClonk)); - SetYDir(-10); - return(1); -} - -func Hit() -{ - if (Random(2)) return(_inherited()); - else - SetYDir(-20); - Sound("BOING"); - return(1); -} -/*-- Neues Script --*/ - -#strict - -func Initialize() { - - return(1); -} diff --git a/TemplePushing.c4s/System.c4g/FireBomb.c b/TemplePushing.c4s/System.c4g/FireBomb.c deleted file mode 100644 index 85ea01c..0000000 --- a/TemplePushing.c4s/System.c4g/FireBomb.c +++ /dev/null @@ -1,21 +0,0 @@ -#strict -#appendto FBMP - -func Activate(pClonk) -{ - [$Shot$|Image=GNPW] - Sound("Blast2"); - Exit(this(),-10+20*GetDir(pClonk)); - SetXDir(-80+160*GetDir(pClonk)); - SetYDir(-10); - return(1); -} - -func Hit() -{ - if (Random(2)) return(_inherited()); - else - SetYDir(-20); - Sound("BOING"); - return(1); -} diff --git a/TemplePushing.c4s/System.c4g/Flint.c b/TemplePushing.c4s/System.c4g/Flint.c deleted file mode 100644 index 82309e0..0000000 --- a/TemplePushing.c4s/System.c4g/Flint.c +++ /dev/null @@ -1,21 +0,0 @@ -#strict -#appendto FLNT - -func Activate(pClonk) -{ - [$Shot$|Image=GNPW] - Sound("Blast2"); - Exit(this(),-10+20*GetDir(pClonk)); - SetXDir(-80+160*GetDir(pClonk)); - SetYDir(-10); - return(1); -} - -func Hit() -{ - if (Random(2)) return(_inherited()); - else - SetYDir(-20); - Sound("BOING"); - return(1); -}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Frostwave.c b/TemplePushing.c4s/System.c4g/Frostwave.c new file mode 100644 index 0000000..3437c6a --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Frostwave.c @@ -0,0 +1,7 @@ +/*-- Frostwave --*/ + +#strict 2 + +#appendto MFWV + +func FxFrostwaveNSpellMaxRange() { return(90); } diff --git a/TemplePushing.c4s/System.c4g/Goblet.c b/TemplePushing.c4s/System.c4g/Goblet.c index a916e35..0f9506f 100644 --- a/TemplePushing.c4s/System.c4g/Goblet.c +++ b/TemplePushing.c4s/System.c4g/Goblet.c @@ -1,21 +1,17 @@ -#strict -#appendto GBLT +/*-- Goblet --*/ -func Activate(pClonk) -{ - [$Shot$|Image=GNPW] - Sound("Blast2"); - Exit(this(),-10+20*GetDir(pClonk)); - SetXDir(-80+160*GetDir(pClonk)); - SetYDir(-10); - return(1); -} +#strict 2 + +#appendto GBLT -func Hit() +private func FillCheck() { - if (Random(2)) return(_inherited()); - else - SetYDir(-20); - Sound("BOING"); - return(1); + var ret = _inherited(); + if (iTimer >= 5) + { + var clonk = Contained(); + if (clonk && clonk->GetOCF() & OCF_CrewMember) clonk->DoEnergy(10); + iTimer = 0; + } + return ret; } diff --git a/TemplePushing.c4s/System.c4g/Helpers.c b/TemplePushing.c4s/System.c4g/Helpers.c new file mode 100644 index 0000000..f22a3c5 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Helpers.c @@ -0,0 +1,15 @@ +/*-- Helpers --*/ + +#strict 2 + +global func IIf(expression, truePart, falsePart) +{ + if (expression) + { + return truePart; + } + else + { + return falsePart; + } +} diff --git a/TemplePushing.c4s/System.c4g/MagicFlint.c b/TemplePushing.c4s/System.c4g/MagicFlint.c new file mode 100644 index 0000000..a158248 --- /dev/null +++ b/TemplePushing.c4s/System.c4g/MagicFlint.c @@ -0,0 +1,26 @@ +/*-- Summon flint --*/ + +#strict 2 + +#appendto MGFL + +public func Activate(object caster, object realcaster) +{ + var result = CheckEffect("FlintNSpell", 0, 125); + if (result) + { + RemoveObject(); + return result != -1; + } + + Sound("Magic*"); + CreateParticle("MSpark", 0,0, 1000, RGBa(255,50,50,150)); + + if (realcaster) caster = realcaster; + + var flints = [FLNT, 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 600733a..af1d3e8 100644 --- a/TemplePushing.c4s/System.c4g/Meteor.c +++ b/TemplePushing.c4s/System.c4g/Meteor.c @@ -1,7 +1,9 @@ -#strict +#strict 2 + #appendto METO -protected func Hit() { - if (FindObject(RCKF)) Explode(Random(75)); - Explode(explosion_base+Random(12)); -}
\ No newline at end of file +protected func Hit() +{ + if (FindObject(RCKF)) Explode(Random(75)); + Explode(explosion_base + Random(12)); +} diff --git a/TemplePushing.c4s/System.c4g/Rain.c b/TemplePushing.c4s/System.c4g/Rain.c new file mode 100644 index 0000000..c44285f --- /dev/null +++ b/TemplePushing.c4s/System.c4g/Rain.c @@ -0,0 +1,25 @@ +/*-- Regen --*/ + +#strict 2 + +global func FxRainStart() +{ + SoundLevel("Rain", 100); + return 1; +} + +global func FxRainTimer() +{ + for (var i; i < 3; ++i) + { + CreateParticle("Raindrop", Random(LandscapeWidth()), 0, 0, 200, Random(300), RGB(170, 170, 255)); + } + if (!Random(200)) Sound("Thunders*"); + return 1; +} + +global func FxFireRainTimer() +{ + if (!Random(50)) CreateObject(DFLM, Random(LandscapeWidth()), 0, NO_OWNER); + return 1; +}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Scroll.c b/TemplePushing.c4s/System.c4g/Scroll.c index a66bb32..07a55d6 100644 --- a/TemplePushing.c4s/System.c4g/Scroll.c +++ b/TemplePushing.c4s/System.c4g/Scroll.c @@ -1,10 +1,10 @@ -#strict +#strict 2 + #appendto SCRL -static SpID; func Initialize() { - SpID=[ABLA,MBOT,MFRB,MDBT,GVTY,MBRG,MMTR,MLGT,CAHE,MSSH,MINV,MFFS,MQKE,ELX1,MICS,MARK]; - SetSpell(SpID[Random(16)]); - return(_inherited()); -}
\ No newline at end of file + var spells = [ABLA, MBOT, MFRB, MDBT, GVTY, MMTR, MLGT, CFAL, MSSH, MINV, MQKE, MARK, MFWV, MGFL]; + SetSpell(spells[Random(GetLength(spells))]); + return _inherited(); +} diff --git a/TemplePushing.c4s/System.c4g/ShootInventory.c b/TemplePushing.c4s/System.c4g/ShootInventory.c new file mode 100644 index 0000000..f2636dd --- /dev/null +++ b/TemplePushing.c4s/System.c4g/ShootInventory.c @@ -0,0 +1,53 @@ +/*-- Shoot inventory object --*/ + +#strict 2 + +#appendto AXE1 +#appendto EGBL +#appendto EFLN +#appendto GBLT +#appendto ROCK +#appendto SWOR + +protected func Activate(object clonk) +{ + [$Shoot$|Image=GNPW] + + // Sound + if (GetID() == EGBL) + { + Sound("Crystal3"); + } + else if (GetID() == GBLT) + { + Sound("Crystal3"); + } + else + { + Sound("Blast2"); + } + + // Make shooting clonk responsible for possible kill + SetController(clonk->GetOwner()); + + // Shoot + if (GetID() == EGBL) + { + Exit(0, -20 + 40 * clonk->GetDir()); + SetXDir(-100 + 200 * clonk->GetDir()); + } + else if (GetID() == ROCK) + { + Exit(0, -15 + 30 * clonk->GetDir()); + SetXDir(-100 + 200 * clonk->GetDir()); + } + else + { + Exit(0, -10 + 20 * clonk->GetDir()); + SetXDir(-80 + 160 * clonk->GetDir()); + } + + SetYDir(-10); + + return 1; +}
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/StringTblDE.txt b/TemplePushing.c4s/System.c4g/StringTblDE.txt index 8e22f20..a6b917f 100644 --- a/TemplePushing.c4s/System.c4g/StringTblDE.txt +++ b/TemplePushing.c4s/System.c4g/StringTblDE.txt @@ -1,2 +1,2 @@ -Shot=Schießen +Shoot=Schießen Push=Schubsen
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/StringTblUS.txt b/TemplePushing.c4s/System.c4g/StringTblUS.txt index 42b3635..e1bd4ca 100644 --- a/TemplePushing.c4s/System.c4g/StringTblUS.txt +++ b/TemplePushing.c4s/System.c4g/StringTblUS.txt @@ -1,2 +1,2 @@ -Shot=Shoot +Shoot=Shoot Push=Push
\ No newline at end of file diff --git a/TemplePushing.c4s/System.c4g/Sword.c b/TemplePushing.c4s/System.c4g/Sword.c deleted file mode 100644 index 4f98bd7..0000000 --- a/TemplePushing.c4s/System.c4g/Sword.c +++ /dev/null @@ -1,21 +0,0 @@ -#strict -#appendto SWOR - -func Activate(pClonk) -{ - [$Shot$|Image=GNPW] - Sound("Blast2"); - Exit(this(),-10+20*GetDir(pClonk)); - SetXDir(-80+160*GetDir(pClonk)); - SetYDir(-10); - return(1); -} - -func Hit() -{ - if (Random(2)) return(_inherited()); - else - SetYDir(-20); - Sound("BOING"); - return(1); -} |
