--****************************************************************************** --[[ @brief 030_NEXT_AC_Sus @author Kazushi Morita ]] --****************************************************************************** -- ▼NEXT使用パラメータ --<< 捕捉用 DIST_RADAR = 2000; -- レーダー:距離 ANGLE_RADAR = 180; -- レーダー:角度 --<< 遠距離オペレーション用 DIST_PIVOT_FAR = 600; -- 超遠距離 DIST_PIVOT_LONGRANGE = 400; -- 遠距離 DIST_PIVOT_MIDDLERANGE = 150; -- 中距離 DIST_PIVOT_SHORTRANGE = 80; -- 近距離 DIST_PIVOT = 350; -- 遠距離/近距離の分水嶺 DIST_MARGIN = 50; -- KeepDistでPIVOTからどれだけ離れようとするか BOOT_DIST = 3000; -- 起動距離 --<< 高度調整用 ALT_RELATIVE = 200; -- 相対高度 TIME_JUMP = 2; -- 飛行時間 TIME_WALK = 4; -- 地上時間 --<< 右攻撃 DIST_R_ATK_LIMIT = 800; -- 右攻撃限界距離 DIST_R_ATK_DECENT_MAX = 550; -- 右適正距離限界 DIST_R_ATK_DECENT_MIN = 200; -- 右適正距離最小 --<< 左攻撃 DIST_L_ATK_LIMIT = 550; -- 左攻撃限界距離 DIST_L_ATK_DECENT_MAX = 450; -- 左適正距離限界 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"); dofile("game:\\common\\event\\include\\m030\\pointid.lua"); dofile("game:\\common\\event\\include\\m030\\entityid.lua"); dofile("game:\\common\\event\\include\\m030\\constvalue.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 ); --<< 捕捉(※レーダーの設定) AddSharedGlobalValue( context, "GO" , 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_myap = GetEntityAPRate( context, m030_ET_NEXTAC); local M_fall_in = GetSharedGlobalValue( context , "GO" ); local M_bestweapon = GetBestWeaponID( context) local M_bestdist = GetBestWeaponDistance( context, M_bestweapon); -- 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 (0.30 < M_myap and M_myap < 0.60 ) then --<< 一定値までAPが減ると換わる⇒イベントと同期させる 通常1 AP減ると0 敵もいなくなると2 ModifySharedGlobalValue( context, "GO", 0); elseif(M_myap < 0.30 ) then ModifySharedGlobalValue( context, "GO", 2); else ModifySharedGlobalValue( context, "GO", 1); end --▼移動 if ( M_fall_in < 1 ) then -- ▼高度調整 SetAdjustAltitudeBase( context , ADJUST_ALTITUDE_BASE__ABSOLUTE ); --<< 絶対高度を見る SetAltitudeParam( context , M_alt , M_alt ); -- ▼通常戦闘 Op_KeepDist( context , OperationIdentifier( 1 ) , 5 , 8 , 1 , nil , 50 , 100 ); Op_RoundRear( context , OperationIdentifier( 2 ) , 3 , 5 , 0.5 , nil ); Op_MoveTargetRelation( context , OperationIdentifier( 3 ) , 2.5 , 4 , 0.5 , nil , 100 , -150 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 2 , 4 , 0.5 , nil , 100 , 90 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 14 ) , 2 , 4 , 0.5 , nil , 50 , 120 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 15 ) , 2 , 4 , 0.5 , nil , 100 , 90 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 5 ) , 2 , 4 , 0.5 , nil , 50 , -90 , 50 , 0 , false ); elseif ( M_fall_in == 1 ) then --<< -- ▼自動高度調整 SetEnableKeepAltitude( context, true); --自動的に高度調整するのを許可するかどうか SetAltitudeParam( context, 50, 50); --自動的に高度調整をする(絶対高度、相対高度) -- ▼ local rand = RandomRangeInt( -10 , 10 ); Op_MoveTargetRelation( context , OperationIdentifier( 6 ) , 4 , 10 , 0.5 , nil , 40 , 60 , 20 , 0 , false ); --40m、右60度、マージン50m Op_MoveTargetRelation( context , OperationIdentifier( 7 ) , 2 , 4 , 0.5 , nil , 200 , 100 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 8 ) , 2 , 4 , 0.5 , nil , 50 , -120 , 50 , 0 , false ); elseif ( M_fall_in == 2 ) then --<< -- ▼自動高度調整 SetEnableKeepAltitude( context, true); --自動的に高度調整するのを許可するかどうか SetAltitudeParam( context, 50, 50); --自動的に高度調整をする(絶対高度、相対高度) -- ▼距離をとったり近づいたり local rand = RandomRangeInt( -10 , 10 ); Op_MoveTargetRelation( context , OperationIdentifier( 10 ) , 4 , 10 , 0.5 , nil , 40 , 80 , 20 , 0 , false ); --40m、右60度、マージン50m Op_MoveTargetRelation( context , OperationIdentifier( 16 ) , 2 , 4 , 1 , nil , 100 , 150 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 11 ) , 2 , 10 , 0.5 , nil , 50 , 100 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 12 ) , 2 , 10 , 0.5 , nil , 100 , -120 , 50 , 0 , false ); Op_KeepDist( context , OperationIdentifier( 13 ) , 5 , 15 , 1 , nil , 150 , 100 ); end end --****************************************************************************** --[[ @brief 右 攻撃 ]] --****************************************************************************** function Init_R_Attack() -- end -- function R_Attack( context) -- ▼ローカル変数 local R_dist = GetToTargetDistance( context ); local R_rand = RandomRangeInt( 0 , 3 ); -- local R_ap = GetEntityAP( context, 0); -- local R_pa = GetEntityPAStability( context, 0); -- local R_en = GetEntityEnergy( context, 0); local avArmR = GetWeaponAvailability( context, WEAPON_ID__ARMWEP_R); local avBackR = GetWeaponAvailability( context, WEAPON_ID__BACK_R); local idBestRWeapon = 0; if ( avArmR < avBackR ) then idBestRWeapon = WEAPON_ID__BACK_R; else idBestRWeapon = WEAPON_ID__ARMWEP_R; end if ( DIST_R_ATK_LIMIT < R_dist ) then --<< 攻撃限界よりも遠く Op_ShootRifle( context, OperationIdentifier( 50 ), 8, 8, 1, nil, idBestRWeapon, 0, 0, 1, true, true); elseif ( DIST_R_ATK_DECENT_MAX < R_dist and R_dist < DIST_R_ATK_LIMIT ) then --<< 遠距離 Op_ShootRifle( context, OperationIdentifier( 51 ), 8, 8, 1, nil, idBestRWeapon, 0, 0, 1, true, true); elseif ( DIST_R_ATK_DECENT_MIN < R_dist and R_dist < DIST_R_ATK_DECENT_MAX ) then --<< 適正距離内 Op_ShootRifle( context, OperationIdentifier( 52 ), 6, 6, 1, nil, idBestRWeapon, 0, 0, 1, true, true); elseif ( R_dist < DIST_R_ATK_DECENT_MIN ) then --<< 短距離 Op_ShootRifle( context, OperationIdentifier( 53 ), 8, 8, 0.3, nil, 0, 0, 0, 1, true, true); Op_ShootRifle( context, OperationIdentifier( 54 ), 8, 8, 1, nil, 2, 0, 0, 1, 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 ); -- local L_ap = GetEntityAP( context, 0); -- local L_pa = GetEntityPAStability( context, 0); -- local L_en = GetEntityEnergy( context, 0); local avArmL = GetWeaponAvailability( context, WEAPON_ID__ARMWEP_L); local avBackL = GetWeaponAvailability( context, WEAPON_ID__BACK_L); local idBestLWeapon = 3; if ( avArmL < avBackL ) then idBestLWeapon = WEAPON_ID__BACK_L; else idBestLWeapon = WEAPON_ID__ARMWEP_L; end if ( DIST_L_ATK_LIMIT < L_dist ) then --<< 攻撃限界よりも遠く Op_ShootMssl( context, OperationIdentifier( 70 ), 8, 8, 1, nil, 3, 0, 0, 0, true, true); elseif ( DIST_L_ATK_DECENT_MAX < L_dist and L_dist < DIST_L_ATK_LIMIT ) then --<< 遠距離 Op_ShootMssl( context, OperationIdentifier( 71 ), 6, 6, 1, nil, 3, 0, 0, 0, true, true); Op_ShootNolock( context, OperationIdentifier( 80 ), 6, 8, 1, nil, 1, 0, 0, 1, 4, true, 600, 8); elseif ( DIST_L_ATK_DECENT_MIN < L_dist and L_dist < DIST_L_ATK_DECENT_MAX ) then --<< 適正距離内 Op_ShootMssl( context, OperationIdentifier( 83 ), 6, 6, 1, nil, 3, 0, 0, 0, true, true); Op_ShootNolock( context, OperationIdentifier( 81 ), 6, 8, 1, nil, 1, 0, 0, 1, 4, true, 500, 7); elseif ( L_dist < DIST_L_ATK_DECENT_MIN ) then --<< 短距離 Op_Nothing( context , OperationIdentifier( 73 ) , 2 , 4 , 1 , nil ); Op_ShootNolock( context, OperationIdentifier( 82 ), 8, 8, 1, nil, 1, 0, 0, 1, 4, true, 400, 6); end end --****************************************************************************** --[[ @brief 肩 攻撃 ]] --****************************************************************************** function Init_S_Attack() -- end -- function S_Attack( context) -- ▼ローカル変数 local S_dist = GetToTargetDistance( context ); local S_rand = RandomRangeInt( 0 , 3 ); -- local S_ap = GetEntityAP( context, 0); -- local S_pa = GetEntityPAStability( context, 0); -- local S_en = GetEntityEnergy( context, 0); -- if ( DIST_S_ATK_LIMIT < S_dist ) then --<< 攻撃限界よりも遠く --Op_ShootRifle( context, OperationIdentifier( 90 ), 3, 3, 1, nil, 4, 1, 1, 0, false, false) -- elseif ( DIST_S_ATK_DECENT_MAX < S_dist and S_dist < DIST_S_ATK_LIMIT ) then --<< 遠距離 --Op_ShootRifle( context, OperationIdentifier( 91 ), 3, 3, 1, nil, 4, 1, 1, 0, false, false) -- elseif ( DIST_S_ATK_DECENT_MIN < S_dist and S_dist < DIST_S_ATK_DECENT_MAX ) then --<< 適正距離内 --Op_ShootRifle( context, OperationIdentifier( 92 ), 3, 3, 1, nil, 4, 1, 1, 0, false, false) -- elseif ( S_dist < DIST_S_ATK_DECENT_MIN ) then --<< 短距離 --Op_ShootRifle( context, OperationIdentifier( 93 ), 3, 3, 1, nil, 4, 1, 1, 0, false, false) -- end end