#include #include "pad.h" #include "gamemain.h" #include "commot.h" //相手がエリア買いにいたら追いかけない //相手がガードしてたらなげる //ダウン中は追いかけない //目の前で刃物を拾わない void ComMove( MAN *p, MAN *e ) { int PADfront,PADback,dist,fc; dist = abs(p->pl.vx - e->pl.vx); p->cont = 0; p->trg = 0; p->gage ++; //もの広い #define CH_JS_B 35 if( p->st == CH_JUMP_A || p->st == CH_JS_B ) { p->FB_cnt = 10; p->FB_flg = 1; } if( Random(200,0) == 0 ) { p->FB_cnt = 10; p->FB_flg = 1; } if( Random(130,0) == 0 ) { p->cont |= PADR1; p->trg |= PADR1; } if( dist > 5000 && Random(50,0) == 0 ) { if( Random(5,0) == 0 ) { if( p->face == RIGHT ) { p->Ldash_cnt = 10; p->Ldash_flg = -1; } else { p->Rdash_cnt = 10; p->Rdash_flg = -1; } } p->FB_cnt = 10; p->FB_flg = 1; } if( p->hold != HOLD_NO ) { if( Random(50,0) == 0 ) { p->trg |= PADRup; } } //方向転換 if( p->st == CH_STAND || p->st == CH_WALK_F ) { if( p->pl.vx < e->pl.vx) p->face = LEFT; else p->face = RIGHT; } //超業だし if( p->gage2 >= GAGE_MAX && p->gage >= 180 || ( p->syu == 1 && p->gage2 >= GAGE_MAX && p->hold != HOLD_NO ) ) { if( p->pl.vx < e->pl.vx ) p->face = LEFT; if( p->pl.vx > e->pl.vx ) p->face = RIGHT; if( p->face == LEFT ) { //自分が左向きなら p->Lhd_cnt = 10; p->Lhd_flg = 1; } else { //自分が左向きなら p->Rhd_cnt = 10; p->Rhd_flg = 1; } p->PB_cnt = 20; p->cont |= PADRright; p->PB_flg = 1; } //前後のキー判定作成 if( p->face == LEFT ) { //自分が左向きなら fc = 1; PADfront = PADLleft; //左が前 PADback = PADLright; } else { fc = -1; //自分が右向きなら PADfront = PADLright; //右が前になる PADback = PADLleft; } if( p->st == CH_UKI ) { //受け身 p->cont |= PADLup; if( Random( 2,0) == 0 ) p->cont |= PADback; else p->cont |= PADfront; } //他目打ち if( p->st != CH_JUMP ) { if( p->gage >= GAGE_MAX || ( p->st == CH_KIDAN && p->gage >= GAGE_MAX/4) ) { p->cont |= PADRright; p->PB_cnt = 20; p->PB_flg = 1; if( p->pl.vx < e->pl.vx && p->face != LEFT ) p->cont |= PADfront; if( p->pl.vx > e->pl.vx && p->face != RIGHT ) p->cont |= PADfront; } } //距離に応じて行動を帰る if( (p->hold == HOLD_NO && dist > 2900 ) || ( p->hold != HOLD_NO && dist > 5500) ) { if( dist > 10000 ) { if( p->st == CH_FDASH ) { if( Random(3,0) == 0 ) { p->HB_cnt = 20; p->HB_flg = 1; } } } if( dist > 18000 || Random(30,0)==0 ) { if( p->face == LEFT ) { p->Ldash_cnt = 10; p->Ldash_flg = -1; } else { p->Rdash_cnt = 10; p->Rdash_flg = -1; } } if( Random(100,0) == 0 ) { p->trg |= PADLup; p->cont |= PADLup; } if( (dist%501) == 0 || Random(150,0) == 0 ) { if( p->gage >= 800 ) { if( !(p->st == CH_JUMP && Random(5,0) == 0) ) { p->cont |= PADRright; p->PB_cnt = 20; p->PB_flg = 1; } } } else { if( p->pl.vy <= GetGrandHeight( p->pl.vx+1000*fc ) || //前進 GetGrandSyu( p->pl.vx+1000*fc ) != 5 ) { if( GetGrandHeight( e->pl.vx ) < 10000 && GetGrandSyu( e->pl.vx ) != 5 ) p->cont |= PADfront; else { p->Ldash_cnt = 0; p->Ldash_flg = 0; p->Rdash_cnt = 0; p->Rdash_flg = 0; } } else { if( p->g_pl.vy >= 0 ) { p->trg |= PADLup; p->cont |= PADLup; } } } } else { if( Random(100,0) == 0 ) { p->cont |= PADR1; p->trg |= PADR1; goto jp; } if( (dist&0x07)==0 ) { p->trg |= PADLdown; p->cont |= PADLdown; } if( Random(100,0) == 0 ) { p->trg |= PADLup; p->cont |= PADLup; } if( Random(10,0) == 0 ) { p->DD_cnt = 10; p->DD_flg = 1; if( Random(1,0) == 0 ) { // p->HB_cnt = 20; // p->HB_flg = 1; } } if( p->dat4 > 1 || (p->syu == 1 && ( p->st == CH_LP0 || p->st == CH_RK0 ) ) ){ p->HB_cnt = 20; p->HB_flg = 1; } else { /* if( dist > 3800 ) { p->trg |= PADfront | PADLup; p->cont |= PADfront | PADLup; p->LB_cnt = 20; p->LB_flg = 1; return; } if( dist > 3800 ) { if( p->g_pl.vy < 0 ) { p->trg |= PADfront | PADLup; p->cont |= PADfront | PADLup; } } 25210 f00 fe20 100 */ //近距離物持ちで if( p->hold != HOLD_NO && Random( 5,0 ) == 0 ) { //なげる if( Random( 3,0 ) == 0 ) { p->trg &= ~PADLup; p->cont &= ~PADLup; p->trg |= PADRup; } else { //ジャンプ p->trg |= PADLup; p->cont |= PADLup; } } else { p->LB_cnt = 20; p->LB_flg = 1; } } } if( p->syu == 2 ) { p->Lhd_cnt = 0; p->Lhd_flg = 0; p->Rhd_cnt = 0; p->Rhd_flg = 0; } jp:; //ガードを確実にするためにジャンプ if( p->syu == 3 ) { if( dist < 3200 ) { if( p->face == LEFT ) p->Ldash_flg = -1; else p->Rdash_flg = -1; p->HB_cnt = 20; p->HB_flg = 1; } } //物を持っているときは球を打たない if( p->hold != HOLD_NO ) { if( !( p->gage2 >= GAGE_MAX && p->gage >= 180 ) ) { p->PB_cnt = 0; p->PB_flg = 0; } //物持ちならよくジャンプする if( Random(20,0) == 0 ) { p->trg |= PADLup; p->cont |= PADLup; } //ぐれ根ー度爆発前ならなげる if( p->hold == HOLD_GRE ) { if( p->hold_pt->dat4 < COUNT_SPPED*3+COUNT_SPPED/8) { p->trg &= ~PADLdown; p->trg |= PADRup; } if( p->hold_pt->dat4 < COUNT_SPPED*2+COUNT_SPPED/2) { p->trg &= ~PADLdown; p->trg |= PADRup; } } //十 爆発前ならなげる if( p->hold == HOLD_FIREGUN ) { if( p->hold_pt->dat4 == -1) { p->trg |= PADRup; } } } }