--****************************************************************************** --[[ @brief 070_mech-fly @author ishidai ]] --****************************************************************************** -- 定数パラメータ DIST_ATKMAX = 250; -- 適正距離最大 DIST_ATKMIN = 0; -- 適正距離最小 -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); -- スクリプト初期化 function InitialSetup( context) -- 最初のオペレーションレイヤーを作成する。 --== 移動 AddInitialLayer_EveryFrame( context, "InitMove", "Move"); --== メイン攻撃 AddInitialLayer_EveryFrame( context, "InitMainAttack", "MainAttack"); --== 旋回と高度調整制御 DefaultSetup( context, false); -- EnableTargetAltitudeRelative( context, false); --絶対高度を取る end -- 初期化 RegistInitializeFuncitonName( "InitialSetup"); --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --****************************************************************************** --[[ @brief 移動 ]] --****************************************************************************** function InitMove() debug_out("メイン関数初期化"); end function Move( context) -- /////ローカル変数宣言 local dist = GetToTargetDistance( context); -- 自機との距離 local alt = 100; -- 展開高度 -- /////ターゲット補足関数 Targetting_CatchUpWithConeInSide( context, 1000, 180); -- レーダー(角度倍) Targetting_CatchUpWithConeInSide( context, 1800, 25); -- 視界  (角度倍) -- SetAltitudeParam( context, alt); -- 高度を調整 -- /////行動オペレーション Op_Nothing( context, OperationIdentifier(1), 99, 99, 1, nil); end --****************************************************************************** --[[ @brief メイン攻撃 ]] --****************************************************************************** function InitMainAttack() -- end function MainAttack( context) -- /////ローカル変数 local dist = GetToTargetDistance( context); -- 自機との距離 local alt = GetToTargetAltitude( context); -- 自機との相対高度 -- /////行動オペレーション if(MainWeaponIsLocked( context)) then if(dist < DIST_ATKMAX) then Op_Shoot2( context, OperationIdentifier(1), 10, 10, 1, nil, 100, true, 4, 6, 5, 8); -- 射撃 end end end