コード例 #1
0
        protected override bool OnDie(Action action)
        {
            // drop stuff
            Race.PlaceDrop(Dungeon, Position);

            // monsters can die
            return(true);
        }
コード例 #2
0
        void IFeatureWriter.Populate(Vec pos, int monsterDensity, int itemDensity, int depth)
        {
            // test every open tile
            if (mDungeon.Tiles[pos].IsPassable)
            {
                // place a monster
                if ((mDungeon.Entities.GetAt(pos) == null) && (Rng.Int(1000) < monsterDensity + (depth / 4)))
                {
                    Monster.AddRandom(mDungeon, depth, pos);
                }

                // place an item
                if (Rng.Int(1000) < itemDensity + (depth / 4))
                {
                    Race race = Race.Random(mDungeon, depth, false);
                    race.PlaceDrop(mDungeon, pos);
                }
            }
        }