因为无聊所以想纯手写崩铁
2024-08-18 20:02:59
发布于:浙江
别看了我是蒟蒻根本不会写
8.15: 刚刚完成一点点,悲(希望能在集训营结束前写完吧)
8.17 角色等级支持到50,光锥到40,增加了个信用点商店(
提示:由于使用了auto遍历容器,请使用c++11或以上版本编译
#include<bits/stdc++.h>//纯自创
#include<windows.h>
using namespace std;
struct node{
int dengj,guangz,xuel,gongj,fangy,baol;
double baos;
};map<string,node>juese;
struct noder{
int xuel,gongj;
string cail;
};
map<string,noder>dir;
map<string,int>beibao;
string cl[]={"_2星材料-掠夺的本能","_2星材料-掠夺的本能","-2星材料-古代零件"};
string cl2[]={"_3星材料-篡改的野心","_3星材料-篡改的野心","-3星材料-古代转轴"};
string cl3[]={"_4星材料-践踏的意志","_4星材料-践踏的意志","-4星材料-古代引擎"};
string dw[]={"开拓者","丹恒","娜塔莎"};
string dr[]={"虚卒","自动机兵","兴风者","自动机兵-齿狼"};
int shengji[101];
void zd(string diren){
system("cls");
srand(time(NULL));
node a[3];
a[0]=juese["开拓者"];a[1]=juese["丹恒"];a[2]=juese["娜塔莎"];
noder d=dir[diren];
int winner=0,zhanjidian=3;
d.gongj=max(max(a[0].fangy+1,a[1].fangy+1),max(a[2].fangy+1,d.gongj));
for(int n=0;;n++){
cout<<"开拓者"<<(a[0].xuel<0?0:a[0].xuel)<< "/"<<juese["开拓者"].xuel<<endl;
cout<<"丹恒"<<(a[1].xuel<0?0:a[1].xuel)<<"/"<<juese["丹恒"].xuel<<endl;
cout<<"娜塔莎"<<(a[2].xuel<0?0:a[2].xuel)<<"/"<<juese["娜塔莎"].xuel<<endl;
cout<<diren<<"剩余血量"<<(d.xuel<0?0:d.xuel)<<endl;
cout<<"目前战技点:";
for(int i=1;i<=zhanjidian;i++)cout<<"◆";
for(int i=zhanjidian+1;i<=5;i++)cout<<"◇";
cout<<endl;
if(a[0].xuel<=0&&a[1].xuel<=0&&a[2].xuel<=0)break;
else if(d.xuel<=0){
winner=1;
break;
}
if(n%4==3){
int _=rand()%3;
while(a[_].xuel<=0&&(a[0].xuel>0||a[1].xuel>0||a[2].xuel>0))_=rand()%3;
cout<<diren<<"对"<<dw[_]<<"造成了"<<d.gongj-a[_].fangy<<"点伤害\n";
a[_].xuel-=d.gongj-a[_].fangy;
Sleep(1000);
_=rand()%3;
while(a[_].xuel<=0&&(a[0].xuel>0||a[1].xuel>0||a[2].xuel>0))_=rand()%3;
cout<<diren<<"对"<<dw[_]<<"造成了"<<d.gongj-a[_].fangy<<"点伤害\n";
a[_].xuel-=d.gongj-a[_].fangy;
Sleep(1000);
system("cls");
}else{
int _=n%4;
cout<<"轮到"<<dw[_]<<"行动\n";
cout<<"使用 1.普攻 2.战技\n";
if(a[_].xuel<=0){
system("cls");
continue;
}
while(1){
int bj=rand()%100-1;
char c;
cin>>c;
if(c=='2'&&zhanjidian==0)cout<<"战技点不够,请重新输入\n";
else if(c=='2'){
if(dw[_]=="娜塔莎"){
cout<<"对谁使用\n";
cout<<"1."<<dw[0]<<"\n2."<<dw[1]<<"\n3."<<dw[2]<<"\n4.返回\n";
char c;
cin>>c;
if(c=='1'){
cout<<dw[0]<<"回复了"<<int(juese["娜塔莎"].xuel*0.2)<<"点血量\n";
a[0].xuel+=int(juese["娜塔莎"].xuel*0.2);
a[0].xuel=min(a[0].xuel,juese[dw[0]].xuel);
zhanjidian--;
Sleep(1000);
system("cls");
break;
}else if(c=='2'){
cout<<dw[1]<<"回复了"<<int(juese["娜塔莎"].xuel*0.2)<<"点血量\n";
a[1].xuel+=int(juese["娜塔莎"].xuel*0.2);
a[1].xuel=min(a[1].xuel,juese[dw[1]].xuel);
zhanjidian--;
Sleep(1000);
system("cls");
break;
}else if(c=='3'){
cout<<dw[2]<<"回复了"<<int(juese["娜塔莎"].xuel*0.2)<<"点血量\n";
a[2].xuel+=int(juese["娜塔莎"].xuel*0.2);
a[2].xuel=min(a[2].xuel,juese[dw[2]].xuel);
zhanjidian--;
Sleep(1000);
system("cls");
break;
}else if(c=='4'){
cout<<"轮到"<<dw[_]<<"行动\n";
cout<<"使用 1.普攻 2.战技\n";
continue;
}else{
cout<<"不是哥们,重输\n";
cout<<"轮到"<<dw[_]<<"行动\n";
cout<<"使用 1.普攻 2.战技\n";
continue;
}
}if(bj<=juese[dw[_]].baol){
cout<<"暴击! "<<dw[_]<<"对"<<diren<<"造成了"<<int(juese[dw[_]].gongj*1.5*(1+juese[dw[_]].baos))<<"点伤害";
d.xuel-=int(juese[dw[_]].gongj*1.5*(1+juese[dw[_]].baos));
}else{
cout<<dw[_]<<"对"<<diren<<"造成了"<<int(juese[dw[_]].gongj*1.5)<<"点伤害";
d.xuel-=int(juese[dw[_]].gongj*1.5);
}
zhanjidian--;
Sleep(1000);
system("cls");
break;
}else if(c=='1'){
if(bj<=juese[dw[_]].baol){
cout<<"暴击! "<<dw[_]<<"对"<<diren<<"造成了"<<int(juese[dw[_]].gongj*(1+juese[dw[_]].baos))<<"点伤害";
d.xuel-=int(juese[dw[_]].gongj*(1+juese[dw[_]].baos));
}else{
cout<<dw[_]<<"对"<<diren<<"造成了"<<juese[dw[_]].gongj<<"点伤害";
d.xuel-=juese[dw[_]].gongj;
}
if(zhanjidian<5)zhanjidian++;
Sleep(1000);
system("cls");
break;
}
}
}
}if(winner){
int _=rand()%5+1,__=rand()%900+100;
cout<<"你成功战胜了 "<<diren<<"\n获得 "<<d.cail<<"*"<<_<<" 信用点*"<<__<<endl;
beibao[d.cail]+=_;
beibao["信用点"]+=__;
return;
}else{
cout<<"(),就多练";
return;
}
}
void xq(){
system("cls");
for(int i=0;i<3;i++){
cout<<dw[i]<<" Lv."<<juese[dw[i]].dengj<<" 光锥Lv."<<juese[dw[i]].guangz<<endl<<"血量:"<<juese[dw[i]].xuel<<" 攻击:"<<juese[dw[i]].gongj<<" 防御:"<<juese[dw[i]].fangy<<" 爆率:"<<juese[dw[i]].baol<<"%"<<" 爆伤:"<<juese[dw[i]].baos*100<<"% "<<"光锥等级Lv."<<juese[dw[i]].guangz<<"\n\n";
}if(!beibao.empty())cout<<"背包内现在有:\n";
for(auto it:beibao){
cout<<it.first<<":"<<it.second<<endl;
}
system("pause");
}
void js(){
system("cls");
cout<<"角色升级界面\n";
for(int i=0;i<3;i++){
cout<<i+1<<"."<<dw[i]<<" Lv."<<juese[dw[i]].dengj<<endl;
}cout<<"4.退出"<<endl;
char c;
cin>>c;
c=c-'0'-1;
if(c>=0&&c<3){
if(juese[dw[c]].dengj==1){
cout<<"是否确定升级(y/n)"<<dw[c]<<" 升级消耗"<<cl[c]<<"*3 你现在拥有"<<beibao[cl[c]]<<"个"<<"\n升级后等级"<<juese[dw[c]].dengj<<"->"<<20<<endl;
cout<<"升级后生命"<<juese[dw[c]].xuel<<"->"<<int(juese[dw[c]].xuel*2)<<endl;
cout<<"升级后攻击"<<juese[dw[c]].gongj<<"->"<<int(juese[dw[c]].gongj*2)<<endl;
cout<<"升级后防御"<<juese[dw[c]].fangy<<"->"<<int(juese[dw[c]].fangy*2)<<endl;
char _;
cin>>_;
if(_=='y'&&beibao[cl[c]]>=3){
beibao[cl[c]]-=3;
juese[dw[c]].dengj=20;
juese[dw[c]].xuel=int(juese[dw[c]].xuel*2);
juese[dw[c]].fangy=int(juese[dw[c]].fangy*2);
juese[dw[c]].gongj=int(juese[dw[c]].gongj*2);
}else if(_=='y'){
cout<<"没材料就别来了:(\n";
Sleep(1000);
}
}else if(juese[dw[c]].dengj==20){
cout<<"是否确定升级(y/n)"<<dw[c]<<" 升级消耗"<<cl[c]<<"*6 你现在拥有"<<beibao[cl[c]]<<"个"<<"\n升级后等级"<<juese[dw[c]].dengj<<"->"<<40<<endl;
cout<<"升级后生命"<<juese[dw[c]].xuel<<"->"<<int(juese[dw[c]].xuel*1.8)<<endl;
cout<<"升级后攻击"<<juese[dw[c]].gongj<<"->"<<int(juese[dw[c]].gongj*1.8)<<endl;
cout<<"升级后防御"<<juese[dw[c]].fangy<<"->"<<int(juese[dw[c]].fangy*1.8)<<endl;
char _;
cin>>_;
if(_=='y'&&beibao[cl[c]]>=6){
beibao[cl[c]]-=6;
juese[dw[c]].dengj=40;
juese[dw[c]].xuel=int(juese[dw[c]].xuel*1.8);
juese[dw[c]].fangy=int(juese[dw[c]].fangy*1.8);
juese[dw[c]].gongj=int(juese[dw[c]].gongj*1.8);
}else if(_=='y'){
cout<<"没材料就别来了:(\n";
Sleep(1000);
}
}else if(juese[dw[c]].dengj==40){
cout<<"是否确定升级(y/n)"<<dw[c]<<" 升级消耗"<<cl2[c]<<"*6 你现在拥有"<<beibao[cl2[c]]<<"个"<<"\n升级后等级"<<juese[dw[c]].dengj<<"->"<<50<<endl;
cout<<"升级后生命"<<juese[dw[c]].xuel<<"->"<<int(juese[dw[c]].xuel*1.7)<<endl;
cout<<"升级后攻击"<<juese[dw[c]].gongj<<"->"<<int(juese[dw[c]].gongj*1.7)<<endl;
cout<<"升级后防御"<<juese[dw[c]].fangy<<"->"<<int(juese[dw[c]].fangy*1.7)<<endl;
char _;
cin>>_;
if(_=='y'&&beibao[cl2[c]]>=3){
beibao[cl2[c]]-=3;
juese[dw[c]].dengj=50;
juese[dw[c]].xuel=int(juese[dw[c]].xuel*1.7);
juese[dw[c]].fangy=int(juese[dw[c]].fangy*1.7);
juese[dw[c]].gongj=int(juese[dw[c]].gongj*1.7);
}else if(_=='y'){
cout<<"没材料就别来了:(\n";
Sleep(1000);
}
}
}else if(c==3){
return;
}system("cls");
js();
}
void wq(){
system("cls");
cout<<"光锥升级界面\n";
for(int i=0;i<3;i++){
cout<<i+1<<"."<<dw[i]<<" Lv."<<juese[dw[i]].guangz<<endl;
}cout<<"4.退出"<<endl;
char c;
cin>>c;
c=c-'0'-1;
if(c>=0&&c<3){
if(juese[dw[c]].guangz==1){
cout<<"是否确定升级(y/n)"<<dw[c]<<" 升级消耗"<<cl[c]<<"*3 你现在拥有"<<beibao[cl[c]]<<"个"<<"\n升级后等级"<<juese[dw[c]].guangz<<"->"<<20<<endl;
cout<<"升级后爆率"<<juese[dw[c]].baol<<"% ->"<<"20%"<<endl;
cout<<"升级后爆伤"<<juese[dw[c]].baos<<"% ->"<<"80%"<<endl;
char _;
cin>>_;
if(_=='y'&&beibao[cl[c]]>=3){
beibao[cl[c]]-=3;
juese[dw[c]].guangz=20;
juese[dw[c]].baol=20;
juese[dw[c]].baos=0.8;
}else if(_=='y'){
cout<<"没材料就别来了:(\n";
Sleep(1000);
}
}else if(juese[dw[c]].guangz==20){
cout<<"是否确定升级(y/n)"<<dw[c]<<" 升级消耗"<<cl[c]<<"*6 你现在拥有"<<beibao[cl[c]]<<"个"<<"\n升级后等级"<<juese[dw[c]].guangz<<"->"<<20<<endl;
cout<<"升级后爆率"<<juese[dw[c]].baol<<"% ->"<<"35%"<<endl;
cout<<"升级后爆伤"<<juese[dw[c]].baos<<"% ->"<<"110%"<<endl;
char _;
cin>>_;
if(_=='y'&&beibao[cl[c]]>=6){
beibao[cl[c]]-=6;
juese[dw[c]].guangz=40;
juese[dw[c]].baol=35;
juese[dw[c]].baos=1.1;
}else if(_=='y'){
cout<<"没材料就别来了:(\n";
Sleep(1000);
}
}
}else if(c==3){
return;
}system("cls");
wq();
}
void zb(){
system("cls");
cout<<"1";
system("pause");
}
void xg(){
system("cls");
for(int i=0;i<4;i++){
cout<<i+1<<"."<<dr[i]<<endl;
}cout<<"5.退出\n";
char c;
cin>>c;
if(c>='1'&&c<='4')zd(dr[c-'0'-1]);
else if(c=='5')return;
else cout<<"不是哥们,重输\n";
system("pause");
xg();
}
void sc(){
system("cls");
for(int i=1;i<3;i++){
cout<<i<<"."<<cl[i]<<"(200信用点)\n";
}for(int i=1;i<3;i++){
cout<<i+2<<"."<<cl2[i]<<"(400信用点)\n";
}for(int i=1;i<3;i++){
cout<<i+4<<"."<<cl3[i]<<"(600信用点)\n";
}cout<<"7.退出\n";
char c;
cin>>c;
c-='0';
if(c==1){
if(beibao["信用点"]>=200){
beibao[cl[c]]++;
beibao["信用点"]-=200;
}else{
cout<<"不是哥们你也没钱啊\n";
Sleep(1000);
}
}if(c==2){
if(beibao["信用点"]>=200){
beibao[cl[c]]++;
beibao["信用点"]-=200;
}else{
cout<<"不是哥们你也没钱啊\n";
Sleep(1000);
}
}if(c==3){
if(beibao["信用点"]>=400){
beibao[cl2[c-2]]++;
beibao["信用点"]-=400;
}else{
cout<<"不是哥们你也没钱啊\n";
Sleep(1000);
}
}if(c==4){
if(beibao["信用点"]>=400){
beibao[cl2[c-2]]++;
beibao["信用点"]-=400;
}else{
cout<<"不是哥们你也没钱啊\n";
Sleep(1000);
}
}if(c==5){
if(beibao["信用点"]>=600){
beibao[cl3[c-4]]++;
beibao["信用点"]-=600;
}else{
cout<<"不是哥们你也没钱啊\n";
Sleep(1000);
}
}if(c==6){
if(beibao["信用点"]>=600){
beibao[cl3[c-4]]++;
beibao["信用点"]-=600;
}else{
cout<<"不是哥们你也没钱啊\n";
Sleep(1000);
}
}
sc();
}
void ck(){
while(1){
system("cls");
cout<<"1.详情\n2.角色升级(目前支持1~50,增加生命攻击防御)\n3.光锥升级(目前支持1~40,增加爆率爆伤)\n4.周本(还没做好)\n5.小怪(角色、光锥材料)\n6.商城(信用点买材料)\n";
char c;
cin>>c;
if(c=='1') xq();
else if(c=='2') js();
else if(c=='3') wq();
else if(c=='4') zb();
else if(c=='5') xg();
else if(c=='6') sc();
else cout<<"你输了个什么东西\n";
}
}
int main(){
srand(time(NULL));
juese["开拓者"].dengj=1;juese["丹恒"].dengj=1;juese["娜塔莎"].dengj=1;
juese["开拓者"].guangz=1;juese["丹恒"].guangz=1;juese["娜塔莎"].guangz=1;
juese["开拓者"].xuel=163,juese["开拓者"].gongj=74,juese["开拓者"].fangy=62,juese["开拓者"].baol=5,juese["开拓者"].baos=0.5;
juese["丹恒"].xuel=156,juese["丹恒"].gongj=104,juese["丹恒"].fangy=42,juese["丹恒"].baol=5,juese["丹恒"].baos=0.5;
juese["娜塔莎"].xuel=209,juese["娜塔莎"].gongj=54,juese["娜塔莎"].fangy=52,juese["娜塔莎"].baol=5,juese["娜塔莎"].baos=0.5;
dir["虚卒"].xuel=1002,dir["虚卒"].gongj=104,dir["虚卒"].cail="_2星材料-掠夺的本能";
dir["自动机兵"].xuel=952,dir["自动机兵"].gongj=124,dir["自动机兵"].cail="-2星材料-古代零件";
dir["兴风者"].xuel=5552,dir["兴风者"].gongj=374,dir["兴风者"].cail="_3星材料-篡改的野心";
dir["自动机兵-齿狼"].xuel=5352,dir["自动机兵-齿狼"].gongj=344,dir["自动机兵-齿狼"].cail="-3星材料-古代转轴";
beibao["_2星材料-掠夺的本能"]=0,beibao["_3星材料-篡改的野心"]=0,beibao["_4星材料-践踏的意志"]=0;
beibao["-2星材料-古代零件"]=0,beibao["-3星材料-古代转轴"]=0,beibao["-4星材料-古代引擎"]=0;
beibao["信用点"]=0;
ck();
}
全部评论 9
原来你上课在写这东西。
2024-08-15 来自 浙江
86
2024-08-16 来自 广东
06
2024-08-16 来自 江苏
06
2024-08-17 来自 广东
0
代码放到DEV里第149行报错了捏(哭)
2024-08-18 来自 陕西
2啊这
2024-08-18 来自 浙江
0看了 大概率是你的DEV版本过低,不支持auto遍历容器(
2024-08-18 来自 浙江
0嗷嗷我看看去(目移)
2024-08-18 来自 陕西
0
催更
2024-09-08 来自 浙江
0vocal
2024-08-28 来自 上海
0为什么进入商店后按7出不去
2024-08-27 来自 广东
0:(
2024-08-27 来自 广东
0少个if
2024-09-08 来自 浙江
0改完后的:
#include<bits/stdc++.h>//纯自创
#include<windows.h>
using namespace std;
struct node{
int dengj,guangz,xuel,gongj,fangy,baol;
double baos;
};map<string,node>juese;
struct noder{
int xuel,gongj;
string cail;
};
map<string,noder>dir;
map<string,int>beibao;
string cl[]={"2星材料-掠夺的本能","2星材料-掠夺的本能","-2星材料-古代零件"};
string cl2[]={"3星材料-篡改的野心","3星材料-篡改的野心","-3星材料-古代转轴"};
string cl3[]={"4星材料-践踏的意志","4星材料-践踏的意志","-4星材料-古代引擎"};
string dw[]={"开拓者","丹恒","娜塔莎"};
string dr[]={"虚卒","自动机兵","兴风者","自动机兵-齿狼"};
int shengji[101];
void zd(string diren){
system("cls");
srand(time(NULL));
node a[3];
a[0]=juese["开拓者"];a[1]=juese["丹恒"];a[2]=juese["娜塔莎"];
noder d=dir[diren];
int winner=0,zhanjidian=3;
d.gongj=max(max(a[0].fangy+1,a[1].fangy+1),max(a[2].fangy+1,d.gongj));
for(int n=0;;n++){
cout<<"开拓者"<<(a[0].xuel<0?0:a[0].xuel)<< "/"<<juese["开拓者"].xuel<<endl;
cout<<"丹恒"<<(a[1].xuel<0?0:a[1].xuel)<<"/"<<juese["丹恒"].xuel<<endl;
cout<<"娜塔莎"<<(a[2].xuel<0?0:a[2].xuel)<<"/"<<juese["娜塔莎"].xuel<<endl;
cout<<diren<<"剩余血量"<<(d.xuel<0?0:d.xuel)<<endl;
cout<<"目前战技点:";
for(int i=1;i<=zhanjidian;i++)cout<<"◆";
for(int i=zhanjidian+1;i<=5;i++)cout<<"◇";
cout<<endl;
if(a[0].xuel<=0&&a[1].xuel<=0&&a[2].xuel<=0)break;
else if(d.xuel<=0){
winner=1;
break;
}
if(n%4==3){
int =rand()%3;
while(a[].xuel<=0&&(a[0].xuel>0||a[1].xuel>0||a[2].xuel>0))=rand()%3;
cout<<diren<<"对"<<dw[]<<"造成了"<<d.gongj-a[].fangy<<"点伤害\n";
a[].xuel-=d.gongj-a[].fangy;
Sleep(1000);
=rand()%3;
while(a[].xuel<=0&&(a[0].xuel>0||a[1].xuel>0||a[2].xuel>0))=rand()%3;
cout<<diren<<"对"<<dw[]<<"造成了"<<d.gongj-a[].fangy<<"点伤害\n";
a[].xuel-=d.gongj-a[].fangy;
Sleep(1000);
system("cls");
}else{
int =n%4;
cout<<"轮到"<<dw[]<<"行动\n";
cout<<"使用 1.普攻 2.战技\n";
if(a[_].xuel<=0){
system("cls");
continue;
}
while(1){
int bj=rand()%100-1;
char c;
cin>>c;
if(c=='2'&&zhanjidian0)cout<<"战技点不够,请重新输入\n";
else if(c'2'2024-09-08 来自 浙江
0
#include<bits/stdc++.h> #include<Windows.h> using namespace std; void SetFont(int size){ CONSOLE_FONT_INFOEX cfi; cfi.cbSize = sizeof cfi; cfi.nFont=0; cfi.dwFontSize.X=size; cfi.dwFontSize.Y=size; cfi.FontFamily=FF_DONTCARE; cfi.FontWeight=FW_NORMAL; //wcscpy_s(cfi.FaceName,L"黑体"); SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE),FALSE,&cfi); // HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE); // CONSOLE_FONT_INFOEX consoleCurrentFont; // GetCurrentsoleFont(handle,FALSE,&consoleCurrentFont); // } int main(){ SetFont(100); system("color 70"); cout<<endl; cout<<"崩坏星穹铁道"<<endl<<endl<<endl<<endl; Sleep(1000); system("cls"); cout<<endl<<" 启动!"<<endl<<endl<<endl<<endl; Sleep(1000); SetFont(00); return 0; }
2024-08-15 来自 浙江
0三月七呢
2024-08-15 来自 浙江
0我记得我看到你加了这角色的
2024-08-15 来自 浙江
0因为我不会写盾
2024-08-15 来自 浙江
1让macw帮你写(doge)
2024-08-15 来自 浙江
0
支持
2024-08-15 来自 浙江
0没玩过崩铁
2024-08-15 来自 广东
0悲
2024-08-15 来自 浙江
0反正我也没写好,根本写不动(
2024-08-15 来自 浙江
2
有帮助,赞一个