Skip to content

Commit

Permalink
Merge pull request #5216 from IllianiCBT/reputation_tweaksAndCorrections
Browse files Browse the repository at this point in the history
Reputation Error Corrections & Report Reformatting
  • Loading branch information
HammerGS authored Nov 23, 2024
2 parents a89a4f0 + 090eec1 commit dcfb52a
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 321 deletions.
106 changes: 57 additions & 49 deletions MekHQ/resources/mekhq/resources/CamOpsReputation.properties
Original file line number Diff line number Diff line change
@@ -1,57 +1,65 @@
unitReputation.text=<html><font size='7'><b>Unit Reputation: %d</b></font><br><br>
refresh.text=This report refreshes every Monday.
count.text=Count
modifier.text=Modifier
required.text=Required
available.text=Available

averageExperienceRating.text=<b><font size='6'>Average Experience Rating: %s</font></b>
experienceLevel.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Experience Level: </b>%s<br><br>
averageExperienceRating.text=Average Experience Rating
experienceLevel.text=Experience Level

commandRating.text=<b><font size='6'>Command Rating: %s</font></b>
leadership.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Leadership: </b>%s
tactics.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tactics: </b>%s
strategy.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Strategy: </b>%s
negotiation.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Negotiation: </b>%s
traits.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Traits: </b>%s <i>Not Implemented</i>
personality.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Personality: </b>%s
commandRating.text=Command Rating
commander.text=Commander
commanderNone.text=No Commander
leadership.text=Leadership
tactics.text=Tactics
strategy.text=Strategy
negotiation.text=Negotiation
traits.text=Traits
traitsNotImplemented.text=Not Implemented
personality.text=Personality

combatRecordRating.text=<b><font size='6'>Combat Record Rating: %s</font></b>
combatRecordRating.text=Combat Record Rating
successes.text=Successes
partialSuccesses.text=Partial Successes
failures.text=Failures
contractsBreached.text=Contracts Breached
retainerDuration.text=Retainer Duration
mission.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%s: </b>%s (%s)

transportationRating.text=<b><font size='6'>Transportation Rating: %s</font></b>
hasJumpShipOrWarShip.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Has JumpShip or WarShip: </b>+10
smallCraft.text=Small Craft
fighters.text=Fighters
battleMeks.text=BattleMeks
vehicleSuperHeavy.text=Vehicles (Super Heavy)
vehicleHeavy.text=Vehicles (Heavy)
vehicleLight.text=Vehicles (Light)
protoMeks.text=ProtoMeks
battleArmor.text=Battle Armor
infantry.text=Infantry
transportString.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%s: </b>%d / %d Bays%s %s
asterisk.text=<br><i>* Lighter units will occupy spare bays</i><br>
noDropShip.text=No DropShip: -5
dropShipString.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DropShips: </b>%d / %d Docking Collars (%s)<br>

supportRating.text=<br><b><font size='6'>Support Rating: %d </font></b>
crewRequirements.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Partially Crewed Large Craft: -5<br>
administrationRequirements.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Administration Requirements: </b>%d / %d (%d)<br>
technicianRequirements.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Technician Requirements: %s</b><br>
battleMeksAndProtoMeks.text=BattleMeks & ProtoMeks
vehicles.text=Vehicles
fightersAndSmallCraft.text=Fighters & Small Craft
technicianString.text=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%s: </b>%d / %d<br>

financialRating.text=<b><font size='6'>Financial Rating: %s</font></b>
hasLoanOrDebt.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Has Loan or Debt: -10</b><br><br>

crimeRating.text=<br><b><font size='6'>Crime Rating: %s</font></b>
piracy.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Piracy: </b>%s
otherCrimes.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Other: </b>%s
dateOfLastCrime.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date of Last Crime: </b>%s<br>

otherModifiers.text=<br><b><font size='6'>Other Modifiers: %s</font></b>
inactiveYears.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inactivity: </b>%d
customModifier.text=<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Custom Modifier: </b>%s

transportationRating.text=Transportation Rating
hasJumpShipOrWarShip.text=JumpShip/WarShip Modifier
hasDropShip.text=DropShip Modifier
capacityCombatant.text=Combatant Capacity
capacityNonCombatant.text=Non-Combatant Capacity
dockingCollars.text=Docking Collars
smallCraft.text=Small Craft Bays
fighters.text=Fighter Bays
battleMeks.text=BattleMek Bays
vehicleSuperHeavy.text=Vehicle Bays (Super Heavy)
vehicleHeavy.text=Vehicle Bays (Heavy)
vehicleLight.text=Vehicle Bays (Light)
protoMeks.text=ProtoMek Bays
battleArmor.text=Battle Armor Bays
infantry.text=Infantry Bays
passengers.text=Non-Combatant Capacity
asterisk.text=Lighter units will occupy spare bays

supportRating.text=Support Rating
crewRequirements.text=Partially Crewed Large Craft Modifier
administrationModifier.text=Administration Modifier
TechnicianModifier.text=Technician Modifier
administrationRequirements.text=Administrators
battleMeksAndProtoMeks.text=BattleMek & ProtoMek Technicians
vehicles.text=Vehicle Technicians
fightersAndSmallCraft.text=Fighters & Small Craft Technicians

financialRating.text=Financial Rating
hasLoanOrDebt.text=Debt Modifier

crimeRating.text=Crime Rating
piracy.text=Piracy
otherCrimes.text=Other
dateOfLastCrime.text=Date of Last Crime

otherModifiers.text=Other Modifiers
inactiveYears.text=Inactivity Modifier
customModifier.text=Custom Modifier
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
*/
package mekhq.campaign.rating.CamOpsReputation;

import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

import megamek.logging.MMLogger;
import mekhq.campaign.Campaign;
import mekhq.campaign.CampaignOptions;
Expand All @@ -32,6 +28,10 @@
import mekhq.campaign.personnel.randomEvents.enums.personalities.Greed;
import mekhq.campaign.personnel.randomEvents.enums.personalities.Social;

import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

public class CommandRating {
private static final MMLogger logger = MMLogger.create(CommandRating.class);

Expand Down Expand Up @@ -82,15 +82,20 @@ protected static Map<String, Integer> calculateCommanderRating(Campaign campaign
* @param skill the skill
*/
private static int getSkillValue(Person person, String skill) {
int skillValue = 0;

if (person == null) {
return 0;
}

if (person.hasSkill(skill)) {
return person.getSkill(skill).getExperienceLevel();
skillValue += person.getSkill(skill).getLevel();
skillValue += person.getSkill(skill).getBonus();
} else {
return 0;
}

return skillValue;
}

/**
Expand Down
Loading

0 comments on commit dcfb52a

Please sign in to comment.