代码拉取完成,页面将自动刷新
#include "output.cpp"
#include "AI.cpp"
//给玩家从三个随机buff和回血回蓝中挑一个
//目前只有7个实装buff
void chooseBuff(role& player) {
int buffNum=0;
for(int i=2; i<=9; i++) if((1<<i)&pBuffs) buffNum++;
buffNum=7-buffNum;
int b,c,d;//三个buff选项
if(buffNum>=1) do {
b=random(8)+2;
} while(pBuffs&(1<<b));
if(buffNum>=2)do {
c=random(8)+2;
} while(pBuffs&(1<<c)||c==b);
if(buffNum>=3)do {
d=random(8)+2;
} while(pBuffs&(1<<d)||(d==b||d==c));
string info;
info="选择你的维修项目:\na.回复全部生命值\n";
if(buffNum>=1)info+="b."+SDATA.buffName[1<<b];
if(buffNum>=2)info+="\nc."+SDATA.buffName[1<<c];
if(buffNum>=3)info+="\nd."+SDATA.buffName[1<<d];
info+="\n输入小写字母进行选择";
string result=inputbox("检查点维修",info,"",getwidth()/3,getheight()/3,true);
switch(result[0]) {
case 'b': {
pBuffs|=1<<b;
break;
}
case 'c': {
pBuffs|=1<<c;
break;
}
case 'd': {
pBuffs|=1<<d;
break;
}
default: {
player.life=SDATA.life[PLAYER];
break;
}
}
}
void visitCheckPoint(role& player) {
//遇到检查点的所有动作
chooseBuff(player);
checkpointNum++;
for(int i=PLANET;i<=GOD;i++) SDATA.maxNum[i]*=1.5;
}
inline void addPlane() {
role t_r;
int num[END];
int type;
float x, y;
for ( int i = 0; i < END; i++ ) {
num[i] = 0;
}
/* 统计场景中飞机的数量 */
for ( int i = 0; i < roles.size(); i++ ) {
t_r = roles[i];
num[t_r.type]++;
}
/* 添加飞机 */
t_r.blasting = false;
t_r.blaststep = 0;
t_r.bulletC = 0;
type = BIGPURPLE;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type];
roles.push_back( t_r );
num[type]++;
}
type = MIDBLUE;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type];
roles.push_back( t_r );
num[type]++;
}
type = SMALLGREEN;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type];
roles.push_back( t_r );
num[type]++;
}
type = NOYA;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
roles.push_back( t_r );
num[type]++;
}
/* 添加行星 */
type = PLANET;
//刷一个就够了
while ( num[type] < min(SDATA.maxNum[type],1.0f) ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, HR );
t_r.R = random( SDATA.width[type] - SDATA.height[type] ) + SDATA.height[type];
t_r.x = pX + x;
t_r.y = pY + y;
t_r.v = 0;
t_r.life = SDATA.life[type] * t_r.R * t_r.R * PI;
roles.push_back( t_r );
num[type]++;
}
/* 添加道具 */
type = LOVE;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type];
roles.push_back( t_r );
num[type]++;
}
/* 添加道具 */
type = CLOUD;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type];
roles.push_back( t_r );
num[type]++;
}
/* 添加检查站 */
if(pF>=(checkpointNum+1)*checkpointDist) {
type = CHECKPOINT;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type];
roles.push_back( t_r );
num[type]++;
addInfo( "发现维修站!" );
}
}
/* 添加boss */
type = PROCER;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type] * 10;
roles.push_back( t_r );
num[type]++;
}
type = BASER;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type] * 10;
roles.push_back( t_r );
num[type]++;
}
type = RUINER;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type] * 10;
roles.push_back( t_r );
num[type]++;
}
type = SPEEDER;
while ( num[type] < SDATA.maxNum[type] ) {
t_r.type = type;
J2DtoS2D( x, y, random( 360 ) * PI / 180, random( max( getwidth(), getheight() ) ) + max( getwidth(), getheight() ) );
t_r.x = pX + x;
t_r.y = pY + y;
t_r.r = random( 360 ) * PI / 180;
t_r.life = SDATA.life[type] * 10;
roles.push_back( t_r );
num[type]++;
}
}
inline void deleteRoles() {
role t_r;
vector<role> s_r;
/* 剔除过远的飞机 */
for ( int i = 0; i < roles.size(); i++ ) {
t_r = roles[i];
if ( ( t_r.x - pX ) * ( t_r.x - pX ) + ( t_r.y - pY ) * ( t_r.y - pY ) <= HR * HR ) {
s_r.push_back( t_r );
}
}
roles = s_r;
s_r.clear();
/* 剔除死亡的飞机 */
for ( int i = 0; i < roles.size(); i++ ) {
t_r = roles[i];
if ( !t_r.death ) {
s_r.push_back( t_r );
}
}
roles = s_r;
s_r.clear();
}
inline void runRoles( role player ) {
addPlane();
/* 使飞机运动 */
if ( !player.clearing ) {
for ( role & tr : roles ) {
if(tr.type==CHECKPOINT) continue;
if ( tr.type == NOYA )
AI3( tr, player );
else AI2( tr, player );
}
}
}
/* 绘制角色 */
inline void drawRoles( role player, bool onlyPlayer = 0 ) {
role t_r;
int dx, dy;
dx = getwidth() / 2;
dy = getheight() / 2;
switch ( player.type ) {
case RUINER: {
putimage_rotate( SDATA.tranImg, SDATA.ruiner, dx, dy, 0.5, 0.5, pR );
for ( gun & g : guns ) {
g.setPos( player );
g.autoPro( player );
if ( g.state ) {
putimage_rotate( SDATA.tranImg, SDATA.gun_on, g.x - pX + getwidth() / 2, g.y - pY + getheight() / 2, 0.5, 0.5, g.r );
} else {
putimage_rotate( SDATA.tranImg, SDATA.gun_off, g.x - pX + getwidth() / 2, g.y - pY + getheight() / 2, 0.5, 0.5, g.r );
}
}
break;
}
case BASER: {
putimage_rotate( SDATA.tranImg, SDATA.baser, dx, dy, 0.5, 0.5, pR );
break;
}
case PROCER: {
putimage_rotate( SDATA.tranImg, SDATA.procer, dx, dy, 0.5, 0.5, pR );
break;
}
case SPEEDER: {
putimage_rotate( SDATA.tranImg, SDATA.speeder, dx, dy, 0.5, 0.5, pR );
break;
}
case GOD: {
putimage_rotate( SDATA.tranImg, SDATA.baser, dx, dy, 0.5, 0.5, pR );
break;
}
case SMALLGREEN: {
putimage_rotate( SDATA.tranImg, SDATA.smallGreen, dx, dy, 0.5, 0.5, pR );
break;
}
case MIDBLUE: {
putimage_rotate( SDATA.tranImg, SDATA.midBlue, dx, dy, 0.5, 0.5, pR );
break;
}
case BIGPURPLE: {
putimage_rotate( SDATA.tranImg, SDATA.bigPurple, dx, dy, 0.5, 0.5, pR );
break;
}
case NOYA: {
putimage_rotate( SDATA.tranImg, SDATA.noya, dx, dy, 0.5, 0.5, pR );
break;
}
case LIGHTER: {
putimage_rotate( SDATA.tranImg, SDATA.lighter, dx, dy, 0.5, 0.5, pR );
break;
}
case STARD: {
putimage_rotate( SDATA.tranImg, SDATA.stard, dx, dy, 0.5, 0.5, pR );
break;
}
}
if ( onlyPlayer )
return;
for ( int i = 0; i < roles.size(); i++ ) {
t_r = roles[i];
dx = t_r.x - pX + getwidth() / 2;
dy = t_r.y - pY + getheight() / 2;
if ( (dx - SDATA.cR[t_r.type] > getwidth() || dx + SDATA.cR[t_r.type] < 0 || dy - SDATA.cR[t_r.type] > getheight() || dy + SDATA.cR[t_r.type] < 0) && t_r.type != PLANET )
continue;
if ( (dx - t_r.R*2.5 > getwidth() || dx + t_r.R*2.5 < 0 || dy - t_r.R*2.5 > getheight() || dy + t_r.R*2.5 < 0) && t_r.type == PLANET )
continue;
switch ( roles[i].type ) {
case BIGPURPLE: {
putimage_rotate( SDATA.tranImg, SDATA.bigPurple, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case MIDBLUE: {
putimage_rotate( SDATA.tranImg, SDATA.midBlue, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case SMALLGREEN: {
putimage_rotate( SDATA.tranImg, SDATA.smallGreen, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case PLANET: {
//日冕
setcolor( EGERGBA( 255, 255, 0 ,255) );
setfillcolor( EGERGBA( 255, 255, 0 ,255) );
float randW=t_r.R*(1.0+randomf()*0.1);
float randH=t_r.R*(1.0+randomf()*0.1);
ege_fillellipse(t_r.x - pX+getwidth() / 2 - randW,t_r.y + getheight() / 2 - pY-randH,randW*2,randH*2);
//本体
setcolor( EGERGBA( 255, 51, 0 ,255) );
setfillcolor( EGERGBA( 255, 51, 0 ,255) );
ege_fillellipse(t_r.x + getwidth() / 2 - pX-t_r.R,t_r.y + getheight() / 2 - pY-t_r.R,t_r.R*2,t_r.R*2);
//引力环
setcolor( EGERGBA( 0, 255, 255 ,255) );
randW=t_r.R*2.5;
randH=t_r.R*2.5;
ege_ellipse(t_r.x - pX+getwidth() / 2 - randW,t_r.y + getheight() / 2 - pY-randH,randW*2,randH*2);
//fillellipse( t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, t_r.R, t_r.R, SDATA.tranImg );
break;
}
case CHECKPOINT: {
//画成一个带核圈就好了
float randW=SDATA.width[CHECKPOINT];
float randH=SDATA.height[CHECKPOINT];
//本体
setcolor( EGERGBA( 0, 204, 255 ,255) );
setfillcolor( EGERGBA( 0, 204, 255 ,255) );
ege_fillellipse(t_r.x + getwidth() / 2 - pX-randW/6,t_r.y + getheight() / 2 - pY-randH/6,randW/3,randH/3);
//环
setcolor( EGERGBA( 0, 255, 00 ,255) );
ege_ellipse(t_r.x - pX+getwidth() / 2 - randW/2,t_r.y + getheight() / 2 - pY-randH/2,randW,randH);
break;
}
case LOVE: {
putimage_rotate( SDATA.tranImg, SDATA.love, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case PROCER: {
putimage_rotate( SDATA.tranImg, SDATA.procer, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case BASER: {
putimage_rotate( SDATA.tranImg, SDATA.baser, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case RUINER: {
putimage_rotate( SDATA.tranImg, SDATA.ruiner, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case SPEEDER: {
putimage_rotate( SDATA.tranImg, SDATA.speeder, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case NOYA: {
putimage_rotate( SDATA.tranImg, SDATA.noya, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
case CLOUD: {
putimage_rotate( SDATA.tranImg, SDATA.cloud, t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, 0.5, 0.5, t_r.r );
break;
}
}
}
}
inline void runBullets() {
vector<bullet> s_b;
for ( bullet & t_b : bullets ) {
if ( (t_b.x - pX) * (t_b.x - pX) + (t_b.y - pY) * (t_b.y - pY) <= HR * HR ) {
t_b.x += t_b.dX;
t_b.y += t_b.dY;
s_b.push_back( t_b );
}
}
bullets = s_b;
}
inline void drawBullets() {
setfillcolor( RED, SDATA.tranImg );
bullet t_b;
for ( int i = 0; i < bullets.size(); i++ ) {
t_b = bullets[i];
if ( t_b.x + getwidth() / 2 - pX < 0 || t_b.x + getwidth() / 2 - pX > getwidth() || t_b.y + getheight() / 2 - pY < 0 || t_b.y + getheight() / 2 - pY > getheight() )
continue;
t_b.draw();
}
}
inline void hColl( role & player ) {
int uint;
/* 机体&子弹的碰撞 */
float r;
for ( role & t_r : roles ) {
if ( t_r.type == PLANET || t_r.type==CLOUD ||t_r.type==CHECKPOINT)
continue;
for ( bullet & t_b : bullets ) {
if ( t_b.type == GOOD_BULLET ) {
//处理强化子弹
if ( isIntersect( t_r.x, t_r.y, SDATA.cR[t_r.type], t_b.x, t_b.y, SDATA.cR[GOOD_BULLET]*POWERFULBLTS_SCALE ) != 0 ) {
if ( t_r.type == LOVE ) {
player.life += t_r.life;
if ( player.mV )
player.hE += t_r.life;
t_r.x = pX + HR + 1;
t_r.y = 0;
MSYS.save();
continue;
} else {
float damage=t_b.life*POWERFULBLTS_SCALE - SDATA.pro[t_r.type];
if(pBuffs&POWERFULLBLTS) damage*=POWERFULBLTS_SCALE;
if(pBuffs&HURTFORPOWER) damage*=(1.0-1.0*player.life/SDATA.life[PLAYER])*HURTFORPOWER_SCALE;
damage-=SDATA.pro[t_r.type];
t_r.life -= damage;
t_b.x = t_b.y = max( pX, pY ) + max( getheight(), getwidth() ) * 2;
if ( bGrade + 0.4 < 8 )
bGrade += 0.4;
else bGrade = 8;
}
}
}
}
if ( t_r.life <= 0 && !t_r.blasting ) {
t_r.life = 0;
if ( !player.protecting && !player.mV && !player.clearing ) {
if(pBuffs&buffstype::DRINKENERGY) player.energy += random( SDATA.life[t_r.type] / 2 )*DRINKENERGY_SCALE;
else player.energy += random( SDATA.life[t_r.type] / 2 );
}
if(pBuffs&buffstype::DRINKBLOOD) player.life+=SDATA.life[t_r.type]*HURTFORENERGY_SCALE;
t_r.blasting = 1;
if ( t_r.type == RUINER || t_r.type == SPEEDER || t_r.type == PROCER || t_r.type == BASER ) {
addInfo( "击落×100" );
pF += 100;
} else {
pF++;
addInfo( "击落×1" );
}
MSYS.blast();
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 4 + BR / 4, 15, 40, 1, 5, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 3 + BR / 3, 5, 30, 1, 4, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
}
}
float qz = (float) player.energy / MAXE * (BR);
float x1, y1, x2, y2;
REJUDGE:
if ( !player.protecting ) {
/* 玩家&子弹碰撞 */
for ( bullet & t_b : bullets ) {
if ( t_b.type == BAD_BULLET ) {
if ( player.type == RUINER )
t_b.life = (float) t_b.life * (1.0 - guns.size()*0.5 / 10.0);//ruiner的减伤
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_b.x, t_b.y, SDATA.cR[BAD_BULLET] ) != 0 ) {
float damage=t_b.life - SDATA.pro[PLAYER];
if(pBuffs&buffstype::HURTFORENERGY) player.energy+=damage*HURTFORENERGY_SCALE;
player.life -= damage;
t_b.x = t_b.y = max( pX, pY ) + max( getheight(), getwidth() ) * 2;
//处理护盾加强buff
if(pBuffs&buffstype::SHEILD) {
vector<bullet> bt;
for(int i=bullets.size(); i>0; i--) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER]*SHEILD_SCALE, bullets[i].x, bullets[i].y, SDATA.cR[BAD_BULLET] ) == 0 )
bt.push_back(bullets[i]);
}
bullets=bt;
goto REJUDGE;
}
MSYS.hit();
setcolor( RED );
circle( getwidth() / 2, getheight() / 2, SDATA.cR[PLAYER] / 4 * 5 );
bGrade = 1;
}
}
}
/* 玩家&机体碰撞 */
for ( role & t_r : roles ) {
if ( t_r.type == PLANET || t_r.type==CLOUD)
continue;
if ( t_r.type == LOVE ) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, SDATA.cR[t_r.type] ) != 0 ) {
player.life += t_r.life;
if ( player.mV )
player.hE += t_r.life;
MSYS.save();
t_r.x = pX + HR + 1;
t_r.y = 0;
}
continue;
}
if(t_r.type==CHECKPOINT) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, SDATA.cR[t_r.type] ) != 0 &&!t_r.blasting) {
visitCheckPoint(player);
t_r.blasting=1;
}
continue;
}
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, SDATA.cR[t_r.type] ) != 0 ) {
calcIntersect( pR, player.v, t_r.r, t_r.v, x1, y1, x2, y2 );
player.x += x1;
player.y += y1;
t_r.x += x2;
t_r.y += y2;
if ( player.type == RUINER )
t_r.life = (float) t_r.life * (1.0 - guns.size()*0.5 / 10.0);
//uint = player.life;
float damage=min(t_r.life,player.life);
player.life -= damage;//min( t_r.life, uint );
t_r.life -= damage;//min( t_r.life, uint );
if(pBuffs&buffstype::HURTFORENERGY) player.energy+=damage*HURTFORENERGY_SCALE;
if ( t_r.life <= 0 && !t_r.blasting ) {
t_r.life = 0;
MSYS.blast();
t_r.blasting = 1;
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 4 + BR / 4, 15, 40, 1, 5, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 3 + BR / 3, 5, 30, 1, 4, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
if ( t_r.type == RUINER || t_r.type == SPEEDER || t_r.type == PROCER || t_r.type == BASER ) {
pF += 100;
addInfo( "击毁×100" );
} else {
pF++;
addInfo( "击毁×1" );
}
//处理护盾加强buff
if(pBuffs&buffstype::SHEILD) {
vector<bullet> bt;
for(int i=bullets.size(); i>0; i--) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER]*SHEILD_SCALE, bullets[i].x, bullets[i].y, SDATA.cR[BAD_BULLET] ) == 0 )
bt.push_back(bullets[i]);
}
bullets=bt;
}
//受击反应
MSYS.hit();
setfillcolor( RED );
circle( getwidth() / 2, getheight() / 2, SDATA.cR[PLAYER] / 4 * 5 );
p_target.fall[t_r.type]++;
bGrade = 1;
}
if ( player.mV && !t_r.blasting ) {
t_r.blasting = 1;
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 4 + BR / 4, 15, 40, 1, 5, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 3 + BR / 3, 5, 30, 1, 4, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
if ( t_r.type == RUINER || t_r.type == SPEEDER || t_r.type == PROCER || t_r.type == BASER ) {
pF += 100;
addInfo( "击毁×100" );
} else {
pF++;
addInfo( "击毁×1" );
}
MSYS.hit();
setcolor( RED );
circle( getwidth() / 2, getheight() / 2, SDATA.cR[PLAYER] / 4 * 5 );
p_target.fall[t_r.type]++;
}
if ( player.energy <= 0 )
break;
}
}
} else {
/* 护盾与子弹的碰撞 */
for ( bullet & t_b : bullets ) {
if ( t_b.type == BAD_BULLET ) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_b.x, t_b.y, 1 ) != 0 ) {
/* 受伤判定:护盾为机体承受0.9的伤害 */
if ( player.type == RUINER )
t_b.life = (float) t_b.life * (1.0 - guns.size() / 10);
player.energy -= (float) t_b.life * 0.9;
player.life -= (float) t_b.life * 0.1 - SDATA.pro[PLAYER];
t_b.x = t_b.y = max( pX, pY ) + max( getheight(), getwidth() ) * 2;
}
}
}
/* 护盾&机体碰撞 */
for ( role & t_r : roles ) {
if ( t_r.type == PLANET || t_r.type==CLOUD)
continue;
if ( t_r.type == LOVE ) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, SDATA.cR[t_r.type] ) != 0 ) {
player.life += t_r.life;
MSYS.save();
t_r.x = pX + HR + 1;
t_r.y = 0;
}
continue;
}
if(t_r.type==CHECKPOINT) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, SDATA.cR[t_r.type] ) != 0 &&!t_r.blasting) {
visitCheckPoint(player);
t_r.blasting=1;
}
continue;
}
if ( isIntersect( pX, pY, SDATA.cR[PLAYER] + BR - qz, t_r.x, t_r.y, SDATA.cR[t_r.type] ) != 0 ) {
if ( player.type == RUINER )
t_r.life = (float) t_r.life * (1.0 - guns.size() / 10);
uint = player.energy;
player.life -= (float) min( t_r.life, (int) player.energy ) * 0.1;
player.energy -= (float) min( t_r.life, (int) player.energy ) * 0.9;
t_r.life -= min( t_r.life, (int) uint );
if ( t_r.life <= 0 && !t_r.blasting ) {
t_r.life = 0;
MSYS.blast();
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 4 + BR / 4, 15, 40, 1, 5, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 3 + BR / 3, 5, 30, 1, 4, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
t_r.blasting = 1;
if ( t_r.type == RUINER || t_r.type == SPEEDER || t_r.type == PROCER || t_r.type == BASER ) {
pF += 100;
addInfo( "击毁×100" );
} else {
pF++;
addInfo( "击毁×1" );
}
p_target.fall[t_r.type]++;
}
if ( player.energy <= 0 )
break;
}
}
}
/* 行星碰撞 */
vector<role> planets;
vector<role> v_r;
/* 创建行星列表 */
for ( role & t_r : roles ) {
if ( t_r.type == PLANET ) {
planets.push_back( t_r );
} else {
v_r.push_back( t_r );
}
}
roles = v_r;
v_r.clear();
/*
* 处理行星引力圈G=6.67×10^-11 N·㎡
* 默认飞机密度8000kg*m^-3
* F=G*M1*M2/(R*R)
*/
/* 处理行星引力 */
float x, y, dx, dy;
if ( player.clearing )
return;
int ar;
double au;
for ( role & t_r : planets ) {
for ( role & tr : roles ) {
if(tr.type==CHECKPOINT) continue;
if ( isIntersect( tr.x, tr.y, SDATA.cR[tr.type], t_r.x, t_r.y, t_r.R*2.5 ) == 0 ) continue;
ar = calcR( t_r.x - tr.x + pX, t_r.y - tr.y + pY );
J2DtoS2D( x, y, ar + PI, getG( t_r.x, t_r.y, t_r.R, 5000, tr.x, tr.y, SDATA.cR[tr.type], 8000, SDATA.cR[SMALLGREEN] ) );
if ( PIL( 0, 0, x, y, t_r.x - tr.x, t_r.y - tr.y ) ) {
tr.x = t_r.x;
tr.y = t_r.y;
} else {
tr.x += x;
tr.y += y;
}
}
for ( bullet & tb : bullets ) {
if ( isIntersect( t_r.x, t_r.y, t_r.R*2.5, tb.x, tb.y, 1 ) == 0 ) continue;
ar = calcR( t_r.x - tb.x + pX, t_r.y - tb.y + pY );
J2DtoS2D( x, y, ar + PI, getG( t_r.x, t_r.y, t_r.R, 5000, tb.x, tb.y, 1, 8000, SDATA.cR[SMALLGREEN] ) );
tb.x += x;
tb.y += y;
}
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, t_r.R*2.5 ) != 0 ) {
ar = calcR( t_r.x, t_r.y );
J2DtoS2D( x, y, ar + PI, getG( t_r.x, t_r.y, t_r.R, 5000, pX, pY, SDATA.cR[PLAYER], 8000, SDATA.cR[SMALLGREEN] ) );
if ( PIL( 0, 0, x, y, t_r.x - pX, t_r.y - pY ) ) {
player.x = t_r.x;
player.y = t_r.y;
} else {
player.x += x;
player.y += y;
}
pX = player.x;
pY = player.y;
}
}
/* 行星&子弹碰撞 */
for ( role & t_r : planets ) {
for ( bullet & t_b : bullets ) {
if ( isIntersect( t_r.x, t_r.y, t_r.R, t_b.x, t_b.y, 1 ) != 0 ) {
t_r.life -= t_b.life;
t_b.x = t_b.y = max( pX, pY ) + max( getheight(), getwidth() ) * 2;
}
}
if ( t_r.life <= 0 && !t_r.blasting ) {
t_r.life = 0;
t_r.blasting = 1;
pF += 5;
addInfo( "一颗星球已被摧毁" );
MSYS.blast();
}
}
/* 行星与机体的碰撞 */
for ( role & t_r : planets ) {
for ( role & tr : roles ) {
if ( isIntersect( tr.x, tr.y, SDATA.cR[tr.type], t_r.x, t_r.y, t_r.R ) != 0 ) {
uint = t_r.life;
t_r.life -= min( t_r.life, tr.life );
tr.life -= min( uint, tr.life );
if ( tr.life <= 0 && !tr.blasting ) {
tr.life = 0;
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 4 + BR / 4, 15, 40, 1, 5, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 3 + BR / 3, 5, 30, 1, 4, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
pF++;
tr.blasting = 1;
MSYS.blast();
p_target.fall[t_r.type]++;
}
}
}
if ( t_r.life <= 0 && !t_r.blasting ) {
t_r.life = 0;
t_r.blasting = 1;
MSYS.blast();
//pF += 100;
pF += 5;
addInfo( "一颗星球已被摧毁" );
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, t_r.R / 4 + BR / 4, 75, 200, 5, 25, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, t_r.R / 3 + BR / 3, 25, 150, 5, 20, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
p_target.fall[t_r.type]++;
}
}
/* 行星与玩家的碰撞 */
for ( role & t_r : planets ) {
if ( isIntersect( pX, pY, SDATA.cR[PLAYER], t_r.x, t_r.y, t_r.R ) != 0 ) {
uint = t_r.life;
t_r.life -= min( t_r.life, player.life );
player.life -= min( uint, player.life );
}
if ( t_r.life <= 0 && !t_r.blasting ) {
t_r.life = 0;
MSYS.blast();
t_r.blasting = 1;
pF += 100;
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, t_r.R / 4 + BR / 4, 75, 200, 5, 25, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, t_r.R / 3 + BR / 3, 25, 150, 5, 20, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
p_target.fall[t_r.type]++;
}
if ( player.mV && !t_r.blasting ) {
t_r.blasting = 1;
pF += 100;
summonGrains( 100, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 4 + BR / 4, 75, 200, 1, 5, 0, false, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, t_r.x, t_r.y, 0, 2 * PI, 0, SDATA.cR[t_r.type] / 3 + BR / 3, 25, 150, 1, 4, 0, false, EGECOLORA( LIGHTGRAY, 127 ) );
p_target.fall[t_r.type]++;
}
}
for ( role & t_r : planets ) {
roles.push_back( t_r );
}
planets.clear();
if ( !player.mV ) {
if ( player.life <= 0 && !player.blasting ) {
player.life = 0;
player.blasting = 1;
MSYS.blast();
summonGrains( 100, pX, pY, 0, 2 * PI, 0, SDATA.cR[PLAYER] / 4 + BR / 4, 15, 40, 1, BT, 127, true, EGECOLORA( WHITE, 127 ) );
summonGrains( 150, pX, pY, 0, 2 * PI, 0, SDATA.cR[PLAYER] / 3 + BR / 3, 5, 30, 1, BT, 127, true, EGECOLORA( LIGHTGRAY, 127 ) );
}
} else {
player.life = player.hE;
}
} /* 碰撞处理 */
/* 处理&绘制爆炸 */
inline void hBlast(role& player) {
for ( role & t_r : roles ) {
if ( t_r.blasting ) {
if ( t_r.type != PLANET ) {
if ( t_r.blaststep >= SDATA.cR[t_r.type] + BR ) {
for ( role & tr : roles ) {
if(isIntersect(tr.x,tr.y,SDATA.cR[tr.type],t_r.x,t_r.y,SDATA.cR[t_r.type] + BR)) {
tr.life -= SDATA.life[tr.type] / 2;
}
}
t_r.death = true;
} else {
t_r.blaststep += (SDATA.cR[t_r.type] + BR) / BT;
setfillcolor( WHITE, SDATA.bImg );
setcolor( WHITE, SDATA.bImg );
fillellipse( t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, t_r.blaststep + SDATA.cR[t_r.type] + BR, t_r.blaststep + SDATA.cR[t_r.type] + BR, SDATA.bImg );
setfillcolor( tranColor, SDATA.bImg );
setcolor( tranColor, SDATA.bImg );
fillellipse( t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, t_r.blaststep * 2, t_r.blaststep * 2, SDATA.bImg );
putimage_transparent( SDATA.tranImg, SDATA.bImg, 0, 0, tranColor, 0, 0, 0, 0 );
}
} else {
if ( t_r.blaststep >= t_r.R +BR * 10 ) {
for ( role & tr : roles ) {
if(isIntersect(tr.x,tr.y,SDATA.cR[tr.type],t_r.x,t_r.y,tr.R+BR*10)) {
tr.life -= SDATA.life[tr.type] * t_r.R * t_r.R * PI / 2;
}
}
t_r.death = true;
} else {
t_r.blaststep += (SDATA.cR[t_r.type] + BR) / BT;
setfillcolor( WHITE, SDATA.bImg );
setcolor( WHITE, SDATA.bImg );
fillellipse( t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, t_r.blaststep + (t_r.R) * 1.5, t_r.blaststep + (t_r.R) * 1.5, SDATA.bImg );
setfillcolor( tranColor, SDATA.bImg );
setcolor( tranColor, SDATA.bImg );
fillellipse( t_r.x - pX + getwidth() / 2, t_r.y - pY + getheight() / 2, t_r.blaststep * 2, t_r.blaststep * 2, SDATA.bImg );
putimage_transparent( SDATA.tranImg, SDATA.bImg, 0, 0, tranColor, 0, 0, 0, 0 );
}
}
}
}
if ( player.blasting ) {
if ( player.blaststep > SDATA.cR[PLAYER] + BR ) {
for ( role & tr : roles ) {
if(isIntersect(tr.x,tr.y,SDATA.cR[tr.type],player.x,player.y,SDATA.cR[PLAYER] + BR)) {
tr.life -= SDATA.life[PLAYER] / 2;
}
}
player.death = true;
} else {
player.blaststep += (SDATA.cR[PLAYER] + BR) / BT;
setfillcolor( EGERGB( 0xEE, 0, 0xEE ), SDATA.bImg );
setcolor( EGERGB( 0xEE, 0, 0xEE ), SDATA.bImg );
fillellipse( player.x - pX + getwidth() / 2, player.y - pY + getheight() / 2, player.blaststep + SDATA.cR[player.type] + BR, player.blaststep + SDATA.cR[player.type] + BR, SDATA.bImg );
setfillcolor( tranColor, SDATA.bImg );
setcolor( tranColor, SDATA.bImg );
fillellipse( player.x - pX + getwidth() / 2, player.y - pY + getheight() / 2, player.blaststep * 2, player.blaststep * 2, SDATA.bImg );
putimage_transparent( SDATA.tranImg, SDATA.bImg, 0, 0, tranColor, 0, 0, 0, 0 );
}
}
}
inline void drawUI( role player ) {
static int paintstep = 0;
/* 绘制血条&能量条 */
int x[] = { getwidth() / 4, getwidth() / 4 * 3, getwidth() / 4, getwidth() / 4 * 3, getwidth() / 4, getwidth() / 4 * 3, getwidth() / 4, getwidth() / 4 * 3 };
int y[] = { getheight() / 32, getheight() / 32, getheight() / 32 * 2, getheight() / 32 * 2, getheight() / 32 * 3, getheight() / 32 * 3, getheight() / 32 * 4, getheight() / 32 * 4 };
setcolor( WHITE );
setfillcolor( EGERGB( 255, 50, 0 ) );
line( x[0], y[0], x[1], y[1] );
line( x[0], y[0], x[2], y[2] );
line( x[1], y[1], x[3], y[3] );
line( x[2], y[2], x[3], y[3] );
bar( x[0] + 1, y[0] + 1, x[0] + (x[3] - x[0]) * player.life / SDATA.life[PLAYER], y[3] );
setfillcolor( 0x8EE5EE );
line( x[4], y[4], x[5], y[5] );
line( x[4], y[4], x[6], y[6] );
line( x[5], y[5], x[7], y[7] );
line( x[6], y[6], x[7], y[7] );
bar( x[4] + 1, y[4] + 1, x[0] + (x[7] - x[4]) * player.energy / MAXE, y[7] );
/* 显示伤害评级 */
setfont( getwidth() / 24, 0, "微软雅黑" );
switch ( (int) bGrade ) {
case 2: {
setcolor( EGERGB( 5, 164, 233 ) );
xyprintf( getwidth() / 4, getheight() / 2, "D" );
break;
}
case 3: {
setcolor( EGERGB( 152, 217, 234 ) );
xyprintf( getwidth() / 4, getheight() / 2, "C" );
break;
}
case 4: {
setcolor( EGERGB( 51, 206, 131 ) );
xyprintf( getwidth() / 4, getheight() / 2, "B" );
break;
}
case 5: {
setcolor( EGERGB( 250, 228, 42 ) );
xyprintf( getwidth() / 4, getheight() / 2, "A" );
break;
}
case 6: {
setcolor( EGERGB( 255, 0, 0 ) );
xyprintf( getwidth() / 4, getheight() / 2, "S" );
break;
}
case 7: {
setcolor( EGERGB( 255, 0, 147 ) );
xyprintf( getwidth() / 4, getheight() / 2, "SS" );
break;
}
case 8: {
setcolor( EGERGB( 177, 0, 215 ) );
xyprintf( getwidth() / 4, getheight() / 2, "SSS" );
break;
}
}
/* 绘制雷达 */
setcolor( GREEN );
setfillcolor( GREEN );
fillellipse( getwidth() / 8, getheight() / 8 * 6, getwidth() / 8, getwidth() / 8 );
setcolor( EGERGB( 0, 200, 0 ) );
circle( getwidth() / 8, getheight() / 8 * 6, getwidth() / 8 / 3 );
circle( getwidth() / 8, getheight() / 8 * 6, getwidth() / 8 / 3 * 2 );
circle( getwidth() / 8, getheight() / 8 * 6, getwidth() / 8 / 3 * 3 );
if ( paintstep >= 10 ) {
for ( role & t_r : roles ) {
if ( t_r.type == LOVE || !isIntersect(t_r.x,t_r.y,SDATA.cR[t_r.type],player.x,player.y,LR )) {
continue;
}
if ( t_r.type == PLANET ) {
setcolor( EGERGB( 0, 250, 0 ) );
setfillcolor( EGERGB( 0, 250, 0 ) );
fillellipse( getwidth() / 8 + (getwidth() * (t_r.x - pX) / 1920) * getwidth() / 8 / LR, getheight() / 8 * 6 + (getwidth() * (t_r.y - pY) / 1920) * getwidth() / 8 / LR, (getwidth() * t_r.R / 1920) * getwidth() / 8 / LR, (getwidth() * t_r.R / 1920) * getwidth() / 8 / LR );
continue;
}
if ( t_r.type == RUINER || t_r.type == BASER || t_r.type == PROCER ) {
drawWay( getwidth() / 8 + (getwidth() * (t_r.x - pX) / 1920) * getwidth() / 8 / LR, getheight() / 8 * 6 + (getwidth() * (t_r.y - pY) / 1920) * getwidth() / 8 / LR, t_r.r, EGERGB( 127, 0, 127 ) );
continue;
}
if(t_r.type==CHECKPOINT) {
drawCross( getwidth() / 8 + (getwidth() * (t_r.x - pX) / 1920) * getwidth() / 8 / LR, getheight() / 8 * 6 + (getwidth() * (t_r.y - pY) / 1920) * getwidth() / 8 / LR,EGERGB(0,204,255));
continue;
}
drawWay( getwidth() / 8 + (getwidth() * (t_r.x - pX) / 1920) * getwidth() / 8 / LR, getheight() / 8 * 6 + (getwidth() * (t_r.y - pY) / 1920) * getwidth() / 8 / LR, t_r.r, EGERGB( 0, 250, 0 ) );
}
drawWay( getwidth() / 8, getheight() / 8 * 6, player.r, RED );
}
if ( paintstep >= 20 )
paintstep = 0;
paintstep++;
}
inline void drawGame( role & player, bool onlyPlayer = 0 ) {
drawBullets();
drawRoles( player, onlyPlayer );
drawStars( 0 );
drawGrain();
hBlast( player );
putimage_transparent( NULL, SDATA.tranImg, 0, 0, tranColor, 0, 0, 0, 0 );
drawStars( 1 );
if ( player.life > SDATA.life[PLAYER] )
player.life = SDATA.life[PLAYER];
if ( player.life < 0 )
player.life = 0;
if ( player.energy > MAXE )
player.energy = MAXE;
if ( player.energy < 0 )
player.energy = 0;
drawUI( player );
drawInfoList();
cleardevice( SDATA.tranImg );
}
/* 处理特效,所有特效除护盾外一次完成以增加帧数 */
inline void hSkills( role & player ) {
float x, y, dx, dy;
/* 处理大清扫 */
if ( player.clearing ) {
while( player.energy > player.hE - MAXE / 2 ) {
drawGame(player);
if ( player.type != RUINER ) {
player.energy -= MAXE / 90;
setfillcolor( EGERGB( 0xEE, 0, 0xEE ), SDATA.bImg );
setcolor( EGERGB( 0xEE, 0, 0xEE ), SDATA.bImg );
fillellipse( player.x - pX + getwidth() / 2, player.y - pY + getheight() / 2, getwidth(), getwidth(), SDATA.bImg );
setfillcolor( tranColor, SDATA.bImg );
setcolor( tranColor, SDATA.bImg );
fillellipse( player.x - pX + getwidth() / 2, player.y - pY + getheight() / 2, (MAXE - player.energy) / 1920 * getwidth(), (MAXE - player.energy) / 1920 * getwidth(), SDATA.bImg );
} else {
player.energy -= MAXE / 90;
J2DtoS2D( x, y, (MAXE / 2 - player.energy) * PI / 180 + player.r, HR );
J2DtoS2D( dx, dy, player.r + 90 * PI / 180, BR );
setlinewidth( getwidth() * 50 / 1920, SDATA.bImg );
setcolor( EGERGB( 0xEE, 0, 0xEE ), SDATA.bImg );
line( getwidth() / 2 + dx, getheight() / 2 + dy, x, y, SDATA.bImg );
setlinewidth( getwidth() * 25 / 1920, SDATA.bImg );
setcolor( WHITE, SDATA.bImg );
line( getwidth() / 2 + dx, getheight() / 2 + dy, x, y, SDATA.bImg );
J2DtoS2D( x, y, (360 - (MAXE / 2 - player.energy) ) * PI / 180 + player.r, HR );
J2DtoS2D( dx, dy, player.r - 90 * PI / 180, BR );
setlinewidth( getwidth() * 50 / 1920, SDATA.bImg );
setcolor( EGERGB( 0xEE, 0, 0xEE ), SDATA.bImg );
line( getwidth() / 2 + dx, getheight() / 2 + dy, x, y, SDATA.bImg );
setlinewidth( getwidth() * 25 / 1920, SDATA.bImg );
setcolor( WHITE, SDATA.bImg );
line( getwidth() / 2 + dx, getheight() / 2 + dy, x, y, SDATA.bImg );
}
putimage_transparent( NULL, SDATA.bImg, 0, 0, tranColor, 0, 0, 0, 0 );
delay_fps(60);
imagefilter_blurring( NULL, 0xFF, 0x100 );
}
/* 清扫飞机 */
for ( role & tr : roles ) {
if(tr.blasting) continue;
if(isIntersect(tr.x,tr.y,SDATA.cR[tr.type],player.x,player.y,max( getwidth(), getheight() )*2)) {
switch(PLAYER) {
case BASER: {
tr.life -= 99999;
break;
}
case PROCER: {
tr.life -= 99;
player.life += 99;
break;
}
case RUINER: {
tr.life /= 9999;
tr.life -= 9999;
break;
}
case STARD: {
tr.life /= 9999;
tr.life -= 9999;
break;
}
}
}
if ( tr.life <= 0 ) {
if ( tr.type == PLANET )
pF += 100;
else if ( tr.type == RUINER || tr.type == BASER || tr.type == PROCER )
pF += 100;
else if ( tr.type != LOVE )
pF++;
tr.blasting = 1;
}
}
player.hE = 0;
player.clearing = 0;
}
if(player.mV) {
PIMAGE img = newimage( getwidth(), getheight() );
int lv;
ege_enable_aa( 1, img );
ege_gentexture( 1, img );
float alp=1.00000001;
player.protecting = 0;
player.mV = 1;
player.hE = player.life;
//动画
setbkcolor(WHITE,img);
cleardevice(img);
while(player.mV) {
if(alp>255) alp=255;
ege_setalpha(alp,img);
player.move();
player.getnew();
runGrain();
drawGame(player,1);
ege_puttexture( img, 0, 0, getwidth(), getheight() );
delay_fps(60);
alp*=alp;
}
ege_setalpha(255,img);
ege_puttexture( img, 0, 0, getwidth(), getheight() );
Sleep(1000);
alp=255;
while(alp>0) {
ege_setalpha(alp,img);
player.move();
player.getnew();
runGrain();
drawGame(player,1);
ege_puttexture( img, 0, 0, getwidth(), getheight() );
delay_fps(60);
alp-=30;
}
//击杀
for ( role & tr : roles ) {
if ( (tr.x - player.x) * (tr.x - player.x) + (tr.y - player.y) * (tr.y - player.y) <= max( getwidth(), getheight() ) * max( getwidth(), getheight() ) * 4 ) {
tr.blasting=1;
if ( tr.type == PLANET )
pF += 100;
else if ( tr.type == RUINER || tr.type == BASER || tr.type == PROCER )
pF += 100;
else if ( tr.type != LOVE )
pF++;
}
}
//瞬移
lv=player.v;
player.v=300000;
player.move();
//恢复原速度
player.v=lv;
player.mV=0;
}
float qz;
/* 处理护盾 */
if ( player.protecting ) {
if ( player.energy <= 0) {
/* 清扫飞机 */
if ( player.type == PROCER ) {
for ( role & tr : roles ) {
if(isIntersect(tr.x,tr.y,SDATA.cR[tr.type],player.x,player.y,getwidth() / 2 )) {
tr.life -= (SDATA.life[PLAYER] - player.life) / 2;
}
}
player.life += (SDATA.life[PLAYER] - player.life) / 2;
}
player.protecting = 0;
player.energy = 0;
} else {
qz = (float) player.energy / MAXE * (BR);
setfillcolor( EGERGB( 255, 50, 0 ), SDATA.bImg );
setcolor( EGERGB( 255, 50, 0 ), SDATA.bImg );
fillellipse( player.x - pX + getwidth() / 2, player.y - pY + getheight() / 2, (SDATA.cR[PLAYER] / 2 + BR - qz) + SDATA.cR[player.type] / 2, (SDATA.cR[PLAYER] / 2 + BR - qz) + SDATA.cR[player.type] / 2, SDATA.bImg );
setfillcolor( tranColor, SDATA.bImg );
setcolor( tranColor, SDATA.bImg );
fillellipse( player.x - pX + getwidth() / 2, player.y - pY + getheight() / 2, (SDATA.cR[PLAYER] / 2 + BR - qz) + SDATA.cR[player.type] / 2 - getwidth() * 50 / 1920, (SDATA.cR[PLAYER] / 2 + BR - qz) + SDATA.cR[player.type] / 2 - getwidth() * 50 / 1920, SDATA.bImg );
putimage_transparent( SDATA.tranImg, SDATA.bImg, 0, 0, tranColor, 0, 0, 0, 0 );
}
}
cleardevice( SDATA.bImg );
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。