using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void menu(character player01)
{
int Input = 0;
do
{
Console.WriteLine(player01.getname() + " Level : " + player01.getLV());
Console.WriteLine("HP : " + player01.getHP() + " / " + player01.getmaxHP());
Console.WriteLine("MP : " + player01.getMP() + " / " + player01.getmaxMP());
Console.WriteLine("Speed : " + player01.getspeed());
Input = 0;
Console.WriteLine("Select Command Here");
Console.WriteLine("1.Use Skill ");
Console.WriteLine("2.Level UP");
Console.WriteLine("3.Rest");
Console.WriteLine("4.refresh");
Input = Convert.ToInt32(Console.ReadLine());
Console.Clear();
int Input2 = 0;
if (Input == 1)
{
Console.WriteLine(player01.getname() + " Level : " + player01.getLV());
Console.WriteLine("HP : " + player01.getHP() + " / " + player01.getmaxHP());
Console.WriteLine("MP : " + player01.getMP() + " / " + player01.getmaxMP());
Console.WriteLine();
int num = 1;
Console.WriteLine("Select Skill");
Console.WriteLine(num + ". Burn Like a Midnight Oil");
num++;
if (player01.getLV() >= 10)
{
Console.WriteLine(num + ". Shiny Shiny Wax ");
num++;
}
Console.WriteLine(num + ". Return ");
Input2 = Convert.ToInt32(Console.ReadLine());
Console.Clear();
if (Input2 == 1)
player01.skill1();
else if (Input2 == 2 && player01.getLV() >= 10)
player01.skill3();
else
Console.WriteLine("Return");
Console.WriteLine();
}
if (Input == 2)
{
player01.lvup();
}
if (Input == 3)
{
player01.rest();
}
} while (Input != 0);
Console.ReadLine();
}
static void Main(string[] args)
{
string name1;
Console.WriteLine("Your character Name : ");
name1 = Console.ReadLine();
character player01 = new character(name1);
Console.Clear();
menu(player01);
}
}
}
CLASS : CHARACTER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
namespace ConsoleApplication1
{
class @character
{
private Timer timer1;
private Timer timer2;
private Timer timer3;
protected int hp = 0;
protected int mp = 0;
protected int speed = 275;
protected int lv = 1;
protected int max_hp = 152;
protected int max_mp = 76;
protected int sk1time = 0;
protected int skill2a = 0;
protected int skill4 = 0;
protected int fire1 = 10;
protected int tempspd = 0;
protected int bwax = 0;
protected int wax1 = 0;
protected int ash = 0;
protected string name = "No name";
DateTime now = DateTime.Now; // <-- Value is copied into local
int y1, z1, cd1;
int y2, z2, cd2;
public character()
{
initialize();
}
public character(string name) : this()
{
this.name = name;
}
public void initialize()
{
hp = max_hp;
mp = max_mp;
}
public int getHP()
{
return hp;
}
public int getMP()
{
return mp;
}
public int getmaxHP()
{
return max_hp;
}
public int getmaxMP()
{
return max_mp;
}
public string getname()
{
return name;
}
public int getLV()
{
return lv;
}
public int getspeed()
{
return speed;
}
public void skill1()
{
y1 = now.Second+skill4;
cd1 = (z1%60) - (y1%60);
Console.Clear();
now = DateTime.Now;
if (cd1 < 0)
{
if (mp > 130)
{
Console.WriteLine("Use ");
Console.WriteLine();
if (skill2a == 8)
speed += ((tempspd * 10) / 100);
if (skill2a == 16)
speed += ((tempspd * 20) / 100);
if (skill2a == 24)
speed += ((tempspd * 30) / 100);
z1 = now.Second + 14;
mp -= 130;
timer1 = new Timer();
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Elapsed += burn;
skill4 = 0;
}
else
{
Console.WriteLine("Not Enough MP");
Console.WriteLine();
}
}
else
{
Console.WriteLine("On Cooldown");
Console.WriteLine("Cooldown " + cd1);
Console.WriteLine();
}
}
public void skill2()
{
if(lv==5)
skill2a = 8;
if (lv == 10)
skill2a = 16;
if (lv == 15)
skill2a = 24;
}
public void skill3()
{
y2 = now.Second;
cd2 = (z2 % 60) - (y2 % 60);
Console.Clear();
now = DateTime.Now;
if (cd2 < 0)
{
if (mp > 200)
{
Console.WriteLine("Use ");
Console.WriteLine();
timer2 = new Timer();
timer2.Interval = 1000;
timer2.Enabled = true;
timer2.Elapsed += wax;
z2 = now.Second + 13-skill4;
mp -= 200;
skill4 = 0;
}
else
{
Console.WriteLine("Not Enough MP");
Console.WriteLine();
}
}
else
{
Console.WriteLine("On Cooldown");
Console.WriteLine("Cooldown " + cd2);
Console.WriteLine();
}
}
public void ashburn(Object source, ElapsedEventArgs e)
{
if (ash == 0)
skill4++;
ash++;
hp -= (25 - skill2a);
Console.WriteLine("Ashburn : HP- " + (25-skill2a));
if (ash == 8)
{
timer3.Stop();
ash = 0;
}
}
public void wax(Object source, ElapsedEventArgs e)
{
if(wax1==0)
{
speed -= (tempspd * 10) / 100;
if (bwax == 1)
{
timer3 = new Timer();
timer3.Interval = 1000;
timer3.Enabled = true;
timer3.Elapsed += ashburn;
}
}
wax1++;
Console.WriteLine("Waxing");
if(wax1==8)
{ timer2.Stop();
wax1 = 0;
}
}
public void lvup()
{
if(lv<25)
{
++lv;
max_hp += 100 + (lv * 10);
max_mp += 100 + (lv * 10);
speed += 20 ;
hp = max_hp;
mp = max_mp;
skill4 = 1;
tempspd = speed;
skill2();
}
else
{
Console.WriteLine("Already MAX LV");
}
}
public void rest()
{
hp = max_hp;
mp = max_mp;
}
private void burn(Object source, ElapsedEventArgs e)
{
if (sk1time == 0)
skill4++;
int fire2 = (fire1 - skill2a);
if (fire2 < 0)
fire2 = 0;
bwax = 1;
hp -= (fire2);
Console.WriteLine("HP -"+ (fire2));
sk1time++;
if (sk1time == 8)
{
timer1.Stop();
sk1time = 0;
if (skill2a == 8)
speed -= ((tempspd * 10) / 100);
if (skill2a == 16)
speed -= ((tempspd * 20) / 100);
if (skill2a == 24)
speed -= ((tempspd * 30) / 100);
bwax = 0;
}
}
}
}
No comments:
Post a Comment