Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Critter
- {
- class Creature
- {
- //Stats
- public int Hunger;
- public int Boredom;
- public string Name;
- public string[] Phrases = new string[6];
- public string[] Tricks = new string[3];
- Random random = new Random();
- public Creature()
- {
- //Stats
- Hunger = 5;
- Boredom = 5;
- Name = "Pannya";
- Phrases[0] = "You're the worst caretaker ever.";
- Phrases[1] = "I'm feeling horrible right now.";
- Phrases[2] = "I'm feeling bad right now.";
- Phrases[3] = "I'm feeling okay right now.";
- Phrases[4] = "I'm feeling good right now.";
- Phrases[5] = "I'm feeling excellent right now.";
- Tricks[0] = "Your Pannya rolled around.";
- Tricks[1] = "Your Pannya stood on her tail.";
- Tricks[2] = "Your Pannya did a backflip.";
- }
- //Action
- private void passTime()
- {
- Hunger++;
- Boredom++;
- Hunger = Math.Min(Hunger, 10);
- Boredom = Math.Min(Boredom, 10);
- }
- public int getMood()
- {
- return (int)Math.Round(0.25 * ((10-Hunger) + (10-Boredom)));
- }
- public void Eat()
- {
- Hunger -= 3;
- Hunger = Math.Max(Hunger, -1);
- passTime();
- }
- public void Play()
- {
- Boredom -= 3;
- Boredom = Math.Max(Boredom, -1);
- passTime();
- }
- public string Talk()
- {
- return Phrases[getMood()];
- }
- public string PerformTrick()
- {
- passTime();
- return Tricks[random.Next(3)];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement