--****************************************************************************** --[[ @brief 220_NEXT @author ishidai ]] --****************************************************************************** -- ▼NEXT使用パラメータ --<< 捕捉用 DIST_RADAR = 1000; -- レーダー:距離 ANGLE_RADAR = 180; -- レーダー:角度 --<< 遠距離オペレーション用 DIST_LONG = 500; -- 遠距離 DIST_MIDDLE = 300; -- 中距離 DIST_SHORT = 80; -- 近距離 --<< 高度調整用 ALT_RELATIVE = 200; -- 相対高度 TIME_JUMP = 6; -- 飛行時間 TIME_WALK = 6; -- 地上時間 --<< メイン攻撃(速射) DIST_M_ATK_LIMIT = 500; -- 右攻撃限界距離 DIST_M_ATK_MAX = 350; -- 右適正距離限界 DIST_M_ATK_MIN = 10; -- 右適正距離最小 --<< サブ攻撃(ブレード) DIST_S_ATK_LIMIT = 400; -- 左攻撃限界距離 DIST_S_ATK_MAX = 200; -- 左適正距離限界 DIST_S_ATK_MIN = 30; -- 左適正距離最小 --<< サード攻撃(コジマ) DIST_T_ATK_LIMIT = 400; -- 左攻撃限界距離 DIST_T_ATK_MAX = 200; -- 左適正距離限界 DIST_T_ATK_MIN = 30; -- 左適正距離最小 -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); dofile("game:\\common\\event\\include\\m220\\pointid.lua"); dofile("game:\\common\\event\\include\\m220\\entityid.lua"); dofile("game:\\common\\event\\include\\m220\\constvalue.lua"); -- スクリプト初期化 function InitialSetup( context) --== 移動 AddInitialLayer_EveryFrame( context, "InitMove", "Move"); --== 攻撃 AddInitialLayer_EveryFrame( context, "IniAtttack", "Attack"); --== 起動用フラグ AddGlobalValue( context , "BOOT_FLAG" , 0 ); -- ▼ターゲッティング Targetting_CatchUpWithConeInSide( context, DIST_RADAR , ANGLE_RADAR ); DefaultSetup( context , true ); SetAdjustAltitudeBase( context , ADJUST_ALTITUDE_BASE__ABSOLUTE ); SetAltitudeParam( context , GetInitialAltitude( context ) , 0 ); SetTimeLengthJump( context , 0 , 1 ); SetReturnRegionID( context, m220_PT_AC_MOVE); end -- 初期化する。 RegistInitializeFuncitonName( "InitialSetup"); --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --****************************************************************************** --[[ @brief 移動 ]] --****************************************************************************** function InitMove() debug_out("メイン関数初期化。"); end function Move( context) Op_LoopQueue( context , OperationIdentifier( 100 ) , 2 , 10 , 1 , nil , "LoopQueue_Construct_Move" , "LoopQueue_Update_Move" , nil , nil , "ループキュー(移動)" ); end function MoveOK( context) -- ▼ローカル変数 local dist = GetToTargetDistance( context ); local alt = GetInitialAltitude( context ); local rand = RandomRangeInt( -20 , 20 ); local ap_ratio = GetMyApRate( context ); local boot_flg = GetGlobalValue( context , "BOOT_FLAG" ); -- ▼ブースト頻度 SetEstimation_WalkDashRate( context , 0.2 , 0.8 ); --<< walk, dash 確率 SetEstimation_BoostEnableEnergyRange( context , 0 , 1 , 0.4 , 0.8 ); SetTimeLengthJump( context , TIME_JUMP , TIME_WALK ); -- ▼行動 if ( dist > DIST_MIDDLE ) then --<< 一定以上遠い時はその距離を保とうとする -- ▼高度調整 SetAdjustAltitudeBase( context , ADJUST_ALTITUDE_BASE__ABSOLUTE ); --<< 絶対高度を見る SetAltitudeParam( context , 70 , 70 ); -- ▼遠距離戦闘 Op_KeepDist( context , OperationIdentifier( 1 ) , 4 , 6 , 0.2 , nil , 200 , 100 ); Op_RoundRear( context , OperationIdentifier( 2 ) , 4 , 6 , 0.5 , nil ); Op_RandomWalk( context , OperationIdentifier( 3 ) , 4 , 6 , 0.3 , nil , 200 , 5 ); else --<< 距離を詰められると接近戦へ移行する -- ▼自動高度調整 SetEnableKeepAltitude( context, true); --自動的に高度調整するのを許可するかどうか SetAltitudeParam( context, 50, 50); --自動的に高度調整をする(絶対高度、相対高度) -- ▼近距離戦闘 local rand = RandomRangeInt( -10 , 10 ); -- Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 2.5 , 5 , 0.5 , nil , 400 , 60 , 50 , 0 , false ); -- Op_MoveTargetRelation( context , OperationIdentifier( 5 ) , 2.5 , 5 , 0.5 , nil , 400 , -80 , 50 , 0 , false ); -- Op_MoveTargetRelation( context , OperationIdentifier( 6 ) , 2 , 5 , 0.5 , nil , 150 , 10 , 50 , 0 , false ); -- Op_MoveTargetRelation( context , OperationIdentifier( 7 ) , 2 , 5 , 0.5 , nil , 150 , -20 , 50 , 0 , false ); -- Op_KeepDist( context , OperationIdentifier( 8 ) , 4 , 6 , 0.5 , nil , 400 , 100 ); -- Op_RoundRear( context , OperationIdentifier( 9 ) , 4 , 6 , 0.5 , nil ); -- Op_RandomWalk( context , OperationIdentifier( 10 ) , 4 , 6 , 0.3 , nil , 200 , 5 ); -- Op_Nothing( context , OperationIdentifier( 11 ) , 4 , 6 , 0.3 , nil); Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 2.5 , 5 , 0.5 , nil , 30 , 150 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 5 ) , 2.5 , 5 , 0.5 , nil , 50 , -80 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 6 ) , 2 , 5 , 0.5 , nil , 30 ,-170 , 50 , 0 , false ); Op_MoveTargetRelation( context , OperationIdentifier( 7 ) , 2 , 5 , 0.5 , nil , 70 , -20 , 50 , 0 , false ); Op_KeepDist( context , OperationIdentifier( 8 ) , 4 , 6 , 0.5 , nil , 150 , 100 ); Op_RoundRear( context , OperationIdentifier( 9 ) , 4 , 6 , 0.5 , nil ); Op_RandomWalk( context , OperationIdentifier( 10 ) , 4 , 6 , 0.3 , nil , 150 , 5 ); Op_Nothing( context , OperationIdentifier( 11 ) , 1 , 2 , 0.3 , nil); end end --****************************************************************************** --[[ @brief 攻撃 -- AP70%以上⇒レーザー ⇒ ブレードのみ ウェイト12を0に変更 -- AP70%未満⇒レーザーかコジマ砲 -- AP30%未満⇒レーザーかブレード ]] --****************************************************************************** function Init_Attack() -- end -- function Attack( context) Op_LoopQueue( context , OperationIdentifier( 110 ) , 2 , 10 , 1 , nil , "LoopQueue_Construct_Attack" , "LoopQueue_Update_Attack" , nil , nil , "ループキュー(攻撃)" ); end function AttackOK( context) -- ▼ローカル変数 local dist = GetToTargetDistance( context ); local rand = RandomRangeInt( 0 , 3 ); local ap_ratio = GetMyApRate( context ); if PlayerIsInRegion( context , m220_PT_AC_MOVE ) then -- APが90%以上 if ap_ratio > 0.95 then -- Op_ShootRifle( context, OperationIdentifier( 1 ), 10, 10, 1, nil, -- WEAPON_ID__MAIN , 1, 4 , 1, false, false); Op_ShootRifle( context, OperationIdentifier( 7 ), 8, 8, 1, nil, WEAPON_ID__SUB , 0, 0, 1, false, false); -- APが50%以上 elseif ap_ratio > 0.5 then Op_ShootRifle( context, OperationIdentifier( 2 ), 8, 8, 1, nil, WEAPON_ID__MAIN , 1, 2, 1, false, false); Op_ShootRifle( context, OperationIdentifier( 3 ), 8, 8, 1, nil, WEAPON_ID__SUB , 0, 0, 1, false, false); -- APが25%未満 elseif ap_ratio > 0.25 then Op_ShootRifle( context, OperationIdentifier( 4 ), 8, 8, 1, nil, WEAPON_ID__MAIN , 1, 4, 1, false, false); -- Op_ShootKojima( context , OperationIdentifier( 5 ) , 10 , 10 , 0.8 , nil , -- WEAPON_ID__THIRD , 0, 2, 12, false, false); Op_ShootRifle( context, OperationIdentifier( 8 ), 8, 8, 1, nil, WEAPON_ID__SUB , 0, 0, 1, false, false); else Op_ShootRifle( context, OperationIdentifier( 6 ), 8, 8, 1, nil, WEAPON_ID__SUB , 0, 0, 1, false, false); end else Op_ShootRifle( context, OperationIdentifier( 50 ), 8, 8, 1, nil, WEAPON_ID__MAIN , 1, 4, 1, false, false); end end ----------------------------------------------------------------------------------- -- ループキュー(移動) ----------------------------------------------------------------------------------- function LoopQueue_Construct_Move( context ) LogAI( "■AI(ネクスト):ループキュー(移動)" ); -- ▼待機中 Queue_Layer( context , 0 , 0 , nil , nil , "EvalWait" , "Wait" , nil , "待機中" ); -- ▼移動中 Queue_Layer( context , 0 , 0 , nil , nil , "EvalDummy" , "MoveOK" , nil , "移動中" ); end ----------------------------------------------------------------------------------- -- ループキュー更新 ----------------------------------------------------------------------------------- function LoopQueue_Update_Move( context ) end ----------------------------------------------------------------------------------- -- ループキュー(攻撃) ----------------------------------------------------------------------------------- function LoopQueue_Construct_Attack( context ) LogAI( "■AI(ネクスト):ループキュー(攻撃)" ); -- ▼待機中 Queue_Layer( context , 0 , 0 , nil , nil , "EvalWait" , "Wait" , nil , "待機中" ); -- ▼攻撃中 Queue_Layer( context , 0 , 0 , nil , nil , "EvalDummy" , "AttackOK" , nil , "攻撃中" ); end ----------------------------------------------------------------------------------- -- ループキュー更新 ----------------------------------------------------------------------------------- function LoopQueue_Update_Attack( context ) end ----------------------------------------------------------------------------------- -- 待機中 ----------------------------------------------------------------------------------- function Wait( context ) Op_Nothing( context , OperationIdentifier( 120) , 2 , 4 , 1 , nil ); end ----------------------------------------------------------------------------------- -- 評価 ----------------------------------------------------------------------------------- function EvalWait( context ) if ( ( GetMyApRate( context ) < 1 ) or ( PlayerIsInRegion( context , m220_PT_ARENA ) ) ) then context:Complete(); end end ----------------------------------------------------------------------------------- -- ダミー ----------------------------------------------------------------------------------- function EvalDummy( context ) end