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 New Unit Option "fuelFlatCost" #3244

Merged
merged 5 commits into from
Mar 7, 2018
Merged

Add New Unit Option "fuelFlatCost" #3244

merged 5 commits into from
Mar 7, 2018

Conversation

ron-murhammer
Copy link
Member

Addresses 4th item on: https://forums.triplea-game.org/topic/558/fuel-enhancements

Functional Changes

  • New XML unit option "fuelFlatCost" which deducts cost once per turn if unit moves instead of per territory moved (especially useful for air units to simplify costs and simulate fuel tank)
  • Updated logic to include new option and ensure it displays with the new route message

Testing

  • Tested by editing new option into Civil War and testing
    XML
    <attachment name="unitAttachment" attachTo="elite_cavalry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
      <option name="consumesUnits" value="1:cavalry"/>
      <option name="movement" value="2"/>
      <option name="transportCost" value="3"/>
      <option name="canBlitz" value="true"/>
      <option name="requiresUnits" value="parade_ground"/>
      <option name="requiresUnits" value="general"/>
      <option name="createsResourcesList" value="-4:Supplies"/>
      <option name="fuelCost" value="Supplies" count="1"/>
      <option name="fuelFlatCost" value="Supplies" count="2"/>
      <option name="fuelFlatCost" value="Industry" count="1"/>
      <option name="canInvadeOnlyFrom" value="transport:train"/>
      <option name="createsResourcesList" value="-1:Manpower"/>
      <option name="attack" value="4"/>
      <option name="defense" value="3"/>
    </attachment>

Before
image

After
image

@codecov-io
Copy link

codecov-io commented Mar 7, 2018

Codecov Report

Merging #3244 into master will increase coverage by <.01%.
The diff coverage is 40.62%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3244      +/-   ##
============================================
+ Coverage     21.46%   21.47%   +<.01%     
- Complexity     5799     5803       +4     
============================================
  Files           830      830              
  Lines         72746    72777      +31     
  Branches      11865    11873       +8     
============================================
+ Hits          15614    15627      +13     
- Misses        55034    55049      +15     
- Partials       2098     2101       +3
Impacted Files Coverage Δ Complexity Δ
...games/strategy/triplea/delegate/MovePerformer.java 73.13% <100%> (ø) 45 <0> (ø) ⬇️
...rc/main/java/games/strategy/engine/data/Route.java 55.47% <100%> (+0.61%) 52 <0> (+1) ⬆️
...s/strategy/triplea/attachments/UnitAttachment.java 41.92% <34.48%> (-0.12%) 244 <2> (+2)
.../src/main/java/games/strategy/net/nio/Decoder.java 73.91% <0%> (+1.08%) 25% <0%> (+1%) ⬆️

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 362a72b...4df6d02. Read the comment docs.

@ssoloff ssoloff merged commit 1a563fb into master Mar 7, 2018
@RoiEXLab RoiEXLab deleted the Add_Fuel_Flat_Cost branch March 7, 2018 18:02
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