113 lines
3.8 KiB
Lua
113 lines
3.8 KiB
Lua
-- $Id: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/ConquerPiratePlan.lua#1 $
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
--
|
|
-- (C) Petroglyph Games, Inc.
|
|
--
|
|
--
|
|
-- ***** ** * *
|
|
-- * ** * * *
|
|
-- * * * * *
|
|
-- * * * * * * * *
|
|
-- * * *** ****** * ** **** *** * * * ***** * ***
|
|
-- * ** * * * ** * ** ** * * * * ** ** ** *
|
|
-- *** ***** * * * * * * * * ** * * * *
|
|
-- * * * * * * * * * * * * * * *
|
|
-- * * * * * * * * * * ** * * * *
|
|
-- * ** * * ** * ** * * ** * * * *
|
|
-- ** **** ** * **** ***** * ** *** * *
|
|
-- * * *
|
|
-- * * *
|
|
-- * * *
|
|
-- * * * *
|
|
-- **** * *
|
|
--
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
-- C O N F I D E N T I A L S O U R C E C O D E -- D O N O T D I S T R I B U T E
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
--
|
|
-- $File: //depot/Projects/StarWars_Steam/FOC/Run/Data/Scripts/AI/ConquerPiratePlan.lua $
|
|
--
|
|
-- Original Author: James Yarrow
|
|
--
|
|
-- $Author: Brian_Hayes $
|
|
--
|
|
-- $Change: 637819 $
|
|
--
|
|
-- $DateTime: 2017/03/22 10:16:16 $
|
|
--
|
|
-- $Revision: #1 $
|
|
--
|
|
--/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
require("pgtaskforce")
|
|
|
|
-- Tell the script pooling system to pre-cache this number of scripts.
|
|
ScriptPoolCount = 4
|
|
|
|
function Definitions()
|
|
MinContrastScale = 1.1
|
|
MaxContrastScale = 1.15
|
|
|
|
Category = "Conquer_Pirate"
|
|
TaskForce = {
|
|
{
|
|
"MainForce"
|
|
, "Infantry | Vehicle | Air | Fighter | Bomber | Corvette | Frigate | Super | Capital = 100%"
|
|
}
|
|
}
|
|
RequiredCategories = { "Air | Infantry | Vehicle" }
|
|
|
|
LandSecured = false
|
|
end
|
|
|
|
function MainForce_Thread()
|
|
|
|
-- Since we're using plan failure to adjust contrast, we're
|
|
-- only concerned with failures in battle. Default the
|
|
-- plan to successful and then
|
|
-- only on the event of our task force being killed is the
|
|
-- plan set to a failed state.
|
|
MainForce.Set_Plan_Result(true)
|
|
|
|
if MainForce.Are_All_Units_On_Free_Store() == true then
|
|
AssembleForce(MainForce)
|
|
else
|
|
BlockOnCommand(MainForce.Produce_Force());
|
|
return
|
|
end
|
|
|
|
BlockOnCommand(MainForce.Move_To(Target))
|
|
if MainForce.Get_Force_Count() == 0 then
|
|
MainForce.Set_Plan_Result(false)
|
|
ScriptExit()
|
|
end
|
|
if Invade(MainForce) == false then
|
|
MainForce.Set_Plan_Result(false)
|
|
ScriptExit()
|
|
end
|
|
|
|
LandSecured = true
|
|
MainForce.Release_Forces(1.0)
|
|
FundBases(PlayerObject, Target)
|
|
|
|
ScriptExit()
|
|
end
|
|
|
|
function MainForce_Production_Failed(failed_object_type)
|
|
ScriptExit()
|
|
end
|
|
|
|
function MainForce_Original_Target_Owner_Changed(tf, old_owner, new_owner)
|
|
--Ignore changes to neutral - it might just be temporary on the way to
|
|
--passing into my control.
|
|
if new_owner ~= PlayerObject and new_owner.Is_Neutral() == false then
|
|
ScriptExit()
|
|
end
|
|
end
|
|
|
|
function MainForce_No_Units_Remaining()
|
|
if not LandSecured then
|
|
MainForce.Set_Plan_Result(false)
|
|
ScriptExit()
|
|
end
|
|
end |