コード例 #1
0
        public bool Act(Monster monster, CommandSystem commandSystem)
        {
            bool didReveal = false;

            DungeonMap dungeonMap = Game.DungeonMap;
            Player     player     = Game.Player;
            MessageLog messageLog = Game.MessageLog;

            foreach (ICell cell in dungeonMap.GetCellsInSquare(monster.X, monster.Y, 1))
            {
                if (dungeonMap.CheckForPlayer(cell.X, cell.Y) && didReveal == false)
                {
                    monster.Name            = "Mimic";
                    monster.Symbol          = 'M';
                    monster.IsMimicInHiding = false;
                    messageLog.Add("That's no armor, that a Mimic", Swatch.DbBlood);
                    messageLog.Add("The mimic spat poison at you", Swatch.DbBlood); // hp debug

                    if (Dice.Roll("1D10") < 7)
                    {
                        if (player.IsPoisonedImmune == false)
                        {
                            messageLog.Add("You were hit! The poison starts to enter your system", Swatch.DbBlood);
                            player.State = new AbnormalState(4, "Poisoned", "The Poison has stated to take its full effect", -2, -2, -3, 2, 3);
                        }
                        else if (player.Status == "Hardened")
                        {
                            messageLog.Add("You were hit! However, the poison has no effect on you in your hardened state");
                        }
                        else
                        {
                            messageLog.Add("You were hit! However, you are completely immune to the poison", Swatch.DbBlood);
                        }
                    }
                    else
                    {
                        messageLog.Add("You swifty dodge the poison");
                    }

                    didReveal = true;
                }
            }

            return(didReveal);
        }
コード例 #2
0
        public void SelectTarget(Point target)
        {
            DungeonMap dungeonmap = Game.DungeonMap;
            Player     player     = Game.Player;

            Game.MessageLog.Add($"{player.Name} casts a {Name}");
            Actor fireballActor = new Actor {
                Attack = _attack, AttackChance = _attackChance, Name = Name
            };

            foreach (ICell cell in dungeonmap.GetCellsInCircle(target.X, target.Y, _area))
            {
                Monster monster = dungeonmap.GetMonsterAt(cell.X, cell.Y);
                if (monster != null)
                {
                    Game.CommandSystem.Attack(fireballActor, monster);
                    if (Dice.Roll("1D100") < _poisonChance)
                    {
                        if (monster.IsPoisonedImmune == false && _poisonDamage != 0)
                        {
                            monster.State = new MonsterAbnormalState(monster, _poisonLength, "Poisoned", -1, -1, _poisonDamage);
                        }
                    }
                }

                if (dungeonmap.CheckForPlayer(cell.X, cell.Y))
                {
                    Game.CommandSystem.Attack(fireballActor, player);
                    if (Dice.Roll("1D100") < _poisonChance)
                    {
                        if (player.IsPoisonedImmune == false && _poisonDamage != 0)
                        {
                            player.State = new AbnormalState(_poisonLength, "Poisoned", "", -2, -2, -3, 2, _poisonDamage);
                        }
                    }
                }
            }
        }