新·唐太宗的瓦罗兰特(破解版
2025-11-21 17:31:03
发布于:浙江
界面更直观
多余操作减少
修复了许多bug
#include<bits/stdc++.h>
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
using namespace std;
int n78;
// 基础属性
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;
// 进阶属性
int skill=0, contacts=0, luck=0;
// 新增系统属性
int house=0, car=0, marriage=0, child=0, age=18;
// 奇遇事件计数器
int event_count=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;
}
}
// 修复:正确定义random函数
int random(int value=100){
return rand()%value;
}
// 奇遇事件处理函数
void random_event(){
event_count++;
if(random(100)<=20+luck){ // 幸运值提升奇遇概率
int event_type = random(10);
clear();
cout<<"【奇遇事件触发!】"<<endl;
Sleep(1000);
switch(event_type){
case 0: {
cout<<"你在路上捡到一个钱包,里面有"<<random(1000)+100<<"元!"<<endl;
int add_money = random(1000)+100;
money+=add_money;
luck--; // 消耗运气
cout<<"金钱 +"<<add_money<<", 幸运值 -1"<<endl;
break;
}
case 1: {
cout<<"遇到一位大师指点,你的技能突飞猛进!"<<endl;
skill+=5;
jl+=30;
cout<<"技能等级 +5, 精力 +30"<<endl;
break;
}
case 2: {
cout<<"被星探发现,邀请你拍广告!"<<endl;
if(rq>=500){
money+=5000;
rq+=300;
cout<<"金钱 +5000, 人气 +300"<<endl;
}
else{
money+=1000;
cout<<"金钱 +1000"<<endl;
}
break;
}
case 3: {
cout<<"参加慈善活动,获得社会赞誉!"<<endl;
safe+=100;
contacts+=50;
cout<<"安全值 +100, 人脉值 +50"<<endl;
break;
}
case 4: {
cout<<"投资的项目意外成功,获得翻倍回报!"<<endl;
if(money>=10000) {
money+=10000;
cout<<"金钱 +10000"<<endl;
}
else {
int add_money = money/2;
money+=add_money;
cout<<"金钱 +"<<add_money<<endl;
}
break;
}
case 5: {
cout<<"遇到碰瓷,损失了"<<random(2000)+500<<"元!"<<endl;
int lose_money = random(2000)+500;
money-=lose_money;
if(money<0) money=0;
cout<<"金钱 -"<<lose_money<<endl;
break;
}
case 6: {
cout<<"身体不适,需要看病治疗"<<endl;
hp-=50;
money-=1000;
cout<<"生命值 -50, 金钱 -1000"<<endl;
break;
}
case 7: {
cout<<"参加抽奖活动,获得一辆代步车!"<<endl;
if(car<1){
car=1;
cout<<"车辆等级 +1"<<endl;
}
else{
money+=5000;
cout<<"金钱 +5000"<<endl;
}
break;
}
case 8: {
cout<<"遇到多年未见的老友,获得珍贵人脉!"<<endl;
contacts+=200;
luck+=3;
cout<<"人脉值 +200, 幸运值 +3"<<endl;
break;
}
case 9: {
cout<<"获得游戏内测资格,游戏天赋大幅提升!"<<endl;
game+=30;
cout<<"游戏天赋 +30"<<endl;
break;
}
}
Sleep(3000);
clear();
}
}
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;
// 读取新增状态变量(兼容旧存档,旧存档无这些值时默认0)
if(file.peek()!=EOF) file>>skill;
if(file.peek()!=EOF) file>>contacts;
if(file.peek()!=EOF) file>>luck;
if(file.peek()!=EOF) file>>house;
if(file.peek()!=EOF) file>>car;
if(file.peek()!=EOF) file>>marriage;
if(file.peek()!=EOF) file>>child;
if(file.peek()!=EOF) file>>age;
file.close();
}
else{
std::ofstream file("TangTaizongsValorant.txt");
}
while(1){
// 年龄增长机制
age++;
cout<<"年龄增长!当前年龄:"<<age<<endl;
// 随机触发奇遇事件
if(event_count>=5){
random_event();
event_count=0;
}
if(safe<=0||random(safe)==0){
if(safe>=500){
cout<<"你被人诬陷入狱..."<<endl;
money-=200;
hp-=20;
jl-=20;
cout<<"金钱 -200, 生命值 -20, 精力 -20"<<endl;
wait(5000);
cout<<"你出狱了..."<<endl;
}
else if(safe<=0){
cout<<"你被枪决..."<<endl;
pause();
break;
}
else{
cout<<"你入狱了..."<<endl;
money-=100;
jl-=50;
hp-=50;
cout<<"金钱 -100, 精力 -50, 生命值 -50"<<endl;
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);
jl=20;
cout<<"精力恢复 +20"<<endl;
cout<<"你醒了..\n";
}
if(dpcs>=3){
cout<<"你吸High了!"<<endl;
system("color 1F");
}
if(n78==2){
cout<<"你开的桂太多,被未知存在盯上了!"<<"\n";
system("color 3F");
}
if(n78==3){
cout<<"你被管家活活打断了双腿"<<"\n";
while(true){
system("start https://img1.baidu.com/it/u=3658849673,3146434119&fm=253&fmt=auto&app=120&f=JPEG?w=667&h=500");
}
}
// 家庭系统效果
if(marriage==1){
jl+=10; // 结婚后精力恢复更快
safe+=5;
cout<<"婚姻效果:精力 +10, 安全值 +5"<<endl;
}
if(child>0){
money-=50*child; // 养孩子有开销
cout<<"养孩子开销:金钱 -"<<50*child<<endl;
if(random(100)<=10){
cout<<"孩子带来欢乐,你的心情变好了!"<<endl;
hp+=10;
cout<<"生命值 +10"<<endl;
}
}
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<<" "<<skill<<" 技能等级"<<endl;
cout<<" "<<contacts<<" 人脉值"<<endl;
cout<<" "<<luck<<" 幸运值"<<endl;
cout<<" "<<house<<" 房产等级"<<endl;
cout<<" "<<car<<" 车辆等级"<<endl;
cout<<" "<<marriage<<" 婚姻状态"<<endl;
cout<<" "<<child<<" 孩子数量"<<endl;
cout<<" "<<age<<" 年龄"<<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;
if(!(money>=500)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 25-健身"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(money>=10000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 26-捐款"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(game>=50)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 27-参加电竞比赛"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(rq>=500)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 28-带货直播"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 29-旅游"<<endl;
if(!(money>=3000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 30-报技能培训班"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(contacts>=200)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 31-参加商业酒会"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(money>=5000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 32-投资加密货币"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 33-街头卖艺"<<endl;
if(!(rq>=2000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 34-开粉丝见面会"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 35-买彩票"<<endl;
// 新增房产系统
if(!(money>=100000&&house==0)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 36-买普通公寓"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(money>=500000&&house==1)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 37-买豪华别墅"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(money>=2000000&&house==2)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 38-买庄园"<<endl;
SetConsoleTextAttribute(hConsole,2);
// 新增车辆系统
if(!(money>=50000&&car==0)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 39-买代步车"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(money>=500000&&car==1)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 40-买豪华轿车"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(money>=2000000&&car==2)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 41-买跑车"<<endl;
SetConsoleTextAttribute(hConsole,2);
// 新增家庭系统
if(!(marriage==0&&money>=100000&&rq>=500)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 42-结婚"<<endl;
SetConsoleTextAttribute(hConsole,2);
if(!(marriage==1&&age>=25&&age<=45&&child<3)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 43-生孩子"<<endl;
SetConsoleTextAttribute(hConsole,2);
// 其他系统
cout<<" 44-医院体检"<<endl;
if(!(skill>=50&&money>=50000)){
SetConsoleTextAttribute(hConsole,8);
}
cout<<" 45-出书立传"<<endl;
SetConsoleTextAttribute(hConsole,2);
cout<<" 78-学习"<<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;
cout<<"精力 -20, 生命值 -50"<<endl;
if(random(10)<=6){
safe+=100;
cout<<"安全值 +100"<<endl;
}
else {
safe-=70;
cout<<"安全值 -70"<<endl;
}
}
else if(op==1){
clear();
wait(2000,"搬砖");
money+=50;
jl-=50;
hp-=20;
cout<<"金钱 +50, 精力 -50, 生命值 -20"<<endl;
}
else if(op==2){
clear();
wait(1000,"吃饭");
money-=30;
hp+=30;
cout<<"金钱 -30, 生命值 +30"<<endl;
}
else if(op==3){
clear();
wait(10000,"睡觉");
jl+=100;
safe+=50;
cout<<"精力 +100, 安全值 +50"<<endl;
}
else if(op==4){
clear();
wait(5000-xl,"打游戏");
jl-=50;
game+=1+gamep;
cout<<"精力 -50, 游戏天赋 +"<<1+gamep<<endl;
if(random(10)==0){
game+=9;
cout<<"游戏天赋额外 +9"<<endl;
}
}
else if(op==114514){
cout<<"这么爱打数字,给你开个桂"<<"\n";
int i78;
cout<<"你要多少钱?注意不要爆long long\n";
cin>>i78;
int old_money = money;
money=i78;
cout<<"金钱调整:"<<(money-old_money>=0?"+":"")<<money-old_money<<endl;
cout<<"你要多少精力?注意不要爆long long\n";
cin>>i78;
int old_jl = jl;
jl=i78;
cout<<"精力调整:"<<(jl-old_jl>=0?"+":"")<<jl-old_jl<<endl;
cout<<"你要多少生命?注意不要爆long long\n";
cin>>i78;
int old_hp = hp;
hp=i78;
cout<<"生命值调整:"<<(hp-old_hp>=0?"+":"")<<hp-old_hp<<endl;
cout<<"你要多少安全值?注意不要爆long long\n";
cin>>i78;
int old_safe = safe;
safe=i78;
cout<<"安全值调整:"<<(safe-old_safe>=0?"+":"")<<safe-old_safe<<endl;
cout<<"你要多少人气?注意不要爆long long\n";
cin>>i78;
int old_rq = rq;
rq=i78;
cout<<"人气调整:"<<(rq-old_rq>=0?"+":"")<<rq-old_rq<<endl;
cout<<"你要多少游戏天赋?注意不要爆long long\n";
cin>>i78;
int old_game = game;
game=i78;
cout<<"游戏天赋调整:"<<(game-old_game>=0?"+":"")<<game-old_game<<endl;
cout<<"你要多少打瓦次数?注意不要爆long long\n";
cin>>i78;
int old_cf = cf;
cf=i78;
cout<<"打瓦次数调整:"<<(cf-old_cf>=0?"+":"")<<cf-old_cf<<endl;
// 新增作弊选项:设置技能、人脉、幸运值等
cout<<"你要多少技能等级?注意不要爆long long\n";
cin>>i78;
int old_skill = skill;
skill=i78;
cout<<"技能等级调整:"<<(skill-old_skill>=0?"+":"")<<skill-old_skill<<endl;
cout<<"你要多少人脉值?注意不要爆long long\n";
cin>>i78;
int old_contacts = contacts;
contacts=i78;
cout<<"人脉值调整:"<<(contacts-old_contacts>=0?"+":"")<<contacts-old_contacts<<endl;
cout<<"你要多少幸运值?注意不要爆long long\n";
cin>>i78;
int old_luck = luck;
luck=i78;
cout<<"幸运值调整:"<<(luck-old_luck>=0?"+":"")<<luck-old_luck<<endl;
cout<<"房产等级(0-3):";
cin>>i78;
int old_house = house;
house=i78;
cout<<"房产等级调整:"<<(house-old_house>=0?"+":"")<<house-old_house<<endl;
cout<<"车辆等级(0-3):";
cin>>i78;
int old_car = car;
car=i78;
cout<<"车辆等级调整:"<<(car-old_car>=0?"+":"")<<car-old_car<<endl;
cout<<"婚姻状态(0/1):";
cin>>i78;
int old_marriage = marriage;
marriage=i78;
cout<<"婚姻状态调整:"<<(marriage-old_marriage>=0?"+":"")<<marriage-old_marriage<<endl;
cout<<"孩子数量:";
cin>>i78;
int old_child = child;
child=i78;
cout<<"孩子数量调整:"<<(child-old_child>=0?"+":"")<<child-old_child<<endl;
cout<<"年龄:";
cin>>i78;
int old_age = age;
age=i78;
cout<<"年龄调整:"<<(age-old_age>=0?"+":"")<<age-old_age<<endl;
n78+=1;
cout<<"作弊次数 +1"<<endl;
}
else if(op==5){
clear();
wait(5000,"偷窃");
jl-=50;
cout<<"精力 -50"<<endl;
if(random(10)){
money+=100;
hp-=20;
safe-=50;
cout<<"偷窃成功:金钱 +100, 生命值 -20, 安全值 -50"<<endl;
}
else{
safe-=10;
cout<<"偷窃失败:安全值 -10"<<endl;
cout<<"无功而返..."<<endl;
}
}
else if(money>=2000&&op==6){
clear();
int tm;
cout<<"请输入你投入的金额:";
cin>>tm;
if(money>=tm){
money-=tm;
cout<<"投资金额:金钱 -"<<tm<<endl;
wait(2000,"投资");
// 人脉提升投资成功率
int success_rate = 50 + contacts/10;
if(random(100)<success_rate){
int profit = tm*(100+random())/100;
money+=profit;
cout<<"投资成功:金钱 +"<<profit<<endl;
}
else{
cout<<"投资失败:金钱损失 -"<<tm<<endl;
}
safe+=50;
cout<<"安全值 +50"<<endl;
}
else{
cout<<"你钱不够!"<<endl;
}
}
else if(game>=25&&op==7){
clear();
wait(7000-zbxl,"直播游戏");
jl-=100;
hp-=20;
int earn_money = random(1000)+20+game+zbmp;
money+=earn_money;
game+=20;
cout<<"精力 -100, 生命值 -20, 金钱 +"<<earn_money<<", 游戏天赋 +20"<<endl;
}
else if(safe<=400&&op==8){
clear();
wait(5000,"抢劫");
jl-=100;
hp-=70;
money+=300;
safe-=100;
cout<<"精力 -100, 生命值 -70, 金钱 +300, 安全值 -100"<<endl;
}
else if(safe<=250&&op==9){
clear();
wait(5000,"绑架");
jl-=120;
hp-=120;
money+=500;
safe-=70;
cout<<"精力 -120, 生命值 -120, 金钱 +500, 安全值 -70"<<endl;
}
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;
cout<<"快乐粉等级 +1, 生命值 -70, 精力 +200, 金钱 -20"<<endl;
}
else if(op==78){
cout<<"这么爱学习\n";
jl-=50;
skill+=5;
cout<<"精力 -50, 技能等级 +5"<<endl;
while(true){
system("start https://www.luogu.com.cn/problem/P4004");
}
}
else if(op==11){
clear();
wait(5000-xl,"打工");
int base_money = 200+cf;
money+=base_money;
jl-=100;
hp-=50;
cout<<"基础收入:金钱 +"<<base_money<<", 精力 -100, 生命值 -50"<<endl;
// 技能等级加成
if(skill>=10){
int bonus = base_money * (skill/10)*10 / 100;
money+=bonus;
cout<<"技能等级加成!额外获得:金钱 +"<<bonus<<endl;
}
}
else if(money>=1000&&op==12){
clear();
int tm;
cout<<"请输入你投入的金额:"<<endl;
cin>>tm;
if(money>=tm){
money-=tm;
cout<<"创业投资:金钱 -"<<tm<<endl;
wait(2000,"创业");
// 人脉提升创业成功率
int success_rate = 50 + contacts/20;
if(random(100)<success_rate){
int profit = tm*(1+random(4));
money+=profit;
cout<<"创业成功:金钱 +"<<profit<<endl;
// 人脉额外加成
if(contacts>=500){
int extra = tm*0.5;
money+=extra;
cout<<"人脉广阔,获得额外投资回报:金钱 +"<<extra<<endl;
}
}
else{
money-=tm*2;
cout<<"创业失败:金钱损失 -"<<tm*2<<endl;
}
}
else{
cout<<"你钱不够!"<<endl;
}
}
else if(dpcs>0&&op==13){
clear();
wait(1000,"卖“快乐粉”");
money+=100;
safe-=120;
jl-=20;
cout<<"金钱 +100, 安全值 -120, 精力 -20"<<endl;
}
else if(op==14){
clear();
wait(2000,"买大餐");
money-=150;
jl+=100;
hp+=100;
cout<<"金钱 -150, 精力 +100, 生命值 +100"<<endl;
}
else if(op==15){
clear();
jl-=50;
cout<<"精力 -50"<<endl;
wait(2000,"读博");
if(random(10)<3){
money+=1000;
cout<<"读博赢了:金钱 +1000"<<endl;
}
else{
money-=500;
cout<<"读博输了:金钱 -500"<<endl;
}
}
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<<"004-买幸运符 5000元(永久+10幸运值)"<<endl;
cout<<"888-买唐太宗 8888元(买上后会有神秘效果)"<<endl;
cin>>op2;
if(havesc==0&&op2==1){
money-=1000;
xl=2000;
gamep=1;
zbxl=3000;
zbmp=200;
havesc=1;
cout<<"购买普通笔记本:金钱 -1000, 游戏效率提升"<<endl;
}
else if(havegc==0&&op2==2){
money-=4800;
xl=4800;
gamep=5;
zbxl=5000;
zbmp=500;
havegc=1;
cout<<"购买电竞笔记本:金钱 -4800, 游戏效率大幅提升"<<endl;
}
else if(haveqc==0&&op2==3){
money-=888888;
xl=5000;
gamep=150;
zbxl=6900;
zbmp=28888;
haveqc=1;
cout<<"购买量子计算机:金钱 -888888, 游戏效率极致提升"<<endl;
}
// 新增商品:幸运符
else if(op2==4){
if(money>=5000){
money-=5000;
luck+=10;
cout<<"购买幸运符成功:金钱 -5000, 幸运值 +10"<<endl;
}
else{
cout<<"钱不够买幸运符!"<<endl;
}
}
else if(op2==888){
money-=8888;
cout<<"购买唐太宗:金钱 -8888"<<endl;
cout<<"唐太宗提款跑路了"<<endl;
}
}
else if(op==17){
clear();
wait(2000,"戒");
jl-=50;
hp+=50;
dpcs--;
cout<<"精力 -50, 生命值 +50, 快乐粉等级 -1"<<endl;
}
else if(op==18){
clear();
wait(2000,"打瓦");
jl-=50;
hp-=20;
cf+=100;
cout<<"精力 -50, 生命值 -20, 打瓦次数 +100"<<endl;
}
else if(cf>0&&op==19){
clear();
wait(2000,"抄题解");
if(random(5)<=3){
cf+=300;
cout<<"抄题解成功:打瓦次数 +300"<<endl;
}
else{
safe-=100;
cf=0;
cout<<"抄题解被发现:安全值 -100, 打瓦次数清零"<<endl;
}
}
else if(op==20){
clear();
wait(5000,"喝提神药");
money-=100;
jl+=300;
cout<<"金钱 -100, 精力 +300"<<endl;
}
else if(op==21){
clear();
if(random(10)){
jl-=50;
hp-=50;
cout<<"战争未爆发:精力 -50, 生命值 -50"<<endl;
}
else{
cout<<"战争爆发了!"<<endl;
pause();
wait(10000,"打仗");
if(random(5)){
jl-=100;
hp-=70;
money+=1000;
cout<<"战争负伤:精力 -100, 生命值 -70, 补助金 +1000"<<endl;
}
else{
cout<<"你在战争中牺牲..."<<endl;
pause();
break;
}
}
}
else if(op==22){
clear();
wait(2000,"拍视频");
int add_rq = 50+rq+random(100);
rq+=add_rq;
jl-=20;
int earn_money = 100+rq/10;
money+=earn_money;
cout<<"人气 +"<<add_rq<<", 精力 -20, 金钱 +"<<earn_money<<endl;
}
else if(rq>=1000&&op==23){
clear();
wait(5000,"主播PK");
int earn_money = rq/5+random(1000);
money+=earn_money;
int add_rq = 100+random(500);
rq+=add_rq;
cout<<"金钱 +"<<earn_money<<", 人气 +"<<add_rq<<endl;
}
else if(op==24){
clear();
int tm;
cout<<"请输入投入金额:"<<endl;
cin>>tm;
if(money>=tm){
money-=tm;
cout<<"股票投资:金钱 -"<<tm<<endl;
double rate = random(500)/250.0;
int value = tm*rate;
money+=value;
if(value > tm) {
cout<<"股票上涨:金钱 +"<<value-tm<<endl;
} else if(value < tm) {
cout<<"股票下跌:金钱 -"<<tm-value<<endl;
} else {
cout<<"股票持平:无盈亏"<<endl;
}
}
else{
cout<<"你钱不够!"<<endl;
}
}
else if(money>=500&&op==25){
clear();
wait(3000,"健身");
money-=200;
jl-=80;
hp+=50;
cout<<"金钱 -200, 精力 -80, 生命值 +50"<<endl;
if(random(10)>=7){
hp+=30;
cout<<"健身效果显著:生命值额外 +30"<<endl;
}
}
else if(money>=10000&&op==26){
clear();
int tm;
cout<<"请输入捐款金额:"<<endl;
cin>>tm;
if(money>=tm && tm>0){
money-=tm;
cout<<"捐款:金钱 -"<<tm<<endl;
wait(2000,"捐款");
int add_safe = tm/100;
safe+=add_safe;
cout<<"获得声望:安全值 +"<<add_safe<<endl;
}
else{
cout<<"捐款金额无效或余额不足!"<<endl;
}
}
else if(game>=50&&op==27){
clear();
wait(8000,"参加电竞比赛");
jl-=150;
hp-=30;
cout<<"参赛消耗:精力 -150, 生命值 -30"<<endl;
int winRate = game + luck/2;
if(random(100)<winRate){
int prize = 5000+game*100;
money+=prize;
rq+=1000;
cout<<"比赛获胜:金钱 +"<<prize<<", 人气 +1000"<<endl;
}
else{
cout<<"比赛失利:无奖励"<<endl;
}
}
else if(rq>=500&&op==28){
clear();
wait(6000,"带货直播");
jl-=120;
hp-=40;
int earn_money = rq*2+random(2000);
money+=earn_money;
rq+=200;
cout<<"直播消耗:精力 -120, 生命值 -40"<<endl;
cout<<"直播收入:金钱 +"<<earn_money<<", 人气 +200"<<endl;
}
else if(op==29){
clear();
if(money>=2000){
money-=2000;
cout<<"旅游花费:金钱 -2000"<<endl;
wait(5000,"旅游");
jl+=50;
hp+=40;
safe+=30;
cout<<"旅游恢复:精力 +50, 生命值 +40, 安全值 +30"<<endl;
if(random(10)>=8){
luck+=5;
cout<<"旅途好运:幸运值 +5"<<endl;
}
}
else{
cout<<"钱不够旅游啊!"<<endl;
}
}
else if(money>=3000&&op==30){
clear();
wait(4000,"报技能培训班");
money-=3000;
jl-=100;
skill+=3;
cout<<"培训花费:金钱 -3000, 精力 -100"<<endl;
cout<<"培训收获:技能等级 +3"<<endl;
}
else if(contacts>=200&&op==31){
clear();
wait(5000,"参加商业酒会");
money-=5000;
jl-=80;
contacts+=200;
safe+=50;
cout<<"酒会花费:金钱 -5000, 精力 -80"<<endl;
cout<<"酒会收获:人脉值 +200, 安全值 +50"<<endl;
}
else if(money>=5000&&op==32){
clear();
wait(3000,"投资加密货币");
int invest = 5000;
money-=invest;
jl-=50;
cout<<"加密货币投资:金钱 -5000, 精力 -50"<<endl;
int profitRate = random(300) - 100 + luck;
if(profitRate>0){
int profit = invest * profitRate / 100;
money+=invest+profit;
cout<<"加密货币暴涨:盈利 +"<<profit<<endl;
}
else if(profitRate<=-50){
cout<<"加密货币崩盘:投资血本无归!金钱 -5000"<<endl;
}
else{
money+=invest;
cout<<"加密货币持平:无盈亏"<<endl;
}
}
else if(op==33){
clear();
wait(2000,"街头卖艺");
jl-=60;
hp-=10;
int income = random(300)+50 + skill*10;
money+=income;
rq+=20;
cout<<"卖艺消耗:精力 -60, 生命值 -10"<<endl;
cout<<"卖艺收入:金钱 +"<<income<<", 人气 +20"<<endl;
}
else if(rq>=2000&&op==34){
clear();
wait(7000,"开粉丝见面会");
money-=10000;
jl-=200;
cout<<"见面会成本:金钱 -10000, 精力 -200"<<endl;
int income = rq*5 + random(5000);
money+=income;
rq+=1000;
contacts+=300;
cout<<"见面会收入:金钱 +"<<income<<", 人气 +1000, 人脉值 +300"<<endl;
}
else if(op==35){
clear();
if(money>=20){
money-=20;
cout<<"彩票花费:金钱 -20"<<endl;
wait(1000,"买彩票");
int winChance = 5 + luck*2;
if(random(1000)<winChance){
int prize = random(100000)+10000;
money+=prize;
cout<<"恭喜中大奖!奖金 +"<<prize<<endl;
}
else if(random(100)<=30){
money+=50;
cout<<"中了小奖!奖金 +50"<<endl;
}
else{
cout<<"未中奖,损失20元"<<endl;
}
}
else{
cout<<"连20元彩票钱都没有!"<<endl;
}
}
// 新增房产系统实现
else if(money>=100000&&house==0&&op==36){
clear();
wait(3000,"购买普通公寓");
money-=100000;
house=1;
safe+=200;
cout<<"购买公寓:金钱 -100000, 房产等级 +1, 安全值 +200"<<endl;
}
else if(money>=500000&&house==1&&op==37){
clear();
wait(5000,"购买豪华别墅");
money-=500000;
house=2;
safe+=500;
luck+=10;
cout<<"购买别墅:金钱 -500000, 房产等级 +1, 安全值 +500, 幸运值 +10"<<endl;
}
else if(money>=2000000&&house==2&&op==38){
clear();
wait(8000,"购买庄园");
money-=2000000;
house=3;
safe+=1000;
luck+=30;
contacts+=500;
cout<<"购买庄园:金钱 -2000000, 房产等级 +1, 安全值 +1000, 幸运值 +30, 人脉值 +500"<<endl;
}
// 新增车辆系统实现
else if(money>=50000&&car==0&&op==39){
clear();
wait(2000,"购买代步车");
money-=50000;
car=1;
jl+=50; // 有车节省通勤精力
cout<<"购买代步车:金钱 -50000, 车辆等级 +1, 精力 +50"<<endl;
}
else if(money>=500000&&car==1&&op==40){
clear();
wait(4000,"购买豪华轿车");
money-=500000;
car=2;
jl+=100;
contacts+=200;
cout<<"购买豪华轿车:金钱 -500000, 车辆等级 +1, 精力 +100, 人脉值 +200"<<endl;
}
else if(money>=2000000&&car==2&&op==41){
clear();
wait(6000,"购买跑车");
money-=2000000;
car=3;
jl+=200;
contacts+=500;
rq+=1000;
cout<<"购买跑车:金钱 -2000000, 车辆等级 +1, 精力 +200, 人脉值 +500, 人气 +1000"<<endl;
}
// 新增家庭系统实现
else if(marriage==0&&money>=100000&&rq>=500&&op==42){
clear();
wait(5000,"结婚");
money-=100000;
marriage=1;
safe+=300;
luck+=5;
cout<<"结婚花费:金钱 -100000"<<endl;
cout<<"结婚效果:婚姻状态 +1, 安全值 +300, 幸运值 +5"<<endl;
}
else if(marriage==1&&age>=25&&age<=45&&child<3&&op==43){
clear();
wait(8000,"生孩子");
money-=50000;
child++;
hp-=30; // 生孩子消耗健康
luck+=3;
cout<<"生育花费:金钱 -50000, 生命值 -30"<<endl;
cout<<"生育效果:孩子数量 +1, 幸运值 +3"<<endl;
}
// 医院体检
else if(op==44){
clear();
wait(2000,"医院体检");
if(money>=1000){
money-=1000;
hp+=20;
cout<<"体检费用:金钱 -1000, 生命值 +20"<<endl;
if(random(100)<=10){
hp+=50;
cout<<"发现疾病并治疗:生命值额外 +50"<<endl;
}
}
else{
cout<<"没钱体检!"<<endl;
}
}
// 出书立传
else if(skill>=50&&money>=50000&&op==45){
clear();
wait(10000,"写书");
money-=50000;
jl-=200;
cout<<"写书成本:金钱 -50000, 精力 -200"<<endl;
if(random(100)<=70+luck){
int income = 500000+skill*1000;
money+=income;
rq+=5000;
contacts+=1000;
cout<<"出版成功:金钱 +"<<income<<", 人气 +5000, 人脉值 +1000"<<endl;
}
else{
money+=10000;
cout<<"出版失败:仅获得版税 +10000"<<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<<skill<<endl;
file<<contacts<<endl;
file<<luck<<endl;
file<<house<<endl;
file<<car<<endl;
file<<marriage<<endl;
file<<child<<endl;
file<<age<<endl;
file.close();
cout<<"存档成功!所有数据已保存"<<endl;
}
}
else{
clear();
cout<<"无效选项"<<endl;
}
pause();
clear();
}
clear();
cout<<"欢迎下次进入";
return 0;
}
全部评论 2
ddd
2025-11-21 来自 浙江
0怎么是老破新唐瓦啊

2025-11-21 来自 浙江
0


















有帮助,赞一个