- C20250082's blog
GAME·WhimsyOfMagic(魔法奇想)
- 2024-5-31 9:29:00 @
#include<bits/stdc++.h> #include<conio.h> #include<stdio.h> #include "windows.h" using namespace std;
#define ll long long
const int MAXN=1e3+5; string in; char inc; ll rin; string player_name;
ll dx[8]={1,0,-1,0,1,-1,1,-1}; ll dy[8]={0,1,0,-1,1,1,-1,-1};
ll pow(int pow,int number){ ll ans=1; for(int i=1;i<=pow_;i++){ ans*=number; } return ans; }
void change_colour(int new_colour){ if(new_colour0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY); if(new_colour1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); if(new_colour2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_RED); if(new_colour3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN); if(new_colour4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN); if(new_colour5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE); if(new_colour6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE); if(new_colour7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE); if(new_colour==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN); }
void print_colour(int new_colour){ if(new_colour0) printf("黑"); if(new_colour1) printf("红"); if(new_colour2) printf("橙"); if(new_colour3) printf("黄"); if(new_colour4) printf("绿"); if(new_colour5) printf("青"); if(new_colour6) printf("蓝"); if(new_colour7) printf("紫"); if(new_colour==8) printf("白"); }
void print_der(ll base_x,ll base_y,ll purpose_x,ll purpose_y){ if(base_xpurpose_x || base_ypurpose_y) printf("正"); if(base_y<purpose_y) printf("东"); if(base_y>purpose_y) printf("西"); if(base_x<purpose_x) printf("南"); if(base_x>purpose_x) printf("北"); return; }
void print_star(int star_s_number){ for(int i=1;i<=star_s_number;i++){ printf("★"); } return; }
void waiting(int x){ int start = time(0),end = time(0); while(end - start < x) end = time(0); return; }
ll pc_turn(ll base_num,ll per_a){ if(per_a==0) return 0; if(base_num<=9999999999999999/per_a){ return base_numper_a/100; } else return base_num/100per_a; }
void print_percent(ll per_a,ll per_b){ if(per_b0){ printf("00PC"); } else if(per_aper_b){ change_colour(4); printf("++++"); change_colour(8); } else{ if(per_a<100000000000000){ if(per_a100/per_b<10) printf(" "); printf("%lldPC",per_a100/per_b); } else{ for(ll i=100/(per_b/per_a+1);i<=100/(per_b/per_a);i++){ if(per_a*i>=per_b){ if(i<10) printf(" "); printf("%lldPC",i); return; } } printf(" 0PC"); } } return; }//a/b
void e_num(ll e_num_kk){ if(e_num_kk==0) { printf(" 0 "); return; } ll e_num_kkp; ll e_num_i; for(ll i=1;i<=1000000000000;i*=1000){ if(e_num_kk>=i && e_num_kk<i*1000){ e_num_kkp=e_num_kk/i; e_num_i=i; } } if(e_num_kkp<10) printf(""); else if(e_num_kkp<100) printf(" "); printf("%lld",e_num_kkp); if(e_num_kkp<10 && e_num_i>1) printf(".%lld",e_num_kk/(e_num_i/10)%10); if(e_num_kk<1000) printf(" "); else if(e_num_kk<1000000) printf("k"); else if(e_num_kk<1000000000) printf("M"); else if(e_num_kk<1000000000000) printf("B"); else if(e_num_kk<1000000000000000) printf("T"); return; }
ll s_to_ll(string trri){ ll trri_ans=0; ll trri_u=1; for(ll i=trri.length()-1;i>=0;i--){ if(trri[i]>='0' && trri[i]<='9'){ if(trri_u>=10000000000000000){ return 0; } trri_ans+=(trri[i]-'0')trri_u; trri_u=10; } } return trri_ans; }
ll lrand(ll youuuo){ // srand(time(NULL)); ll dwuhkhwad=0; dwuhkhwad+=(rand()%100)*10000000000; // srand(time(NULL)); dwuhkhwad+=(rand()%100)*100000000; // srand(time(NULL)); dwuhkhwad+=(rand()%100)*1000000; // srand(time(NULL)); dwuhkhwad+=(rand()%100)*10000; // srand(time(NULL)); dwuhkhwad+=(rand()%100)*100; // srand(time(NULL)); dwuhkhwad+=rand()%100; if(1000000000000%youuuo>1000000000000-dwuhkhwad) return lrand(youuuo); return abs(dwuhkhwad%youuuo); } ll faster_lrand(ll youuuo){ ll dwuhkhwad=0; dwuhkhwad+=(rand()%10000)*100000000; // srand(time(NULL)); dwuhkhwad+=(rand()%10000)*10000; // srand(time(NULL)); dwuhkhwad+=rand()%10000; // srand(time(NULL)); if(1000000000000%youuuo>1000000000000-dwuhkhwad) return lrand(youuuo); return abs(dwuhkhwad%youuuo); }
ll x_walk(string oytuiop){ if(oytuiop=="a") return 0; if(oytuiop=="d") return 0; if(oytuiop=="s") return 1; if(oytuiop=="w") return -1; return 2; }
ll y_walk(string oytuiop){ if(oytuiop=="a") return -1; if(oytuiop=="d") return 1; if(oytuiop=="s") return 0; if(oytuiop=="w") return 0; return 2; }
void die(){ while(true){ system("cls"); change_colour(1); printf("你死了!!!\n"); cin >> in; } return; }//已弃用
string qua_name[6]={"普通","稀有","史诗","传奇","神话","非物品"};
string part_itd="第一阶段:准备\n第二阶段:准备\n第三阶段:准备\n第四阶段:生物造成伤害\n第五阶段:摸牌\n第六阶段:出牌\n第七阶段:弃牌\n";
//构建信息与物品 ll ima_mb; string ima_name[MAXN]; ll ima_qua[MAXN];//0普通 1稀有 2史诗 3绝世 4传奇 5非物品 ll ima[2][MAXN]; void build_ima(){ for(ll i=0;i<MAXN;i++){ ima_qua[i]=0; ima[0][i]=0; ima[1][i]=0; } ima_mb=0;
ima_mb++;
ima_name[ima_mb]="手牌上限";
ima_qua[ima_mb]=5;
ima_mb++;
ima_name[ima_mb]="银币";
ima_qua[ima_mb]=0;
ima_mb++;
ima_name[ima_mb]="金币";
ima_qua[ima_mb]=1;
ima_mb++;
ima_name[ima_mb]="紫晶币";
ima_qua[ima_mb]=2;
ima_mb++;
ima_name[ima_mb]="紫晶币";
ima_qua[ima_mb]=2;
ima_mb++;
ima_name[ima_mb]="血红宝石";
ima_qua[ima_mb]=2;
return;
}
// 构建标记 ll sig_mb; string sig_name[MAXN]; string sig_itd[MAXN];
void build_sig(){ sig_mb=0; sig_mb++; sig_name[sig_mb]="燃烧"; sig_itd[sig_mb]="在拥有者回合内:第二阶段时,对拥有者造成X/5(下取整)点近身火焰伤害。第三阶段,自行消去5点。(X为此效果数量)"; sig_mb++; sig_name[sig_mb]="格挡"; sig_itd[sig_mb]="帮助拥有者抵消至多X点的一些属性伤害,除雷电、火焰、风刃、光刃、黑暗伤害。(X为此效果数量)"; return; }
//构建伤害属性 ll dam_att_mb; string dam_att_name[MAXN]; string dam_att_itd[MAXN]; void build_dam_att(){ dam_att_mb=0; dam_att_name[dam_att_mb]="普通"; dam_att_itd[dam_att_mb]=""; dam_att_mb++; dam_att_name[dam_att_mb]="火焰"; dam_att_itd[dam_att_mb]="无视普通防御,对目标造成X点燃烧效果。(X为对目标造成的实际伤害,即目标减少的血量)"; return; }
// 构建生物 ll ani_mb; string ani_name[MAXN]; ll ani_mlv[MAXN];//最大级别 ll ani_att[MAXN];//伤害属性 ll ani_hp[MAXN][20];//血量 ll ani_dam[MAXN][20];//每5点时机造成伤害 ll ani_time[MAXN][20];//时机 ll ani_once_pow[MAXN][20];//发动一次攻击所损耗能量 ll ani_pow[MAXN][20];//总能量 ll ani_add_hp[MAXN][20];//血量恢复力 ll ani_add_pow[MAXN][20];//能量恢复力 ll ani_ski_mb[MAXN][20]; ll ani_ski_list[MAXN][20][20]; ll ani_ski[MAXN][20][20];
ll ski_mb; string ski_name[MAXN]; string ski_itd[MAXN];
void build_ski(){ ski_mb=0; ski_mb++; ski_name[ski_mb]="迟缓"; ski_itd[ski_mb]="令敌方每回合有X%的概率时机减少五成"; return; }
void build_ani(){ ani_mb=0; for(ll i=0;i<MAXN;i++){ ani_mlv[i]=0; ani_att[i]=0; for(ll j=0;j<20;j++){ ani_hp[i][j]=0;//血量 ani_dam[i][j]=0;//每5点时机造成伤害 ani_time[i][j]=0;//时机 ani_once_pow[i][j]=0;//发动一次攻击所损耗能量 ani_pow[i][j]=0;//总能量 ani_add_hp[i][j]=0;//血量恢复力 ani_add_pow[i][j]=0;//能量恢复力
}
}
ani_mb++;
ani_name[ani_mb]="盗贼";
ani_mlv[ani_mb]++;
ani_hp[ani_mb][ani_mlv[ani_mb]]=5;
ani_dam[ani_mb][ani_mlv[ani_mb]]=1;
ani_time[ani_mb][ani_mlv[ani_mb]]=10;
ani_pow[ani_mb][ani_mlv[ani_mb]]=6;
ani_once_pow[ani_mb][ani_mlv[ani_mb]]=1;
ani_add_pow[ani_mb][ani_mlv[ani_mb]]=2;
ani_mlv[ani_mb]++;
ani_hp[ani_mb][ani_mlv[ani_mb]]=15;
ani_dam[ani_mb][ani_mlv[ani_mb]]=2;
ani_time[ani_mb][ani_mlv[ani_mb]]=10;
ani_pow[ani_mb][ani_mlv[ani_mb]]=6;
ani_once_pow[ani_mb][ani_mlv[ani_mb]]=1;
ani_add_pow[ani_mb][ani_mlv[ani_mb]]=2;
return;
}
//构建战力信息 x队 y队 ll x_mb[2];//成员数量 ll team[2][20];//0 代表主魔法师 ll team_lv[2][20]; ll team_hp[2][20]; ll team_pow[2][20];
//构建魔法牌
ll mag_mb;
string mag_name[MAXN];
ll mag_mlv[MAXN];
ll mag_str[MAXN];//0普通魔法牌 1限定魔法牌
ll mag_qua[MAXN];//★基础魔法★★初级魔法★★★中级魔法★★★★高级魔法★★★★★禁咒(每次战斗仅可使用一次)
ll mag_pre[MAXN];//是否可以预置 0不可以 1可以 2必须(即仅能通过放入预置牌组的方式加入战斗)
ll mag_time[MAXN][20];//耗时 -1即打出此牌后时间清0 按照此牌消耗的时间计算效果
ll mag_pow[MAXN][20];//耗能
ll mag_give[MAXN];//可否主动弃置 0:可以 1:不行(锁定牌) 2:可以,但弃置后进入缓冲牌堆 (一般情况下,即使是被动弃置,也看该项数据决定是否进入缓冲牌堆) 3:弃牌阶段时自动弃置
ll mag_out[MAXN];//可否打出 0:可以 1:不行(限制牌)
ll mag_et[MAXN];//是否是先天诅咒牌 0否 1是
ll mag_cd[MAXN][20];//缓冲时间
ll mag_pur[MAXN];//目标 0无目标 1敌方目标 2己方目标 4 所有目标
ll mag_choice[MAXN];//选择目标的方式 0普通 1真视
ll mag_sig_mb[MAXN][20];
ll mag_sig_list[MAXN][20][20];//更改标记 (增加或减少)
ll mag_sig[MAXN][20][20];
ll mag_efe_mb[MAXN][20];
ll mag_efe_list[MAXN][20][20];
ll mag_efe[MAXN][20][20];
ll efe_mb; string efe_name[MAXN]; string efe_itd[MAXN]; void build_efe(){ efe_mb=0; efe_mb++; efe_name[efe_mb]="伤害属性"; efe_itd[efe_mb]=""; efe_mb++; efe_name[efe_mb]="伤害"; efe_itd[efe_mb]="请手动完成";
return;
}
void build_mag(){ mag_mb=0; for(ll i=0;i<MAXN;i++){ mag_mlv[i]=0; mag_str[i]=0; mag_qua[i]=1; mag_pre[i]=0; mag_et[i]=0; mag_pur[i]=0; mag_choice[i]=0; for(ll j=0;j<20;j++){ mag_time[i][j]=0; mag_pow[i][j]=0; mag_give[i]=0; mag_out[i]=0; mag_cd[i][j]=0; mag_sig_mb[i][j]=0; mag_efe_mb[i][j]=0; } } mag_mb++; mag_name[mag_mb]="打击"; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=10; mag_pow[mag_mb][mag_mlv[mag_mb]]=1; mag_efe_mb[mag_mb][mag_mlv[ani_mb]]++; mag_efe_list[mag_mb][mag_mlv[mag_mb]][mag_efe_mb[mag_mb][mag_mlv[mag_mb]]]=1; mag_efe[mag_mb][mag_mlv[mag_mb]][mag_efe_mb[mag_mb][mag_mlv[mag_mb]]]=0; mag_efe_mb[mag_mb][mag_mlv[mag_mb]]++; mag_efe_list[mag_mb][mag_mlv[mag_mb]][mag_efe_mb[mag_mb][mag_mlv[mag_mb]]]=2; mag_efe[mag_mb][mag_mlv[mag_mb]][mag_efe_mb[mag_mb][mag_mlv[mag_mb]]]=1; mag_mb++; mag_name[mag_mb]="格挡"; mag_pre[mag_mb]=1; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=10; mag_pow[mag_mb][mag_mlv[mag_mb]]=1; mag_sig_mb[mag_mb][mag_mlv[mag_mb]]++; mag_sig_list[mag_mb][mag_mlv[mag_mb]][mag_sig_mb[mag_mb][mag_mlv[mag_mb]]]=2; mag_sig[mag_mb][mag_mlv[mag_mb]][mag_sig_mb[mag_mb][mag_mlv[mag_mb]]]=1; mag_mb++; mag_name[mag_mb]="暗伤"; mag_give[mag_mb]=1; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=30; mag_pow[mag_mb][mag_mlv[mag_mb]]=18; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=30; mag_pow[mag_mb][mag_mlv[mag_mb]]=30; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=30; mag_pow[mag_mb][mag_mlv[mag_mb]]=45; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=30; mag_pow[mag_mb][mag_mlv[mag_mb]]=64; mag_mlv[mag_mb]++; mag_time[mag_mb][mag_mlv[mag_mb]]=30; mag_pow[mag_mb][mag_mlv[mag_mb]]=100; }
ll card_mb[3];
ll card[3][MAXN];
ll card_lv[3][MAXN];
ll card_type[3][MAXN];//牌型:0普通牌;1暂存牌;3封印牌
ll card_et[3][MAXN];//是否是诅咒牌 0否 1是
ll pre_card[3][MAXN];//预置牌组 ll seal_card[3][MAXN];//封印牌组 ……已弃用
void build_card(){ for(ll ioixe=0;ioixe<2;ioixe++){ for(ll i=1;i<=10;i++){ card[ioixe][i]=1; card_lv[ioixe][i]=1; card_type[ioixe][i]=0; } for(ll i=11;i<=16;i++){ card[ioixe][i]=2; card_lv[ioixe][i]=1; card_type[ioixe][i]=0; } for(ll i=17;i<=17;i++){ card[ioixe][i]=1; card_lv[ioixe][i]=2; card_type[ioixe][i]=0; } for(ll i=18;i<=20;i++){ card[ioixe][i]=3; card_lv[ioixe][i]=1; card_type[ioixe][i]=2; } }
return;
}
ll get_card_lv(ll w_team,ll number){ ll part_ans=0; part_ans=card_lv[w_team][number]; return part_ans; }
ll get_card_type(ll w_team,ll number){ ll part_ans=0; part_ans=card_lv[w_team][number]; return part_ans; }
ll get_card_et(ll w_team,ll number){ ll part_ans=0; part_ans=card_et[w_team][number]; return part_ans; }
ll get_card_mlv(ll w_team,ll number){ ll part_ans=0; part_ans=mag_mlv[card[w_team][number]]; return part_ans; }
ll get_card_str(ll w_team,ll number){ ll part_ans=0; part_ans=mag_str[card[w_team][number]]; return part_ans; }
ll get_card_qua(ll w_team,ll number){ ll part_ans=0; part_ans=mag_qua[card[w_team][number]]; return part_ans; } ll get_card_pre(ll w_team,ll number){ ll part_ans=0; part_ans=mag_pre[card[w_team][number]]; return part_ans; } ll get_card_time(ll w_team,ll number){ ll part_ans=0; part_ans=mag_time[card[w_team][number]][get_card_lv(w_team,number)]; return part_ans; }
ll get_card_pow(ll w_team,ll number){ ll part_ans=0; part_ans=mag_pow[card[w_team][number]][get_card_lv(w_team,number)]; return part_ans; }
ll get_card_give(ll w_team,ll number){ ll part_ans=0; part_ans=mag_give[card[w_team][number]]; return part_ans; }
ll get_card_out(ll w_team,ll number){ ll part_ans=0; part_ans=mag_out[card[w_team][number]]; return part_ans; }
ll get_card_cd(ll w_team,ll number){ ll part_ans=0; part_ans=mag_cd[card[w_team][number]][get_card_lv(w_team,number)]; return part_ans; }
ll get_card_Et(ll w_team,ll number){ ll part_ans=0; part_ans=mag_et[card[w_team][number]]; return part_ans; }
ll get_card_pur(ll w_team,ll number){ ll part_ans=0; part_ans=mag_pur[card[w_team][number]]; return part_ans; }
ll get_card_choice(ll w_team,ll number){ ll part_ans=0; part_ans=mag_choice[card[w_team][number]]; return part_ans; }
ll get_card_sig_list(ll w_team,ll number,ll list_num){ ll part_ans=0; part_ans=mag_sig_list[card[w_team][number]][card_lv[w_team][number]][list_num]; return part_ans; }
ll gat_card_sig(ll w_team,ll number,ll list_num){ ll part_ans=0; part_ans=mag_sig_list[card[w_team][number]][card_lv[w_team][number]][list_num]; return part_ans; }
ll get_card_efe_list(ll w_team,ll number,ll list_num){ ll part_ans=0; part_ans=mag_efe_list[card[w_team][number]][card_lv[w_team][number]][list_num]; return part_ans; }
ll gat_card_efe(ll w_team,ll number,ll list_num){ ll part_ans=0; part_ans=mag_efe_list[card[w_team][number]][card_lv[w_team][number]][list_num]; return part_ans; }
void change_ima(ll w_team,ll number,ll amount,ll wh_pvp/是否是PVP战斗模式中,一般默认是/){ ima[w_team][number]+=amount; if(ima_qua[number]<5){ if(ima_qua[number]==0) change_colour(3); if(ima_qua[number]==1) change_colour(6); if(ima_qua[number]==2) change_colour(7); if(ima_qua[number]==3) change_colour(1); if(ima_qua[number]4) change_colour(5); if(wh_pvp0){ if(amount>0) cout << "恭喜你获得了" << amount << "个" << ima_name[number] << "【" << qua_name[ima_qua[number]] << "】!\n"; if(amount<0) cout << "你失去了" << -amount << "个" << ima_name[number] << "【" << qua_name[ima_qua[number]] << "】!\n"; } else{ if(amount>0) cout << w_team << "号玩家获得了" << amount << "个" << ima_name[number] << "【" << qua_name[ima_qua[number]] << "】!\n"; if(amount<0) cout << w_team << "号玩家失去了" << -amount << "个" << ima_name[number] << "【" << qua_name[ima_qua[number]] << "】!\n"; } change_colour(8); } return; }
void change_hp(ll w_team,ll w_member,ll amount){ team_hp[w_team][w_member]+=amount; if(amount>0) change_colour(4),cout << w_team << "号玩家增加了" << amount << "点血量!\n",change_colour(8); if(amount<0) change_colour(1),cout << w_team << "号玩家减少了" << -amount << "点血量!\n",change_colour(8); return; }
void hurt(/pur即目标数据/ll pur_team,ll pur_num,ll amount,ll harm_att,/ori即伤害来源数据/ll ori_team,ll ori_num){
return;
}
void print_team(ll w_team/0(NoHuman) or 1 or 2/){
return;
}
ll beat(ll beat_type/战斗类型 1/2: team1/2 vs NoHuman 0: team1 vs team2/){ ll p[3]; ll ans=0,turn=1; p[1]=beat_type,p[2]=0; if(p[1]==0){ p[1]=1,p[2]=2; }
while(true){
if(p[turn]==0){
}
else{
while(true){
print_team(p[turn]);
}
}
turn=turn%2+1;
}
return ans;
}
int main(){ build_sig(); build_dam_att(); build_ski(); build_ani(); build_efe(); build_mag(); build_card(); cin >> in; return 0; }