更新内容

1.加入新boss,更高的难度。

2.支持组队模式勒!

3.针对大家反应的人物属性算法进行了修改,现在人物属性更多的取决于名字而不是随机数

4.用户界面优化

INF.代码拿走赞留下,不然你赢不了的

//by floatiy

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<windows.h>
using namespace std;
string name[];
int n;
struct I {
int heal;
int att;
int stand;
int buff;
int baoji;
int lengdong;
int flag;
string s;
}id[];
//显示部分
void welcome(){
printf(" SDFZ版名字竞技场\n");
printf("几人对战?\n");cin>>n;
printf("输入名字:\n");
for(int i = ;i <= n;i++){
cin>>name[i];
}
printf("按顺序输入战队(数字):");
for(int i = ;i <= n;i++){
cin>>id[i].flag;
}
printf("请稍后");
}
void print() {
printf(" SDFZ版名字竞技场\n");
// --------------------------------------------------------------------------------
printf(" by floatiy\n");
for(int i = ; i <= n; i++) {
cout <<" "<<id[i].s<<" HP:"<<id[i].heal<<" 攻击:"<<id[i].att<<" 防御:"<<id[i].stand;
cout<<" 暴击:"<<id[i].baoji<<" 冷冻:"<<id[i].lengdong<<endl;
}
for(int i = ; i <= n; i++) {
cout<<id[i].flag<<"队 "<<id[i].s<<" HP ";
int tmp=id[i].heal;
while(tmp > ) {
tmp-=;
cout<<"-";
}
cout<<endl;
}
printf("\n\n");
} //初始化
void init_Teacher(string x,int num) {
if(x== "静静") {
id[num].baoji = ;
id[num].heal += ;
id[num].lengdong = ;
id[num].att += ;
id[num].stand = ;
}
}
void init_MP5(string x,int num) {
if(x== "MP5娘") {
id[num].baoji += ;
id[num].heal += ;
id[num].lengdong = ;
id[num].stand = ;
}
}
void init_WWQ(string x,int num) {
if(x== "王文强") {
id[num].baoji = ;
id[num].heal += ;
id[num].lengdong = ;
id[num].att = ;
}
}
void BOSS() {
for(int i = ; i <= n; i++) {
init_MP5(name[i],i);
init_WWQ(name[i],i);
init_Teacher(name[i],i);
}
}
void join(I &x,string neko) {
x.s = neko;
x.att = x.s[] + (rand() % );
if(x.att < ) x.att *= -;
x.heal = x.s[] - x.s[] + rand() % ;
x.heal *= ;
x.stand = rand() % x.s[];
x.att += ;
Sleep();
x.baoji = rand() + x.s[];
x.baoji %= ;
Sleep();
x.lengdong = rand()-x.s[];
x.lengdong %= ;
x.lengdong += ;
x.baoji += ;
if(x.heal < ) x.heal *= -;
Sleep();
}
void init() {
for(int i = ;i <= n;i++){
join(id[i],name[i]);
}
BOSS();
system("cls");
} //技能
void hit(I &x,I &y);
bool teacher_BOSS(I &x,I &y,int opt){
if(x.s == "静静" && opt % == ) {
y.heal = -;
print();
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"静静发现"<<y.s<<"在玩游戏,来查房了!"<<endl;
Sleep();
cout<<y.s<<"出局了!"<<endl;
Sleep();
system("cls");
return ;
}
return ;
}
bool tongji_BOSS(I &x,I &y,int opt) {
if(x.s == "王文强" && opt % == ) {
x.baoji += ;
x.heal += ;
x.lengdong += ;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<"王文强开始了通技课,各项能力提高了!"<<endl;
Sleep();
cout<<"然而大家都睡着了。。。对方跳过一回合"<<endl;
Sleep();
system("cls");
hit(x,y);
return ;
}
return ;
}
bool MP5_BOSS(I &x,I &y,int opt) {
if(x.s == "MP5娘" && opt % == ) {
int ham = x.att;
if(ham <= ) ham = ;
x.stand += ;
y.heal -= ham*;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<x.s<<"启动了核心"<<endl;
cout<<x.s<<"造成了"<<ham*<<"点伤害!"<<endl;
Sleep();
cout<<y.s<<"还有"<<y.heal<<"点生命!"<<endl;
Sleep();
cout<<"MP5娘开启了力场,防御++"<<endl;
if(y.heal < ){
Sleep();
y.buff = ;
cout<<y.s<<"被击倒了"<<endl;
}
Sleep();
system("cls");
return ;
}
return ;
}
bool BAOJI(I &x,I &y,int opt) {
if(<opt && opt < x.baoji) {
int ham = x.att - rand() % ;
if(ham <= ) ham = ;
ham *= ;
y.heal -= ham;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<x.s<<"打出了致命一击!"<<endl;
cout<<x.s<<"造成了"<<ham<<"点伤害!"<<endl;
Sleep();
cout<<y.s<<"还有"<<y.heal<<"点生命!"<<endl;
if(y.heal < ){
Sleep();
y.buff = ;
cout<<y.s<<"被击倒了"<<endl;
}
Sleep();
system("cls");
return ;
}
return ;
}
bool FREEZE(I &x,I &y,int opt) {
if( <= opt && opt <= + x.lengdong) {
int ham = y.heal * 0.4;
y.heal -= ham;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<x.s<<"打开了对方的月考卷子!敌人凉凉了"<<endl;
cout<<x.s<<"造成了"<<ham<<"点伤害!(剩余生命的40%)"<<endl;
Sleep();
cout<<y.s<<"还有"<<y.heal<<"点生命!暂停一回合"<<endl;
if(y.heal < ){
Sleep();
y.buff = ;
cout<<y.s<<"被击倒了"<<endl;
}
Sleep();
system("cls");
hit(x,y);
return ;
}
return ;
}
bool AOYE(I &x,I &y,int opt) {
if(opt% ==) {
int ham = y.att * 0.4;
y.att -= ham;
y.heal += ;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<x.s<<"留了大量的作业!"<<endl;
cout<<y.s<<"熬夜爆肝,攻击力下降了"<<ham<<"!"<<endl;
cout<<y.s<<"学到了知识,体力恢复了50点!"<<endl;
Sleep();
system("cls");
return ;
}
return ;
}
bool GEDANG(I &x,I &y,int opt) {
if(y.stand > opt) {
y.heal += ;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<x.s<<"的攻击被格挡了!"<<endl;
cout<<y.s<<"去校园服务部吃东西"<<endl;
cout<<y.s<<"体力恢复了50点!"<<endl;
Sleep();
system("cls");
return ;
}
return ;
} //主体
void judge() {
int cnt = ;
int col = ;
for(int i = ; i <= n; i++) {
if(id[i].heal > && col == ) col = id[i].flag;
if(id[i].heal > && col != id[i].flag) return;
}
cout<<col<<"队胜利了!"<<endl;
cout<<"幸存:";
for(int i = ;i <= n;i++){
if(id[i].heal > ) cout<<id[i].s<<" ";
}
exit();
}
void hit(I &x,I &y) {
if(x.heal< || y.heal<) return;
int opt = rand() % + ;
if(tongji_BOSS(x,y,opt)) return;
else if(MP5_BOSS(x,y,opt)) return;
else if(teacher_BOSS(x,y,opt)) return;
else if(BAOJI(x,y,opt)) return;
else if(FREEZE(x,y,opt)) return;
else if(GEDANG(x,y,opt)) return;
else if(AOYE(x,y,opt)) return; int ham = x.att - rand() % ;
if(ham <= ) ham = ;
y.heal -= ham;
print();
cout<<" 当前回合:"<<x.s<<endl;
cout<<"--------------------------------------------------------------------------------"<<endl;
cout<<x.s<<"造成了"<<ham<<"点伤害!"<<endl;
Sleep();
cout<<y.s<<"还有"<<y.heal<<"点生命!"<<endl;
if(y.heal < ){
Sleep();
y.buff = ;
cout<<y.s<<"被击倒了"<<endl;
}
Sleep();
system("cls");
}
void begin() {
while() {
for(int i = ; i <= n; i++) {
for(int j = ; j <= n; j++) {
if(i == j) continue;
if(id[i].flag && id[j].flag && id[i].flag == id[j].flag) continue;
if(id[j].buff != && id[i].buff != ) hit(id[i],id[j]);
judge();
}
}
}
}
//id[2].heal
//主函数
int main() {
srand(time(NULL));
welcome();
init();
begin();
return ;
} //by SDFZ-Floatiy

名字竞技场 V3.0的更多相关文章

  1. 【cocos2d-js官方文档】二十五、Cocos2d-JS v3.0中的单例对象

    为何将单例模式移除 在Cocos2d-JS v3.0之前.全部API差点儿都是从Cocos2d-x中移植过来的,这是Cocos2d生态圈统一性的重要一环.可惜的是,这样的统一性也在非常大程度上限制了C ...

  2. 【Gamma】“北航社团帮”测试报告——小程序v3.0

    目录 测试计划.过程和结果 后端测试--单元测试与覆盖率 后端测试--压力测试 展示部分数据 平均数据 前端测试--小程序v3.0 新功能 各页面均可正常打开,跳转,回退 授权登录与权限检查 页面数据 ...

  3. FineUI(专业版)v3.0.0 发布,手机、平板和桌面全支持!

    FineUI(专业版)v3.0.0 已经正式发布,全面支持手机.平板和桌面!       自 2008 年 4 月发布第一个版本,我们持续更新了 126 个版本,拥有 16000 多位注册用户,130 ...

  4. css sprite,css雪碧图生成工具V3.0更新

    V3.0主要改进 1.增加了单独添加单张图片以及删除单张图片的功能 2.增加了生成.sprite文件用以保存雪碧图信息 3.增加了打开.sprite文件功能 什么是css sprite CSS spr ...

  5. [原创小工具]软件内存、CPU使用率监视,应用程序性能监测器 v3.0 绿色版

    应用程序性能监测器 V3.0 更新内容:    1.对一些代码进行了修改,软件本身的性能有所提升. 应用程序性能监测器 V2.0 更新内容:     1.鼠标移动到曲线区域,显示相关的曲线值      ...

  6. RDIFramework.NET ━ .NET快速信息化系统开发框架钜献 V3.0 版本强势发布

    继上个版本“RDIFramework.NET V2.9版本”的推出,受到了重多客户的认可与选择,V2.9版本是非常成功与稳定的版本,感谢大家的认可与长期以来的关注与支持.V3.0版本在V2.9版本的基 ...

  7. RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版新增消息管理

    在V3.0版本的Web(Mvc.WebForm)与WinForm中我们新增了“消息管理”模块.“消息管理”模块是对框架的所有消息进行管理.通过左侧的消息分类可以查看所选分类的所有消息列表.在主界面上我 ...

  8. RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版新增查询引擎管理

    欲了解V3.0版本的相关内容可查看下面的链接地址. RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版本发布 RDIFramework.NET — 基于.NET的快速信 ...

  9. RDIFramework.NET平台代码生成器V3.0版本全新发布-更新于20160518(提供下载)

    最新版本请转到:RDIFramework.NET平台代码生成器V3.1版本全新发布-更新于2016-10-08(提供下载) RDIFramework.NET代码生成器V3.0版本修改了针对3.0版本的 ...

随机推荐

  1. UVA 11748 - Rigging Elections(dfs)

    UVA 11748 - Rigging Elections option=com_onlinejudge&Itemid=8&page=show_problem&category ...

  2. ERROR (ConnectionError): HTTPConnectionPool (Caused by &lt;class &#39;socket.error&#39;&gt;: [Errno 111] Connecti

    感谢朋友支持本博客.欢迎共同探讨交流,因为能力和时间有限,错误之处在所难免.欢迎指正! 假设转载,请保留作者信息. 博客地址:http://blog.csdn.net/qq_21398167 原博文地 ...

  3. [Python] partial改变方法默认參数

    Python 标准库中 functools库中有非常多对方法非常有有操作的封装,partial Objects就是当中之中的一个,他是对方法參数默认值的改动. 以下就看下简单的应用測试. #!/usr ...

  4. ASP.NET_SessionId vs .ASPXAUTH why do we need both of them?

    https://stackoverflow.com/questions/23758704/asp-net-sessionid-vs-aspxauth-why-do-we-need-both-of-th ...

  5. iOS界面之间的跳转方式

    iOS界面之间的跳转方式基本有3种. .改变window的根视图 [self.window setRootViewController:VC]; .模态弹出 [self presentViewCont ...

  6. Ned的难题

    题目描述 Ned再也看不下去Robert的种种恶习,于是他决定出一道题来让他醒悟. Ned的题目是这样: 给出一个有n个数的序列,求其中所有连续子序列的数的最大公因数的乘积模1000000009的值. ...

  7. thinkphp调试手段

    使用ThinkPHP应该掌握的调试手段经常看到有人问到findAll的返回数据类型是什么之类的问题,以及出错了不知道什么原因的情况,其实还是没有熟悉ThinkPHP内置的调试手段和方法,抛开IDE本身 ...

  8. Elasticsearch如何做到亿级数据查询毫秒级返回?

    阅读本文大概需要 6 分钟. 如果面试的时候碰到这样一个面试题:ES 在数据量很大的情况下(数十亿级别)如何提高查询效率? 这个问题说白了,就是看你有没有实际用过 ES,因为啥?其实 ES 性能并没有 ...

  9. 24Pointgame-----24点游戏

    题意简单     第一行是  测试数据有几组   然后分别有  几行  第一个数字是  有几个数字  第二个是 需要配出来的数字 下面附上我的代码   ---   我感觉 我这个代码 和其他人的都不一 ...

  10. Maven+Docker,发布到Registry

    1.配置Pom.xml <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEnc ...