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

Updated Assertiveness and Removed Toughness Biography Entries #4560

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions MekHQ/resources/mekhq/resources/RandomBackgrounds.properties

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
package mekhq.campaign.personnel.backgrounds;

import mekhq.MekHQ;
import mekhq.campaign.Campaign;
import mekhq.campaign.personnel.Person;

import java.util.ResourceBundle;

public class BackgroundsController {
public static void generateBackground(Campaign campaign, Person person) {
ResourceBundle resources = ResourceBundle.getBundle("mekhq.resources.RandomBackgrounds",
MekHQ.getMHQOptions().getLocale());

if (campaign.getCampaignOptions().isUseToughness()) {
Toughness.generateToughness(person, resources);
Toughness.generateToughness(person);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,19 @@
import megamek.common.Compute;
import mekhq.campaign.personnel.Person;

import java.util.ResourceBundle;

public class Toughness {
/**
* Generates the toughness attribute for a character.
*
* @param person The person for whom the toughness attribute is being generated.
* @param resources The resource bundle for retrieving localized strings.
*/
public static void generateToughness(Person person, ResourceBundle resources) {
public static void generateToughness(Person person) {
int roll = Compute.d6(2);

if (roll == 2) {
person.setToughness(-1);

person.setBiography(String.format(resources.getString("toughnessWeakJaw.biography"), person.getFirstName()));
} else if (roll == 12) {
person.setToughness(1);

person.setBiography(String.format(resources.getString("toughnessStrongJaw.biography"), person.getFirstName()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum Aggression {
//region Enum Declarations
NONE("Personality.NONE.text", "Personality.NONE.description", false, false),
AGGRESSIVE("Aggression.AGGRESSIVE.text", "Aggression.AGGRESSIVE.description", false, false),
ASSERTIVE("Aggression.ASSERTIVE.text", "Aggression.ASSERTIVE.description", false, false),
ASSERTIVE("Aggression.ASSERTIVE.text", "Aggression.ASSERTIVE.description", true, false),
BELLIGERENT("Aggression.BELLIGERENT.text", "Aggression.BELLIGERENT.description", false, false),
BLOODTHIRSTY("Aggression.BLOODTHIRSTY.text", "Aggression.BLOODTHIRSTY.description", false, true),
BOLD("Aggression.BOLD.text", "Aggression.BOLD.description", true, false),
Expand Down