--****************************************************************************** --[[ @brief arena_NEXT_AC_38 @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 = 8; -- 飛行時間 TIME_WALK = 5; -- 地上時間 --<< 右攻撃 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"); -- ▼ターゲッティング 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 Rand_A = RandomRangeInt( 0 , 99 ); local Rand_B = RandomRangeInt( 0 , 99 ); local Rand_C = RandomRangeInt( 0 , 99 ); local Rand_D = RandomRangeInt( 0 , 99 ); local M_dist = GetToTargetDistance( context ); local Y_leng = 0; --基本絶対高度 local D_rate = 0.9; --基本ダッシュ率 local W_rate = 0.1; --基本歩行率 local F_time = 2; --基本飛行時間 local W_time = 1; --基本地上時間 local QB_con = 0; local QBE_A = 100; --撃たれたら避ける距離下限 local QBE_B = 600; --撃たれたら避ける距離上限 local QBE_C = 30; --撃たれたら避けるEN%上限 local QBE_D = 10; --撃たれたら避ける間隔下限 local QBE_E = 40; --撃たれたら右に避ける確率0〜この値% local QBE_F = 80; --撃たれたら左に避ける確率QBE_E〜この値%(QBE_F〜100%で避けない) local QBE_G = 800; --撃たれたら避ける直前のダメージ上限 local M_con = 0; local B_dist = 400; --ベスト距離(可変可) local X_dist = 100; --距離のぶれ local S_dist = 250; --避けたい距離(短い) local H_dist = 550; --避けたい距離(長い) local B_angl = 130; --ベスト角度 local Move_A = 40; --右を狙う確率0〜この値%(Move_A〜100%で左を狙う) local Move_B = 90; --切り返し確率 local Move_C = 80; --切り返し最低フレーム local Move_D = 25; --切り返しQB最低EN local Move_E = 25; --切り返しQB確率(これ以外で切り返さないQB) local SMove_A = 20; --逃げQB確率 local SMove_B = 15; --逃げQB最低EN local SMove_C = 100; --すれ違い確率(SMove_A〜SMove_C%) local SMove_D = 60; --すれ違いOB確率 local SMove_E = 70; --すれ違い角度 local X_leng = 150; --すれ違い相対高度 local HMove_A = 70; --追いQB確率 local HMove_B = 30; --追いQB最低EN local HMove_C = 60; --追いOB確率(HMove_A〜HMove_C%) local HMove_D = 15; --追い切り返し確率 local HMove_E = 60; --右追い切り返し確率(残りは左) local RQB_c = 5; --ランダムQB確率 local RQB_en = 40; --ランダムQB最低EN local RQB_cc = 15; --ロックされているときのランダムQB上昇 local RQB_f = 20; --ランダムQBしたときに前の確率 local RQB_r = 50; --ランダムQBしたときに右の確率(RQB_f〜RQB_r%) local RQB_l = 50; --ランダムQBしたときに左の確率(RQB_r〜RQB_l%)残りはうしろ local Y_dist = 50; --潜り込むときの距離 local Y_angl = 180; --潜り込むときの角度 local Y_obdist = 50; --潜り込みOBの使用距離上限 local YMove_A = 70; --潜り込みOB使用確率 if ( M_dist < 5000 ) then ModifyGlobalValue( context, "BOOT_FLAG", 1 ); end if ( GetGlobalValue( context, "BOOT_FLAG" ) == 1 ) then SetEnableTurnToTarget(context, true); SetEnableViewTurn( context, true); SetAdjustAltitudeBase( context ,ADJUST_ALTITUDE_BASE__ABSOLUTE ); SetAltitudeParam( context, Y_leng, Y_leng); SetEstimation_WalkDashRate( context, W_rate, D_rate ); SetEstimation_BoostEnableEnergyRange( context, 0, 1, 0.4, 0.8 ); SetTimeLengthJump( context, F_time, W_time); if ( QB_con > 0 ) then QB_con = QB_con - 1; end if ( M_dist > QBE_A and M_dist < QBE_B and GetMyEnergyRate( context ) > QBE_C and GetMyLastDamage( context ) > QBE_G and QB_con == 0 and TargetHasShot( context ) and SelfIsLocked( context ) ) then QB_con = QBE_D; if ( Rand_A < QBE_E ) then SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); elseif ( Rand_A < QBE_F ) then SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); end end if ( GetToTargetAltitude( context ) > 150 ) then Op_MoveTargetRelation( context, OperationIdentifier( 1 ), 1, 3, 5, nil, Y_dist, Y_angl, X_dist, 0, false ); if ( Rand_A < YMove_A and M_dist < Y_obdist ) then SetOverdBoostDesirablitiy( context, 1, 3 ); end elseif ( M_dist < S_dist ) then if ( Rand_A < SMove_A and GetMyEnergyRate( context ) > SMove_B ) then SetQuickBoostDesirablitiy( context, 4, 1, 0.001 ); elseif ( Rand_A < SMove_C ) then if ( GetToTargetAltitude( context ) > 0 ) then SetAdjustAltitudeBase( context ,ADJUST_ALTITUDE_BASE__TARGET_RELATIVE ); SetAltitudeParam( context, X_leng, X_leng); else SetAdjustAltitudeBase( context ,ADJUST_ALTITUDE_BASE__ABSOLUTE ); SetAltitudeParam( context, 0, 0); end Op_MoveTargetRelation( context, OperationIdentifier( 1 ), 1, 3, 5, nil, B_dist, SMove_E, X_dist, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 2 ), 1, 3, 5, nil, B_dist, -SMove_E, X_dist, 0, false ); if ( Rand_B < SMove_D ) then SetOverdBoostDesirablitiy( context, 1, 2 ); end end elseif ( M_dist > H_dist ) then Op_MoveTargetRelation( context, OperationIdentifier( 6 ), 1, 3, 5, nil, B_dist, 10, X_dist, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 7 ), 1, 3, 5, nil, B_dist, -10, X_dist, 0, false ); if ( Rand_A < HMove_D ) then if ( Rand_B < HMove_E ) then Op_MoveTargetRelation( context, OperationIdentifier( 8 ), 0.3, 0.6, 10, nil, M_dist, 90, X_dist, 0, false ); else Op_MoveTargetRelation( context, OperationIdentifier( 9 ), 0.3, 0.6, 10, nil, M_dist, -90, X_dist, 0, false ); end end if ( Rand_C < HMove_A and GetMyEnergyRate( context ) > HMove_B ) then SetQuickBoostDesirablitiy( context, 1, 1, 0.001 ); elseif ( Rand_C < HMove_C ) then SetOverdBoostDesirablitiy( context, 1, 4 ); end end if ( Rand_A < Move_A ) then Op_MoveTargetRelation( context, OperationIdentifier( 10 ), 2, 3, 1, nil, B_dist, B_angl, X_dist, 0, false ); M_con = M_con + 1; if ( Rand_B < Move_B and M_con > Move_C ) then if ( GetMyEnergyRate( context ) > Move_D ) then if ( Rand_C < Move_E ) then SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); else SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); end else Op_MoveTargetRelation( context, OperationIdentifier( 11 ), 0.8, 2, 10, nil, B_dist, -B_angl, X_dist, 0, false ); end M_con = 0; end else Op_MoveTargetRelation( context, OperationIdentifier( 20 ), 2, 3, 1, nil, B_dist, -B_angl, X_dist, 0, false ); M_con = M_con + 1; if ( Rand_B < Move_B and M_con > Move_C ) then if ( GetMyEnergyRate( context ) > Move_D ) then if ( Rand_C < Move_E ) then SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); else SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); end else Op_MoveTargetRelation( context, OperationIdentifier( 21 ), 0.8, 2, 10, nil, B_dist, B_angl, X_dist, 0, false ); end M_con = 0; end end if ( SelfIsLocked( context ) ) then if ( Rand_D > RQB_c + RQB_cc and GetMyEnergyRate( context ) > RQB_en ) then if ( Rand_A < RQB_f ) then SetQuickBoostDesirablitiy( context, 1, 1, 0.001 ); elseif ( Rand_A < RQB_r ) then SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); elseif ( Rand_A < RQB_l ) then SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); else SetQuickBoostDesirablitiy( context, 4, 1, 0.001 ); end end else if ( Rand_D > RQB_c and GetMyEnergyRate( context ) > RQB_en ) then if ( Rand_A < RQB_f ) then SetQuickBoostDesirablitiy( context, 1, 1, 0.001 ); elseif ( Rand_A < RQB_r ) then SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); elseif ( Rand_A < RQB_l ) then SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); else SetQuickBoostDesirablitiy( context, 4, 1, 0.001 ); end end end end end --****************************************************************************** --[[ @brief 右 攻撃 ]] --****************************************************************************** function Init_R_Attack() -- end -- function R_Attack( context) -- ▼ローカル変数 local R_dist = GetToTargetDistance( context ); local R_rand = RandomRangeInt( 0 , 3 ); 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 ( 500 < R_dist ) then --<< 攻撃限界よりも遠く Op_ShootRifle( context, OperationIdentifier( 50 ), 8, 8, 1, nil, idBestRWeapon, 0, 0, 2, true, true); elseif ( 300 < R_dist and R_dist < 500 ) then --<< 遠距離 Op_ShootRifle( context, OperationIdentifier( 51 ), 8, 8, 1, nil, idBestRWeapon, 0, 0, 2, true, true); else Op_ShootRifle( context, OperationIdentifier( 52 ), 2, 2, 1, nil, idBestRWeapon, 0, 0, 0, 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 ( 350 > L_dist ) then --<< 攻撃限界よりも遠く Op_ShootRifle( context, OperationIdentifier( 70 ), 8, 8, 1, nil, 1, 0, 0, 0, true, true); end end