当前位置: 首页>>代码示例>>C#>>正文


C# Player.LearnSpell方法代码示例

本文整理汇总了C#中Classes.Player.LearnSpell方法的典型用法代码示例。如果您正苦于以下问题:C# Player.LearnSpell方法的具体用法?C# Player.LearnSpell怎么用?C# Player.LearnSpell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Classes.Player的用法示例。


在下文中一共展示了Player.LearnSpell方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: sub_6A00F

        // sub_6A00F
        internal static void sub_6A00F(Player player)
        {
            for (int i = 0; i < 5; i++)
            {
                player.spellCastCount[0, i] = 0;
                player.spellCastCount[1, i] = 0;
                player.spellCastCount[2, i] = 0;
            }

            for (SkillType skill = SkillType.Cleric; skill <= SkillType.Monk; skill++)
            {
                int skillLevel = player.SkillLevel(skill);

                if (skillLevel > 0)
                {
                    switch (skill)
                    {
                        case SkillType.Cleric:
                            player.spellCastCount[0, 0] += 1;

                            for (int PlayerLvl = 0; PlayerLvl <= (skillLevel - 2); PlayerLvl++)
                            {
                                for (int sp_lvl = 0; sp_lvl < 5; sp_lvl++)
                                {
                                    player.spellCastCount[0, sp_lvl] += ClericSpellLevels[PlayerLvl, sp_lvl];
                                }
                            }

                            calc_cleric_spells(false, player);

                            foreach (Spells spell in System.Enum.GetValues(typeof(Spells)))
                            {
                                SpellEntry se = gbl.spellCastingTable[(int)spell];

                                int sp_class = (se.spellLevel - 1) / 5;
                                int sp_lvl = (se.spellLevel - 1) % 5;

                                if (se.spellClass == 0 &&
                                    player.spellCastCount[sp_class, sp_lvl] > 0 &&
                                    spell != Spells.animate_dead)
                                {
                                    player.LearnSpell(spell);
                                }
                            }
                            break;

                        case SkillType.Paladin:
                            if (skillLevel > 8)
                            {
                                for (int addLvl = 8; addLvl < skillLevel; addLvl++)
                                {
                                    for (int spellLvl = 0; spellLvl < 5; spellLvl++)
                                    {
                                        player.spellCastCount[0, spellLvl] += PaladinSpellLevels[addLvl, spellLvl];
                                    }
                                }

                                foreach (Spells spell in System.Enum.GetValues(typeof(Spells)))
                                {
                                    SpellEntry se = gbl.spellCastingTable[(int)spell];
                                    int sp_class = (se.spellLevel - 1) / 5;
                                    int sp_lvl = (se.spellLevel - 1) % 5;

                                    if (se.spellClass == 0 &&
                                        player.spellCastCount[sp_class, sp_lvl] > 0)
                                    {
                                        player.LearnSpell(spell);
                                    }
                                }
                            }
                            break;

                        case SkillType.Ranger:
                            if (skillLevel > 7)
                            {
                                for (int var_3 = 8; var_3 <= skillLevel; var_3++)
                                {
                                    for (int sp_lvl = 0; sp_lvl < 3; sp_lvl++)
                                    {
                                        player.spellCastCount[1, sp_lvl] += unk_1A758[var_3, sp_lvl];
                                    }

                                    for (int sp_lvl = 3; sp_lvl < 5; sp_lvl++)
                                    {
                                        player.spellCastCount[2, sp_lvl - 3] += unk_1A758[var_3, sp_lvl];
                                    }
                                }

                                foreach (Spells spell in System.Enum.GetValues(typeof(Spells)))
                                {
                                    if (gbl.spellCastingTable[(int)spell].spellClass == SpellClass.Druid)
                                    {
                                        player.LearnSpell(spell);
                                    }
                                }
                            }

                            break;

//.........这里部分代码省略.........
开发者ID:gowantervo,项目名称:coab,代码行数:101,代码来源:ovr026.cs

示例2: createPlayer


//.........这里部分代码省略.........
                for (int i = 0; i < 5; i++)
                {
                    player.spellCastCount[0, i] = 0;
                    player.spellCastCount[1, i] = 0;
                    player.spellCastCount[2, i] = 0;
                }

                for (int class_idx = 0; class_idx <= 7; class_idx++)
                {
                    if (player.ClassLevel[class_idx] > 0)
                    {
                        if (class_idx == 0)
                        {
                            player.spellCastCount[0, 0] = 1;
                        }
                        else if (class_idx == 5)
                        {
                            player.spellCastCount[2, 0] = 1;
                        }

                        //var_21 += ovr024.roll_dice(unk_1A8C4[class_idx], unk_1A8C3[class_idx]);
                        //TODO this was not used in original code.

                        if (class_idx == 0)
                        {
                            ovr026.calc_cleric_spells(false, player);

                            foreach (Spells spell in System.Enum.GetValues(typeof(Spells)))
                            {
                                SpellEntry stru = gbl.spellCastingTable[(int)spell];

                                if (stru.spellClass == 0 && stru.spellLevel == 1)
                                {
                                    player.LearnSpell(spell);
                                }
                            }
                        }
                        else if (class_idx == 5)
                        {
                            player.LearnSpell(Spells.detect_magic_MU);
                            player.LearnSpell(Spells.read_magic);
                            player.LearnSpell(Spells.enlarge);
                            player.LearnSpell(Spells.sleep);
                        }

                        var_20++;
                    }
                }

                player.Money.SetCoins(Money.Platinum, 300);
                player.hit_point_rolled = sub_509E0(0xff, player);
                player.hit_point_max = player.hit_point_rolled;

                var_1E = get_con_hp_adj(player);

                if (var_1E < 0)
                {
                    if (player.hit_point_max > (System.Math.Abs(var_1E) + var_20))
                    {
                        player.hit_point_max = (byte)((player.hit_point_max + var_1E) / var_20);
                    }
                    else
                    {
                        player.hit_point_max = 1;
                    }
                }
开发者ID:gowantervo,项目名称:coab,代码行数:67,代码来源:ovr018.cs

示例3: DuelClass

        internal static void DuelClass(Player player)
        {
            List<MenuItem> list = new List<MenuItem>();

            list.Add(new MenuItem("Pick New Class", true));

            foreach (var _class in gbl.RaceClasses[(int)player.race])
            {
                if (SecondClassAllowed(_class, player) == true)
                {
                    list.Add(new MenuItem(ovr020.classString[(int)_class]));
                }
            }

            if (list.Count == 1)
            {
                seg041.DisplayStatusText(15, 4, player.name + " doesn't qualify.");
                list.Clear();
                return;
            }

            MenuItem list_ptr;
            int index = 1;
            bool show_exit = true;
            bool var_F = true;

            char input_key;

            do
            {
                input_key = ovr027.sl_select_item(out list_ptr, ref index, ref var_F, show_exit, list,
                    0x16, 0x26, 2, 1, gbl.defaultMenuColors, "Select", string.Empty);

                if (input_key == 0)
                {
                    return;
                }
            } while (input_key != 'S');

            player.exp = 0;
            player.attacksCount = 2;
            int newClass = 0;

            while (newClass <= 7 && ovr020.classString[newClass] != list_ptr.Text)
            {
                newClass++;
            }

            list.Clear();

            player.ClassLevelsOld[(int)HumanCurrentClass_Unknown(player)] = HumanCurrentClassLevel_Zero(player);

            player.multiclassLevel = player.HitDice;
            player.HitDice = 1;

            player.ClassLevel[(int)HumanCurrentClass_Unknown(player)] = 0;
            player.ClassLevel[newClass] = 1;

            for (int i = 0; i < 5; i++)
            {
                player.spellCastCount[0, i] = 0;
                player.spellCastCount[1, i] = 0;
                player.spellCastCount[2, i] = 0;
            }

            if (newClass == 0)
            {
                player.spellCastCount[0, 0] = 1;
            }
            else if (newClass == 5)
            {
                player.spellCastCount[2, 0] = 1;
                player.LearnSpell(Spells.detect_magic_MU);
                player.LearnSpell(Spells.read_magic);
                player.LearnSpell(Spells.sleep);
            }

            player._class = (ClassId)newClass;

            seg041.DisplayStatusText(0, 10, player.name + " is now a 1st level " + ovr020.classString[newClass] + ".");

            player.spellList.Clear();

            ReclacClassBonuses(player);
            calc_cleric_spells(true, player);
            reclac_saving_throws(player);
            reclac_thief_skills(player);

            foreach (var item in player.items)
            {
                if ((gbl.ItemDataTable[item.type].classFlags & player.classFlags) == 0 &&
                    item.cursed == false)
                {
                    item.readied = false;
                }
            }
        }
开发者ID:gowantervo,项目名称:coab,代码行数:97,代码来源:ovr026.cs

示例4: rest_scribe

        static int rest_scribe(ref bool findNext, Player player)
        {
            int next_scribe_lvl = 0;
            foreach (Item item in player.items.ToArray())
            {
                if (item.IsScroll() == true)
                {
                    for (int spellIdx = 1; spellIdx < 4 && next_scribe_lvl == 0; spellIdx++)
                    {
                        if (item.getAffect(spellIdx) > (Affects)0x80)
                        {
                            if (findNext == true)
                            {
                                next_scribe_lvl = gbl.spellCastingTable[(int)item.getAffect(spellIdx) & 0x7F].spellLevel;
                            }
                            else
                            {
                                byte spellId = (byte)((int)item.getAffect(spellIdx) & 0x7F);
                                player.LearnSpell((Spells)spellId);
                                ovr023.remove_spell_from_scroll(spellId, item, player);

                                display_resting_time(0);

                                ovr023.DisplayCaseSpellText(spellId, "has scribed", player);
                                findNext = true;
                            }
                        }
                    }
                }

                if (next_scribe_lvl != 0) break;
            }

            return next_scribe_lvl;
        }
开发者ID:gowantervo,项目名称:coab,代码行数:35,代码来源:ovr021.cs


注:本文中的Classes.Player.LearnSpell方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。