--****************************************************************************** --[[ @brief arena_NEXT_AC_17 @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 = 300; -- 右攻撃限界距離 DIST_R_ATK_DECENT_MAX = 250; -- 右適正距離限界 DIST_R_ATK_DECENT_MIN = 10; -- 右適正距離最小 --<< 左攻撃 DIST_L_ATK_LIMIT = 400; -- 左攻撃限界距離 DIST_L_ATK_DECENT_MAX = 40; -- 左適正距離限界 DIST_L_ATK_DECENT_MIN = 35; -- 左適正距離最小 --<< 肩攻撃 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("testメイン関数初期化。"); 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; local M_en = GetMyEnergyRate( context); 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, 1, 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 > 300 ) 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, 80, 160, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 2 ), 3, 4, 1, nil, 80, -170, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 3 ), 3, 4, 1, nil, 80, 150, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 4 ), 3, 4, 1, nil, 80, -160, 10, 0, false ); elseif ( 4 <= M_rand and M_rand <= 7 ) then SetAdjustAltitudeBase(context ,ADJUST_ALTITUDE_BASE__TARGET_RELATIVE ); SetAltitudeParam(context, 200, 200); Op_MoveTargetRelation( context, OperationIdentifier( 5 ), 2, 3, 1, nil, 80, 90, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 6 ), 2, 3, 1, nil, 80, -90, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 7 ), 2, 3, 1, nil, 80, -75, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 8 ), 2, 3, 1, nil, 80, -85, 10, 0, false ); else SetAdjustAltitudeBase(context ,ADJUST_ALTITUDE_BASE__TARGET_RELATIVE ); SetAltitudeParam(context, 200, 200); Op_MoveTargetRelation( context, OperationIdentifier( 9 ), 1, 2, 1, nil, 80, 50, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 10 ), 1, 2, 1, nil, 80, -50, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 11 ), 1, 2, 1, nil, 80, 55, 10, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 12 ), 1, 2, 1, nil, 80, -55, 10, 0, false ); end elseif ( M_dist < 80 ) then SetAdjustAltitudeBase(context ,ADJUST_ALTITUDE_BASE__TARGET_RELATIVE ); SetAltitudeParam(context, 0, 0); Op_MoveTargetRelation( context, OperationIdentifier( 13 ), 1, 2, 1, nil, 0, 0, 20, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 14 ), 1, 2, 1, nil, 0, 0, 20, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 15 ), 1, 2, 1, nil, 0, 0, 20, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 16 ), 1, 2, 1, nil, 0, 0, 20, 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, 200, 120, 30, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 18 ), 1, 2, 1, nil, 300, -120, 30, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 19 ), 1, 2, 1, nil, 350, 150, 20, 0, false ); Op_MoveTargetRelation( context, OperationIdentifier( 20 ), 1, 2, 1, nil, 400, -150, 20, 0, false ); end end end --****************************************************************************** --[[ @brief 右 攻撃 ]] --****************************************************************************** function Init_R_Attack() -- end function R_Attack( context) -- ▼ローカル変数 local R_dist = GetToTargetDistance( context ); if ( 350 > R_dist ) then Op_ShootRifle( context, OperationIdentifier( 50 ), 8, 8, 1, nil, 0, 0, 1, 0, true, true); else Op_ShootRifle( context, OperationIdentifier( 51 ), 2, 2, 1, nil, 0, 0, 1, 0, true, true); end end --****************************************************************************** --[[ @brief 左 攻撃 ]] --****************************************************************************** function Init_L_Attack() -- end function L_Attack( context) -- ▼ローカル変数 local L_dist = GetToTargetDistance( context ); if ( 40 > L_dist) then Op_SubShoot2( context, OperationIdentifier( 70 ), 1, 1, 1, nil, 100, true, 1, 1, 1, 1); else Op_ShootNolock( context, OperationIdentifier( 71 ), 8, 8, 1, nil, 3, 0, 0, 1, 1, true, 500, 8); end end