Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Repaired Changes Into #2691

Merged
merged 4 commits into from Dec 16, 2017
Merged

Conversation

ron-murhammer
Copy link
Member

@ron-murhammer ron-murhammer commented Dec 15, 2017

Addresses part 2 of feature request: https://forums.triplea-game.org/topic/327/unit-option-when-damaged-change-into-different-unit-weakened-battleships

Functional Changes

  • Added new unit option whenHitPointsRepairedChangesInto to allow units to change into a different unit type when repaired

Tested

  • Added the below example XML to TWW, as well as adding germanBattleshipDamaged to unit repair list, and tested repairing germanBattleshipDamaged

Example XML

    <attachment name="unitAttachment" attachTo="germanBattleship" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="2"/>
      <option name="attack" value="7"/>
      <option name="defense" value="8"/>
      <option name="canBombard" value="true"/>
      <option name="isSea" value="true"/>
      <option name="hitPoints" value="2"/>
      <option name="bombard" value="6"/>
      <option name="requiresUnits" value="germanDocks:germanFactory"/>
      <option name="consumesUnits" value="1:germanHull"/>
      <option name="whenHitPointsDamagedChangesInto" value="1:true:germanBattleshipDamaged"/>
    </attachment>
    <attachment name="unitAttachment" attachTo="germanBattleshipDamaged" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="movement" value="1"/>
      <option name="attack" value="3"/>
      <option name="defense" value="4"/>
      <option name="canBombard" value="true"/>
      <option name="isSea" value="true"/>
      <option name="hitPoints" value="2"/>
      <option name="bombard" value="3"/>
      <option name="whenHitPointsRepairedChangesInto" value="0:true:germanBattleship"/>
    </attachment>

@codecov-io
Copy link

Codecov Report

Merging #2691 into master will increase coverage by 2.3%.
The diff coverage is 2.77%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #2691     +/-   ##
===========================================
+ Coverage     20.14%   22.45%   +2.3%     
- Complexity     5759     7254   +1495     
===========================================
  Files           816      816             
  Lines         73664    78483   +4819     
  Branches      12299    14510   +2211     
===========================================
+ Hits          14841    17624   +2783     
- Misses        56686    58523   +1837     
- Partials       2137     2336    +199
Impacted Files Coverage Δ Complexity Δ
.../games/strategy/triplea/delegate/MoveDelegate.java 51.94% <0%> (-0.57%) 110 <0> (+51)
...s/strategy/triplea/attachments/UnitAttachment.java 46.01% <3.22%> (+3.36%) 422 <0> (+98) ⬆️
.../java/games/strategy/triplea/delegate/Matches.java 47.28% <33.33%> (+4.04%) 707 <2> (+351) ⬆️
...rategy/triplea/attachments/UnitTypeComparator.java 35.71% <0%> (-7.15%) 10% <0%> (-1%)
...tegy/engine/message/unifiedmessenger/EndPoint.java 59.77% <0%> (-3.45%) 14% <0%> (-1%)
...es/strategy/triplea/delegate/EndRoundDelegate.java 1.26% <0%> (-0.47%) 1% <0%> (ø)
...tegy/triplea/oddsCalculator/ta/OddsCalculator.java 43.75% <0%> (-0.32%) 13% <0%> (ø)
...s/strategy/triplea/printgenerator/PlayerOrder.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...games/strategy/triplea/printgenerator/PUChart.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
.../games/strategy/triplea/printgenerator/PuInfo.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ad2d51...64c27a9. Read the comment docs.

@ssoloff ssoloff merged commit 39aa6af into master Dec 16, 2017
@RoiEXLab RoiEXLab deleted the Add_Unit_Repaired_Changes_Into branch December 16, 2017 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants