今回はそれを扱います。
最初にアイテムとそれぞれが関係している要素を確認します。
1.ドレス->変身の仕方
2.指輪->吸収範囲
3.宝石->吸収ボーダーライン
4.ステルスジャケット->自機当たり判定
5.フェロモン->敵当たり判定
6.親父の根性魂->喰らいボム受付時間
1.ドレス->変身の仕方
各状態に変われるかどうかのフラグを持たせ、
3つの状態で切り替わるようにしても問題はないと思いますが
今回、服はどれか一つしか装備できないようにします。
struct.hのch_tに以下を追加します。
ini.cppのgame_ini()に以下を追加します。
//変身について
if(*equip_item[11]==2){
ch.transmode=1;
}
else if(*equip_item[5]==2){
ch.transmode=2;
}
else ch.transmode=0;
mura.cppのcontrol_mura_menu()の以下を変更します。
if(CheckStatePad(configpad.shot)==1){
if(*equip_item[mura_menu_command]==1){
*equip_item[mura_menu_command]=2;
//服は一つしか装備しないようにする
if(mura_menu_command==5 && *equip_item[11]==2){
*equip_item[11]=1;
}
else if(mura_menu_command==11 && *equip_item[5]==2){
*equip_item[5]=1;
}
}
else if(*equip_item[mura_menu_command]==2){
*equip_item[mura_menu_command]=1;
}
}
break;
struct.hのch_tに以下を追加します。
ini.cppのgame_ini()に初期化処理を追加します。
//吸収倍率について
ch.indraw_rate=1.0;
if(*equip_item[0]==2){
ch.indraw_rate*=1.3;
}
if(*equip_item[6]==2){
ch.indraw_rate*=1.3;
}
//低速状態で自機付近なら
if(CheckStatePad(configpad.slow)>0 &&
x*x+y*y吸収ボーダーライン
struct.hのch_tに以下を追加します。
[code=cpp] int item_border_plus;//ボーダーラインを下に動かす量
//ボーダーラインの位置について
ch.item_border_plus=0;
if(*equip_item[1]==2){
ch.item_border_plus+=40;
}
if(*equip_item[7]==2){
ch.item_border_plus+=30;
}
if(ch.y240){
SetDrawBlendMode(DX_BLENDMODE_ALPHA,255-5*(stage_count-240));
}
DrawRotaGraph(FX+FMX/2,FY+ITEM_GET_BORDER_LINE+ch.item_border_plus,1,0,img_item_border_line,TRUE);
SetDrawBlendMode(DX_BLENDMODE_NOBLEND,255);
}
struct.hのch_tに以下を追加します。
ini.cppのgame_ini()に処理を追加します。
//自機の当たり判定倍率について
ch.crange_rate=1.0;
if(*equip_item[2]==2){
ch.crange_rate*=0.9;
}
if(*equip_item[8]==2){
ch.crange_rate*=0.9;
}
out.cppで二か所、out_lazer.cppでか所修正します。
//自機と敵ショットが当たったかどうかを判定する
int out_judge_enemyshot(int s,int n){
if(shot[s].bullet[n].cnt>0){//ショットの軌道が1度でも計算されていたら
if(out_judge(
shot[s].bullet[n].x,shot[s].bullet[n].y,ch.x,ch.y,
bullet_info[shot[s].bullet[n].knd].range,CRANGE*ch.crange_rate,
shot[s].bullet[n].spd,shot[s].bullet[n].angle
)){
return 1;
}
}
return 0;
}
//自機とボスショットが当たったかどうかを判定する
int out_judge_bossshot(int n){
if(boss_shot.bullet[n].cnt>0){//ショットの軌道が1度でも計算されていたら
if(out_judge(
boss_shot.bullet[n].x,boss_shot.bullet[n].y,ch.x,ch.y,
bullet_info[boss_shot.bullet[n].knd].range*boss_shot.bullet[n].size,CRANGE*ch.crange_rate,
boss_shot.bullet[n].spd,boss_shot.bullet[n].angle
)){
return 1;
}
}
return 0;
}
int out_lazer(){
int i,j;
pt_t sqrp[4],rpt={ch.x,ch.y};//長方形の4点と円の中心
//レーザー分ループ
for(i=0;i0 && lazer[i].hantei!=0){
for(j=0;j敵当たり判定
struct.hのch_tに以下を追加する。
[code=cpp] double erange_rate;//敵当たり判定倍率
//敵の当たり判定倍率について
ch.erange_rate=1.0;
if(*equip_item[3]==2){
ch.erange_rate*=1.2;
}
if(*equip_item[9]==2){
ch.erange_rate*=1.2;
}
out.cppの二か所を修正します。
//敵と自機ショットが当たったかどうかを判定する
int out_judge_cshot(int i,int s){
if(cshot[i].cnt>0){//ショットの軌道が1度でも計算されていたら
if(out_judge(cshot[i].x,cshot[i].y,enemy[s].x,enemy[s].y,
cshot_range[cshot[i].knd],enemy_range[enemy[s].knd]*ch.erange_rate,
cshot[i].spd,cshot[i].angle)){
return 1;
}
}
return 0;
}
//ボスと自機ショットが当たったかどうかを判定する
int out_judge_cshot_boss(int i){
if(cshot[i].cnt>0){//ショットの軌道が1度でも計算されていたら
if(out_judge(cshot[i].x,cshot[i].y,boss.x,boss.y,
cshot_range[cshot[i].knd],BRANGE*ch.erange_rate,cshot[i].spd,cshot[i].angle)){
return 1;
}
}
return 0;
}
struct.hのch_tに以下を追加します。
ini.cppのgame_ini()に以下の処理を追加します。
//喰らいボム受付時間について
ch.kurai_bom_time=20;
if(*equip_item[4]==2){
ch.kurai_bom_time=ch.kurai_bom_time*3/2;
}
if(*equip_item[10]==2){
ch.kurai_bom_time=ch.kurai_bom_time*3/2;
}
char.cppのcalc_ch()の以下を変更
if(ch.flag==1){//喰らいボム受付中
bright_set.brt=80;//暗く
if(ch.cnt>ch.kurai_bom_time){//喰らいボム受付時間を過ぎたら
ch.flag =2; //1:喰らいボム受付中 2:死んで浮き上がり中
ch.cnt =0;
bright_set.brt=255;
}
}
おまけの弾幕
[nico]http://www.nicovideo.jp/watch/sm13742485[/nico]
弾幕関数
► スポイラーを表示