--****************************************************************************** --[[ @brief arena_NEXT_AC_01_ベルリオーズ @author Hidetaka Miyazaki ]] --****************************************************************************** DIST_RADAR = 5000; ANGLE_RADAR = 180; ALT_RELATIVE = 200; 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 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 = 30; --距離のぶれ 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 = 50; --切り返し最低フレーム local Move_D = 45; --切り返しQB最低EN local Move_E = 45; --切り返しQB確率(これ以外で切り返さないQB) local SMove_A = 40; --逃げQB確率 local SMove_B = 35; --逃げQB最低EN local SMove_C = 90; --すれ違い確率(SMove_A〜SMove_C%) local SMove_D = 40; --すれ違いOB確率 local SMove_E = 70; --すれ違い角度 local X_leng = 100; --すれ違い相対高度 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 = 60; --ランダムQBしたときに右の確率(RQB_f〜RQB_r%) local RQB_l = 95; --ランダム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 R_Attack( context ) local R_dist = GetToTargetDistance( context ); local R_HMV = 0; if ( 600 < R_dist ) then Op_ShootRifle( context, OperationIdentifier( 50 ), 1, 2, 1, nil, 0, 0, 0, 0, true, true); Op_Nothing( context, OperationIdentifier( 51 ), 1, 2, 1, nil ); elseif ( 600 >= R_dist and R_dist > 400 ) then Op_ShootRifle( context, OperationIdentifier( 52 ), 1, 2, 1, nil, 0, 0, 0, 0, true, true); elseif ( 400 >= R_dist and R_dist > 100 ) then Op_ShootRifle( context, OperationIdentifier( 53 ), 3, 6, 3, nil, 2, 0, 0, 0, true, true); Op_ShootRifle( context, OperationIdentifier( 54 ), 2, 4, 1, nil, 0, 0, 0, 0, true, true); elseif ( 100 >= R_dist ) then Op_ShootRifle( context, OperationIdentifier( 55 ), 2, 4, 1, nil, 0, 0, 0, 0, true, true); Op_Nothing( context, OperationIdentifier( 56 ), 1, 2, 1, nil ); else R_HMV = R_HMV + 1; end if ( R_HMV > 120 ) then Op_ShootRifle( context, OperationIdentifier( 57 ), 1, 2, 0.5, nil, 0, 0, 0, 0, true, true); Op_ShootRifle( context, OperationIdentifier( 58 ), 1, 2, 0.5, nil, 2, 0, 0, 0, true, true); Op_Nothing( context, OperationIdentifier( 59 ), 1, 2, 0.5, nil ); R_HMV = 0; end end --****************************************************************************** --[[ @brief 左 攻撃 ]] --****************************************************************************** function L_Attack( context) local L_dist = GetToTargetDistance( context ); local L_HMV = 0; if ( 500 < L_dist ) then Op_ShootRifle( context, OperationIdentifier( 60 ), 2, 4, 1, nil, 1, 0, 0, 0, true, true); Op_Nothing( context, OperationIdentifier( 61 ), 1, 2, 3, nil ); elseif ( 500 >= L_dist and L_dist > 50 ) then Op_ShootRifle( context, OperationIdentifier( 62 ), 4, 8, 1, nil, 1, 0, 0, 0, true, true); elseif ( 50 >= L_dist ) then Op_ShootRifle( context, OperationIdentifier( 63 ), 1, 3, 1, nil, 1, 0, 0, 0, true, true); Op_Nothing( context, OperationIdentifier( 64 ), 1, 1, 1, nil ); else L_HMV = L_HMV + 1; end if ( L_HMV > 120 ) then Op_ShootRifle( context, OperationIdentifier( 65 ), 1, 2, 0.5, nil, 1, 0, 0, 0, true, true); Op_Nothing( context, OperationIdentifier( 66 ), 1, 2, 0.5, nil ); L_HMV = 0; end end