--****************************************************************************** --[[ @brief arena_NEXT_AC_08 @author Kazushi Morita ]] --****************************************************************************** -- ▼NEXT使用パラメータ --<< 捕捉用 DIST_RADAR = 5000; -- レーダー:距離 ANGLE_RADAR = 180; -- レーダー:角度 --<< 遠距離オペレーション用 DIST_PIVOT_FAR = 600; -- 超遠距離 DIST_PIVOT_LONGRANGE = 400; -- 遠距離 DIST_PIVOT_MIDDLERANGE = 150; -- 中距離 DIST_PIVOT_SHORTRANGE = 80; -- 近距離 DIST_PIVOT = 200; -- 遠距離/近距離の分水嶺 DIST_MARGIN = 50; -- KeepDistでPIVOTからどれだけ離れようとするか BOOT_DIST = 3000; -- 起動距離 --<< 高度調整用 ALT_RELATIVE = 200; -- 相対高度 TIME_JUMP = 2; -- 飛行時間 TIME_WALK = 2; -- 地上時間 --<< 右攻撃 DIST_R_ATK_LIMIT = 500; -- 右攻撃限界距離 DIST_R_ATK_DECENT_MAX = 350; -- 右適正距離限界 DIST_R_ATK_DECENT_MIN = 10; -- 右適正距離最小 --<< 左攻撃 DIST_L_ATK_LIMIT = 400; -- 左攻撃限界距離 DIST_L_ATK_DECENT_MAX = 200; -- 左適正距離限界 DIST_L_ATK_DECENT_MIN = 30; -- 左適正距離最小 --<< 肩攻撃 DIST_S_ATK_LIMIT = 550; -- 肩攻撃限界距離 DIST_S_ATK_DECENT_MAX = 450; -- 肩適正距離限界 DIST_S_ATK_DECENT_MIN = 30; -- 肩適正距離最小 TIME_WAIT_LONG = 3; -- 待ち時間:長 TIME_WAIT_MIDDLE = 1; -- 待ち時間:中 TIME_WAIT_SHORT = 1; -- 待ち時間:短 -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); -- スクリプト初期化 function InitialSetup( context) -- 最初のオペレーションレイヤーを作成する。 --== 移動 -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "InitMove", "Move"); --== 右攻撃 -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "Init_R_Attack", "R_Attack"); --== 左攻撃 -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "Init_L_Attack", "L_Attack"); --== 肩攻撃 -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "Init_S_Attack", "S_Attack"); -- ▼ターゲッティング Targetting_CatchUpWithConeInSide( context, DIST_RADAR , ANGLE_RADAR ); --<< 捕捉(※レーダーの設定) --== 起動用フラグ AddGlobalValue( context , "BOOT_FLAG" , 0 ); 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_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); -- local boot_flg = GetGlobalValue( context , "BOOT_FLAG" ); -- local M_ap = GetEntityAP( context, 0); -- local M_pa = GetEntityPAStability( context, 0); -- local M_en = GetEntityEnergy( context, 0); -- ▼ブースト頻度 SetEstimation_WalkDashRate( context , 0.2 , 0.8 ); --<< 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 < BOOT_DIST ) then ModifyGlobalValue( context , "BOOT_FLAG" , 1 ); end if ( GetGlobalValue( context , "BOOT_FLAG" ) == 1 ) then --<< 行動開始許可が出ていたら if ( M_dist > DIST_PIVOT ) then --<< 一定以上遠い時はその距離を保とうとする -- ▼高度調整 SetAdjustAltitudeBase( context , ADJUST_ALTITUDE_BASE__ABSOLUTE ); --<< 絶対高度を見る SetAltitudeParam( context , 200 , 200 ); -- ▼遠距離戦闘 Op_KeepDist( context , OperationIdentifier( 1 ) , 5 , 8 , 1 , nil , M_bestdist , 100 ); Op_KeepDist( context , OperationIdentifier( 1 ) , 5 , 8 , 1 , nil , M_bestdist - 200 , 100 ); Op_RoundRear( context , OperationIdentifier( 2 ) , 10 , 10 , 0.5 , nil ); Op_RandomWalk( context , OperationIdentifier( 3 ) , 5 , 8 , 0.3 , nil , 200 , 5 ); else --<< 距離を詰められると接近戦へ移行する -- ▼自動高度調整 SetEnableKeepAltitude( context, true); --自動的に高度調整するのを許可するかどうか SetAltitudeParam( context, 50, 50); --自動的に高度調整をする(絶対高度、相対高度) -- ▼近距離戦闘 local rand = RandomRangeInt( -10 , 10 ); Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 2.5 , 10 , 0.5 , nil , M_bestdist , 80 , 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 , M_bestdist-200 , 140 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 7 ) , 2 , 10 , 0.5 , nil , M_bestdist-100 , -160 , 50 , 0 , false ); Op_KeepDist( context , OperationIdentifier( 8 ) , 5 , 8 , 1 , nil , M_bestdist , 100 ); Op_KeepDist( context , OperationIdentifier( 9 ) , 12 , 15 , 1 , nil , M_bestdist + 400 , 200 ); Op_RoundRear( context , OperationIdentifier( 10 ) , 8 , 10 , 0.5 , nil ); end else --<< まだ行動開始じゃない Op_Nothing( context , OperationIdentifier( 11 ) , 2 , 4 , 1 , nil ); Op_RandomWalk( context , OperationIdentifier( 12 ) , 2 , 4 , 1 , nil , 50 , 2 ); end end --****************************************************************************** --[[ @brief 右 攻撃 ]] --****************************************************************************** function Init_R_Attack() -- end -- function R_Attack( context) -- ▼ローカル変数 local R_dist = GetToTargetDistance( context ); local R_rand = RandomRangeInt( 0 , 3 ); if ( 500 < R_dist ) then Op_ShootRifle( context, OperationIdentifier( 50 ), 8, 8, 1, nil, 2, 0, 0, 2, true, true); elseif ( 200 < R_dist and R_dist < 500 ) then Op_ShootRifle( context, OperationIdentifier( 51 ), 8, 8, 1, nil, 0, 0, 0, 2, true, true); else Op_ShootRifle( context, OperationIdentifier( 52 ), 2, 2, 1, nil, 0, 0, 0, 0, true, true); Op_ShootRifle( context, OperationIdentifier( 53 ), 2, 2, 1, nil, 2, 0, 0, 2, true, true); end end --****************************************************************************** --[[ @brief 左 攻撃 ]] --****************************************************************************** function Init_L_Attack() -- end -- function L_Attack( context) -- ▼ローカル変数 local L_dist = GetToTargetDistance( context ); local L_rand = RandomRangeInt( 0 , 3 ); if ( 550 > L_dist ) then Op_ShootRifle( context, OperationIdentifier( 70 ), 2, 2, 1, nil, 1, 0, 0, 2, true, true); end end --****************************************************************************** --[[ @brief 肩 攻撃 ]] --****************************************************************************** function Init_S_Attack() -- end -- function S_Attack( context) -- ▼ローカル変数 Op_ShootRifle( context, OperationIdentifier( 90 ), 3, 3, 1, nil, 4, 1, 1, 10, false, false) end