--****************************************************************************** -- 010_飛行型ノーマル(ハード) --****************************************************************************** -- ▼NEXT使用パラメータ --<< 捕捉用 DIST_RADAR = 9999; -- レーダー:距離 ANGLE_RADAR = 180; -- レーダー:角度 --<< 遠距離オペレーション用 DIST_PIVOT_FAR = 600; -- 超遠距離 DIST_PIVOT_LONGRANGE = 400; -- 遠距離 DIST_PIVOT_MIDDLERANGE = 150; -- 中距離 DIST_PIVOT_SHORTRANGE = 80; -- 近距離 DIST_PIVOT = 300; -- 遠距離/近距離の分水嶺 DIST_MARGIN = 50; -- KeepDistでPIVOTからどれだけ離れようとするか BOOT_DIST = 3000; -- 起動距離 --<< 高度調整用 ALT_RELATIVE = 100; -- 相対高度 TIME_JUMP = 6; -- 飛行時間 TIME_WALK = 5; -- 地上時間 --<< 右攻撃 DIST_R_ATK_LIMIT = 500; -- 右攻撃限界距離 DIST_R_ATK_DECENT_MAX = 350; -- 右適正距離限界 DIST_R_ATK_DECENT_MIN = 10; -- 右適正距離最小 -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); dofile("game:\\common\\event\\include\\m010\\pointid.lua"); dofile("game:\\common\\event\\include\\m010\\entityid.lua"); dofile("game:\\common\\event\\include\\m010\\constvalue.lua"); -- スクリプト初期化 function InitialSetup( context) -- 最初のオペレーションレイヤーを作成する。 --== 移動 AddInitialLayer_EveryFrame( context, "InitMove", "Move"); --== メイン攻撃 AddInitialLayer_EveryFrame( context, "InitAttack", "Attack"); --== サブ攻撃 AddInitialLayer_EveryFrame( context, "InitSubAttack", "SubAttack"); DefaultSetup( context , true ); -- ▼ターゲッティング Targetting_CatchUpWithConeInSide( context, DIST_RADAR , ANGLE_RADAR ); --<< 捕捉(※レーダーの設定) end -- 初期化する。 RegistInitializeFuncitonName( "InitialSetup"); --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --****************************************************************************** --@brief 移動 --****************************************************************************** function InitMove() debug_out("メイン関数初期化。"); end function Move( context) -- ▼ローカル変数 local M_dist = GetToTargetDistance( context ); local M_alt = GetInitialAltitude( context ); local M_decent = ( DIST_R_ATK_DECENT_MAX + DIST_R_ATK_DECENT_MIN ) / 2; local M_rand = RandomRangeInt( -20 , 20 ); local M_bestweapon = GetBestWeaponID( context) local M_bestdist = GetBestWeaponDistance( context, M_bestweapon); -- ▼ブースト頻度 SetEstimation_WalkDashRate( context , 0 , 1 ); --<< walk, dash 確率 SetEstimation_BoostEnableEnergyRange( context , 0 , 1 , 0.4 , 0.8 ); SetTimeLengthJump( context , TIME_JUMP , TIME_WALK ); -- ▼旋回 SetEnableTurnToTarget( context, true); --<< 自動的に捕捉しようと旋回するのを許可するかどうか SetEnableViewTurn( context, true); -- ▼行動 if ( M_dist > 300 ) then -- ▼高度調整 SetAdjustAltitudeBase( context , ADJUST_ALTITUDE_BASE__ABSOLUTE ); --<< 絶対高度を見る SetAltitudeParam( context , 200 , 200 ); SetTimeLengthJump( context , 50 , 5 ); Op_KeepDist( context , OperationIdentifier( 1 ) , 5 , 8 , 1 , nil , 200 , 50 ); else -- ▼自動高度調整 SetAdjustAltitudeBase( context , ADJUST_ALTITUDE_BASE__TARGET_RELATIVE ); SetAltitudeParam( context, 50, 50); --自動的に高度調整をする(絶対高度、相対高度) SetTimeLengthJump( context , TIME_JUMP , TIME_WALK ); -- ▼近距離戦闘 local rand = RandomRangeInt( -10 , 10 ); Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 2.5 , 10 , 0.5 , nil , M_bestdist , 60 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 5 ) , 2.5 , 10 , 0.5 , nil , M_bestdist , -80 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 6 ) , 2 , 10 , 0.5 , nil , 150 , 10 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 7 ) , 2 , 10 , 0.5 , nil , 150 , -20 , 50 , 0 , false ); Op_RoundRear( context , OperationIdentifier( 10 ) , 8 , 10 , 0.5 , nil ); end end ----------------------------------------------------------------------------------- --@brief 射撃 ----------------------------------------------------------------------------------- function InitAttack() end function Attack( context ) -- ▼ローカル変数 local ratio = GetMyApRate( context ); local dist = GetToTargetDistance( context ); -- ▼射撃オペレーション(射出) if dist < 800 then Op_ShootRifle( context , OperationIdentifier( 33 ) , 8 , 10 , 1 , nil , WEAPON_ID__MAIN , 2, 3, 0 , false , true); else Op_Nothing( context, OperationIdentifier( 34 ) , 8 , 10 , 1 , nil); end end ----------------------------------------------------------------------------------- --@brief 射撃 ----------------------------------------------------------------------------------- function InitSubAttack() end function SubAttack( context ) -- ▼ローカル変数 local ratio = GetMyApRate( context ); local dist = GetToTargetDistance( context ); -- ▼射撃オペレーション(射出) if dist < 300 then Op_ShootRifle( context , OperationIdentifier( 33 ) , 8 , 10 , 1 , nil , WEAPON_ID__SUB , 2, 3, 0 , false , true); else Op_Nothing( context, OperationIdentifier( 34 ) , 8 , 10 , 1 , nil); end end