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


C# Floor.monster_aware_of_player方法代码示例

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


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

示例1: attack_monster_in_grid

        public void attack_monster_in_grid(Floor fl, Weapon w, int c_monsterID, gridCoordinate current_gc, double multiplier, out bool rolled_max, bool charge_attack = false)
        {
            rolled_max = false;
            List<Attack> modified_attacks = new List<Attack>();

            if (fl.badguy_by_monster_id(c_monsterID) != null && !fl.monster_aware_of_player(c_monsterID) && my_class == Chara_Class.Rogue)
                max_energy += 2;

            if (fl.badguy_by_monster_id(c_monsterID) != null)
            {
                if (w != null)
                {
                    string attack_msg = "You attack the " + fl.badguy_by_monster_id(c_monsterID).my_name + " with your " + w.get_my_name() + "!";
                    message_buffer.Add(attack_msg);
                    List<Attack> attacks = new List<Attack>();
                    List<StatusEffect> debuffs = new List<StatusEffect>();

                    bool aoe_effect = false;
                    if (w.get_my_weapon_type() == Weapon.Type.Axe || w.get_my_weapon_type() == Weapon.Type.Lance)
                        aoe_effect = true;

                    handle_attack_damage(w, null, multiplier, charge_attack, out rolled_max, ref attacks, ref debuffs);
                    fl.damage_monster(attacks, debuffs, c_monsterID, true, aoe_effect);
                }
                else //Unarmed attack.
                {
                    double base_dmg_val = (double)rGen.Next(1, 4) * multiplier;

                    if (base_dmg_val == 3 * multiplier)
                        rolled_max = true;

                    int modified_dmg_val = (int)base_dmg_val;
                    if (my_character == Character.Falsael)
                        modified_dmg_val = (int)Math.Ceiling(base_dmg_val * 1.2);

                    modified_attacks.Add(new Attack(Attack.Damage.Crushing, modified_dmg_val));
                    string attack_msg = "You attack the " + fl.badguy_by_monster_id(c_monsterID).my_name + " with your fists!";
                    message_buffer.Add(attack_msg);
                    fl.damage_monster(modified_attacks, null, c_monsterID, true, false);
                }
            }
        }
开发者ID:Chupaflor,项目名称:Cronkpit_Samples,代码行数:42,代码来源:Player.cs


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