新·唐太宗的瓦罗兰特
2025-10-20 22:10:39
发布于:浙江
界面更直观
多余操作减少
修复了许多bug
可存档
#include<bits/stdc++.h>
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
using namespace std;
int money=500,jl=500,hp=200,game=0,safe=500,cf=0,rq=0,dpcs=0,xl=0,gamep=0,zbxl=0,zbmp=0;
void clear(){
system("cls");
}
void pause(){
system("pause");
}
void title(string name){
name="title "+name;
system(name.c_str());
}
void wait(int ms, string reason="\0"){
system("cls");
for(int i=1;i<=20;i++){
if(reason=="\0"){
cout<<"正在执行操作中..."<<endl;
}
else{
cout<<"正在执行\""<<reason<<"\"操作中..."<<endl;
}
string ts="[";
for(int j=1;j<=i;j++){
ts+="=";
}
for(int j=i+1;j<=20;j++){
ts+="-";
}
ts+="]";
cout<<ts<<endl;
cout<<"time: "<<(ms/20)*i<<"ms / "<<ms<<"ms"<<endl;
Sleep(ms/20);
system("cls");
}
if(reason=="\0"){
cout<<"操作执行完成!"<<endl;
}
else{
cout<<"\""<<reason<<"\"执行完成"<<endl;
}
}
int random(int value=100){return rand()%value;}
int main(){
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
srand(time(NULL));
title("模拟出生 作者:唐太宗,隋雷");
cout<<endl;
cout<<" 我是唐太宗,喜欢别墅里面打瓦"<<endl;
cout<<endl;
cout<<" 精彩游戏加载中";
Sleep(1000);
cout<<".";
Sleep(1000);
cout<<".";
Sleep(1000);
cout<<".";
Sleep(1000);
clear();
system("color 02");
bool havesc=0,havegc=0,haveqc=0;
std::ifstream file("TangTaizongsValorant.txt");
if(file.is_open()){
file>>money;
file>>jl;
file>>hp;
file>>game;
file>>safe;
file>>cf;
file>>rq;
file.close();
}
else{
std::ofstream file("TangTaizongsValorant.txt");
}
while(1){
if(safe<=0||random(safe)==0){
if(safe>=500){
cout<<"你被人诬陷入狱..."<<endl;
money-=200;
hp-=20;
jl-=20;
wait(5000);
cout<<"你出狱了..."<<endl;
}
else if(safe<=0){
cout<<"你被枪决..."<<endl;
pause();
break;
}
else{
cout<<"你入狱了..."<<endl;
money-=100;
jl-=50;
hp-=50;
wait((500-safe)*1000);
cout<<"你出狱了..."<<endl;
}
}
if(hp<=0||dpcs>=5){
cout<<"你死了..."<<endl;
pause();
break;
}
if(money<=0){
cout<<"你穷死了..."<<endl;
pause();
break;
}
if(jl<=0){
cout<<"你累倒了..."<<endl;
wait(20000+abs(jl)*1000);
cout<<"你醒了..\n";
jl=20;
}
if(dpcs>=3){
cout<<"你吸High了!"<<endl;
system("color 1F");
}
cout<<"您现在有:"<<endl;
cout<<endl;
cout<<" "<<money<<" 元钱"<<endl;
cout<<" "<<jl<<" 精力"<<endl;
cout<<" "<<hp<<" 生命值"<<endl;
cout<<" "<<game<<" 游戏天赋"<<endl;
cout<<" "<<safe<<" 安全值"<<endl;
cout<<" "<<cf<<" 打瓦次数"<<endl;
cout<<" "<<rq<<" 人气"<<endl;
cout<<endl;
Sleep(1000);
cout<<"所有操作:"<<endl;
cout<<endl;
if(!(safe<=100)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 00-虾仁灭口"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 01-搬砖"<<endl;
cout<<" 02-吃饭"<<endl;
cout<<" 03-睡觉"<<endl;
cout<<" 04-打游戏"<<endl;
cout<<" 05-当小偷"<<endl;
if(!(money>=2000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 06-投资"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(game>=25)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 07-直播游戏"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(safe<=400)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 08-抢劫"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(safe<=250)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 09-绑架"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(safe<=50||money<=50||dpcs>0||money>=5000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 10-吸“快乐粉”"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 11-打工"<<endl;
if(!(money>=1000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 12-创业"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(dpcs>0)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 13-卖“快乐粉”"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 14-买大餐"<<endl;
cout<<" 15-网络读博"<<endl;
cout<<" 16-去商店"<<endl;
if(!(dpcs>0)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 17-戒一天“快乐粉”"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 18-打瓦"<<endl;
if(!(cf>0)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 19-抄题解"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 20-喝提神药"<<endl;
cout<<" 21-当兵打仗"<<endl;
cout<<" 22-拍视频"<<endl;
if(!(rq>=1000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 23-主播PK"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 24-买股票"<<endl;
cout<<" 91-退出"<<endl;
cout<<" 92-存档"<<endl;
cout<<endl;
int op;
cin>>op;
if(safe<=100&&op==0){
clear();
wait(2000,"虾仁灭口");
jl-=20;
hp-=50;
if(random(10)<=6){
safe+=100;
}
else safe-=70;
}
else if(op==1){
clear();
wait(2000,"搬砖");
money+=50;
jl-=50;
hp-=20;
}
else if(op==2){
clear();
wait(1000,"吃饭");
money-=30;
hp+=30;
}
else if(op==3){
clear();
wait(10000,"睡觉");
jl+=100;
safe+=50;
}
else if(op==4){
clear();
wait(5000-xl,"打游戏");
jl-=50;
game+=1+gamep;
if(random(10)==0){
game+=9;
}
}
else if(op==5){
clear();
wait(5000,"偷窃");
jl-=50;
if(random(10)){
money+=100;
hp-=20;
safe-=50;
}
else{
cout<<"无功而返..."<<endl;
safe-=10;
}
}
else if(money>=2000&&op==6){
clear();
int tm;
cout<<"请输入你投入的金额:";
cin>>tm;
if(money>=tm){
money-=tm;
wait(2000,"投资");
if(random(2)){
cout<<"你赚了"<<endl;
money+=tm*(100+random())/100;
}
else{
cout<<"你亏了"<<endl;
}
safe+=50;
}
else{
cout<<"你钱不够!"<<endl;
}
}
else if(game>=25&&op==7){
clear();
wait(7000-zbxl,"直播游戏");
jl-=100;
hp-=20;
money+=random(1000)+20+game+zbmp;
game+=20;
}
else if(safe<=400&&op==8){
clear();
wait(5000,"抢劫");
jl-=100;
hp-=70;
money+=300;
safe-=100;
}
else if(safe<=250&&op==9){
clear();
wait(5000,"绑架");
jl-=120;
hp-=120;
money+=500;
safe-=70;
}
else if((safe<=50||money<=50||dpcs>0||money>=5000)&&op==10){
clear();
wait(2000,"吸食中");
system("color 4");
cout<<"你感觉飘飘欲仙..."<<endl;
dpcs++;
hp-=70;
jl+=200;
money-=20;
}
else if(op==11){
clear();
wait(5000-xl,"打工");
money+=200+cf;
jl-=100;
hp-=50;
}
else if(money>=1000&&op==12){
clear();
int tm;
cout<<"请输入你投入的金额:"<<endl;
cin>>tm;
if(money>=tm){
money-=tm;
wait(2000,"创业");
if(random(2)){
cout<<"你大赚一笔..."<<endl;
money+=tm*(1+random(4));
}
else{
cout<<"你的公司破产了..."<<endl;
money-=tm*2;
}
}
else{
cout<<"你钱不够!"<<endl;
}
}
else if(dpcs>0&&op==13){
clear();
wait(1000,"卖“快乐粉”");
money+=100;
safe-=120;
jl-=20;
}
else if(op==14){
clear();
wait(2000,"买大餐");
money-=150;
jl+=100;
hp+=100;
}
else if(op==15){
clear();
jl-=50;
wait(2000,"读博");
if(random(10)<3){
cout<<"赢了!"<<endl;
money+=1000;
}
else{
cout<<"输了..."<<endl;
money-=500;
}
}
else if(op==16){
clear();
int op2;
if(havesc==0){
cout<<"001-买普通笔记本 1000元"<<endl;
}
if(havegc==0){
cout<<"002-买电竞笔记本 4800元"<<endl;
}
if(haveqc==0){
cout<<"003-买量子计算机 888888元"<<endl;
}
cout<<"888-买唐太宗 8888元(买上后会有神秘效果)"<<endl;
cin>>op2;
if(havesc==0&&op2==1){
money-=1000;
xl=2000;
gamep=1;
zbxl=3000;
zbmp=200;
havesc=1;
}
else if(havegc==0&&op2==2){
money-=4800;
xl=4800;
gamep=5;
zbxl=5000;
zbmp=500;
havegc=1;
}
else if(haveqc==0&&op2==3){
money-=888888;
xl=5000;
gamep=150;
zbxl=6900;
zbmp=28888;
haveqc=1;
}
else if(op2==888){
cout<<"唐太宗提款跑路了"<<endl;
money-=8888;
}
}
else if(op==17){
clear();
wait(2000,"戒");
jl-=50;
hp+=50;
dpcs--;
}
else if(op==18){
clear();
wait(2000,"打瓦");
jl-=50;
hp-=20;
cf+=100;
}
else if(cf>0&&op==19){
clear();
wait(2000,"抄题解");
if(random(5)<=3){
cout<<"抄题解没被发现..."<<endl;
cf+=300;
}
else{
cout<<"你作弊了!"<<endl;
safe-=100;
cf=0;
}
}
else if(op==20){
clear();
wait(5000,"喝提神药");
money-=100;
jl+=300;
}
else if(op==21){
clear();
if(random(10)){
cout<<"战争并没爆发..."<<endl;
jl-=50;
hp-=50;
}
else{
cout<<"战争爆发了!"<<endl;
pause();
wait(10000,"打仗");
if(random(5)){
cout<<"你在战争中负伤,国家给你发了补助金"<<endl;
jl-=100;
hp-=70;
money+=1000;
}
else{
cout<<"你在战争中牺牲..."<<endl;
pause();
break;
}
}
}
else if(op==22){
clear();
wait(2000,"拍视频");
rq+=50+rq+random(100);
jl-=20;
money+=100+rq/10;
}
else if(rq>=1000&&op==23){
clear();
wait(5000,"主播PK");
money+=rq/5+random(1000);
rq+=100+random(500);
}
else if(op==24){
clear();
int tm;
cout<<"请输入投入金额:"<<endl;
cin>>tm;
if(money>=tm){
money-=tm;
tm*=random(500)/250.0;
cout<<"持有股票目前价值为:"<<tm<<endl;
money+=tm;
}
else{
cout<<"你钱不够!"<<endl;
}
}
else if(op==91){
break;
}
else if(op==92){
clear();
std::ofstream file("TangTaizongsValorant.txt");
if(file.is_open()){
file<<money<<endl;
file<<jl<<endl;
file<<hp<<endl;
file<<game<<endl;
file<<safe<<endl;
file<<cf<<endl;
file<<rq<<endl;
file.close();
cout<<"存档成功!"<<endl;
}
}
else{
clear();
cout<<"无效选项"<<endl;
}
pause();
clear();
}
clear();
cout<<"欢迎下次进入";
return 0;
}
回去!
全部评论 1
ber我怎么改不了题库题目了,我测试点写错了
昨天 来自 浙江
0刚不知道谁把权限改了
昨天 来自 浙江
0
有帮助,赞一个