The Challenge: -Develop a turn based combat system that implements the following choices that occur during the player's turns:
--Fight (Straight Damage)
--Item (Use an object from a choice of your design)
--Ability (Use an ability from a choice of your design)
--Run (Flee the battle)
>>1
Really, the deadline needs to be extended. I would consider doing this if the deadline was in say; one week. Quite frankly I have more important things I need to do and can't just drop all my plans to complete a challenge posed by an Anonymous user on an internet bulletin board.
>>7
What is the point of having two different modes? All it does is differentiate between people who have made plans for the next two days and people who have not. Don't you think the difficulty of the challenge should be determined by something more related to the subject?
out: while(true){
println("You've encountered a monster!!");
int health=randInt(10)+5;
println("It has "+health+" health!!!");
while(true){
println("WHAT THE FUCK WILL YOU DO NOW??");
println("1. --Fight");
println("2. --Item");
println("3. --Ability");
println("4. --Run");
int choice=getNextInt();
int dmg=0;
switch(choice){
case 1:
println("You swing your feeble nerd arms at monster!");
dmg=randInt(4);
if(dmg==0) println("LOLOL YOU MISSED!");
else println("You did "+dmg+" damage!!!!!!");
break;
case 2:
println("You use an item!!!");
println("Your item is a SICP snake!!!");
dmg=randInt(2)+1;
println("Snake does "+dmg+" damage!!!!!!);
break;
case 3:
println("You use ability!!!!");
println("Your ability is... HAX ANUS");
dmg= health%2==0?3:0;
if(dmg==0) println("Monster's anus could not be haxed!");
else println("Monster's anus is haxed for 3 damage!!");
break;
case 4:
println("You try to run!! *cough*pussy*cough");
if(randInt(1)==0){
println("You get away!!");
continue out;
}else{
println("There's no way out!!");
}
break;
}
health-=dmg;
if(health<=0){
println("You defeated the monster!!");
break;
}
println("Monster has "+health+" life remaining!!!");
println("Monster attacks you!!!");
println("The power of SICP protects you!");
}
}
for (i = 0; i < 10; ++i)
printf("\t\t\t%s\n", faces[hps[0] > 0 ? 1 : 0][3][i]);
printf(hps[0] > 0 ? "\n\t\t\tYou have defeated your opponent!\n\n"
: "\n\t\t\tYou have been defeated.\n\n");
return 0;
}
Name:
Anonymous2010-06-29 17:29
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>『Final Quest Saga XXI: Wahrheit und Lüge im außermoralischen Sinn』</title>
</head>
<body>
<noscript>This HTML program requires Javascript<i>!</i></noscript>
<h1>Encountered an enemy<i>!</i></h1>
<h2>Name: Sussman | Class: Wizard | Level: 255</h2>
<ul>
<li>
<a href="javascript:document.body.innerHTML = '
<h1>You attack Sussman with your Sword<i>!</i><br>
Sussman receives 0 point(s) of damage<i>!</i><br>
Sussman summons a computational process<i>!</i><br>
The computational process attacks you<i>!</i><br>
You receive 9999 point(s) of damage<i>!</i><br>
You die<i>!</i><br>
Game over.</h1>';">
Fight<i>!</i></a>
</li>
<li>
<a href="javascript:document.body.innerHTML = '
<h1>You start reading ``How to Design Programs\'\'<i>!</i><br>
It\'s not very effective...<br>
Sussman receives 0 point(s) of damage<i>!</i><br>
Sussman summons a computational process<i>!</i><br>
The computational process attacks you<i>!</i><br>
You receive 9999 point(s) of damage<i>!</i><br>
You die<i>!</i><br>
Game over.</h1>';">
Item<i>!</i></a>
</li>
<li>
<a href="javascript:document.body.innerHTML = '
<h1>You summon a snake<i>!</i><br>
A snake attacks Sussman<i>!</i><br>
Sussman receives 0 point(s) of damage<i>!</i><br>
Sussman summons a computational process<i>!</i><br>
The computational process attacks you<i>!</i><br>
You receive 9999 point(s) of damage<i>!</i><br>
You die<i>!</i><br>
Game over.</h1>';">
Ability<i>!</i></a>
</li>
<li>
<a href="javascript:document.body.innerHTML = '
<h1>You attempt to run away<i>!</i><br>
Your escape attempt is unsuccessful<i>!</i><br>
Sussman summons a computational process<i>!</i><br>
The computational process attacks you<i>!</i><br>
You receive 9999 point(s) of damage<i>!</i><br>
You die<i>!</i><br>
Game over.</h1>';">
Run<i>!</i></a>
</li>
</body>
</html>
Name:
Anonymous2010-06-29 18:10
>>14
very nice.
it crashes if you have too much hp though.
>>19 void print_menu(WINDOW *win, char **menu, int current, int number); void print_submenu(char **choices, int nchoices); void print_progsnake(); void read_sicp();
Why do you declare functions right before you define them? I think you missed a point somewhere along the line.
>>24 Why do you declare functions right before you define them? I think you missed a point somewhere along the line.
I think you haven't programmed in C, ever.
>>26
It's a bit ENTERPRISE, really, and it smells of cargo cult programming.
I declare all of my functions before I define them, but I also define all of them after main, for readability.
In the end I won't go with SDL because it's shit and obsolete and for some reason link.exe can't find an entry point and all the FAQs and tutorials are written for the IDEs.
>>31
I'll agree with you that it's shit, and especially lacking in comparison to Allegro, but it's not obsolete. It surely works on modern systems quite nicely and isn't too terribly difficult to use. If you need a FAQ or tutorial you're probably doing it wrong - just read the headers and documentation, and you'll be fine.
>>35 SDL_main.h defines a main macro, so that your program isn't the real main but SDL's main runs first and initializes stuff.
The real main should be in SDLmain.lib. I am linking my main.obj with SDL.lib and SDLmain.lib; I even tried different orders (since AFAIR order matters), but it doesn't work anyway.