--****************************************************************************** --[[ @brief 050_BFF_AC @author Kazushi Morita ]] --****************************************************************************** -- ▼NEXT使用パラメータ --<< 捕捉用 DIST_RADAR = 4000; -- レーダー:距離 ANGLE_RADAR = 180; -- レーダー:角度 --<< 遠距離オペレーション用 DIST_PIVOT = 300; -- 遠距離/近距離の分水嶺 --<< 高度調整用 TIME_JUMP = 2; -- 飛行時間 TIME_WALK = 1; -- 地上時間 --<< 右攻撃 DIST_R_ATK_LIMIT = 700; -- 右攻撃限界距離 -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); dofile("game:\\common\\event\\include\\m050\\pointid.lua"); dofile("game:\\common\\event\\include\\m050\\entityid.lua"); dofile("game:\\common\\event\\include\\m050\\constvalue.lua"); -- スクリプト初期化 function InitialSetup( context) -- 最初のオペレーションレイヤーを作成する。 --== 移動 -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "InitMove", "Move"); --== 右攻撃 -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "Init_R_Attack", "R_Attack"); -- ▼ターゲッティング Targetting_CatchUpWithConeInSide( context, DIST_RADAR , ANGLE_RADAR ); --<< 捕捉(※レーダーの設定) DefaultSetup( context , true ); end -- 初期化する。 RegistInitializeFuncitonName( "InitialSetup"); --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --****************************************************************************** --[[ @brief 移動 ]] --****************************************************************************** function InitMove() debug_out("メイン関数初期化。"); end function Move( context) -- ▼ローカル変数 local M_dist = GetToTargetDistance( context ); local M_alt = GetInitialAltitude( context ); local M_rand = RandomRangeInt( -200 , 200 ); -- ▼ブースト頻度 SetEstimation_BoostEnableEnergyRange( context , 0 , 1 , 0.4 , 0.8 ); SetTimeLengthJump( context , TIME_JUMP , TIME_WALK ); -- ▼旋回 SetEnableTurnToTarget( context, true); --<< 自動的に捕捉しようと旋回するのを許可するかどうか SetEnableViewTurn( context, true); -- ▼行動開始用フラグ処理 if ( M_dist > DIST_PIVOT ) then --<< 一定以上遠い時はその距離を保とうとする -- ▼高度調整 SetEnableKeepAltitude( context, true); --自動的に高度調整するのを許可するかどうか SetAltitudeParam( context , M_alt , M_alt ); -- ▼遠距離戦闘 Op_KeepDist( context , OperationIdentifier( 1 ) , 5 , 8 , 1 , nil , 100 , 100 ); Op_RoundRear( context , OperationIdentifier( 2 ) , 10 , 10 , 0.5 , nil ); Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 2.5 , 10 , 0.5 , nil , 150 , 60 , 50 , 0 , false ); else --<< 距離を詰められると接近戦へ移行する -- ▼自動高度調整 SetEnableKeepAltitude( context, true); --自動的に高度調整するのを許可するかどうか SetAltitudeParam( context, M_alt, M_alt); --自動的に高度調整をする(絶対高度、相対高度) -- ▼近距離戦闘 Op_KeepDist( context , OperationIdentifier( 8 ) , 5 , 8 , 1 , nil , 400 + M_rand , 100 ); Op_KeepDist( context , OperationIdentifier( 9 ) , 12 , 12 , 1 , nil , 800 + M_rand , 200 ); Op_RoundRear( context , OperationIdentifier( 10 ) , 8 , 10 , 0.5 , nil ); end end --****************************************************************************** --[[ @brief 右 攻撃 ]] --****************************************************************************** function Init_R_Attack() -- end function R_Attack( context) -- ▼ローカル変数 local R_dist = GetToTargetDistance( context ); if ( DIST_R_ATK_LIMIT < R_dist ) then --<< 攻撃限界よりも遠く Op_Nothing( context , OperationIdentifier( 50 ) , 2 , 4 , 1 , nil ); else Op_ShootRifle( context, OperationIdentifier( 51 ), 8, 8, 1, nil, 0, 0, 0, 0, true, true); end end