--****************************************************************************** --[[ @brief テスト用 ]] --****************************************************************************** -- 依存ファイル dofile("game:\\common\\airesource\\script\\include\\include.lua"); dofile("game:\\common\\event\\include\\m070\\pointid.lua"); TARGET_SHOOT_COUNTER = 0; -- スクリプト初期化 function Setup( context) LogAI( "長谷川テスト用AIを初期化します。"); -- 最初のオペレーションレイヤーを作成する。 AddInitialLayer_EveryFrame( context, "InitTestMain", "TestMain"); -- -- SetAltitudeParam( context, 20, 0); -- 相手の情報 AddGlobalValue( context, "Right", 0); AddGlobalValue( context, "Left", 0); AddGlobalValue( context, "Common0", 0); AddGlobalValue( context, "Common1", 0); AddGlobalValue( context, "Common2", 0); AddGlobalValue( context, "Common3", 0); SetKeepOutRegion( context, 1); SetKeepOutRegion( context, 2); SetKeepOutRegion( context, 3); SetKeepOutRegion( context, 4); -- AddGlobalValue( context, "tgt_AP", 0); -- AddGlobalValue( context, "tgt_APrate", 0); -- AddGlobalValue( context, "tgt_PA", 0); -- AddGlobalValue( context, "tgt_PArate", 0); -- AddGlobalValue( context, "tgt_energy", 0); -- AddGlobalValue( context, "tgt_energyRate", 0); -- AddGlobalValue( context, "tgt_MainBul", 0); -- AddGlobalValue( context, "tgt_SubBul", 0); -- AddGlobalValue( context, "tgt_Boost", 0); -- AddGlobalValue( context, "tgt_MainWepC", 0); -- AddGlobalValue( context, "tgt_SubWepC", 0); -- AddGlobalValue( context, "tgt_LegC", 0); SetEnableTurnToTarget( context, false); -- 強制クイックブースト設定 --1 SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__FORWARD, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__RIGHT, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__BACK, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__LEFT, 1, 1); --2 SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__FORWARD, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__RIGHT, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__BACK, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__LEFT, 1, 1); --3 SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__FORWARD, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__RIGHT, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__BACK, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__LEFT, 1, 1); --4 SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__FORWARD, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__RIGHT, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__BACK, 1, 1); SetQuickBoostDesirablitiy( context, USER_INPUT_QUICK_BOOST_DIR__LEFT, 1, 1); -- 常駐オペレーション設定 DefaultSetup( context, false); Targetting_CatchUpWithConeInSide( context, 3000, 180); -- IniOp_ShootRifleInRange( context, WEAPON_ID__MAIN, 0, 0, 1, 10, false, false, 100, 30); -- IniOp_ZakoHeriMove( context, 150, 30, 2, 3, 2, 3, 2, 3); end -- -- 初期化する。 RegistInitializeFuncitonName( "Setup"); --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////////////////////////////////////////////////// --****************************************************************************** --[[ @brief 移動 ]] --****************************************************************************** function InitTestMain() end function TestMain( context) -- Op_ShootMachinegun( context, OperationIdentifier(10), 4, 20, 1, nil, WEAPON_ID__MAIN, 0, 3, 4, 4, true); -- Op_ShootBlade( context, OperationIdentifier(10), 4, 20, 1, nil, WEAPON_ID__SUB, 0, 0, true, true); -- Op_ShootMachinegun( context, OperationIdentifier(11), 4, 20, 1, nil, WEAPON_ID__5TH, 0, 0, 100, 100, false, false); -- Op_ShootMachinegun( context, OperationIdentifier(11), 4, 20, 1, nil, WEAPON_ID__MAIN, 0, 0, 1, 10, false, false); -- Op_ShootNolock( context, OperationIdentifier(11), 4, 20, 1, nil, WEAPON_ID__MAIN, 0, 0, 1, 2, false, 1000, 5); -- Op_MoveTargetRelation( context, OperationIdentifier(11), 4, 20, 1, nil, 5000, -15, 20, 0, true); -- Op_FollowRoute( context, OperationIdentifier(10), 4, 20, 1, nil, m070_PT_AC01, m070_PT_AC02, true); -- Op_LoopQueue( context, OperationIdentifier(10), 4, 20, 1, nil, "LoopConstruct", nil, nil, nil, "TestLoopQueue"); Op_Nothing( context, OperationIdentifier(10), 4, 20, 1, nil); Op_Nothing( context, OperationIdentifier(11), 4, 20, 1, nil); -- 相手の情報 ModifyGlobalValue( context, "Right", IsInTargetPartialSphere( context, 60, 0, 135, 45)); ModifyGlobalValue( context, "Left", IsInTargetPartialSphere( context, 60, 0, -135, -45)); ModifyGlobalValue( context, "tgt_AP", GetEntityAP( context, 0)); if ( TargetHasShot( context)) then TARGET_SHOOT_COUNTER = TARGET_SHOOT_COUNTER +1; end local LockLock = 0; if ( HasPerfectLockedByTarget( context)) then LockLock = 9999; end ModifyGlobalValue( context, "Common0", TARGET_SHOOT_COUNTER); -- ModifyGlobalValue( context, "Common0", GetMyEnemyECMEffect( context)); ModifyGlobalValue( context, "Common1", LockLock); ModifyGlobalValue( context, "Common2", GetToTargetEnemyECMEffect( context)); ModifyGlobalValue( context, "Common3", GetMyLastDamage( context)); -- ModifyGlobalValue( context, "Common3", GetWeaponAvailability( context, WEAPON_ID__SUB)); -- ModifyGlobalValue( context, "tgt_AP", GetEntityAP( context, 0)); -- ModifyGlobalValue( context, "tgt_APrate", GetEntityAPRate( context, 0)); -- ModifyGlobalValue( context, "tgt_PA", GetEntityPAStability( context, 0)); -- ModifyGlobalValue( context, "tgt_PArate", GetEntityPAStabilityRate( context, 0)); -- ModifyGlobalValue( context, "tgt_energy", GetEntityEnergy( context, 0)); -- ModifyGlobalValue( context, "tgt_energyRate", GetEntityEnergyRate( context, 0)); -- ModifyGlobalValue( context, "tgt_MainBul", GetEntityMainWeaponBulletRest( context, 0)); -- ModifyGlobalValue( context, "tgt_SubBul", GetEntitySubWeaponBulletRest( context, 0)); -- ModifyGlobalValue( context, "tgt_Boost", GetEntityBoostSpeedCapability( context, 0)); -- ModifyGlobalValue( context, "tgt_MainWepC", GetEntityMainWeaponCategory( context, 0)); -- ModifyGlobalValue( context, "tgt_SubWepC", GetEntitySubWeaponCategory( context, 0)); -- ModifyGlobalValue( context, "tgt_LegC", GetEntityLegCategory( context, 0)); -- Op_ShootMachinegun( context, OperationIdentifier(10), 4, 20, 1, nil, WEAPON_ID__MAIN, 0, 0, 10, 15, GetMagazineReloadTime( context, WEAPON_ID__MAIN), false); -- Op_ShootRifle( context, OperationIdentifier(11), 4, 20, 1, nil, WEAPON_ID__SUB, 0, 0, 0, false); -- Op_MoveTargetRelation( context, OperationIdentifier(10), 4, 20, 1, nil, 50, 15, 20, 0, true); -- Op_MoveTargetRelation( context, OperationIdentifier(11), 4, 20, 1, nil, 5000, -15, 20, 0, true); end function LoopConstruct( context) Queue_Layer( context, 2, 3, nil, nil, nil, "OverdBoostDesirabilityOverride", nil, "OverdBoostOverride") Queue_Nothing( context, 2, 3, nil, nil, nil); end function OverdBoostDesirabilityOverride( context) SetOverdBoostDesirablitiy( context, 2, 3); end