コード例 #1
0
        public static string DescribeMinorFeature(MinorFeatures mf)
        {
            switch (mf)
            {
            case MinorFeatures.Glow:
                return(" The walls of the room are giving off a faint glow. You find it comforting for some reason.");

            case MinorFeatures.Drip:
                return(" A strange liquid is dripping from the roof. You cannot identify the liquid.");

            case MinorFeatures.Slime:
                return(" The surfaces of this room are covered in a fine layer of slime. It is sticky to the touch.");

            case MinorFeatures.Rock:
                return(" The walls of the room appear to be made of a rough stone, of a type you cannot identify.");

            case MinorFeatures.Rats:
                return(" Tiny rats scurry away from you.");

            case MinorFeatures.Blood:
                return(" There is a faint trail of blood accross the floor.");

            case MinorFeatures.Needles:
                return(" The room is covered in tiny needles, not big enough to hurt you, but unnerving nevertheless.");

            case MinorFeatures.Fruit:
                return(" The floor is covered in rotten fruit.");

            case MinorFeatures.Music:
                return(" You can hear faint music coming from somewhere. The melody reminds you of your childhood, or breakfast.");

            default:
                return("");
            }
        }
コード例 #2
0
 public Room(Overviews overview, MinorFeatures minorFeature1, MinorFeatures minorFeature2, Sensories sensory, int x, int y)
 {
     Overview      = overview;
     MinorFeature1 = minorFeature1;
     MinorFeature2 = minorFeature2;
     Sensory       = sensory;
     RoomX         = x;
     RoomY         = y;
     FloorWeapon   = null;
 }
コード例 #3
0
        /*
         * Static data for creating rooms
         */
        public static Room GenerateRoom(Random rand, int x, int y)
        {
            Array         ovs = Enum.GetValues(typeof(Overviews));
            Overviews     ov  = (Overviews)ovs.GetValue(rand.Next(ovs.Length));
            Array         mfs = Enum.GetValues(typeof(MinorFeatures));
            MinorFeatures mf1 = (MinorFeatures)ovs.GetValue(rand.Next(1, mfs.Length)); // Make sure it cant be None
            // 1/3 chance for a second minor feature
            MinorFeatures mf2 = MinorFeatures.None;

            if (rand.Next(2) == 0)
            {
                mf2 = (MinorFeatures)ovs.GetValue(rand.Next(1, mfs.Length)); // Make sure it cant be None
            }
            // 50% of a sensory
            Sensories sen = Sensories.None;

            if (rand.Next(1) == 0)
            {
                Array sens = Enum.GetValues(typeof(Sensories));
                sen = (Sensories)sens.GetValue(rand.Next(sens.Length));
            }

            return(new Room(ov, mf1, mf2, sen, x, y));
        }