更新内容

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. LeetCode 500. Keyboard Row (键盘行)

    Given a List of words, return the words that can be typed using letters of alphabet on only one row' ...

  2. research plan2222

    Thank you for calling. I've been looking forward to this call for a long time.Now, let me introduce ...

  3. 我的Android进阶之旅------>Android中MediaRecorder.stop()报错 java.lang.RuntimeException: stop failed.【转】

    本文转载自:http://blog.csdn.net/ouyang_peng/article/details/48048975 今天在调用MediaRecorder.stop(),报错了,java.l ...

  4. mysql创建用户,并授予权限

    mysql> GRANT ALL PRIVILEGES ON *.* TO jiqing@"%" IDENTIFIED BY '123456'; Query OK, 0 ro ...

  5. C# LIstbox 解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”的问题

    解决WinForm下ListBox控件“设置DataSource属性后无法修改项集合”的问题 分类: winform2008-05-24 02:33 2592人阅读 评论(11) 收藏 举报 winf ...

  6. J20170618-hm

    番兵(ばんぺい) 哨兵 後始末 善后  

  7. 【题解】动态逆序对 [CQOI2011] [P3157] [BZOJ3295] [P1393]

    [题解]动态逆序对 [CQOI2011] [P3157] [BZOJ3295] [P1393] 水一水QAQ 题目链接: \([P3157]\) \([BZOJ3295]\) [题目描述] 对于一个序 ...

  8. scrapy 简单操作

    1.创建一个简单的scrapy项目 scrapy startproject search(项目名称)按照提示cd searchscrapy genspider serachname search.co ...

  9. 【知识总结】卡特兰数 (Catalan Number) 公式的推导

    卡特兰数的英文维基讲得非常全面,强烈建议阅读! Catalan number - Wikipedia (本文中图片也来源于这个页面) 由于本人太菜,这里只选取其中两个公式进行总结. (似乎就是这两个比 ...

  10. ACM_题目这么难,来局愉快的昆特牌吧

    题目这么难,来局愉快的昆特牌吧 Time Limit: 2000/1000ms (Java/Others) Problem Description: 小Z打比赛,然而比赛太难了,他坐在电脑面前被题淹没 ...