Menu

#1069 supportAttachment name="faction" value="enemy" displays wrong tooltip

v1.0 (example)
closed-fixed
redrum
None
5
2015-07-08
2014-09-03
kor438
No

When using name="faction" value="enemy" instead of the more usual value="allied" in a supportAttachment, the unit's tooltip and the Unit Help window display "gives [number] Defense Power to [number] Enemy Units" when it should be "gives [number] Attack [number] Enemy Units", and vice-versa.

It's unclear whether it's just the displayed tooltip or the actual support given that's wrong. Faction "allied:enemy" seems especially problematic (it's undocumented, but games.strategy.triplea.attatchments.UnitAttachment.toStringShortAndOnlyImportantDifferences() handles it).

For example, the attached savegame and modified middle_earth_12player.xml add

<!-- Castle - removes 1 offensive strength from up to 3 attacking infantry or cavalry units -->
<attatchment name="supportAttachmentCastle" attatchTo="castle" javaClass="games.strategy.triplea.attatchments.UnitSupportAttachment" type="unitType">
  <option name="unitType" value="archers:axeInfantry:berzerkers:chariotArchers:corsairs:heavyCavalry:hobbits:hunters:lightCavalry:oliphant:orcs:phalanx:raiderCavalry:raiders:shooters:spearInfantry:stabbers:towerGuard:trolls:urukhai:warChariot:warWagon:warWolves:wargs:wizard:xbowInfantry"/><!-- all infantry and cavalry -->
  <option name="faction" value="enemy"/>
  <option name="side" value="defence"/>
  <option name="dice" value="strength"/>
  <option name="bonus" value="-1"/>
  <option name="number" value="3"/>
  <option name="bonusType" value="walls"/>
  <option name="players" value="Dale:Dwarves:Elves:Freefolk:Goblins:Gondor:Haradrim:Khand:Mordor:Rhun:Rohan:Saruman"/><!-- all players -->
  <option name="impArtTech" value="false"/>
</attatchment>
<!-- Castle - gives 2 offensive strength to all attacking siege engines -->
<attatchment name="supportAttachmentCastleArtillery" attatchTo="castle" javaClass="games.strategy.triplea.attatchments.UnitSupportAttachment" type="unitType">
  <option name="unitType" value="cannon:catapult:mortar:trebuche:siegeTower"/>
  <option name="faction" value="enemy"/>
  <option name="side" value="defence"/>
  <option name="dice" value="strength"/>
  <option name="bonus" value="2"/>
  <option name="number" value="9999"/>
  <option name="bonusType" value="siege_engines"/>
  <option name="players" value="Dale:Dwarves:Elves:Freefolk:Goblins:Gondor:Haradrim:Khand:Mordor:Rhun:Rohan:Saruman"/><!-- all players -->
  <option name="impArtTech" value="false"/>
</attatchment>

with the idea of reducing most units' attack strength when attacking castles, but increasing siege engines' attack strength instead.

The battle works as intended - 3 of the 10 attacking wargs have 1 attack strength instead of their base 2, and the catapult has 4 attack strength instead of its base 2; but the tooltip for castle reads "Land unit, can Produce Units Up To Territory Value, can be Captured, can be Placed Without Factory, can be Attacked By Raids, gives -1 Defense Power to 3 Enemy Units, gives 2 Defense Power to 9999 Enemy Units".

It can be worked around in this repro by just using a custom tooltip, but not in the map I'm working on. (The relevant units are modified by techs, whose effects should show up in the tooltip only when the tech's researched; that's only possible with the default tooltips.)

Version 1.8.0.3, Windows platform.

1 Attachments

Discussion

  • kor438

    kor438 - 2014-09-03

    That should be "gives [number] Attack Power to [number] Enemy Units", of course. (How come these things never jump out at me during preview?)

     
  • redrum

    redrum - 2015-07-08

    Already fixed.

     
  • redrum

    redrum - 2015-07-08
    • status: open --> closed-fixed
    • assigned_to: redrum
     

Log in to post a comment.

MongoDB Logo MongoDB