From f4f2030b29cef3c93957a0637f53f88736aa0f0f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 2 Dec 2016 15:55:37 +0000 Subject: [PATCH] Port scripts to new api. --- mods/ra/maps/desert-shellmap/desert-shellmap.lua | 4 ++-- mods/ra/maps/desert-shellmap/rules.yaml | 14 ++++++++++++-- mods/ra/maps/fort-lonestar/fort-lonestar.lua | 2 +- mods/ts/maps/fields-of-green/fields-of-green.lua | 4 ++-- mods/ts/maps/fields-of-green/map.yaml | 8 ++++++-- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/mods/ra/maps/desert-shellmap/desert-shellmap.lua b/mods/ra/maps/desert-shellmap/desert-shellmap.lua index c0f101d799..dd7f10b13e 100644 --- a/mods/ra/maps/desert-shellmap/desert-shellmap.lua +++ b/mods/ra/maps/desert-shellmap/desert-shellmap.lua @@ -113,8 +113,8 @@ end SetupAlliedUnits = function() Utils.Do(Map.NamedActors, function(a) - if a.Owner == allies and a.HasProperty("AcceptsUpgrade") and a.AcceptsUpgrade("unkillable") then - a.GrantUpgrade("unkillable") + if a.Owner == allies and a.HasProperty("AcceptsCondition") and a.AcceptsCondition("unkillable") then + a.GrantCondition("unkillable") a.Stance = "Defend" end end) diff --git a/mods/ra/maps/desert-shellmap/rules.yaml b/mods/ra/maps/desert-shellmap/rules.yaml index f49bfa81fd..accc448782 100644 --- a/mods/ra/maps/desert-shellmap/rules.yaml +++ b/mods/ra/maps/desert-shellmap/rules.yaml @@ -11,8 +11,6 @@ World: ValuePerUnit: 0 LuaScript: Scripts: desert-shellmap.lua - ExternalConditions: - Conditions: unkillable -StartGameNotification: ^Vehicle: @@ -23,6 +21,8 @@ World: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable ^Tank: GivesBounty: @@ -32,6 +32,8 @@ World: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable ^Infantry: GivesBounty: @@ -47,6 +49,8 @@ World: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable ^Ship: GivesBounty: @@ -56,6 +60,8 @@ World: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable ^Plane: GivesBounty: @@ -63,6 +69,8 @@ World: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable ^Building: GivesBounty: @@ -70,6 +78,8 @@ World: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable OILB: CashTrickler: diff --git a/mods/ra/maps/fort-lonestar/fort-lonestar.lua b/mods/ra/maps/fort-lonestar/fort-lonestar.lua index 4a13adae72..35866c9721 100644 --- a/mods/ra/maps/fort-lonestar/fort-lonestar.lua +++ b/mods/ra/maps/fort-lonestar/fort-lonestar.lua @@ -98,7 +98,7 @@ SendUnits = function(entryCell, unitTypes, targetCell, extraData) end) if extraData == "IronCurtain" then - a.GrantTimedUpgrade("invulnerability", DateTime.Seconds(25)) + a.GrantCondition("invulnerability", DateTime.Seconds(25)) end end) end diff --git a/mods/ts/maps/fields-of-green/fields-of-green.lua b/mods/ts/maps/fields-of-green/fields-of-green.lua index ab397fa105..d4656f3fb7 100644 --- a/mods/ts/maps/fields-of-green/fields-of-green.lua +++ b/mods/ts/maps/fields-of-green/fields-of-green.lua @@ -38,8 +38,8 @@ end SetupInvulnerability = function() Utils.Do(Map.NamedActors, function(actor) - if actor.HasProperty("AcceptsUpgrade") and actor.AcceptsUpgrade("unkillable") then - actor.GrantUpgrade("unkillable") + if actor.HasProperty("AcceptsCondition") and actor.AcceptsCondition("unkillable") then + actor.GrantCondition("unkillable") end end) end diff --git a/mods/ts/maps/fields-of-green/map.yaml b/mods/ts/maps/fields-of-green/map.yaml index be11da9d7d..88c2c68da3 100644 --- a/mods/ts/maps/fields-of-green/map.yaml +++ b/mods/ts/maps/fields-of-green/map.yaml @@ -1436,8 +1436,6 @@ Rules: GlobalLightingPaletteEffect: Blue: 0.7 Ambient: 0.7 - ExternalConditions: - Conditions: unkillable HARV: -Targetable: GALITE: @@ -1449,11 +1447,17 @@ Rules: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable NAOBEL: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable NALASR: DamageMultiplier@UNKILLABLE: RequiresCondition: unkillable Modifier: 0 + ExternalConditions: + Conditions: unkillable