经过一点点的努力,我把之前写的代码改精炼了些,然后也改了些内容,应该比以前要好玩些了
更新内容
去掉职业大乱斗(因为你打不到人)
改模式选择为规则调整
更改岩浆下降速度(更刺激了)
改为双视角同人物(一号在左边为空心圆 二号在右边为实心圆)
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <cctype>
#include <string>
#include <vector>
#include <conio.h>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <iostream>
#include <algorithm>
#include <windows.h>
using namespace std; //不要在意头文件
const int M = 15, N = 105;
int mapp[N][M];
string s[M] = {
"" , "冰冻状态" , "混淆状态" , "黑暗状态" };
int num;
bool rule_attact , rule_poison , rule_lava;
int lava_position , lava_down_time;
struct player {
bool on;
int x , y;
int if_jump;
int effect[M];
int numm;
int direction;
int affect;
int st , timee;
bool survive;
}a[M];
void map_reset () {
lava_position = -5;
lava_down_time = 0;
num = 1;
for ( int i = 1 ; i <= 100 ; i += 3 ) {
for ( int j = 1 ; j <= 10 ; j ++ ) mapp[i][j] = 1;
mapp[i + 1][1] = mapp[i + 1][10] = mapp[i + 2][1] = mapp[i + 2][10] = 1;
mapp[i][rand () % 8 + 2] = 0;
}
for ( int j = 1 ; j <= 10 ; j ++ ) {
mapp[100][j] = 1;
}
}
void player_reset () {
a[1].x = a[2].x = 3;
a[1].y = a[2].y = 2;
a[1].if_jump = a[2].if_jump = 0;
a[1].direction = a[2].direction = 1;
a[1].affect = a[2].affect = 0;
a[1].numm = a[2].numm = 0;
a[1].st = a[2].st = 0;
a[2].on = false;
a[1].survive = a[2].survive = true;
}
void put_map () {
for ( int i = -3 ; i <= 3 ; i ++ ) {
for ( int j = 1 ; j <= 10 ; j ++ ) {
if ( i == 0 && j == a[1].y ) printf ( "○" );
else if ( a[1].x + i <= lava_position ) printf ( "▓" );
else if ( a[1].effect[3] > clock () ) printf("**");
else if ( a[1].x + i == a[2].x && j == a[2].y && a[2].on ) printf ( "●" );
else if ( mapp[a[1].x + i][j] == 1 ) printf (<