Doragon Kuesuto 1.6
/*
* <<D Q>>
*
* Author xkfx<wyzxk_fx@163.com>
*
* 游戏规则:利用适当的决策,在13回合内击杀恶龙取得胜利。
*
* 2016 - *
*/ #include<stdio.h>
#include<stdlib.h>
#include<time.h> void show_State(int round, int dragon_HP, int warrior_HP, int warrior_MP)
{
//输出起始分割栏
printf("- ROUND-%2d ---------------\n", round);
//输出dragon状态
printf(" <Deathwing> \n");
printf(" HP = %-4d , MP = ???? \n", dragon_HP);
//输出worrior状态
printf(" <Worrior> \n");
printf(" HP = %-4d , MP = %-4d \n", warrior_HP, warrior_MP);
//输出结束分割栏
printf("--------------------------------\n");
} void show_Skill()
{
printf("Here is your actions:\n");
//show hero skill
printf("1 Holy Light -140mp\n");
//show basic skill
printf("2 Normal Attack -20mp\n");
printf("3 Force of Nature -0mp\n");
//show final skill
printf("4 Sword of Judgement \n");
printf(">Warrior, please choose your action:");
} int main()
{
/*创建游戏所需的数据*/
int dragon_HP = ;
int warrior_HP = ;
int warrior_MP = ;
int score = ;
int skill_tmp = ;
int skill_tmp_2 = ;
int round;
int choice; srand((int)time());
system("cls");
for(round = ; round <= ; round ++){
srand(rand());
/*显示人物状态*/
show_State(round, dragon_HP, warrior_HP, warrior_MP);
/**/
if(round == )
printf("Deathwing: ALL WILL BURN...\n");
/*显示决策信息*/
show_Skill();
/*选择决策*/
scanf("%d", &choice);
system("cls");
/*执行决策&优先判定敌方*/
/*warrior*/
switch(choice){ case :
if(warrior_MP < )
break;
skill_tmp = - warrior_HP; warrior_HP = ;
warrior_MP = warrior_MP - ; score = score - skill_tmp; printf("Warrior: I am theone horseman of the Apocalypse!\n");
printf("You has restored %d HP.\n", skill_tmp);
break; case :
if(warrior_MP < )
break;
skill_tmp = skill_tmp_2 + + rand()%; dragon_HP = dragon_HP - skill_tmp;
warrior_MP = warrior_MP - ; skill_tmp_2 = ; score = score + skill_tmp; printf("Your cause %d damage !\n", skill_tmp);
break; case :
skill_tmp_2 = skill_tmp_2 + + rand()%;
printf("Your Damage Pool: %d\n", skill_tmp_2);
break; case :
skill_tmp = warrior_HP + + rand()%; dragon_HP = dragon_HP - skill_tmp;
warrior_HP = ; score = score + skill_tmp; printf("warrior: Embrace the end!\n");
printf("Your cause %d damage !\n", skill_tmp);
break; default:
break;
}
if(dragon_HP <= ){
printf("Deathwing: It is impossible !?...\n");
printf("warrior: Embrace the end! So be it!\n");
printf(".....\n");
printf("..YOU WIN!\n");
break;
}
/*dragon*/
skill_tmp = + rand()%;
warrior_HP = warrior_HP - skill_tmp;
printf("You got a few injuries - %d HP\n", skill_tmp);
if(warrior_HP <= ){
printf("...\n");
printf("......\n");
printf("..GAME OVER.\n");
break;
}
/*显示决策结果*/
}
/*显示游戏结果*/
if(dragon_HP <= ){
score = score + ( - round) * ;
}else{
score = score + round * ;
}
if(warrior_HP >= && dragon_HP >= )
printf("The game ended in a draw.\n");
printf("\nYour final score: %d\n", score);
system("pause");
return ;
}
Doragon Kuesuto 1.6的更多相关文章
- Doragon Kuesuto 1.0
#include<stdio.h> #include<stdlib.h> #include<time.h> int main() { ; ; ; int actio ...
- Doragon Kuesuto 1.15
#include<stdio.h> #include<stdlib.h> #include<time.h> int main() { ; ; ; int actio ...
- FIRST GAME.
-Doragon Kuesuto(.c) Doragon Kuesuto 1.0 Doragon Kuesuto 1.15 Doragon Kuesuto 1.6
随机推荐
- rsync的断点续传设置。
关于rsync的断点续传 关于rsync的断点续传 经常copy大文件,由于服务器.路由等网络的不确定性,老是出现 remote server not responding.于是查了下资料,发现rsy ...
- HDU 4709:Herding
Herding Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Su ...
- The 3n + 1 problem 分类: POJ 2015-06-12 17:50 11人阅读 评论(0) 收藏
The 3n + 1 problem Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53927 Accepted: 17 ...
- script中的if
function isOK() { var isTrue = false; var value = $("#myTest1").val(); // if (value && ...
- Python学习笔记-Day3-python关键字
1.and 逻辑与 2.assert 判断某个条件是否为真,如果为假,抛出错误 3.break跳出for,while循环 4.class 类定义 5.continue 跳出本次循环,执行下次循环 6. ...
- web前端职业规划
关于一个WEB前端的职业规划,其实是有各种的答案,没有哪种答案是完全正确的,全凭自己的选择,只要是自己选定了, 坚持去认真走,就好.在这里,我只是简要说一下自己对于这块儿内容的理解.有一个观点想要分享 ...
- SqlSever基础 dateadd day 增加五天
镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...
- Outlook 无法更新全球通讯簿,错误 0×80190194
当 Outlook 客户端尝试更新全球通讯簿,实际上是下载脱机通讯簿(Officeline Address Book,简称 OAB)时,可能会收到 0×80190194 的错误.错误代码 0×8019 ...
- null&this&super&向上转型
向上转型:父类声明子类实例化对象 例如A是父类 B是子类 1 : 实际上是父类的对象但将会丢失子类没有的父类方法 ,如果调用方法 将会调用子类重写的父类方法 2:上转型对象不能调用子类新增 ...
- (1)编写一个接口:InterfaceA,只含有一个方法int method(int n); (2)编写一个类:ClassA来实现接口InterfaceA,实现int method(int n)接口方 法时,要求计算1到n的和; (3)编写另一个类:ClassB来实现接口InterfaceA,实现int method(int n)接口 方法时,要求计算n的阶乘(n!); (4)编写测试类E测试
package a; public interface InterfaceA { int method(int n); } package a; public class ClassA impleme ...