名字竞技场 V3.0
更新内容
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的更多相关文章
- 【cocos2d-js官方文档】二十五、Cocos2d-JS v3.0中的单例对象
为何将单例模式移除 在Cocos2d-JS v3.0之前.全部API差点儿都是从Cocos2d-x中移植过来的,这是Cocos2d生态圈统一性的重要一环.可惜的是,这样的统一性也在非常大程度上限制了C ...
- 【Gamma】“北航社团帮”测试报告——小程序v3.0
目录 测试计划.过程和结果 后端测试--单元测试与覆盖率 后端测试--压力测试 展示部分数据 平均数据 前端测试--小程序v3.0 新功能 各页面均可正常打开,跳转,回退 授权登录与权限检查 页面数据 ...
- FineUI(专业版)v3.0.0 发布,手机、平板和桌面全支持!
FineUI(专业版)v3.0.0 已经正式发布,全面支持手机.平板和桌面! 自 2008 年 4 月发布第一个版本,我们持续更新了 126 个版本,拥有 16000 多位注册用户,130 ...
- css sprite,css雪碧图生成工具V3.0更新
V3.0主要改进 1.增加了单独添加单张图片以及删除单张图片的功能 2.增加了生成.sprite文件用以保存雪碧图信息 3.增加了打开.sprite文件功能 什么是css sprite CSS spr ...
- [原创小工具]软件内存、CPU使用率监视,应用程序性能监测器 v3.0 绿色版
应用程序性能监测器 V3.0 更新内容: 1.对一些代码进行了修改,软件本身的性能有所提升. 应用程序性能监测器 V2.0 更新内容: 1.鼠标移动到曲线区域,显示相关的曲线值 ...
- RDIFramework.NET ━ .NET快速信息化系统开发框架钜献 V3.0 版本强势发布
继上个版本“RDIFramework.NET V2.9版本”的推出,受到了重多客户的认可与选择,V2.9版本是非常成功与稳定的版本,感谢大家的认可与长期以来的关注与支持.V3.0版本在V2.9版本的基 ...
- RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版新增消息管理
在V3.0版本的Web(Mvc.WebForm)与WinForm中我们新增了“消息管理”模块.“消息管理”模块是对框架的所有消息进行管理.通过左侧的消息分类可以查看所选分类的所有消息列表.在主界面上我 ...
- RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版新增查询引擎管理
欲了解V3.0版本的相关内容可查看下面的链接地址. RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版本发布 RDIFramework.NET — 基于.NET的快速信 ...
- RDIFramework.NET平台代码生成器V3.0版本全新发布-更新于20160518(提供下载)
最新版本请转到:RDIFramework.NET平台代码生成器V3.1版本全新发布-更新于2016-10-08(提供下载) RDIFramework.NET代码生成器V3.0版本修改了针对3.0版本的 ...
随机推荐
- TensorFlow 官方文档中文版
http://wiki.jikexueyuan.com/list/deep-learning/ TensorFlow 官方文档中文版 你正在阅读的项目可能会比 Android 系统更加深远地影响着世界 ...
- 第二课 MongoDB 数据模型
1.课程大纲 本课程主要介绍MongoDB数据模型相关知识.包含文档.集合与数据库的基本概念.用法及命名规则:MongoDB主要的数据类型介绍以及MongoDB Shell的简单介绍与使用. 文档 ( ...
- Elasticsearch安装中文分词插件ik
Elasticsearch默认提供的分词器,会把每一个汉字分开,而不是我们想要的依据关键词来分词.比如: curl -XPOST "http://localhost:9200/userinf ...
- Codesys——PLCopen基本运动控制功能块的使用方法总结
MC_Halt 在MC_MoveVelocity模式下,用MC_Halt停止其轴,当前轴的状态由 ContinuousMotion(当前转速)--->DiscreteMotion(速度不为0)- ...
- SignalR -- server push 利器
实际上关于SignalR的介绍网上有很多,这里不做过多赘述,我们来看下官方网站的描述. [摘录自http://signalr.net/] What is ASP.NET SignalR ASP.NET ...
- [python基础] celery beat/task/flower解析
一.Celery 介绍 Celery 是一个强大的分布式任务队列,它可以让任务的执行完全脱离主程序,甚至可以被分配到其他主机上运行.我们通常使用它来实现异步任务( async task )和定时任务( ...
- MVVMLight消息通知实现机制详解(二)
接上文 MVVMLight消息通知实现机制详解(一) 该工具的内部主要逻辑是以字典模式进行储存持有订阅对象设置的传入参数Type类型.Key值.Action.Target(订阅对象本身) 在发生订阅事 ...
- 【洛谷3224/BZOJ2733】[HNOI2012]永无乡 (Splay启发式合并)
题目: 洛谷3224 分析: 这题一看\(n\leq100000\)的范围就知道可以暴力地用\(O(nlogn)\)数据结构乱搞啊-- 每个联通块建一棵Splay树,查询就是Splay查询第k大的模板 ...
- hdu2027
http://acm.hdu.edu.cn/showproblem.php?pid=2027 #include<iostream> #include<stdio.h> #inc ...
- 6.11---swagger文件上传的写法【照着写就行了,主要是需要声明contentType未mutilpart---如果不设置这个,就无法识别文件的】
MultipartFile 是直接接收前台传过来的文件,File是抽象出来的文件对象,用来表示文件,一般操作都是操作的File,所以需要将MultipartFile转为File controller写 ...