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 GameBase_test_
- {
- class Program
- {
- static void Main(string[] args)
- {
- int m = 0;
- int Strength = 5;
- int Agility = 5;
- int Intelligence = 5;
- int Level = 0;
- string specialty;
- string Name;
- Console.WriteLine("What is your name?");
- Name = Console.ReadLine();
- Console.WriteLine("What is your specialty?");
- Console.WriteLine("Strength, Agility, or Intelligence");
- while (m != 1)
- {
- specialty = Console.ReadLine();
- if (specialty != "Strength")
- {
- if (specialty != "Agility")
- {
- if (specialty != "Intelligence")
- {
- Console.WriteLine("Try Again");
- }
- else
- {
- Console.WriteLine("Intelligence increased by 3!");
- Intelligence += 3;
- Console.WriteLine("Your Intelligence is now: " + Intelligence);
- m = 1;
- }
- }
- else
- {
- Console.WriteLine("Agility increased by 3!");
- Agility += 3;
- Console.WriteLine("Your Agility is now: " + Agility);
- m = 1;
- }
- }
- else
- {
- Console.WriteLine("Strength Increased by 3!");
- Strength += 3;
- Console.WriteLine("Your Strength is now: " + Strength);
- m = 1;
- }
- }
- GameLoop(Strength, Agility, Intelligence, Level);
- Console.ReadLine();
- }
- static int CalculateHealth(int strength, int Damage)
- {
- int Health = 19 * strength + 150 - Damage;
- return Health;
- }
- static int CalculateMana(int Intelligence, int SpellCost)
- {
- int Mana = 13 * Intelligence + 100 - SpellCost;
- return Mana;
- }
- static int CalculateAttackSpeed(int Agility, int Slows)
- {
- int AttackSpeed = Agility + 10 - Slows;
- return AttackSpeed;
- }
- static void GameLoop(int Strength, int Agility, int Intelligence, int Level)
- {
- int XP = 0;
- int Damage = 0;
- int SpellCost = 0;
- int Slows = 0;
- int EnemiesKilled = 0;
- string Input = "";
- Level = 1;
- int neededXP = XpScaler(Level, XP);
- while (Input != "Quit")
- {
- Console.WriteLine("Your Health is: " + CalculateHealth(Strength, Damage));
- Console.WriteLine("Your Mana is: " + CalculateMana(Intelligence, SpellCost));
- Console.WriteLine("Your Attack Speed is: " + CalculateAttackSpeed(Agility, Slows));
- Console.WriteLine("What will you do?");
- Console.WriteLine("(Fight)");
- Input = Console.ReadLine();
- if (Input == "Fight")
- {
- if (FightLoop(Strength, Agility, Intelligence, Damage, SpellCost, Slows, Level) == false)
- {
- //Calculate Score
- }
- else
- {
- int EnemyLevel = CalculateEnemyLevel(Level);
- EnemiesKilled = EnemiesKilled + 1;
- XP = xpgenerator(EnemyLevel, Level) + XP;
- Console.WriteLine("You Have: " + XP + "XP");
- int XPTillNextLevel = neededXP - XP;
- Console.WriteLine("XP untill your next level: " + XPTillNextLevel);
- if (XPTillNextLevel <= 0)
- {
- Console.WriteLine("You have leveled up!");
- Level = Level + 1;
- XpScaler(Level, XP);
- XP = 0;
- }
- Console.ReadLine();
- }
- }
- }
- }
- static bool FightLoop(int Strength, int Agility, int Intelligence, int Damage, int SpellCost, int Slows, int Level)
- {
- int EnemyDamage = 0;
- int PlayerHealth = CalculateHealth(Strength, Damage);
- int EnemyLevel = CalculateEnemyLevel(Level);
- bool Death = false;
- int EnemySlows = 0;
- int EnemyStrength = CalculateEnemyStrength(EnemyLevel);
- string Input = "";
- while (Death == false)
- {
- int EnemyHealth = CalculateEnemyHealth(EnemyStrength, EnemyDamage);
- if (EnemyHealth >= 1)
- {
- if (PlayerHealth >= 1)
- {
- Console.WriteLine("What will you do?");
- Console.WriteLine("Attack, Dodge, or Examine");
- Input = Console.ReadLine();
- if (Input != "Attack")
- {
- if (Input != "Dodge")
- {
- if (Input != "Examine")
- {
- if (Input != "Run")
- {
- Console.WriteLine("What was that?");
- }
- else
- {
- Console.WriteLine("Running is not an option you pussy");
- }
- }
- else
- {
- Console.WriteLine("Your enemies stats are: ");
- CalculateEnemyStats(EnemyLevel, EnemyDamage, EnemySlows);
- }
- }
- else
- {
- //Generate dodge chance and test against enemy speed + strength.
- }
- }
- else
- {
- int AttackDamage = CalculateAttack(Strength);
- EnemyDamage += AttackDamage;
- }
- }
- else
- {
- Console.WriteLine("You have been rekt");
- Death = true;
- return false;
- }
- }
- else if (EnemyHealth <= 0)
- {
- Console.WriteLine("You have slain your enemy");
- Death = true;
- }
- }
- return true;
- }
- static int XpScaler(int Level, int XP)
- {
- int HML = Level + 10;
- int LevelEffect = 10 * Level;
- int XPTillNextLevel = 100 + LevelEffect + HML;
- return XPTillNextLevel;
- }
- static int xpgenerator(int EnemyLevel, int Level)
- {
- int XPGained = 10 + EnemyLevel - Level;
- if (XPGained < 1)
- {
- XPGained = 1;
- }
- return XPGained;
- }
- static int CalculateAttack(int Strength)
- {
- int AttackDamage = Strength * 5;
- return AttackDamage;
- }
- static int CalculateEnemyLevel(int Level)
- {
- int EnemyMin = Level - 5;
- if (EnemyMin < 1)
- {
- EnemyMin = 1;
- }
- int EnemyMax = Level + 10;
- Random random = new Random();
- int EnemyLevel = random.Next(EnemyMin, EnemyMax);
- return EnemyLevel;
- }
- static void CalculateEnemyStats(int EnemyLevel,int EnemyDamage, int EnemySlows)
- {
- int EnemyStrength = CalculateEnemyStrength(EnemyLevel);
- int EnemyHealth = CalculateEnemyHealth(EnemyStrength, EnemyDamage);
- int EnemyMana = CalculateEnemyMana();
- int EnemyAttackSpeed = CalculateEnemyAgility(EnemyLevel);
- Console.WriteLine("Your Enemies Health is: " + EnemyHealth);
- Console.WriteLine("Your Enemies Mana is: " + EnemyMana);
- Console.WriteLine("Your Enemies AttackSpeed is: " + EnemyAttackSpeed);
- }
- static int CalculateEnemyStrength(int EnemyLevel)
- {
- int EnemyStrength = EnemyLevel + 5;
- return EnemyStrength;
- }
- static int CalculateEnemyAgility(int EnemyLevel)
- {
- int EnemyAgility = EnemyLevel + 5;
- return EnemyAgility;
- }
- static int CalculateEnemyHealth(int EnemyStrength, int EnemyDamage)
- {
- int EnemyHealth = 19 * EnemyStrength - EnemyDamage;
- return EnemyHealth;
- }
- static int CalculateEnemyMana()
- {
- int EnemyMana = 13 * 5;
- return EnemyMana;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement