正文
增加 40 行删除 20 行
2 行未改动34567891011121314151617181920215 行未改动27282930313233343520 行未改动565758596061626364657 行未改动7374757677787980818222 行未改动1051061071081091101111121131148 行未改动1231241251261271281291301312 行未改动13413513613713813914014114214314414514 行未改动16016116216316416516616716816916 行未改动18618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521620 行未改动2372382392402412422432442 行未改动//Created by seanli1008 on 2025/9/26.//Copyright (c) 2025年 seanli1008. All rights reserved.//Acknowledgements: sfy666 for checking my code and giving useful advice#include <bits/stdc++.h>using namespace std;mt19937 rnd(time(0));struct player{//all things about player}pl[10];struct car{//all things about car}car[100];struct compass_car{//all things about compass car}cps_car[100];bool over(){if(pl[1].hp<=0){cout<<"player 2 is the winner!"<<endl;return true;5 行未改动return false;}void job_skill(int x){if(pl[x].job==1){cout<<"Please choose a item"<<endl;string item;cin>>item;//get item}20 行未改动if(pl[x].job==6)pl[x].dice=1;if(pl[x].job==8 && !pl[x].magic_used)pl[x].change_item_time=3;}void clear(x){}void alz(int x){if(!pl[x].is_alz)7 行未改动if(round_cnt%10==0)clear(x);}void swim(int x){if(pl[x].job==4 && pl[x].pos==5 && pl[x].at_door=0)pl[x].hp+=0.5;}void sleeping(int x){if(pl[x].asleep){pl[x].sleep_round++;22 行未改动if(pl[x].taipingtianshu)dmg/=2;if(pl[x].rubber_hp>=0){double tmp=dmg;dmg-=rubber_hp;rubber_hp-=min(rubber_hp,tmp);}pl[x].hp-=min(dmg,0.0);}void move(int x,string dest){8 行未改动to=4;if(dest=="pool")to=5;pl[x].pos=to;if(place[to].electric_web_exist){pl[x].at_door=1;if(!pl[x].taipingtianshu){if(pl[x].rubber_hp<=0)pl[x].hp-=0.5;2 行未改动}place[to].electric_web_time--;if(place[to].electric_web_time==0)place[to].electric_web_exist=0;}}void purchase(int x,string item){if(pl[x].pos==0 || pl[x].pos==5 || pl[x].at_door=1){cout<<"Invalid operation!"<<endl;return;}if(pl[x].pos==4){14 行未改动}if(pl[x].pos==3){if(item=="car"){pl[x].car_num++;pl[x].powered=0;pl[x].car_fix=2;pl[x].car_hp=3;}if(item=="oil")pl[x].oil_num++;16 行未改动}}int main(){cout<<"wake-up war developed by seanli1008"<<endl;Sleep(200);system("cls");cout<<"player 1, please choose your job: 1 - shop assistance 2 - doctor 3 - racer 4 - swimmer 5 - physicist 6 - madman 7 - Alzheimer 8 - magician 9 - OIer"<<endl;cin>>pl[1].job;if(pl[1].job==7)pl[1].is_alz=1;cout<<"player 2, please choose your job: 1 - shop assistance 2 - doctor 3 - racer 4 - swimmer 5 - physicist 6 - madman 7 - Alzheimer 8 - magician 9 - OIer"<<endl;cin>>pl[2].job;if(pl[2].job==7)pl[2].is_alz=1;job_skill(1);job_skill(2);while(!over()){round_cnt++;alz(1);alz(2);swim(1);swim(2);on_fire_check(1);on_fire_check(2);on_laser_check(1);on_laser_check(2);sleeping(1);sleeping(2);int x=rnd()%2+1;while(!pl[x].asleep)20 行未改动for(int i=4;i<op.size();i++)item+=op[i];purchase(x,item);}}return 0;}```2 行未改动345678910111213141516171819202122232425262728293031325 行未改动38394041424344454620 行未改动6768697071727374757677787 行未改动86878889909192939495969722 行未改动1201211221231241251261271281298 行未改动1381391401411421431441451462 行未改动14915015115215315415515615715815916016116214 行未改动17717817918018118218318418518616 行未改动20320420520620720820921021121221321421521621721821922022122222322422522622722822923020 行未改动2512522532542552562572582592602612622632642 行未改动//Created by seanli1008 on 2025/9/26.//Copyright (c) 2025年 seanli1008. All rights reserved.//Acknowledgements: sfy666 for checking my code and giving useful advice#include <bits/stdc++.h>#include <windows.h>using namespace std;mt19937 rnd(time(0));int round_cnt;struct player{double hp,rubber_hp,car_hp;int job,med_num,mask_num,second_pos,third_pos,change_item_time,change_data_num,pos,sleep_round,on_fire_num,on_laser_num,hammer_num,ltn_num,ltn_time,mimic_num,laser_num,laser_time,electric_web_num,car_num,oil_num,speed_med_num,poison_num,hormone_num;bool on_mask,need_return,can_swim,dice,magic_used,change_data_used,is_alz,at_door,asleep,on_fire,rattan_armor,on_cps_car,taipingtianshu,on_laser,car_powered,car_fixed,on_car,instruction,awake,swimming_circle;}pl[10];struct car{//all things about car}car[10];struct compass_car{//all things about compass car}cps_car[10];struct location{bool destroyed,electric_web_exist;int electric_web_time,electric_web_belong;}place[10];void init(){}bool over(){if(pl[1].hp<=0){cout<<"player 2 is the winner!"<<endl;return true;5 行未改动return false;}void job_skill(int x){if(pl[x].job==1){cout<<"player "<<x<<" please choose a item"<<endl;string item;cin>>item;//get item}20 行未改动if(pl[x].job==6)pl[x].dice=1;if(pl[x].job==8 && !pl[x].magic_used)pl[x].change_item_time=3;if(pl[x].job==9 && !pl[x].change_data_used)pl[x].change_data_num=3;}void clear(int x){}void alz(int x){if(!pl[x].is_alz)7 行未改动if(round_cnt%10==0)clear(x);}void swim(int x){if(pl[x].job==4 && pl[x].pos==5 && pl[x].at_door)pl[x].hp+=0.5;else if(pl[x].job!=4 && pl[x].pos==5 && !pl[x].at_door && !pl[x].swimming_circle)pl[x].hp-=1.0;}void sleeping(int x){if(pl[x].asleep){pl[x].sleep_round++;22 行未改动if(pl[x].taipingtianshu)dmg/=2;if(pl[x].rubber_hp>=0){double tmp=dmg;dmg-=pl[x].rubber_hp;pl[x].rubber_hp-=min(pl[x].rubber_hp,tmp);}pl[x].hp-=min(dmg,0.0);}void move(int x,string dest){8 行未改动to=4;if(dest=="pool")to=5;pl[x].pos=to;if(place[to].electric_web_exist && place[to].electric_web_belong!=x){pl[x].at_door=1;if(!pl[x].taipingtianshu){if(pl[x].rubber_hp<=0)pl[x].hp-=0.5;2 行未改动}place[to].electric_web_time--;if(place[to].electric_web_time==0)place[to].electric_web_exist=0;if(pl[x].on_car)pl[x].car_hp-=0.5;}}void purchase(int x,string item){if(pl[x].pos==0 || pl[x].pos==5 || pl[x].at_door==true){cout<<"Invalid operation!"<<endl;return;}if(pl[x].pos==4){14 行未改动}if(pl[x].pos==3){if(item=="car"){pl[x].car_num++;pl[x].car_powered=0;pl[x].car_fixed=2;pl[x].car_hp=3;}if(item=="oil")pl[x].oil_num++;16 行未改动}}int main(){init();cout<<"wake-up war developed by seanli1008"<<endl;Sleep(500);system("cls");cout<<"player 1, please choose your job: 1 - shop assistance 2 - doctor 3 - racer 4 - swimmer 5 - physicist 6 - madman 7 - Alzheimer 8 - magician 9 - OIer"<<endl;cin>>pl[1].job;if(pl[1].job==7)pl[1].is_alz=1;job_skill(1);system("cls");cout<<"player 2, please choose your job: 1 - shop assistance 2 - doctor 3 - racer 4 - swimmer 5 - physicist 6 - madman 7 - Alzheimer 8 - magician 9 - OIer"<<endl;cin>>pl[2].job;if(pl[2].job==7)pl[2].is_alz=1;job_skill(2);system("cls");while(!over()){round_cnt++;alz(1);alz(2);sleeping(1);sleeping(2);int x=rnd()%2+1;while(!pl[x].asleep)20 行未改动for(int i=4;i<op.size();i++)item+=op[i];purchase(x,item);}swim(1);swim(2);on_fire_check(1);on_fire_check(2);on_laser_check(1);on_laser_check(2);}return 0;}```