Exemple #1
0
        // Function from file: spellbook.dm
        public int Refund(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
        {
            dynamic A            = null;
            int     spell_levels = 0;
            Obj_Effect_ProcHolder_Spell aspell = null;

            A = Lang13.FindObj(typeof(Zone_WizardStation));

            if (!A.contents.Contains(user))
            {
                user.WriteMsg("<span clas=='warning'>You can only refund spells at the wizard lair</span>");
                return(-1);
            }

            if (!Lang13.Bool(this.S))
            {
                this.S = Lang13.Call(this.spell_type);
            }
            spell_levels = 0;

            foreach (dynamic _a in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell)))
            {
                aspell = _a;


                if (Lang13.Initial(this.S, "name") == Lang13.Initial(aspell, "name"))
                {
                    spell_levels = aspell.spell_level;
                    user.mind.spell_list.Remove(aspell);
                    GlobalFuncs.qdel(this.S);
                    return(this.cost * (spell_levels + 1));
                }
            }
            return(-1);
        }
Exemple #2
0
        // Function from file: spellbook.dm
        public bool CanRefund(dynamic user = null, Obj_Item_Weapon_Spellbook book = null)
        {
            Obj_Effect_ProcHolder_Spell aspell = null;


            if (!this.refundable)
            {
                return(false);
            }

            if (!Lang13.Bool(this.S))
            {
                this.S = Lang13.Call(this.spell_type);
            }

            foreach (dynamic _a in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell)))
            {
                aspell = _a;


                if (Lang13.Initial(this.S, "name") == Lang13.Initial(aspell, "name"))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #3
0
 // Function from file: spellbook.dm
 public override bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
 {
     GlobalFuncs.feedback_add_details("wizard_spell_learned", this.log_name);
     GlobalFuncs.rightandwrong(false, user, 25);
     GlobalFuncs.playsound(GlobalFuncs.get_turf(user), "sound/magic/CastSummon.ogg", 50, 1);
     user.WriteMsg("<span class='notice'>You have cast summon guns!</span>");
     return(true);
 }
Exemple #4
0
 // Function from file: spellbook.dm
 public virtual bool CanBuy(dynamic user = null, Obj_Item_Weapon_Spellbook book = null)
 {
     if (book.uses < this.cost || this.limit == 0)
     {
         return(false);
     }
     return(true);
 }
 // Function from file: spellbook.dm
 public override bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
 {
     GlobalFuncs.feedback_add_details("wizard_spell_learned", this.log_name);
     GlobalFuncs.rightandwrong(true, user, 0);
     book.uses  += 1;
     this.active = true;
     GlobalFuncs.playsound(GlobalFuncs.get_turf(user), "sound/magic/CastSummon.ogg", 50, 1);
     user.WriteMsg("<span class='notice'>You have cast summon magic and gained an extra charge for your spellbook.</span>");
     return(true);
 }
 // Function from file: spellbook.dm
 public override bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
 {
     if (base.Buy(user, book))
     {
         if (!(((Dna)((dynamic)user).dna).check_mutation("X Ray Vision") != 0))
         {
             ((Dna)((dynamic)user).dna).add_mutation("X Ray Vision");
         }
     }
     return(true);
 }
Exemple #7
0
        // Function from file: spellbook.dm
        public override bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
        {
            bool _default = false;

            _default = base.Buy(user, book);

            if (_default)
            {
                user.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Conjure_Construct(null));
            }
            return(_default);
        }
Exemple #8
0
        // Function from file: spellbook.dm
        public override bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
        {
            bool _default = false;

            _default = base.Buy(user, book);

            if (_default)
            {
                new Obj_Item_Clothing_Shoes_Sandal(GlobalFuncs.get_turf(user));
                new Obj_Item_Clothing_Gloves_Color_Purple(GlobalFuncs.get_turf(user));
            }
            return(_default);
        }
Exemple #9
0
 // Function from file: spellbook.dm
 public override bool CanBuy(dynamic user = null, Obj_Item_Weapon_Spellbook book = null)
 {
     return(base.CanBuy((object)(user), book) && !this.active);
 }
Exemple #10
0
        // Function from file: spellbook.dm
        public virtual bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
        {
            Obj_Effect_ProcHolder_Spell aspell = null;


            if (!Lang13.Bool(this.S) || Lang13.Bool(GlobalFuncs.qdeleted(this.S)))
            {
                this.S = Lang13.Call(this.spell_type);
            }

            foreach (dynamic _b in Lang13.Enumerate(user.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell)))
            {
                aspell = _b;


                if (Lang13.Initial(this.S, "name") == Lang13.Initial(aspell, "name"))
                {
                    if (aspell.spell_level >= aspell.level_max)
                    {
                        user.WriteMsg("<span class='warning'>This spell cannot be improved further.</span>");
                        return(false);
                    }
                    else
                    {
                        aspell.name = Lang13.Initial(aspell, "name");
                        aspell.spell_level++;
                        aspell.charge_max = Num13.Floor(Convert.ToDouble(Lang13.Initial(aspell, "charge_max") - aspell.spell_level * Convert.ToDouble(Lang13.Initial(aspell, "charge_max") - aspell.cooldown_min) / aspell.level_max));

                        if (aspell.charge_max < aspell.charge_counter)
                        {
                            aspell.charge_counter = aspell.charge_max;
                        }

                        switch ((int)(aspell.spell_level))
                        {
                        case 1:
                            user.WriteMsg("<span class='notice'>You have improved " + aspell.name + " into Efficient " + aspell.name + ".</span>");
                            aspell.name = "Efficient " + aspell.name;
                            break;

                        case 2:
                            user.WriteMsg("<span class='notice'>You have further improved " + aspell.name + " into Quickened " + aspell.name + ".</span>");
                            aspell.name = "Quickened " + aspell.name;
                            break;

                        case 3:
                            user.WriteMsg("<span class='notice'>You have further improved " + aspell.name + " into Free " + aspell.name + ".</span>");
                            aspell.name = "Free " + aspell.name;
                            break;

                        case 4:
                            user.WriteMsg("<span class='notice'>You have further improved " + aspell.name + " into Instant " + aspell.name + ".</span>");
                            aspell.name = "Instant " + aspell.name;
                            break;
                        }

                        if (aspell.spell_level >= aspell.level_max)
                        {
                            user.WriteMsg("<span class='notice'>This spell cannot be strengthened any further.</span>");
                        }
                        return(true);
                    }
                }
            }
            GlobalFuncs.feedback_add_details("wizard_spell_learned", this.log_name);
            user.mind.AddSpell(this.S);
            user.WriteMsg("<span class='notice'>You have learned " + this.S.name + ".</span>");
            return(true);
        }
Exemple #11
0
 // Function from file: spellbook.dm
 public override bool Buy(Mob user = null, Obj_Item_Weapon_Spellbook book = null)
 {
     Lang13.Call(this.item_path, GlobalFuncs.get_turf(user));
     GlobalFuncs.feedback_add_details("wizard_spell_learned", this.log_name);
     return(true);
 }