コード例 #1
0
    public void instantiateSkills()
    {
        PassiveSpell passive1 = new PassiveSpell("Increase Attack",
                                                 "Increases the attack damage by ", ".", 20);
        PassiveSpell passive2 = new PassiveSpell("Increase Max HP",
                                                 "Increases the maximum HP by ", "%.", 10);

        passives.Add(passive1);
        passives.Add(passive2);

        ActiveSpell active1 = new ActiveSpell("Heal",
                                              "Heals the paladin in ", " health points.",
                                              5, 0, 100, 0, 20, 0);
        ActiveSpell active2 = new ActiveSpell("Vengeance",
                                              "Releases an wave which deals ", " damage to the enemies it passes through.\n" +
                                              "[Can't be used while jumping]",
                                              5, 0, 150, -1, 30, 0);
        ActiveSpell active3 = new ActiveSpell("Judgement",
                                              "Creates a explosion of energy around the paladin, dealing ", " damage.\n" +
                                              "[Can't be used while jumping]",
                                              25, 300, 100, -5, 60, 0);
        ActiveSpell active4 = new ActiveSpell("Intervention",
                                              "The paladin is immune to all damage during ", " seconds.",
                                              30, 2, 1, 0, 100, 0);

        actives.Add(active1);
        actives.Add(active2);
        actives.Add(active3);
        actives.Add(active4);
    }
コード例 #2
0
ファイル: Equip.cs プロジェクト: scozirge/AVentureCapital
 /// <summary>
 /// 新增武器的被動施法
 /// </summary>
 void AddPassiveSpell(int _spellID)
 {
     if (_spellID == 0)
         return;
     PassiveSpell spell = new PassiveSpell(_spellID, this);
     PassiveSpellList.Add(spell);
 }
コード例 #3
0
ファイル: PassiveSpell.cs プロジェクト: Murakle/OOP_game
        public static string getSpellName(this PassiveSpell passiveSpell)
        {
            switch (passiveSpell)
            {
            case PassiveSpell.FREEZE:
                return("Freeze");

            case PassiveSpell.HEADSHOT:
                return("Headshot");

            case PassiveSpell.HEAD_TWIN:
                return("Head Twin");

            case PassiveSpell.INNER_FIRE:
                return("Inner Fire");

            case PassiveSpell.DOUBLE_DAMAGE:
                return("Double Damage");

            case PassiveSpell.ANCIENT_BONDS:
                return("Ancient Bonds");

            case PassiveSpell.LIFESTEAL:
                return("Life Steal");

            default:
                return("NULL");
            }
        }
コード例 #4
0
ファイル: MasteryInfo.cs プロジェクト: Argalep/ServUO
        public static bool IsActivePassive(Mobile m, PassiveSpell spell)
        {
            if (spell == PassiveSpell.AnticipateHit)
            {
                return(m.Skills.CurrentMastery == SkillName.Bushido);
            }

            return(GetActivePassive(m) == spell);
        }
コード例 #5
0
 public Spell(PassiveSpell passiveSpell, PassiveCondition condition, Target target)
 {
     castRange         = (int)1e9;
     spellType         = SpellType.PASSIVE;
     this.passiveSpell = passiveSpell;
     passiveCondition  = condition;
     manaCost          = 0;
     t = target;
 }
コード例 #6
0
ファイル: MasteryInfo.cs プロジェクト: Argalep/ServUO
        public MasteryInfo(Type skillType, int spellID, SkillName masterySkill, PassiveSpell passive = PassiveSpell.None)
        {
            SpellType = skillType;
            SpellID   = spellID;

            MasterySkill = masterySkill;
            PassiveSpell = passive;

            NameLocalization = GetLocalization(masterySkill);
        }
コード例 #7
0
ファイル: Equip.cs プロジェクト: scozirge/CthulhuAdventure
    /// <summary>
    /// 新增武器的被動施法
    /// </summary>
    void AddPassiveSpell(int _spellID)
    {
        if (_spellID == 0)
        {
            return;
        }
        PassiveSpell spell = new PassiveSpell(_spellID, this);

        PassiveSpellList.Add(spell);
    }
コード例 #8
0
ファイル: Spell.cs プロジェクト: scozirge/AVentureCapital
 /// <summary>
 /// 初始化施法
 /// </summary>
 protected void SetPassiveSpell()
 {
     string spellListStr = AttrsDic["SpellList"];
     string[] spellIDStr = spellListStr.Split(',');
     for (int i = 0; i < spellIDStr.Length; i++)
     {
         int spellID = int.Parse(spellIDStr[i]);
         if (spellID == 0)
             continue;
         PassiveSpell spell = new PassiveSpell(spellID, this);
         PassiveSpellList.Add(spell);
     }
 }
コード例 #9
0
        public MasteryInfo(Type skillType, int spellID, SkillName masterySkill, Volume volume, PassiveSpell passive = PassiveSpell.None)
        {
            SpellType    = skillType;
            SpellID      = spellID;
            MasterySkill = masterySkill;
            Volume       = volume;

            if (skillType == null && passive != PassiveSpell.None)
            {
                PassiveSpell = passive;
                Passive      = true;
            }

            NameLocalization = GetLocalization(masterySkill);
        }
コード例 #10
0
    /// <summary>
    /// 初始化施法
    /// </summary>
    protected void SetPassiveSpell()
    {
        string spellListStr = AttrsDic["SpellList"];

        string[] spellIDStr = spellListStr.Split(',');
        for (int i = 0; i < spellIDStr.Length; i++)
        {
            int spellID = int.Parse(spellIDStr[i]);
            if (spellID == 0)
            {
                continue;
            }
            PassiveSpell spell = new PassiveSpell(spellID, this);
            PassiveSpellList.Add(spell);
        }
    }
コード例 #11
0
ファイル: MasteryInfo.cs プロジェクト: Argalep/ServUO
        public static int GetSpellID(PassiveSpell spell)
        {
            switch (spell)
            {
            case PassiveSpell.EnchantedSummoning: return(714);

            case PassiveSpell.AnticipateHit: return(715);

            case PassiveSpell.Intuition: return(717);

            case PassiveSpell.SavingThrow: return(732);

            case PassiveSpell.Potency: return(738);

            case PassiveSpell.Knockout: return(741);

            case PassiveSpell.Boarding: return(744);
            }

            return(-1);
        }
コード例 #12
0
        public static bool IsActivePassive(Mobile m, PassiveSpell spell)
        {
            if (m == null || m.Skills == null)
            {
                return(false);
            }

            int id = GetSpellID(spell);

            foreach (MasteryInfo info in Infos)
            {
                SkillName current = m.Skills.CurrentMastery;

                if (id == info.SpellID && current == info.MasterySkill && HasLearned(m, id, current))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #13
0
ファイル: MasteryInfo.cs プロジェクト: Argalep/ServUO
        public static void OnMasteryChanged(Mobile m, SkillName oldMastery)
        {
            PassiveSpell passive    = GetActivePassive(m);
            SkillName    newMastery = m.Skills.CurrentMastery;

            if (oldMastery != newMastery)
            {
                List <SkillMasterySpell> list = SkillMasterySpell.GetSpells(m);

                if (list != null)
                {
                    list.ForEach(spell =>
                    {
                        spell.Expire();
                    });

                    ColUtility.Free(list);
                }

                if (m is PlayerMobile && oldMastery == SkillName.Necromancy)
                {
                    ((PlayerMobile)m).AllFollowers.IterateReverse(mob =>
                    {
                        if (mob is BaseCreature && CommandUndeadSpell.ValidateTarget((BaseCreature)mob))
                        {
                            ((BaseCreature)mob).SetControlMaster(null);
                        }
                    });
                }

                SpecialMove move = SpecialMove.GetCurrentMove(m);

                if (move is SkillMasteryMove)
                {
                    SpecialMove.ClearCurrentMove(m);
                }

                m.RemoveStatMod("SavingThrow_Str");

                ColUtility.Free(list);
                RemovePassiveBuffs(m);
            }

            if (passive != PassiveSpell.None && passive != PassiveSpell.AnticipateHit)
            {
                switch (passive)
                {
                case PassiveSpell.EnchantedSummoning:
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.EnchantedSummoning, 1155904, 1156090, String.Format("{0}\t{0}", EnchantedSummoningBonus(m).ToString()), true));     // +~1_STAMINA~ Stamina Regeneration and +~2_HP~% Hit Points for summoned pets.<br>Increased difficulty for summoned pets to be dispelled.
                    break;

                case PassiveSpell.Intuition:
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Intuition, 1155907, 1156089, IntuitionBonus(m).ToString(), true));     // Mana Increase ~1_VAL~
                    break;

                case PassiveSpell.SavingThrow:
                {
                    string args = null;

                    switch (GetMasteryLevel(m, newMastery))
                    {
                    default: args = "5\t0\t0\t0"; break;

                    case 2: args = "5\t5\t0\t0"; break;

                    case 3: args = "5\t5\t5\t5"; break;
                    }

                    m.AddStatMod(new StatMod(StatType.Str, "SavingThrow_Str", 5, TimeSpan.Zero));
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.SavingThrow, 1156031, 1156032, args, true));         // Provides a chance to block disarm attempts based on Mastery level, weapon skill level and tactics skill level.
                }
                break;

                case PassiveSpell.Potency:
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Potency, 1155928, 1156195, NonPoisonConsumeChance(m).ToString(), true));     // ~1_VAL~% chance to not consume poison charges when using infecting strike or injected strike.
                    break;

                case PassiveSpell.Knockout:
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Knockout, 1155931, 1156030, String.Format("{0}\t{1}", GetKnockoutModifier(m).ToString(), GetKnockoutModifier(m, true).ToString(), true)));     // Wrestling Damage Bonus:<br>+~1_VAL~% PvM<br>+~2_VAL~% PvP
                    break;

                case PassiveSpell.Boarding:
                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Boarding, 1155934, 1156194, BoardingSlotIncrease(m).ToString(), true));     // Your number of stable slots has been increased by ~1_VAL~.
                    break;
                }

                m.Delta(MobileDelta.WeaponDamage);
                m.UpdateResistances();

                if (m.Mana > m.ManaMax)
                {
                    m.Mana = m.ManaMax;
                }
            }

            if (m.Backpack != null)
            {
                foreach (Item item in m.Backpack.FindItemsByType(typeof(BookOfMasteries)))
                {
                    BookOfMasteries book = item as BookOfMasteries;

                    if (book != null)
                    {
                        book.InvalidateProperties();
                    }
                }
            }

            foreach (Item item in m.Items.Where(i => i is BookOfMasteries))
            {
                BookOfMasteries book = item as BookOfMasteries;

                if (book != null)
                {
                    book.InvalidateProperties();
                }
            }
        }
コード例 #14
0
    public void instantiateSkills()
    {
        PassiveSpell passive1 = new PassiveSpell("Increase Attack",
            "Increases the attack damage by ", ".", 20);
        PassiveSpell passive2 = new PassiveSpell("Increase Max HP",
            "Increases the maximum HP by ", "%.",10);
        passives.Add(passive1);
        passives.Add(passive2);

        ActiveSpell active1 = new ActiveSpell("Heal",
            "Heals the paladin in ", " health points.",
            5, 0, 100, 0, 20, 0);
        ActiveSpell active2 = new ActiveSpell("Vengeance",
            "Releases an wave which deals ", " damage to the enemies it passes through.\n" +
            "[Can't be used while jumping]",
            5, 0, 150, -1, 30, 0);
        ActiveSpell active3 = new ActiveSpell("Judgement",
            "Creates a explosion of energy around the paladin, dealing ", " damage.\n" +
            "[Can't be used while jumping]",
            25, 300, 100, -5, 60, 0);
        ActiveSpell active4 = new ActiveSpell("Intervention",
            "The paladin is immune to all damage during ", " seconds.",
            30, 2, 1, 0, 100, 0);
        actives.Add(active1);
        actives.Add(active2);
        actives.Add(active3);
        actives.Add(active4);
    }