规则详见1.0
更新内容
新增模式「职业大乱斗」
当你面前有人时,可以将其击飞(定义前面为上一个动作的方向)
#include <windows.h>
#include <conio.h>
#include <bits/stdc++.h>
struct player{
int x;
int y;
int ice_time;
int wrong_time;
int blind_time;
int repelled;
int mine;
bool life;
int job;
int dir;
int speed_time;
}a[5];
char map[201][11];
void put(char*p);
void put_map() {
for(int i = -5; i <= 4; i ++) {
for(int j = 1; j <= 10; j ++) {
if(i == 0 && j == a[1].y) printf("○");
else if(a[1].x + i == a[2].x && j == a[2].y) printf("●");
else if(map[a[1].x + i][j] == 0) printf(" ");
else if(map[a[1].x + i][j] == 1) printf("■");
else if(map[a[1].x + i][j] == 2) printf("▓");
}
printf(" ");
for(int j = 1; j <= 10; j ++) {
if(i == 0 && j == a[2].y) printf("○");
else if(a[2].x + i == a[1].x && j == a[1].y) printf("●");
else if(map[a[2].x + i][j] == 0) printf(" ");
else if(map[a[2].x + i][j] == 1) printf("■");
else if(map[a[2].x + i][j] == 2) printf("▓");
}
puts("");
}
printf("玩家一 ");
if(a[1].ice_time > clock() && a[1].wrong_time < clock()) {
printf("冰冻状态 ");
}
else if(a[1].wrong_time > clock() && a[1].ice_time < clock()) {
printf("混乱状态 ");
}
else if(a[1].wrong_time > clock()) {
printf("混乱状态 冰冻状态");
}
else printf("正常状态 ");
printf(" 玩家二 ");
if(a[2].ice_time > clock() && a[2].wrong_time < clock()) {
printf("冰冻状态 ");
}
else if(a[2].wrong_time > clock() && a[2].ice_time < clock()) {
printf("混乱状态 ");
}
else if(a[2].wrong_time > clock()) {
printf("混乱状态 冰冻状态");
}
else printf("正常状态 ");
puts("");
printf("技能点:%2d 技能点:%2d", a[1].mine, a[2].mine);
}
void game_one() {
srand(unsigned(time(0)));
for(int i = 1; i <= 200; i += 3) {
map[i][1] = 1;
map[i][10] = 1;
for(int j = 2; j <= 9; j ++) {
map[i][j] = 1;
}
if(i != 1) {
map[i - 1][1] = 1;
map[i - 1][10] = 1;
map[i - 2][1] = 1;
map[i - 2][10] = 1;
for(int j = i - 2; j <= i - 1; j ++) {
for(int k = 2; k <= 9; k ++) {
map[j][k] = 0;
}
}
int index = rand() % 7 + 2;
map[i][index] = 0;
map[i][index + 1] = 0;
}
}
for(int i = 1; i <= 10; i ++) {
map[200][i] = 1;
}
a[1].x = 2;
a[1].y = 2;
a[2].x = 2;
a[2].y = 2;
a[1].ice_time = 0;
a[1].wrong_time = 0;
a[2].ice_time = 0;
a[2].wrong_time = 0;
a[1].mine = 0;
a[1].mine = 0;
while(a[1].x <= 198 && a[2].x <= 198) {
if(kbhit()) {
char c = getch();
if(c == -32) {
c = getch();
if(a[1].ice_time > clock()) {
;
}
else if(a[1].wrong_time > clock()) {
srand(unsigned(time(0)));
int s = rand() % 2;
if(s == 0 && map[a[1].x][a[1].y - 1] != 1) -- a[1].y;
else if(map[a[1].x][a[1].y + 1] != 1) ++ a[1].y;
}
else if(c == 75 && map[a[1].x][a[1].y - 1] != 1) {
-- a[1].y;
}
else if(c == 77 && map[a[1].x][a[1].y + 1] != 1) {
++ a[1].y;
}
else if(c == 72 && a[1].x % 3 == 0) {
a[1].x -= 2;
}
}
if(c == 'a' || c == 'w' || c == 'd') {
if(a[2].ice_time > clock()) {
;
}
else if(a[2].wrong_time > clock()) {
srand(unsigned(time(0)));
int s = rand() % 2;
if(s == 0 && map[a[2].x][a[2].y - 1] != 1) -- a[2].y;
else if(map[a[2].x][a[2].y + 1] != 1) ++ a[2].y;
}
else if(c == 'a' && map[a[2].x][a[2].y - 1] != 1) {
-- a[2].y;
}
else if(c == 'd' && map[a[2].x][a[2].y + 1] != 1) {
++ a[2].y;
}
else if(c == 'w' && a[2].x % 3 == 0) {
a[2].x -= 2;
}
}
if(c == '0' && a[1].mine >= 1) {
-- a[1].mine;
map[a[1].x + 1][a[1].y] = 0;
}
if(c == '.' && a[1].mine >= 1) {
-- a[1]