Skip to content

Commit

Permalink
tooltip upgrade, corrupter scrin
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwieth committed Jan 14, 2024
1 parent eecef24 commit 21352eb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 19 deletions.
17 changes: 13 additions & 4 deletions OpenRA.Mods.CA/Widgets/Logic/Ingame/ProductionTooltipLogicCA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ Color GetEffectiveLabelColor(int effectValue, int neutralValue) {
}

String GetEffectiveLabelText(int effectValue, int neutralValue) {
return $"{effectValue}%";
/*
if (effectValue >= neutralValue * 2)
return "It's super effective!";
else if (effectValue >= neutralValue * 1.33)
Expand All @@ -375,45 +377,52 @@ String GetEffectiveLabelText(int effectValue, int neutralValue) {
return "not effective";
else
return "ok";
*/
}

LabelWidget GetArmorTypeLabel(LabelWidget armorTypeLabel, ActorInfo actor)
{
var armor = actor.TraitInfos<ArmorInfo>().FirstOrDefault();
armorTypeLabel.Text = armor != null ? armor.Type : "";

var health = actor.TraitInfos<HealthInfo>().FirstOrDefault();
var healthText = health != null ? "("+health.HP/100+")" : "";

// hard coded, specific to CA - find a better way to set user-friendly names and colors for armor types
switch (armorTypeLabel.Text)
{
case "None":
armorTypeLabel.Text = "Infantry";
armorTypeLabel.Text = "Infantry"+healthText;
armorTypeLabel.TextColor = Color.LightSalmon;
break;

case "Light":
armorTypeLabel.Text += healthText;
armorTypeLabel.TextColor = Color.Khaki;
break;

case "Reflector":
armorTypeLabel.Text += healthText;
armorTypeLabel.TextColor = Color.SkyBlue;
break;

case "Heavy":
armorTypeLabel.Text += healthText;
armorTypeLabel.TextColor = Color.Crimson;
break;

case "Concrete":
armorTypeLabel.Text = "Fortified";
armorTypeLabel.Text = "Fortified"+healthText;
armorTypeLabel.TextColor = Color.Gray;
break;

case "Wood":
armorTypeLabel.Text = "Building";
armorTypeLabel.Text = "Building"+healthText;
armorTypeLabel.TextColor = Color.IndianRed;
break;

case "Brick":
armorTypeLabel.Text = "Wall";
armorTypeLabel.Text = "Wall"+healthText;
armorTypeLabel.TextColor = Color.RosyBrown;
break;

Expand Down
17 changes: 13 additions & 4 deletions OpenRA.Mods.CA/Widgets/Logic/Ingame/SelectionTooltipLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ Color GetEffectiveLabelColor(int effectValue, int neutralValue) {
}

String GetEffectiveLabelText(int effectValue, int neutralValue) {
return $"{effectValue}%";
/*
if (effectValue >= neutralValue * 2)
return "It's super effective!";
else if (effectValue >= neutralValue * 1.33)
Expand All @@ -311,45 +313,52 @@ String GetEffectiveLabelText(int effectValue, int neutralValue) {
return "not effective";
else
return "ok";
*/
}

LabelWidget GetArmorTypeLabel(LabelWidget armorTypeLabel, ActorInfo actor)
{
var armor = actor.TraitInfos<ArmorInfo>().FirstOrDefault();
armorTypeLabel.Text = armor != null ? armor.Type : "";

var health = actor.TraitInfos<HealthInfo>().FirstOrDefault();
var healthText = health != null ? "("+health.HP/100+")" : "";

// hard coded, specific to CA - find a better way to set user-friendly names and colors for armor types
switch (armorTypeLabel.Text)
{
case "None":
armorTypeLabel.Text = "Infantry";
armorTypeLabel.Text = "Infantry"+healthText;
armorTypeLabel.TextColor = Color.LightSalmon;
break;

case "Light":
armorTypeLabel.Text += healthText;
armorTypeLabel.TextColor = Color.Khaki;
break;

case "Reflector":
armorTypeLabel.Text += healthText;
armorTypeLabel.TextColor = Color.SkyBlue;
break;

case "Heavy":
armorTypeLabel.Text += healthText;
armorTypeLabel.TextColor = Color.Crimson;
break;

case "Concrete":
armorTypeLabel.Text = "Fortified";
armorTypeLabel.Text = "Fortified"+healthText;
armorTypeLabel.TextColor = Color.Gray;
break;

case "Wood":
armorTypeLabel.Text = "Building";
armorTypeLabel.Text = "Building"+healthText;
armorTypeLabel.TextColor = Color.IndianRed;
break;

case "Brick":
armorTypeLabel.Text = "Wall";
armorTypeLabel.Text = "Wall"+healthText;
armorTypeLabel.TextColor = Color.RosyBrown;
break;

Expand Down
15 changes: 8 additions & 7 deletions mods/ca/rules/scrin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ CORR:
Name: Corrupter
Buildable:
BuildPaletteOrder: 65
Prerequisites: nerv, ~vehicles.scrin, ~!commander_tree.corrupter.area, ~!commander_tree.corrupter.range
Prerequisites: nerv, ~vehicles.scrin, ~!filler.corrupter
Queue: Vehicle
Description: Short-ranged anti-infantry/structure unit.\n Strong vs Infantry, Buildings\n Weak vs Tanks, Defenses, Aircraft
IconPalette: chrome
Expand Down Expand Up @@ -831,7 +831,7 @@ CORR.Area:
Tooltip:
Name: Area Corrupter
Buildable:
Prerequisites: nerv, ~vehicles.scrin, ~commander_tree.corrupter.area
Prerequisites: nerv, ~vehicles.scrin, ~commander_tree.corrupter.area, ~!filler.corrupter2
Description: Short-ranged anti-infantry/structure unit.\n Strong vs Infantry, Buildings\n Weak vs Tanks, Defenses, Aircraft
IconPalette: chrome
Health:
Expand All @@ -855,8 +855,9 @@ CORR.Area:
RevokeDelay: 20
RevokeOnNewTarget: False
RevokeAll: True
-WithAttackAnimation:

CORR.Area.PLD:
CORR.Area.PDL:
Inherits: CORR.Area
Inherits@PLD: ^PointLaserDefenseSystem
WithProductionIconOverlay@PDL:
Expand All @@ -866,7 +867,7 @@ CORR.Area.PLD:
Tooltip:
Name: Area Corrupter (PDL)
Buildable:
Prerequisites: techcenter, ~vehicles.scrin, ~commander_tree.corrupter.area, ~commander_tree.corrupter.pld
Prerequisites: techcenter, ~vehicles.scrin, ~commander_tree.corrupter.area, ~commander_tree.corrupter.pdl
Description: Ranged anti-infantry/structure unit.\n Strong vs Infantry, Buildings, Projectiles\n Weak vs Tanks, Defenses, Aircraft

CORR.Area.Reflector:
Expand All @@ -891,13 +892,13 @@ CORR.Range:
Tooltip:
Name: Ranged Corrupter
Buildable:
Prerequisites: nerv, ~vehicles.scrin, ~commander_tree.corrupter.range
Prerequisites: nerv, ~vehicles.scrin, ~commander_tree.corrupter.range, ~!filler.corrupter2
Description: Ranged anti-infantry/structure unit.\n Strong vs Infantry, Buildings\n Weak vs Tanks, Defenses, Aircraft
IconPalette: chrome
Armament@PRIMARY:
Weapon: CorrupterSpew.range

CORR.Range.PLD:
CORR.Range.PDL:
Inherits: CORR.Range
Inherits@PLD: ^PointLaserDefenseSystem
WithProductionIconOverlay@PDL:
Expand All @@ -907,7 +908,7 @@ CORR.Range.PLD:
Tooltip:
Name: Ranged Corrupter (PDL)
Buildable:
Prerequisites: techcenter, ~vehicles.scrin, ~commander_tree.corrupter.range, ~commander_tree.corrupter.pld
Prerequisites: techcenter, ~vehicles.scrin, ~commander_tree.corrupter.range, ~commander_tree.corrupter.pdl
Description: Ranged anti-infantry/structure unit.\n Strong vs Infantry, Buildings, Projectiles\n Weak vs Tanks, Defenses, Aircraft

CORR.Range.Reflector:
Expand Down
4 changes: 2 additions & 2 deletions mods/ca/rules/scrin/commander-tree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ commander_tree.Corrupter.Range:
ProvidesPrerequisite@filler:
Prerequisite: filler.corrupter

commander_tree.Corrupter.PLD:
commander_tree.Corrupter.PDL:
Inherits: ^default.commander_tree_item
RenderSprites:
Image: CORR
Expand Down Expand Up @@ -136,7 +136,7 @@ commander_tree.Corrupter.Reflector:
Queue: Commander_Tree
BuildPaletteOrder: 411
ForceIconLocation: true
Prerequisites: prerequisite.has_points, techcenter, ~vehicles.scrin, ~filler.corrupter, ~!commander_tree.corrupter.pld
Prerequisites: prerequisite.has_points, techcenter, ~vehicles.scrin, ~filler.corrupter, ~!commander_tree.corrupter.pdl
Description: Upgrades the Corrupter with Reflector armor. \nReflector armor is very efficient vs energy weapons.
ProvidesPrerequisite@filler:
Prerequisite: filler.corrupter2
Expand Down
4 changes: 2 additions & 2 deletions mods/ca/sequences/scrin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ intl.destroyed:

corr:
Inherits: ^VehicleOverlays
Defaults:
Defaults: corrupter
Scale: 0.5
idle: corrupter
Facings: 8
Expand All @@ -899,7 +899,7 @@ corr:
corr.destroyed:
Inherits: ^VehicleOverlays
Defaults:
Scale: 0.6
Scale: 0.5
idle: corrupter
Facings: 8
Stride: 11
Expand Down

0 comments on commit 21352eb

Please sign in to comment.