From f1ece16c08d8c01e1d49a25f0314a96c021e73cb Mon Sep 17 00:00:00 2001 From: Jan <> Date: Fri, 10 Jul 2015 18:11:22 +0200 Subject: r0.921 --- TemplePushing.c4s/System.c4g/Scroll.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'TemplePushing.c4s/System.c4g/Scroll.c') diff --git a/TemplePushing.c4s/System.c4g/Scroll.c b/TemplePushing.c4s/System.c4g/Scroll.c index 7228fe0..6156e26 100644 --- a/TemplePushing.c4s/System.c4g/Scroll.c +++ b/TemplePushing.c4s/System.c4g/Scroll.c @@ -2,12 +2,28 @@ #appendto SCRL +static SCRL_spells; + protected func Initialize() { - var spells = [ABLA, MBOT, MFRB, MDBT, GVTY, MMTR, MLGT, CFAL, MSSH, MINV, MQKE, MARK, MFWV, MGFL, LAVS, MGPL, ICNL]; - if (mode == MODE_Festive) spells = [ABLA, MFWV, MICS, MLGT, MGPL, ICNL]; - - SetSpell(spells[Random(GetLength(spells))]); + SetSpell(SCRL_spells[Random(GetLength(SCRL_spells))]); return _inherited(); } + +public func SpellFailed(id idSpell, object pAimingClonk) +{ + // Spell canceled? Give back the scroll + SetSpell(idSpell); + if(pAimingClonk && !pAimingClonk->~RejectCollect(GetID(this), this)) + { + Enter(pAimingClonk, this); + } + pAimingClonk = 0; + return 0; +} + +global func SetScrollSpells(array spells) +{ + SCRL_spells = spells; +} -- cgit v1.2.3-54-g00ecf