更新内容

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. LinearLayout (线性布局)的分析

    android提供了5中布局,线性布局,相对布局,帧布局.表格布局和绝对布局 线性和相对布局用的是最多的 以下要说的是线性布局 提到线性布局 一定要记住.它里面的全部组件一定不会重叠的, 切不会换行. ...

  2. ubuntu安装ruby,安装sass,安装compass

    安装ruby apt-get install ruby. 默认会安装1.9的. 不是自己想要的. 可以进行下面的处理. # sudo apt-get install python-software-p ...

  3. unsigned 赋值负数输出情况 & printf输出格式

    %d 有符号10进制整数 %ld 长整型 %hd短整型 %i 有符号10进制整数 %o 无符号8进制整数 %u 无符号10进制整数 %x 无符号的16进制数字,并以小写abcdef表示 %X 无符号的 ...

  4. [App Store Connect帮助]三、管理 App 和版本(2.3)输入 App 信息:提供自定许可协议

    Apple 提供了适用于所有地区的标准 EULA(最终用户许可协议).如果您不提供自定许可协议,则您的 App 会应用标准 Apple EULA,且该许可协议链接不会显示在您的 App Store 产 ...

  5. quill支持json吗

    RT quill目前的驱动(2.4.2版本)不支持json,等待作者更新版本吧

  6. SpringBoot集成Mybatis配置动态数据源

    很多人在项目里边都会用到多个数据源,下面记录一次SpringBoot集成Mybatis配置多数据源的过程. pom.xml <?xml version="1.0" encod ...

  7. strupr函数

    2019-06-03 15:13:39 strupr()函数! strupr,函数的一种,将字符串s转换为大写形式. 说明:只转换s中出现的小写字母,不改变其它字符.返回指向s的指针. 兼容性说明:s ...

  8. 微信小程序的wxml文件和wxss文件在webstrom的支持

    webstrom默认不支持wxml文件和wxss文件,所以要进入设置里面手动添加支持. 对wxml文件的支持: 文件 -> 设置 -> 编辑器 -> 文件类型, 然后选择XML文件, ...

  9. ACM_ZHANGZHANG喜欢手表

    ZHANGZHANG喜欢手表 Time Limit: 2000/1000ms (Java/Others) Problem Description: ZHANGZHANG刚过生日,收到了好朋友NENGN ...

  10. 题解报告:hdu 1285 确定比赛名次

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1285 Problem Description 有N个比赛队(1<=N<=500),编号依次 ...