正文
增加 55 行删除 13 行
12345678951 行未改动6162636465666768697071727374757677787980818283845 行未改动909192939495969798991001011021031041052 行未改动10810911011111211311411511611711811912012112212337 行未改动16116216316416516616716816917017117217317417517617717817923 行未改动```cpp//wake-up war 1V1 version//Created by seanli1008 on 2025/9/26.//Copyright (c) 2025年 seanli1008. All rights reserved.//Acknowledgements: sfy666#include <bits/stdc++.h>using namespace std;mt19937 rnd(time(0));struct player{51 行未改动void clear(x){}void alz(int x){if(round_cnt%5==0){cout<<"Player "<<x<<" is Alzheimer. He forgot who he is. Please choose your job again"<<endl;cout<<"1 - shop assistance 2 - doctor 3 - racer 4 - swimmer 5 - physicist 6 - madman 7 - Alzheimer 8 - magician 9 - OIer"<<endl;cin>>pl[x].job;job_skill(x);}if(round_cnt%10==0)clear(x);}void sleeping(int x){if(pl[x].asleep){pl[x].sleep_round++;if(pl[x].sleep_round==3)pl[x].sleep_round=pl[x].asleep=0;}}void move(int x,string dest){int to=0;if(dest=="shop")to=1;5 行未改动to=4;if(dest=="pool")to=5;pl[x].pos=to;if(place[dest].electric_web_exist){pl[x].at_door=1;if(!pl[x].taipingtianshu){if(!pl[x].rubber)pl[x].hp-=0.5;elsepl[x].rubber_hp-=0.5;}}}void purchase(int x,string item){if(pl[x].pos==0 || pl[x].pos==5 || pl[x].at_door=1){2 行未改动}if(pl[x].pos==4){if(item=="hammer")pl[x].hammer_num++;else if(item=="lightning"){pl[x].ltn_num++;pl[x].ltn_time+=3;}else if(item=="laser"){pl[x].laser_num++;pl[x].laser_time++;}}if(pl[x].pos==3){if(item=="car"){pl[x].car_num++;37 行未改动job_skill(1);job_skill(2);while(!over()){round_cnt++;if(pl[1].ori_job==7)alz(1);if(pl[2].ori_job==7)alz(2);if(pl[1].job==4 && pl[1].pos==5 && pl[1].at_door=0)pl[1].hp+=0.5;if(pl[2].job==4 && pl[2].pos==5 && pl[2].at_door=0)pl[2].hp+=0.5;sleeping(1);sleeping(2);int x=rnd()%2+1;cout<<"player "<<x<<"'s turn"<<endl;string op;cin>>op;getline(cin,op);23 行未改动12345678951 行未改动6162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161175 行未改动1231241251261271281291301311321331341351361371381391401412 行未改动14414514614714814915015115215315415515615715815916016116216337 行未改动20120220320420520620720820921021121221321421521621721821922022123 行未改动```cpp//wake-up war 1V1 version//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{51 行未改动void clear(x){}void alz(int x){if(!pl[x].is_alz)return;if(round_cnt%5==0){cout<<"Player "<<x<<" is Alzheimer. He forgot who he is. Please choose your job again"<<endl;cout<<"1 - shop assistance 2 - doctor 3 - racer 4 - swimmer 5 - physicist 6 - madman 7 - Alzheimer 8 - magician 9 - OIer"<<endl;cin>>pl[x].job;job_skill(x);}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++;if(pl[x].sleep_round==3)pl[x].sleep_round=pl[x].asleep=0;}}void on_fire_check(int x){if(!pl[x].on_fire)return;double dmg=pl[x].on_fire_num;if(pl[x].rattan_armor)dmg++;if(pl[x].on_cps_car)dmg++;if(pl[x].taipingtianshu)dmg/=2;pl[x].hp-=dmg;}void on_laser_check(int x){if(!pl[x].on_laser)return;double dmg=pl[x].on_laser_num;if(pl[x].pos==5 && pl[x].at_door==0)dmg++;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){int to=0;if(dest=="shop")to=1;5 行未改动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;elsepl[x].rubber_hp-=0.5;}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){2 行未改动}if(pl[x].pos==4){if(item=="hammer")pl[x].hammer_num++;if(item=="lightning"){pl[x].ltn_num++;pl[x].ltn_time+=3;}if(item=="laser"){pl[x].laser_num++;pl[x].laser_time++;}if(item=="mimic")pl[x].mimic_num++;if(item=="electric web")pl[x].electric_web_num++;}if(pl[x].pos==3){if(item=="car"){pl[x].car_num++;37 行未改动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)x=3-x;cout<<"player "<<x<<"'s turn"<<endl;string op;cin>>op;getline(cin,op);23 行未改动