--****************************************************************************** --[[ @brief arena_NEXT_AC_22 @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"); --== 肩攻撃 -- 最初のオペレーションレイヤーを作成する。 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_rand = RandomRangeInt( 0, 9 ); local QB_con = 0; local Sam_dam = 0; local Dam_con = 0; 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, 50, 50 ); SetEstimation_WalkDashRate( context, 0.1, 0.9 ); SetEstimation_BoostEnableEnergyRange( context, 0, 1, 0.4, 0.8 ); SetTimeLengthJump( context, 5, 5); --QB回避(撃たれたら) if ( QB_con > 0 ) then QB_con = QB_con - 1; end if ( M_dist < 600 and GetMyEnergyRate( context ) > 20 and QB_con == 0 and TargetHasShot( context ) and SelfIsLocked( context ) ) then QB_con = 10; if ( M_rand < 5 ) then SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); elseif ( 5 <= M_rand < 9 ) then SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); end end --QB回避(ダメージ蓄積したら) Sam_dam = Sam_dam + GetMyLastDamage( context ); Dam_con = Dam_con + 1; if ( Dam_con > 90 ) then Sam_dam = 0; Dam_con = 0; end if ( Sam_dam > 1000 and GetMyEnergyRate( context ) > 20 ) then if ( M_rand < 5 ) then SetQuickBoostDesirablitiy( context, 2, 1, 0.001 ); elseif ( 5 <= M_rand < 9 ) then SetQuickBoostDesirablitiy( context, 3, 1, 0.001 ); end Sam_dam = 0; Dam_con = 0; end if ( M_dist < 200 ) then if ( 0 <= M_rand and M_rand <= 3 ) then if ( GetMyPaRate( context ) > 30 and GetMyEnergyRate( context ) > 30 ) then SetOverdBoostDesirablitiy( context, 0.8, 3); end SetOverdBoostDesirablitiy( context, 1, 3); Op_MoveTargetRelation( context, OperationIdentifier( 1 ), 3, 4, 1, nil, 800, 160, 100, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 2 ), 3, 4, 1, nil, 900, -170, 100, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 3 ), 3, 4, 1, nil, 750, 150, 100, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 4 ), 3, 4, 1, nil, 850, -160, 100, 0, false ); elseif ( 4 <= M_rand and M_rand <= 7 ) then SetAdjustAltitudeBase(context ,ADJUST_ALTITUDE_BASE__TARGET_RELATIVE ); SetAltitudeParam(context, 400, 400); Op_MoveTargetRelation( context, OperationIdentifier( 5 ), 2, 3, 1, nil, 300, 60, 70, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 6 ), 2, 3, 1, nil, 300, -70, 70, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 7 ), 2, 3, 1, nil, 350, -55, 70, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 8 ), 2, 3, 1, nil, 330, -45, 70, 0, false ); else if ( GetMyEnergyRate( context ) > 60 and M_rand < 7 ) then SetQuickBoostDesirablitiy( context, 4, 1, 0.001 ); end Op_MoveTargetRelation( context, OperationIdentifier( 9 ), 1, 2, 1, nil, 1000, 30, 100, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 10 ), 1, 2, 1, nil, 1100, -30, 100, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 11 ), 1, 2, 1, nil, 1050, 35, 100, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 12 ), 1, 2, 1, nil, 1150, -35, 100, 0, false ); end elseif ( M_dist < 700 ) then Op_MoveTargetRelation( context, OperationIdentifier( 13 ), 1, 2, 1, nil, 1000, 30, 300, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 14 ), 1, 2, 1, nil, 1000, -30, 300, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 15 ), 1, 2, 1, nil, 1000, 15, 200, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 16 ), 1, 2, 1, nil, 1000, -15, 200, 0, false ); else if ( GetMyPaRate( context ) > 90 and GetMyEnergyRate( context ) > 60 ) then SetOverdBoostDesirablitiy( context, 0.8, 3); end Op_MoveTargetRelation( context, OperationIdentifier( 17 ), 1, 2, 1, nil, 1000, 120, 300, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 18 ), 1, 2, 1, nil, 1000, -120, 300, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 19 ), 1, 2, 1, nil, 1000, 150, 200, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 20 ), 1, 2, 1, nil, 1000, -150, 200, 0, false ); end end end --****************************************************************************** --[[ @brief 右 攻撃 ]] --****************************************************************************** function Init_R_Attack() -- end -- function R_Attack( context) -- ▼ローカル変数 local R_dist = GetToTargetDistance( context ); local R_rand = RandomRangeInt( 0 , 3 ); if ( 400 < R_dist and 500 > R_dist ) then Op_ShootMssl( context, OperationIdentifier( 50 ), 2, 10, 1, nil, 2, 0, 1, 2, true, true); elseif ( 400 > R_dist ) then Op_ShootRifle( context, OperationIdentifier( 51 ), 8, 8, 1, nil, 0, 0, 2,0, true, true); else Op_ShootMssl( context, OperationIdentifier( 52 ), 2, 2, 1, nil, 2, 0, 1, 2, true, true); Op_ShootRifle( context, OperationIdentifier( 53 ), 2, 2, 1, nil, 0, 0, 2,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 ); local L_pa = GetEntityPAStability( context, 0); local L_alt = GetToTargetAltitude( context); if ( L_pa < 50 ) then Op_ShootRifle( context, OperationIdentifier( 70 ), 8, 8, 1, nil, 3, 0, 0,0, true, true); elseif ( 500 > L_dist ) then --<< 攻撃限界よりも遠く Op_ShootRifle( context, OperationIdentifier( 71 ), 8, 8, 1, nil, 3, 0, 0,0, true, true); Op_ShootMssl( context, OperationIdentifier( 72 ), 4, 4, 1, nil, 1, 0, 0, 2, true, true); elseif(L_alt > 100 and -100 > L_alt) then Op_ShootMssl( context, OperationIdentifier( 73 ), 4, 4, 1, nil, 1, 0, 0, 2, true, true); else Op_ShootMssl( context, OperationIdentifier( 74 ), 4, 4, 1, nil, 1, 0, 0, 2, true, true); end end --****************************************************************************** --[[ @brief 肩 攻撃 ]] --****************************************************************************** function Init_S_Attack() -- end -- function S_Attack( context) -- ▼ローカル変数 local S_dist = GetToTargetDistance( context ); local S_rand = RandomRangeInt( 0 , 3 ); end