Quest
Quest
Example heading with h3 size
Following is the C# code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace HelloWorld
{
public class Program
{
public static int health = 10;
public static int attack = 5;
public static int speed = 15;
public static int experience = 0;
public static int progress = 0;
//Gear
public static int dullSwords = 0;
public static int shinySwords = 0;
public static int abandonedArmor = 0;
public static int shinyArmor = 0;
public static bool turnedAround = false;
public static void Main()
{
//Console.WriteLine("Welcome");
Game();
}
public static void Game() {
string[] names = new string[2] {"Larry The Skeleton", "Barry The Skeleton"};
Random chance = new Random();
int chance1 = chance.Next(1, 4);
int rewardRandom = chance.Next(1,5);
int nameRandom = chance.Next(0,2);
//Variables
Console.WriteLine("Health: " + health);
Console.WriteLine("Attack: " + attack);
Console.WriteLine("Speed: " + speed);
Console.WriteLine(" ");
Console.WriteLine("Welcome");
Console.WriteLine("Where do you go? Abandoned Castle, Jungle, Temple.(1, 2, 3)");
Console.WriteLine("Only Abandoned Castle has been made so far...");
int one = Convert.ToInt32(Console.ReadLine());
if (one == 1) {
Console.WriteLine("You enter the Abandoned Castle");
turnedAround = false;
progress = 1;
RandomItem();
//Console.WriteLine("You Find... nothing new.");
one = 5;
if(one == 5) {
//AbandonedCastleTurnAround();
Console.WriteLine(" ");
Console.WriteLine("You continue down a dark hallway");
Console.WriteLine("You find a split in the path, where do you go? Left, Right.(1, 2)");
one = Convert.ToInt32(Console.ReadLine());
}
if(one == 1) {
progress++;
//higher strength makes higher chance
Console.WriteLine("You enter the dungeon.");
Console.WriteLine("The doors shut behind you and 3 skeletons approach you.");
//Check Attack Stats
if(attack > 5 && attack < 15) {
health -= 3;
Console.WriteLine("You are able defend yourself from some of the skeletons, but still get hurt.");
Console.WriteLine("Health: " + health);
if(health <= 0) {
GameOver();
}
experience += 3;
if(rewardRandom > 0 && rewardRandom < 4) {
RandomItem();
}
one = 5;
}
if(attack <= 5){
health -=5;
Console.WriteLine("You fail in defending yourself from the skeletons and get hurt.");
Console.WriteLine("Health: " + health);
if(health <= 0) {
GameOver();
}
experience += 5;
one = 5;
}
if(attack >= 15) {
Console.WriteLine("You defend yourself from all of the skeletons.");
Console.WriteLine("Health: " + health);
experience += 2;
RandomItem();
one = 5;
}
}
if(one == 2) {
progress++;
health -= 3;
Console.WriteLine("You continue down a dark corridoor");
Console.WriteLine("You get attacked by a skeleton which promptly falls apart");
Console.WriteLine("Health: " + health);
if(health <= 0) {
GameOver();
}
experience += 3;
rewardRandom = chance.Next(1,5);
if(rewardRandom > 3) {
Console.WriteLine("You find a health potion. Do you use it? (1 - use it, 2 - leave it)");
one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
//Drink health potion
health += 3;
Console.WriteLine("It has a bitter taste.");
Console.WriteLine("Health: " + health);
}
if(one == 2) {
//Leave health potion
Console.WriteLine("You leave the potion");
Console.WriteLine("Health: " + health);
}
}
//enemy skeleton approaches
}
one = 5;
if(one == 5) {
progress++;
Console.WriteLine(" ");
Console.WriteLine("You end up at the center of the castle");
AbandonedCastleTurnAround();
RandomItem();
//if progress is farther, higher chance of taknig damage when running
Random starter = new Random();
int startFighter = starter.Next(1, 3);
SkeletonFight(15, 10, startFighter, names[nameRandom]);
Console.WriteLine("It seems that you survived " + names[nameRandom]);
progress++;
Console.WriteLine(" ");
WishingWell();
Console.WriteLine(" ");
Inventory();
Console.WriteLine(" ");
AbandonedCastleTurnAround();
Console.WriteLine(" ");
Console.WriteLine("There is a dark stairwell ahead, what do you do? Go up, go down. (1, 2)");
one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
Console.WriteLine("You head up the dark stairwell and see a glimmer of light.");
}
if(one == 2) {
Console.WriteLine("You head down the dark stairwell.");
Console.WriteLine("Water drips from the ceiling as you head down.");
nameRandom = starter.Next(0, 2);
startFighter = starter.Next(1, 3);
SkeletonFight(25, 15, startFighter, names[nameRandom]);
}
}
}
if(one == 2) {
progress = 1;
Console.WriteLine("You enter the Jungle");
experience += 5;
RandomItem();
}
if(one == 3) {
progress++;
Console.WriteLine("You enter the Temple");
experience += 10;
RandomItem();
}
}//end of game function method thing
public static void Inventory() {
Console.WriteLine("Do you want to access your inventory? Yes, No. (1, 2) (It will show you stats as well as other things)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
Console.WriteLine("Stats:");
Console.WriteLine("Health: " + health);
Console.WriteLine("Attack: " + attack);
Console.WriteLine("Experience: " + experience);
Console.WriteLine(" ");
if(dullSwords > 0) {
Console.WriteLine("Dull Swords: " + dullSwords);
}
if(shinySwords > 0) {
Console.WriteLine("Shiny Swords: " + shinySwords);
}
if(abandonedArmor > 0) {
Console.WriteLine("Abandoned Armor Sets: " + abandonedArmor);
}
if(shinyArmor > 0) {
Console.WriteLine("Shiny Armor Sets: " + shinyArmor);
}
Console.WriteLine(" ");
Console.WriteLine("Crafting coming in a later version");
}
if(one == 2) {
Console.WriteLine("You decide to continue on your journey");
}
}
public static void WishingWell() {
Console.WriteLine("You see a Wishing Well nearby, what do you do? Get closer, ignore it. (1, 2)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
Console.WriteLine("You approach the Wishing Well and see rusted coins inside.");
Console.WriteLine("The well speaks to you...");
Console.WriteLine("Sacrifice 5 experience for a random item? Yes, No. (1, 2)");
one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
Console.WriteLine("You attempt to use the Wishing Well");
if(experience >= 5) {
experience -= 5;
Console.WriteLine("You successfully sacrifice 5 experience");
RandomItem();
}else {
Console.WriteLine("The Wishing Well rejects you.");
Console.WriteLine(experience);
}
}
if(one == 2) {
Console.WriteLine("You leave the odd wishing well, wondering who put it there.");
}
}
if(one == 2) {
Console.WriteLine("You ignore the Wishing Well as the water bubbles.");
}
}
//Turn around - abandoned castle
public static void AbandonedCastleTurnAround() {
Random chance = new Random();
Console.WriteLine("Do you decide to keep going, (1) or turn around? (2)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 2) {
int chance1 = chance.Next(1, 4);
turnedAround = true;
Console.WriteLine("You decide to turn around");
Console.WriteLine(" ");
if(progress <= 2) {
Console.WriteLine("You make it back without any issues.");
}else if (progress > 2 && progress < 5) {
if(chance1 <= 3) {
health -= 3;
Console.WriteLine("While going back, you trip on a skeleton.");
Console.WriteLine("Health: " + health);
Console.WriteLine(" ");
}
if(chance1 == 4) {
Console.WriteLine("You make it back without any issues.");
Console.WriteLine(" ");
}
}else if (progress >= 5 && progress < 8) {
if(chance1 <= 2) {
Console.WriteLine("You make it back without any issues.");
Console.WriteLine(" ");
}
if(chance1 > 2) {
health -= 5;
Console.WriteLine("While on your way back, you fall through a trap doo.");
Console.WriteLine("Health: " + health);
Console.WriteLine(" ");
}
}
Game();
}
if(one == 1) {
turnedAround = false;
Console.WriteLine("You decide to keep on going forward");
}
}
//Combat method
public static void SkeletonFight(int ohealth, int oattack, int start, string name) {
//Variables
string[] attacks = new string[3] {"Punch", "Kick", "BONNNESAWWW"};
Random rnd = new Random();
//int ohealth = rnd.Next(10, 15);
//int oattack = rnd.Next(5, 10);
int enemyAttack = rnd.Next(0, 3);
int reason = rnd.Next (1, 3);
int run = rnd.Next (1, 3);
Console.WriteLine(" ");
Console.WriteLine(name + " approaches you.");
if(start == 1) {
Console.WriteLine(name + " begins the battle with a " + attacks[enemyAttack]);
health -= oattack;
if(health <= 0) {
health = 1;
}
Console.WriteLine("Health: " + health);
}else {
Console.WriteLine("What do you do? Attack, Reason, Run. (1, 2, 3)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
ohealth -= attack;
if(ohealth <= 0) {
ohealth = 1;
}
Console.WriteLine(name + "'s health: " + ohealth);
}
if(one == 2) {
if(reason == 1) {
Console.WriteLine("You failed in reasoning with " + name);
}
if(reason > 1) {
ohealth -= ohealth;
Console.WriteLine("You successfully reasoned with " + name);
}
}
if(one == 3) {
ohealth -= ohealth;
Console.WriteLine("You successfully escaped " + name);
}
}
if(start == 2 && ohealth > 0) {
health -= oattack;
Console.WriteLine(name + " attacks with a " + attacks[enemyAttack]);
if (health <= 0) {
health = 1;
}
Console.WriteLine("Health: " + health);
}
//Beginning of battle loop
while(health > 0 && ohealth > 0) {
reason = rnd.Next (1, 3);
run = rnd.Next(1, 3);
Console.WriteLine("What do you do? Attack, Reason, Run. (1, 2, 3)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
ohealth -= attack;
Console.WriteLine(name + "'s health: " + ohealth);
if(ohealth <= 0) {
RandomItem();
break;
}
}
if(one == 2) {
if(reason == 1) {
Console.WriteLine("You failed in reasoning with " + name);
}
if(reason > 1) {
Console.WriteLine("You successfully reasoned with " + name);
break;
}
}
if(one == 3) {
if(run == 1) {
Console.WriteLine("You failed in escaping " + name);
}
if(run > 1) {
ohealth -= ohealth;
//add chance of slipping and taking damage
Console.WriteLine("You successfully escaped " + name);
break;
}
}
if(health > 0 && ohealth > 0) {
enemyAttack = rnd.Next(0, 3);
Console.WriteLine(name + " attacks you with a " + attacks[enemyAttack]);
health -= oattack;
Console.WriteLine("Health: " + health);
}
}
}
//Give Random Item
public static void RandomItem() {
Random reward = new Random();
int rewardChance = reward.Next(1, 5);
if (experience < 5) {
if(rewardChance > 0 && rewardChance < 3) {
Console.WriteLine("You find a Dull Sword");
Console.WriteLine("Do you take it? (1 - take it, 2 - leave it)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
dullSwords++;
attack = 7;
Console.WriteLine("A chip of metal falls off as you pick up the Dull Sword.");
Console.WriteLine("Attack: " + attack);
}
if(one == 2) {
Console.WriteLine("You decide to leave behind the Dull Sword.");
Console.WriteLine("Attack: " + attack);
}
}
if(rewardChance > 2 && rewardChance < 5) {
Console.WriteLine("You find a set of Abandoned Armor");
Console.WriteLine("Do you take it? (1 - take it, 2 - leave it)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
abandonedArmor++;
health = 15;
Console.WriteLine("You hear the metal creak as you put on the Abandoned Armor set");
Console.WriteLine("Health: " + health);
}
if(one == 2) {
Console.WriteLine("You decide to leave behind the Abandoned Armor");
Console.WriteLine("Health: " + health);
}
}
if(rewardChance >= 5) {
Console.WriteLine("You are unable to salvage anything.");
}
}
if(experience >= 5 && experience < 10) {
if(rewardChance > 0 && rewardChance < 3) {
Console.WriteLine("You find a Shiny Sword");
Console.WriteLine("Do you take it? (1 - take it, 2 - leave it)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
shinySwords++;
attack = 15;
Console.WriteLine("The Shiny Sword gleams in the light as you pick it up.");
Console.WriteLine("Attack: " + attack);
}
if(one == 2) {
Console.WriteLine("You decide to leave behind the Shiny Sword as it gleams in the light.");
Console.WriteLine("Attack: " + attack);
}
}
if(rewardChance > 2 && rewardChance <= 4) {
Console.WriteLine("You find a set of Shiny Armor");
Console.WriteLine("Do you take i? (1 - take it, 2 - leave it)");
int one = Convert.ToInt32(Console.ReadLine());
if(one == 1) {
shinyArmor++;
health = 30;
Console.WriteLine("The Shiny Armor set shines in the light as you put it on.");
Console.WriteLine("Health: " + health);
}
if(one == 2) {
Console.WriteLine("You decide to leave behind the Shiny Armor set as it gleams in the light.");
Console.WriteLine("Health: " + health);
}
}
if(rewardChance > 5) {
Console.WriteLine("You are unable to salvage anything.");
}
}
if(experience >= 10) {
health = 15;
attack = 15;
Console.WriteLine("TBA");
Console.WriteLine("For now, health and attack are equal to 15");
}
}
public static void GameOver() {
Console.WriteLine("Game Over!");
RestartGame();
}
public static void RestartGame() {
Console.WriteLine(" ");
Console.WriteLine("Restarting Game...");
Console.WriteLine(" ");
Game();
}
}
}
//The dungeon is in the abandoned castle
//Dull sword: 7 attack
//Abandoned Armor: 15 health
//Shiny Sword: 15 attack
//Shiny Armor: 30 Health
/*
At each main point add option to access wishing well to sacrifice exp for guaranteed items, wishing well can change to genie or sacrificial altar depending on level
add access to inventory at each mani point
*/
//make it so that enemies can reason with the player during battle if losing and they will have stupid arguments
//Interconnect the maps