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


C# Weapon.get_my_equipped_talismans方法代码示例

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


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

示例1: handle_attack_damage

        //Functions for handling attack lists and talismans
        public void handle_attack_damage(Weapon w, Scroll s, double initialMultiplier, bool charge_attack, out bool rolledMax,
                                         ref List<Attack> attacksOut, ref List<StatusEffect> effectsOut)
        {
            rolledMax = false;

            int mindmg = 0;
            int maxdmg = 0;
            Attack.Damage dmgTyp = 0;
            List<Talisman> equipped_talismans = new List<Talisman>();
            List<Attack> temp_attacks = new List<Attack>();
            if (w != null)
            {
                mindmg = w.specific_damage_val(false);
                maxdmg = w.specific_damage_val(true);
                dmgTyp = w.get_my_damage_type();
                equipped_talismans = w.get_my_equipped_talismans();
            }
            else if (s != null)
            {
                mindmg = s.get_specific_damage(false);
                maxdmg = s.get_specific_damage(true);
                dmgTyp = s.get_damage_type();
                equipped_talismans = s.get_my_equipped_talismans();
            }

            int baseDamage = rGen.Next(mindmg, maxdmg + 1);
            if(w != null)
                rolledMax = baseDamage == w.specific_damage_val(true);

            //next we check for a talisman of expediency.
            for (int i = 0; i < equipped_talismans.Count; i++)
            {
                if (equipped_talismans[i].get_my_type() == Talisman.Talisman_Type.Expediency)
                {
                    int base_val = (int)equipped_talismans[i].get_my_prefix() + 2;
                    int min_damage_modifier = base_val;
                    int max_damage_modifier = (base_val * 2);
                    if (baseDamage > 0)
                        baseDamage += rGen.Next(min_damage_modifier, max_damage_modifier + 1);
                }
            }

            //Next we check for Thrashing damage
            int thrashing_slot = check_for_status_effect(Scroll.Status_Type.Thrashing);
            if (thrashing_slot != -1)
            {
                int thrashing_stacks = BuffDebuffTracker[thrashing_slot].get_current_stacks();
                int thrashing_bonus = rGen.Next( thrashing_stacks * 2, (thrashing_stacks * 3) + 1);
                baseDamage += thrashing_bonus;
            }

            //Next we see if the spell is a rage dump and add bonus damage as appropriate
            if (s != null && s.spell_is_rage_dump())
            {
                baseDamage += s.get_rage_bonus(c_energy, rGen);
                c_energy = 0;
            }

            //Now we add any talisman based attacks.
            for (int i = 0; i < equipped_talismans.Count; i++)
            {
                if (equipped_talismans[i].extra_damage_specific_type_talisman())
                {
                    int base_val = (int)equipped_talismans[i].get_my_prefix() + 1;
                    Attack.Damage dmg_typ = 0;
                    switch (equipped_talismans[i].get_my_type())
                    {
                        case Talisman.Talisman_Type.Pressure:
                            dmg_typ = Attack.Damage.Crushing;
                            break;
                        case Talisman.Talisman_Type.Heat:
                            dmg_typ = Attack.Damage.Fire;
                            break;
                        case Talisman.Talisman_Type.Snow:
                            dmg_typ = Attack.Damage.Frost;
                            break;
                        case Talisman.Talisman_Type.Razors:
                            dmg_typ = Attack.Damage.Slashing;
                            break;
                        case Talisman.Talisman_Type.Heartsblood:
                            dmg_typ = Attack.Damage.Piercing;
                            break;
                        case Talisman.Talisman_Type.Toxicity:
                            dmg_typ = Attack.Damage.Acid;
                            break;
                        case Talisman.Talisman_Type.Sparks:
                            dmg_typ = Attack.Damage.Electric;
                            break;
                    }
                    temp_attacks.Add(new Attack(dmg_typ, rGen.Next(base_val, (base_val * 2) + 1), Weapon.Type.Talisman));
                }
            }
            //next, for characters. Falsael gets a bonus to all nonbow weapons
            //and melee spells. Petaer gets a bonus to all spells.
            if ((my_character == Character.Petaer && s != null) ||
               (my_character == Character.Falsael && ((w != null && w.get_my_weapon_type() != Weapon.Type.Bow) ||
                                                      (s != null && s.is_melee_range_spell()))))
                baseDamage = (int)(Math.Ceiling((double)baseDamage * 1.2));

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


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