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