Esempio n. 1
0
        public void InitiateEncounter()
        {
            var monsterId = SelectRandomMonster(TerrainMeasurement.TerrainAtPlayer());

            RenderState.DisplayMonsterID = monsterId;

            if (monstDir == Direction.None)
            {
                SetMonsterImagePosition();
            }

            for (int i = 0; i < monstCount; i++)
            {
                var m = new Monster(Data.MonsterInfo.First(x => x.ID == monsterId));

                m.HP = (int)(m.HP * (Random.NextDouble() * 0.4 + 0.8));

                currentMonst.Add(m);
            }
        }
Esempio n. 2
0
        private double TerrainEncounterChance()
        {
            switch (TerrainMeasurement.TerrainAtPlayer())
            {
            case TerrainType.Grass:
                return(0.51);

            case TerrainType.Mixed:
            case TerrainType.Forest:
                return(0.67);

            case TerrainType.Swamp:
            case TerrainType.Foothills:
                return(0.9);

            case TerrainType.Desert:
            case TerrainType.Mountain:
                return(1.25);

            case TerrainType.Water:
            default:
                return(0.4);
            }
        }