--****************************************************************************** --[[ @brief test_一般的な量産AC(例:ハーゼン) @author Yoshikazu KOIDE ]] --****************************************************************************** -- 本ミッション用定数 DIST_LADER = 800; -- レーダー距離 DIST_TARGET_LIMIT = 400; -- この距離より近くに他敵が入ってくるとそいつを優先的に狙う DIST_ATTACK_MAX = 700; DIST_CANNON = 350; -- cannon使う距離 ALT_SURFACE = 5; -- 地表絶対高度 ALT_LIMIT = 50; -- 飛行時最大高度 -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); dofile("game:\\common\\event\\include\\m200\\pointid.lua"); RANDOM = "random"; DAMAGE = "damage_hit"; -- スクリプト初期化 function InitialSetup( context) AddGlobalValue( context , DAMAGE , 0 ); DefaultSetup( context , false ); AddInitialLayer( context , "InitMove" , "Move" , 0.2); AddInitialLayer_EveryFrame( context , "InitAttack" , "Attack" ); Targetting_CatchUpWithConeInSide( context , 700 , 180 ); -- 1000m, 360 /レーダー SetKeepOutRegion( context , m200_PT_DROP1 ); SetKeepOutRegion( context , m200_PT_DROP2 ); SetKeepOutRegion( context , m200_PT_DROP3 ); SetKeepOutRegion( context , m200_PT_DROP4 ); --▼ ブースト頻度 SetEstimation_WalkDashRate( context , 0 , 1 ); SetEstimation_BoostEnableEnergyRange( context , 0 , 1 , 1 , 1 ); -- IniOp_ShootMachinegunInRange( context , 0 , 0.1 , 0.5 , 0.3 , 0.5 , true , true , 500 , 0 ); end -- 初期化する。 RegistInitializeFuncitonName( "InitialSetup"); --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --****************************************************************************** --[[ @brief 移動 ]] --****************************************************************************** function InitMove() debug_out("testメイン関数初期化。"); end function Move( context) -- ローカル変数 local dist = GetToTargetDistance( context); local decent = ( DIST_ATTACK_MAX + DIST_CANNON ) * 0.5 ; if ( IsExistTarget( context) ) then local rand = RandomRangeInt( -50 , 50 ); --GetGlobalValue( context , RANDOM ); -- LogAI( string.format( " rand = %d " , rand ) ); -- Op_MoveTargetRelation( context , OperationIdentifier( 1 ) , 25 , 30 , 1 , nil , decent , 60 , 30 , 0 , false ); -- Op_MoveTargetRelation( context , OperationIdentifier( 2 ) , 25 , 30 , 1 , nil , decent , -40 , 30 , 0 , false ); -- Op_Nothing( context , OperationIdentifier( 3 ) , 1.5 , 2 , 1 , nil ); -- 立ち止まる(振り向く) Op_KeepDist( context , OperationIdentifier( 1) , 1.5 , 10.5 , 1 , nil , 150 + rand , 10 ); -- 急接近 -- Op_KeepDist( context , OperationIdentifier( 2) , 1.5 , 10.5 , 1 , nil , 550 + rand , 10 ); -- 急接近 -- Op_RandomWalk( context , OperationIdentifier( 6 ) , 2 , 8 , 1 , nil , 100 , 4) ; -- ウロウロ -- Op_RoundRear( context , OperationIdentifier( 3 ) , 1 , 9 , 0.95 , nil ); -- Op_MoveTargetRelation( context , OperationIdentifier( 4 ) , 0.5 , 13.0 , 1 , nil , decent + rand , rand , 20 , 0 , true ); else -- Op_RandomWalk( context , OperationIdentifier( 5 ) , 2 , 4 , 1 , nil , 100 , 4) ; -- ウロウロ Op_Nothing( context , OperationIdentifier( 3 ) , 1.5 , 2 , 1 , nil ); -- 何もしない end end --****************************************************************************** --[[ @brief test 攻撃 ]] --****************************************************************************** function InitAttack() -- end -- function Attack( context) -- 中距離アサルト/近づいたらブレード local dist = GetToTargetDistance( context); Op_ShootRifle( context, OperationIdentifier(11), 3, 6, 1, nil, 0, 0.1 , 5.0 , 0 , true , true ); --[[ if ( GetMyLastDamage( context ) > 10 ) then ModifyGlobalValue( context , DAMAGE , 1 ); end -- 一度でもダメージを受けたら攻撃を開始する if( GetGlobalValue( context , DAMAGE ) == 1 ) then Op_ShootRifle( context, OperationIdentifier(11), 3, 6, 1, nil, 0, 0.1 , 5.0 , 0 , true , true ); else Op_Nothing( context , OperationIdentifier( 13 ) , 1.5 , 2 , 1 , nil ); -- 何もしない end]] end