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

WIP - Equipment/Unit modifiers (salvage quality, partial repair, scenario effect) #6229

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Nov 27, 2024

This PR aims to add modifiers to equipment that simulate salvage quality (CO p215), partial repair (CO, 205-207) and scenario effects. These include +x heat, +x to hit, jam, reduced range and others. These are applied to Mounteds or sometimes maybe the Entity if there is no corresponding Mounted (e.g. gyro) but also possibly to MHQ's Parts so that a salvage quality medium laser (which requires rolling up a specific modifier for it) could actually be buyable or obtained from battle salvage.

very much work in progress. Some modifiers are fairly easy to implement, others not so much.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.99%. Comparing base (9f53853) to head (fd5b558).
Report is 102 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6229      +/-   ##
============================================
- Coverage     29.17%   28.99%   -0.18%     
- Complexity    13970    13982      +12     
============================================
  Files          2628     2664      +36     
  Lines        266540   268280    +1740     
  Branches      47565    47743     +178     
============================================
+ Hits          77769    77799      +30     
- Misses       184889   186596    +1707     
- Partials       3882     3885       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1775,4 +1778,8 @@
state.add("Size: " + size);
return intro + " { " + String.join(", ", state) + " }";
}

public List<EquipmentModifier> getModifiers() {

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
Modifiable.getModifiers
; it is advisable to add an Override annotation.
}

private String modifierText(EquipmentModifier modifier) {
if (modifier instanceof HeatModifier heatModifier) {

Check notice

Code scanning / CodeQL

Chain of 'instanceof' tests Note

This if block performs a chain of 7 type tests - consider alternatives, e.g. polymorphism or the visitor pattern.
@@ -15822,4 +15860,8 @@
fleeZone = HexArea.EMPTY_AREA;
hasFleeZone = false;
}

public List<EquipmentModifier> getModifiers() {

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
Modifiable.getModifiers
; it is advisable to add an Override annotation.
* @return Weapons of this vehicle that are jammed and can be de-jammed so as to work again. Other weapons on the tank might be jammed
* without the option to return them to a working state within the current game. Those are not part of the returned list.
*/
public List<Mounted<?>> getDejammableWeapons() {

Check notice

Code scanning / CodeQL

Exposing internal representation Note

getDejammableWeapons exposes the internal representation stored in field dejammableWeapons. The value may be modified
after this call to getDejammableWeapons
.
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.

1 participant