Example #1
0
        public PlayerSense GetPlayerSense(PlayerSenseType sense)
        {
            switch (sense)
            {
            case PlayerSenseType.MAGIC:
                return(MagicSns);

            case PlayerSenseType.NOISE:
                return(NoiseSns);

            case PlayerSenseType.SMELL:
                return(SmellSns);

            case PlayerSenseType.COLOR:
                return(ColorSns);

            default:
                throw new NotImplementedException("PlayerSenseType " + sense + " undefiniert!");
            }
        }
Example #2
0
        public PlayerSense GetRoomSense(PlayerSenseType roomSense)
        {
            IList <PlayerSense> senses = new List <PlayerSense>();

            foreach (IRPGObject obj in objects)
            {
                PlayerSense sense = obj.GetPlayerSense(roomSense);
                if (sense != null)
                {
                    senses.Add(sense);
                }
            }

            PlayerSense randomSense = RPGUtils.GetRandomWeightedPlayerSense(senses);

            if (randomSense != null)
            {
                return(new PlayerSense(randomSense.Description, randomSense.Potency));
            }
            else
            {
                return(new PlayerSense());
            }
        }