When upgrade a siege unit into a Rocket Artillery, it keeps the promotion that requires it to setup before a ranged attack.
adde to commented codes in the sid meier's civilization v\Assets\UI\InGame\WorldView\UnitPanel.lua
--------------------------------------------------------------------------------
-- UnitAction<idx> was clicked.
--------------------------------------------------------------------------------
function OnUnitActionClicked( action )
if bOkayToProcess then
if (GameInfoActions[action].SubType == ActionSubTypes.ACTIONSUBTYPE_PROMOTION) then
Events.AudioPlay2DSound("AS2D_INTERFACE_UNIT_PROMOTION");
end
-- aded by lucie
if( GameInfoActions[action].Type == "COMMAND_UPDAGE" ) then
local unit = UI.GetHeadSelectedUnit();
local promotion = GameInfo["UnitPromotions"]["PROMOTION_MUST_SET_UP"]["ID"];
if( GameInfo.Units.UNIT_ROCKET_ARTILLERY.ID == unit:GetUpdagedUnitType() ) then
unit:SetHasPromotion( promotion, false );
end
end
-- bye~
Game.HandleAction( action );
end
end
adde to commented codes in the sid meier's civilization v\Assets\UI\InGame\WorldView\UnitPanel.lua
--------------------------------------------------------------------------------
-- UnitAction<idx> was clicked.
--------------------------------------------------------------------------------
function OnUnitActionClicked( action )
if bOkayToProcess then
if (GameInfoActions[action].SubType == ActionSubTypes.ACTIONSUBTYPE_PROMOTION) then
Events.AudioPlay2DSound("AS2D_INTERFACE_UNIT_PROMOTION");
end
-- aded by lucie
if( GameInfoActions[action].Type == "COMMAND_UPDAGE" ) then
local unit = UI.GetHeadSelectedUnit();
local promotion = GameInfo["UnitPromotions"]["PROMOTION_MUST_SET_UP"]["ID"];
if( GameInfo.Units.UNIT_ROCKET_ARTILLERY.ID == unit:GetUpdagedUnitType() ) then
unit:SetHasPromotion( promotion, false );
end
end
-- bye~
Game.HandleAction( action );
end
end