//Dark Woods by Freakazoitt
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//опять линуксоиды
//#include <unistd.h>
//#define Sleep(ms) sleep((ms)/1000)
#define sleep
#define scan_s
#define random
int main(void)
{
// сразу дается нош на 1 атаку
char k="z";
int g=0,a=1,d=0,i=0,m=0;
int x=0,d1=0,d2=0,d3=0,d4=0,d5=0,kills=0,buy=0,m_loot=0,m_attack=0;
printf("Dark Woods by Freakazoitt\n\ncommand list: \n w - work in mines for gold \n i - look stats \n b - buy items \n m - kill monsters \n q - quit \n u - kill boss ");
d=d1+d2+d3+d4+d5;
scan_s("%c",&k);
switch(k)
{
case 'w': // работать в шахте
printf("started to work in mines");
sleep(60000);
{
printf("finished work in mines");
}
g=g+1; // заработал 1 gold
printf("earned 1 gold");
break;
case 'i': // инфа о персонаже
printf("class: mercenary\n");
printf("attack: ",a);
printf("\ndefence:",d);
printf("\nweapon: ","nife");
printf("\nmoney: ",g);
printf("\nmonsters killed",kills);
break;
case 'b': // купить
printf("\nshop items list\n\n weapons: \n d - dagger +2 attack, cost 3 gold \n a - axe +4 attack, cost 5 gold \n s - sword +6 attack, cost 8 gold \n p - enchanted pike +10 attack, cost 10 gold \n\n");
printf("armor: \n i - leather jacket +1 defence, cost 1 gold \n b - leather gloves +1 defencr, cost 1 gold \n l - studded boots +1 defence, cost 2 gold \n c - chainmail +3 defence, replasing leather jacket, cost 3 gold \n h - steel helmet +2 defence, cost 4 gold \n g - iron face mask +1 defence, 2 gold");
scan_s("%c",&buy); // покупка
switch(buy)
{
case 'd':
printf("You bought dagger +2 attack for 3 gold coins");
a=2; // атака
g=g-3; // минус зотото
break;
case 'a':
printf("You bought axe +4 attack for 5 gold coins"); // axe на 4 атака
a=4;
g=g-5; // 5 gold
break;
case 's': //
printf("You bought sword +6 attack for 8 gold coins");
a=6;
g=g-8; // 8 gold
break;
case 'p': //
printf("You bought enchanted pike +8 attack for 15 gold coins");
a=10;
g=g-15;
break;
case 'i': // leather jacket +1 defence
printf("You bought leather jacket +1 defence for 1 gold coin");
d1=1; g=g-1;
break;
case 'b': // perchatki +1 defence
printf("You bought leather gloves +1 defence for 1 gold coin");
d2=1; g=g-1;
break;
case 'l': // sapogi s plastinami +1 defence
printf("You bought studded leather boots +1 defence for 2 gold coins");
d3=1; g=g-2;
break;
case 'c': // chainmale 7gold +3 defence, zamenyaet leather jacket
printf("You bought chainmail +3 defence for 3 gold coins. Replaced leather jacket.");
d1=3; g=g-3;
break;
case 'h': // stalnoj shlem 7g
printf("You bought steel helmet +2 defence for 4 gold coins");
d5=2; g=g-4;
break;
case 'g': // защитные очки
printf("You bought iron face mask +1 defence for 2 gold coins");
d4=1; g=g-2;
break;
}
case 'm': // hunting on monster
{
int p;
printf("You are going into the dark woods. Choose monster to attack: \n r -rat \n w -wolf \n g - goblin \n o -undead \n t - giant poison toad");
scan_s("%c",&p);
switch(p)
{
case 'r': // rat
m_attack=1;
m_loot=1;
break;
case 'w': // wolf
m_attack=2;
m_loot=2;
break;
case 'g': // goblin
m_attack=4;
m_loot=3;
break;
case 'o': // undead
m_attack=8;
m_loot=5;
d4=2;
printf("You picked up undead skin");
break;
case 't': // zhaba
m_attack=10;
m_loot=6;
a=12;
printf("You picked up poison");
break;
x=(a+d);
if (x>0)
{
printf("You won \n gained ",m_loot,"gold");
g=g+m_loot;
k=k+1;
}
else
{
printf("You loose");
sleep(60000);
printf("Find better equipment and try again");
}
break;
}
break;
}
case 'u': // final quest
{
printf("Fihting against final boss - evil mage Boratur");
x=(a+d)*(random(1,5)-15*random(1,5));
if (x>0) { printf("You won! \n Game over: You won"); }
else { printf("You loose!");
sleep(60000);
return 0;
break;
}
return 0;
}
}
}