代码拉取完成,页面将自动刷新
/* 数据托管 */
class sData
{
public:
PIMAGE bad_bullet;
PIMAGE bigPurple;
PIMAGE good_bullet;
PIMAGE midBlue;
PIMAGE stard;
PIMAGE ruiner, baser, procer, speeder,lighter, god;
PIMAGE smallGreen;
PIMAGE cloud;
PIMAGE noya;
PIMAGE planet;
PIMAGE love;
PIMAGE gun_on, gun_off;
hImage hImg;
PIMAGE tranImg; /* 临时储存背景 */
PIMAGE bImg; /* 爆炸图像&特效缓存 */
PIMAGE vscreen;
float width[END];
float height[END];
int maxV[END]; /* 每种机型最快速度 */
float maxNum[END]; /* 每种机型最大数量,用float可分阶段刷出 */
int life[END]; /* 各种机型的生命值 */
int cR[END]; /* 碰撞球半径 */
int hurt[END]; /* 各种机型子弹杀伤力 */
int pro[END]; /* 各种机型防御力 */
int BNum[END]; /* 各机型弹夹容量 */
int pri[END];//各种机型价格
map<int,string> i2n;//id转名字
map<string,int> n2i;//名字转id
map<int,string> buffName;//buff名字
int shootV[7]; /* 每种机型的射速 */
void initData(bool StoryMode=false) {
float pw = 1; /* 绘制缩放权值 */
//设置buff名
buffName[MOREBLTS]="霰弹";
buffName[POWERFULLBLTS]="子弹增强";
buffName[STRONGER]="提升攻击力与血量上限";
buffName[SHEILD]="强化护盾,受伤时清除部分弹幕";
buffName[DRINKENERGY]="击杀获得更多能量";
buffName[DRINKBLOOD]="吸血";
buffName[HURTFORENERGY]="受伤时回复能量";
buffName[HURTFORPOWER]="血量越低伤害越高";
/* 设定长宽 */
width[BAD_BULLET] = getwidth() * 20.0 / 1920 * pw;//留直径
height[BAD_BULLET] = getheight() * 20.0 / 1080 * pw;
width[GOOD_BULLET] = getwidth() * 20.0 / 1920 * pw;
height[GOOD_BULLET] = getheight() * 20.0 / 1080 * pw;
width[CHECKPOINT] = getwidth() * 700.0 / 1920 * pw;
height[CHECKPOINT] = getheight() * 700.0 / 1080 * pw;
width[CLOUD] = getwidth() * 300.0 / 1920 * pw;
height[CLOUD] = getheight() * 200.0 / 1080 * pw;
width[NOYA] = getwidth() * 175.0 / 1920 * pw;
height[NOYA] = getheight() * 150.0 / 1080 * pw;
width[SMALLGREEN] = getwidth() * 125.0 / 1920 * pw;
height[SMALLGREEN] = getheight() * 100.0 / 1080 * pw;
width[MIDBLUE] = getwidth() * 175.0 / 1920 * pw;
height[MIDBLUE] = getheight() * 125.0 / 1080 * pw;
width[BIGPURPLE] = getwidth() * 200.0 / 1920 * pw;
height[BIGPURPLE] = getheight() * 150.0 / 1080 * pw;
width[BASER] = getwidth() * 175.0 / 1920 * pw;
height[BASER] = getheight() * 125.0 / 1080 * pw;
width[PROCER] = getwidth() * 175.0 / 1920 * pw;
height[PROCER] = getheight() * 150.0 / 1080 * pw;
width[SPEEDER] = getwidth() * 267.0 / 1920 * pw;
height[SPEEDER] = getheight() * 150.0 / 1080 * pw;
width[RUINER] = getwidth() * 175.0 / 1920 * pw;
height[RUINER] = getheight() * 150.0 / 1080 * pw;
width[LIGHTER] = getwidth() * 280.0 / 1920 * pw;
height[LIGHTER] = getheight() * 258.0 / 1080 * pw;
width[GOD] = getwidth() * 175.0 / 1920 * pw;
height[GOD] = getheight() * 150.0 / 1080 * pw;
width[STARD] = getwidth() * 200.0 / 1920 * pw;
height[STARD] = getheight() * 1000.0 / 1080 * pw;
/* 行星长==最大直径,高==最小直径 */
width[PLANET] = getwidth() * 1000.0 / 1920 * pw;
height[PLANET] = getwidth() * 300.0 / 1080 * pw;
width[LOVE] = height[LOVE] = getwidth() * 60 / 1920 * pw;
//设定各种机型的极速
maxV[NOYA] = 35;
maxV[SMALLGREEN] = 52;
maxV[MIDBLUE] = 47;
maxV[BIGPURPLE] = 52;
maxV[BASER] = 53;
maxV[PROCER] = 45;
maxV[SPEEDER] = 65;
maxV[RUINER] = 50;
maxV[PLANET] = 20;
maxV[LIGHTER] = 66;
maxV[GOD] = 99999;
maxV[STARD] = 20;
//初始化机型数量
memset(maxNum,0,sizeof(int)*END);
//设定各机型的弹仓
BNum[BIGPURPLE] = 2*5;
BNum[MIDBLUE] = 1*5;
BNum[SMALLGREEN] = 2*5;
BNum[PLANET] = 0;
BNum[LOVE] = 0;
BNum[BASER] = 8 / 2*5;
BNum[PROCER] = 6 / 2*5;
BNum[RUINER] = 20 / 2*5;
BNum[SPEEDER] = 6 / 2*5;
BNum[LIGHTER] = 6 / 2*5;
BNum[NOYA] = 0;
BNum[GOD] = 10000*5;
BNum[STARD] = 1000*5;
BNum[PLAYER] *= 2;
//设定各机型生命
life[NOYA] = 150;
life[CLOUD] = 1;
life[CHECKPOINT] =1;
life[SMALLGREEN] = 30*4;
life[MIDBLUE] = 50*3;
life[BIGPURPLE] = 150*2;
life[BASER] = 500;
life[PROCER] = 650;
life[SPEEDER] = 400;
life[RUINER] = 400;
life[LIGHTER]=300;
life[GOD] = 99999999;
life[PLANET] = 1; /* 行星生命==生命值*体积 */
life[LOVE] = life[PLAYER] / 16; /* 回血 */
life[STARD] = 10000;
//各机型射速
shootV[NOYA] = 1;
shootV[SMALLGREEN] = 1;
shootV[MIDBLUE] = 2;
shootV[BIGPURPLE] = 3;
shootV[BASER] = 3;
shootV[PROCER] = 3;
shootV[SPEEDER] = 5;
shootV[RUINER] = 4;
shootV[LIGHTER] = 5;
shootV[GOD] = 1;
shootV[STARD] = 100;
//创建碰撞球
//计算公式:
//一、偏大:较大长或宽*2
//二、标准:平均半径&最大半径的平均数
#define F(a,b) ((a+b)/2+max(a,b))/2
cR[GOOD_BULLET] = 10;
cR[BAD_BULLET] = 10;
cR[CLOUD] = F( width[CLOUD], height[CLOUD] );
cR[CHECKPOINT] = F( width[CHECKPOINT], height[CHECKPOINT] );
cR[LOVE] = max( width[LOVE], height[LOVE] ) * 2;
cR[BIGPURPLE] = F( width[BIGPURPLE],height[BIGPURPLE] );
cR[MIDBLUE] = F( width[MIDBLUE], height[MIDBLUE] );
cR[SMALLGREEN] = F( width[SMALLGREEN], height[SMALLGREEN] );
cR[NOYA] = F( width[NOYA], height[NOYA] );
cR[RUINER] = F( width[RUINER], height[RUINER] );
cR[BASER] = F( width[BASER], height[BASER] );
cR[PROCER] = F( width[PROCER], height[PROCER] );
cR[SPEEDER] = F( width[SPEEDER], height[SPEEDER] );
cR[LIGHTER] = F( width[LIGHTER], height[LIGHTER] );
cR[GOD] = F( width[GOD], height[GOD] );
cR[STARD] = F( width[STARD], height[STARD] );
#undef F
//设定基础伤害
hurt[BIGPURPLE] = 15/2;
hurt[RUINER] = 25/2;
hurt[BASER] = 17/2;
hurt[PROCER] = 5/2;
hurt[SPEEDER] = 7/2;
hurt[MIDBLUE] = 10/2;
hurt[SMALLGREEN] = 5/2;
hurt[LIGHTER]=9;
hurt[NOYA] = 99999999;
hurt[GOD] = 99999999;
hurt[STARD] = 25;
//设定护盾
pro[NOYA] = 30;
pro[SMALLGREEN] = 5;
pro[MIDBLUE] = 15;
pro[BIGPURPLE] = 15;
pro[BASER] = 20;
pro[PROCER] = 30;
pro[SPEEDER] = 11;
pro[RUINER] = 14;
pro[LIGHTER] = 26;
pro[GOD] = 99999999;
pro[STARD] = 100;
//设定价格
pri[NOYA]=0;
pri[SMALLGREEN]=1200;
pri[MIDBLUE]=5000;
pri[BIGPURPLE]=10000;
pri[BASER]=200000;
pri[PROCER]=190000;
pri[SPEEDER]=210000;
pri[RUINER]=350000;
pri[LIGHTER]=300000;
pri[STARD]=2147483647;
//初始化id&名称对照表
i2n[NOYA]="NOYA";
i2n[SMALLGREEN]="sGreen";
i2n[MIDBLUE]="mBlue";
i2n[BIGPURPLE]="bPurl";
i2n[BASER]="BASER";
i2n[PROCER]="PROCER";
i2n[SPEEDER]="SPEEDER";
i2n[RUINER]="RUINER";
i2n[LIGHTER]="LIGHTER";
i2n[STARD]="EXCUTER";
i2n[PLANET]="PLANET";
i2n[LOVE]="MEDIC";
i2n[CLOUD]="CLOUD";
i2n[GOD]="GOD";
i2n[CHECKPOINT]="CHECKPOINT";
n2i["NOYA"]=NOYA;
n2i["sGreen"]=SMALLGREEN;
n2i["mBlue"]=MIDBLUE;
n2i["bPurl"]=BIGPURPLE;
n2i["BASER"]=BASER;
n2i["PROCER"]=PROCER;
n2i["SPEEDER"]=SPEEDER;
n2i["RUINER"]=RUINER;
n2i["LIGHTER"]=LIGHTER;
n2i["EXCUTER"]=STARD;
n2i["PLANET"]=PLANET;
n2i["MEDIC"]=LOVE;
n2i["CLOUD"+98]=CLOUD;
n2i["GOD"]=GOD;
n2i["CHECKPOINT"]=CHECKPOINT;
return;
}
void getImage() {
tranImg = newimage( getwidth(), getheight() );
setbkcolor( tranColor, tranImg );
bImg = newimage( getwidth(), getheight() );
vscreen = newimage();
setbkcolor( tranColor, bImg );
cloud=newimage();
//bad_bullet = newimage();
bigPurple = newimage();
//good_bullet = newimage();
midBlue = newimage();
smallGreen = newimage();
planet = newimage();
love = newimage();
gun_on = newimage();
gun_off = newimage();
ruiner = newimage();
baser = newimage();
procer = newimage();
speeder = newimage();
god = newimage();
noya = newimage();
lighter=newimage();
stard = newimage();
string path = "image\\item\\";
hImg.begin( tranColor );
//getimage( bad_bullet, (path + "bad_bullet.png").c_str() );
getimage( bigPurple, (path + "bigPurple\\bigPurple.png").c_str() );
//getimage( good_bullet, (path + "good_bullet.png").c_str() );
getimage( midBlue, (path + "midBlue\\midBlue.png").c_str() );
getimage( smallGreen, (path + "smallgreen\\smallGreen.png").c_str() );
getimage( love, (path + "love.png").c_str() );
getimage( ruiner, (path + "ruiner\\ruiner.png").c_str() );
getimage( baser, (path + "baser\\baser.png").c_str() );
getimage( procer, (path + "procer\\procer.png").c_str() );
getimage( speeder, (path + "speeder\\speeder.png").c_str() );
getimage( lighter, (path + "lighter\\lighter.png").c_str() );
getimage( noya, (path + "noya\\noya.png").c_str() );
getimage( stard, (path + "STARDESTROYER\\STARDESTROYER.png").c_str() );
getimage( planet, (path + "planet.png").c_str() );
getimage( cloud, (path + "cloud\\cloud.png").c_str() );
/* 读玩家贴图 */
switch ( PLAYER ) {
case RUINER: {
getimage( gun_on, (path + "ruiner\\gun_on.png").c_str() );
getimage( gun_off, (path + "ruiner\\gun_off.png").c_str() );
gun_on = hImg.boostImage( (float) 50 / 1920 * getwidth(), (float) 70 / 1920 * getwidth(), gun_on );
gun_off = hImg.boostImage( (float) 60 / 1920 * getwidth(), (float) 70 / 1920 * getwidth(), gun_off );
break;
}
}
// switch ( PLAYER ) {
// case BASER: {
// getimage( good_bullet, (path + "baser\\bullet.png").c_str() );
// break;
// }
// case RUINER: {
// getimage( good_bullet, (path + "ruiner\\bullet.png").c_str() );
// break;
// }
// case PROCER: {
// getimage( good_bullet, (path + "procer\\bullet.png").c_str() );
// break;
// }
// case SPEEDER: {
// getimage( good_bullet, (path + "speeder\\bullet.png").c_str() );
// break;
// }
// case SMALLGREEN: {
// getimage( good_bullet, (path + "smallgreen\\bullet.png").c_str() );
// break;
// }
// case MIDBLUE: {
// getimage( good_bullet, (path + "midblue\\bullet.png").c_str() );
// break;
// }
// case BIGPURPLE: {
// getimage( good_bullet, (path + "bigpurple\\bullet.png").c_str() );
// break;
// }
// case LIGHTER: {
// getimage( good_bullet, (path + "lighter\\bullet.png").c_str() );
// break;
// }
// case STARD: {
// getimage( good_bullet, (path + "STARDESTROYER\\bullet.png").c_str() );
// break;
// }
// }
//bad_bullet = hImg.boostImage( width[BAD_BULLET], height[BAD_BULLET], bad_bullet );
bigPurple = hImg.boostImage( width[BIGPURPLE], height[BIGPURPLE], bigPurple );
//good_bullet = hImg.boostImage( width[GOOD_BULLET], height[GOOD_BULLET], good_bullet );
midBlue = hImg.boostImage( width[MIDBLUE], height[MIDBLUE], midBlue );
smallGreen = hImg.boostImage( width[SMALLGREEN], height[SMALLGREEN], smallGreen );
love = hImg.boostImage( width[LOVE], height[LOVE], love );
cloud = hImg.boostImage( width[CLOUD], height[CLOUD], cloud );
ruiner = hImg.boostImage( width[RUINER], height[RUINER], ruiner );
baser = hImg.boostImage( width[BASER], height[BASER], baser );
procer = hImg.boostImage( width[PROCER], height[PROCER], procer );
speeder = hImg.boostImage( width[SPEEDER], height[SPEEDER], speeder );
noya = hImg.boostImage( width[NOYA], height[NOYA], noya );
lighter = hImg.boostImage( width[LIGHTER], height[LIGHTER], lighter );
stard = hImg.boostImage( width[STARD], height[STARD], stard );
god = baser;
STARNUM=getwidth() * getheight() / 200;
bkcolor=0;
}
~sData(){
delimage( bad_bullet);
delimage( bigPurple);
delimage( good_bullet );
delimage( midBlue );
delimage( smallGreen );
delimage( love );
delimage( ruiner );
delimage( baser );
delimage( procer );
delimage( speeder );
delimage( lighter );
delimage( noya );
delimage( stard );
delimage( planet );
delimage( cloud );
}
} SDATA;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。