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

Relationship & Childhood Overhaul #4521

Merged
merged 54 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
70724db
Add randomized relationship history for personnel
IllianiCBT Jul 29, 2024
b437dc5
Fixed status logic for clan members
IllianiCBT Jul 29, 2024
a2a0aab
Replace PercentageRandomProcreation with randomProcreation
IllianiCBT Jul 29, 2024
532fc80
Rolled Back accidental switch from `randomFloat` to `randomInt` in te…
IllianiCBT Jul 29, 2024
b5ce81d
Update the procreation process to weekly instead of daily
IllianiCBT Jul 29, 2024
350f599
Adjust simulation duration to use weeks instead of days
IllianiCBT Jul 29, 2024
c8dacd2
Refactored marriage logic to use dice roll method
IllianiCBT Jul 30, 2024
24ffa55
Switch random divorce method to dice roll
IllianiCBT Jul 30, 2024
bd3f387
Deprecate `useRandomSameSexMarriages` option
IllianiCBT Jul 30, 2024
0beba4c
Update panel titles in CampaignOptionsDialog
IllianiCBT Jul 30, 2024
fcac235
Adjusted marriage and procreation dice sizes.
IllianiCBT Jul 30, 2024
161330a
Merge branch 'master' into relationships_doubleToInt
IllianiCBT Jul 30, 2024
27b9c66
Refactored random divorce logic and fixed procreation class name
IllianiCBT Jul 30, 2024
01b22d6
Refactor marriage logic and simplify dice size settings
IllianiCBT Jul 30, 2024
519004b
Update procreation settings and simplify logic
IllianiCBT Jul 30, 2024
e3400fb
Remove same-sex marriage setting
IllianiCBT Jul 30, 2024
fb65061
Remove redundant checks and strings
IllianiCBT Jul 30, 2024
20947ec
Add separate dice size for same-sex random marriages
IllianiCBT Jul 30, 2024
aface43
Added support for inter-unit marriages
IllianiCBT Jul 30, 2024
b225f3a
Fix age adjustment logic for external spouse creation
IllianiCBT Jul 30, 2024
4378d59
Add logging and joinedCampaign attribute to Person
IllianiCBT Jul 31, 2024
aa0ed0f
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Jul 31, 2024
6c4857b
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Aug 2, 2024
08c3c83
Refactor logging system references
IllianiCBT Aug 2, 2024
1e6630b
Merge branch 'refs/heads/backgrounds_simulatedRelationships' into rel…
IllianiCBT Aug 2, 2024
50c62fb
Refactor and streamline personnel generation logic
IllianiCBT Aug 3, 2024
5413a64
Refactored personnel generation and dialog code.
IllianiCBT Aug 3, 2024
76b2986
Remove redundant test verifications for processNewWeek
IllianiCBT Aug 3, 2024
b8c9a11
Refactor role checking and marriage & divorce processes
IllianiCBT Aug 4, 2024
6999be0
Remove minimum marriage age option and update marriage checks
IllianiCBT Aug 4, 2024
793a538
Refactor PersonViewPanel display behavior
IllianiCBT Aug 4, 2024
2337bbd
Add maternity leave support
IllianiCBT Aug 4, 2024
7a4b56b
Add tests for ON_MATERNITY_LEAVE PersonnelStatus
IllianiCBT Aug 4, 2024
9e52e7f
Add adoption functionality for personnel management
IllianiCBT Aug 4, 2024
24e7d9b
Added non-binary gender option for personnel generation
IllianiCBT Aug 5, 2024
183052c
Refactored Gender Enum and Added Marriage/Children Dice Sizes
IllianiCBT Aug 5, 2024
94fc177
Update copyright years for MekHQ source files
IllianiCBT Aug 5, 2024
1a71bd2
Merge branch 'master' into relationships_doubleToInt
IllianiCBT Aug 7, 2024
4143dde
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Aug 7, 2024
7bea27d
Merge remote-tracking branch 'origin/relationships_doubleToInt' into …
IllianiCBT Aug 7, 2024
b31bad5
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Aug 9, 2024
c54baed
Refactored imports in AbstractProcreation.java
IllianiCBT Aug 9, 2024
186e22f
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Aug 19, 2024
d83c2a1
Refactor randomize methods to remove Person parameter
IllianiCBT Aug 20, 2024
5ae936e
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Sep 25, 2024
f1f7c5a
Fixed post-merge weirdness
IllianiCBT Sep 25, 2024
b6d9d00
Remove @SuppressWarnings annotations and add documentation
IllianiCBT Sep 25, 2024
30e3fe1
Remove @SuppressWarnings annotations and add documentation
IllianiCBT Sep 25, 2024
1a39f8e
Merge remote-tracking branch 'origin/relationships_doubleToInt' into …
IllianiCBT Sep 25, 2024
837b344
Enhanced Random-Death Reporting
IllianiCBT Sep 25, 2024
8619d8e
Roll-back Accidental Push to Master
IllianiCBT Sep 25, 2024
a2f8860
Merge branch 'MegaMek:master' into master
IllianiCBT Sep 25, 2024
52d0cdc
Merge branch 'refs/heads/master' into relationships_doubleToInt
IllianiCBT Sep 25, 2024
b42aca4
Remove redundant imports in CampaignGUI.java
IllianiCBT Sep 25, 2024
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
54 changes: 22 additions & 32 deletions MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ personnelPanel.title=Personnel
turnoverAndRetentionPanel.title=Turnover and Retention

## Header
chkUseRetirementDateTracking.text=Track Departure Date
chkUseRetirementDateTracking.toolTipText=Track the date of a person's departure from the unit.
chkUseRandomRetirement.text=Enable Employee Turnover
chkUseRandomRetirement.toolTipText=Determines whether personnel will randomly leave the unit.

Expand Down Expand Up @@ -437,32 +435,32 @@ chkUseDylansRandomXP.toolTipText=Use Dylan's optional random XP on creation of a
chkUseRandomPersonalities.text=Use Random Personalities
chkUseRandomPersonalities.toolTipText=<html>Personnel are generated with random personality traits, quirks and intelligence.\
<br>\
<br>Intelligence affects a characters ability to graduate from education module academies.\
<br>Intelligence affects a character's ability to graduate from education module academies.\
<br>\
<br>While traits and quirks do not currently have a mechanical effect, they will be used by the upcoming Random Events module.</html>

# Family
familyPanel.title=Family (Unofficial)
familyPanel.title=Family
lblFamilyDisplayLevel.text=The Level of Relation to be Displayed in the Personnel Panel
lblFamilyDisplayLevel.toolTipText=<html>This setting is the relation to the selected person that MekHQ will display up to, including the previous levels <br>(higher levels require more processing when loading a person in the personnel table)</html>

# Marriage
marriagePanel.title=Marriage
marriagePanel.title=Marriage (Unofficial)
chkUseManualMarriages.text=Use Manual Marriages
chkUseManualMarriages.toolTipText=<html>This allows the player to disable the Choose Spouse (Mate) option in the personnel table mouse adapter. <br>This option is provided for performance reasons for extremely large campaigns (10k+ personnel).</html>
chkUseClanPersonnelMarriages.text=Use Clan Personnel Marriages
chkUseClanPersonnelMarriages.toolTipText=Allow clan-origin personnel to marry other personnel.
chkUsePrisonerMarriages.text=Use Prisoner Marriages
chkUsePrisonerMarriages.toolTipText=Allow prisoners to marry other prisoners, and manually marrying a prisoner to a free member of the force. Bondsmen are treated as free personnel when it comes to this option, and are thus not affected by it.
lblMinimumMarriageAge.text=Minimum Marital Age
lblMinimumMarriageAge.toolTipText=This is the minimum age that is allowed for a person to be married.
lblMinimumMarriageAge.toolTipText=This is the minimum age allowed for a person to be married.
lblCheckMutualAncestorsDepth.text=Minimum Mutual Ancestor Check Depth for Marriage to be Possible
lblCheckMutualAncestorsDepth.toolTipText=<html>This is the depth to which the ancestry of two people are checked for mutual ancestors to determine if they can marry. <br>Set to 0 to disable the ancestry check.</html>
lblCheckMutualAncestorsDepth.toolTipText=<html>This is the depth to which the ancestry of two people is checked for mutual ancestors to determine if they can marry. <br>Set to 0 to disable the ancestry check.</html>
chkLogMarriageNameChanges.text=Log Marriage Name Changes
chkLogMarriageNameChanges.toolTipText=This enables the addition of a personnel log entry whenever a name is changed during marriage.
marriageSurnameWeightsPanel.title=Marriage Surname Weights
marriageSurnameWeightsPanel.toolTipText=<html>These are the weights used in determining the surname change, if any, when using the Weighted Marriage option. <br>They will be the percent chance if the values for the weights all add up to 100.</html>
randomMarriagePanel.title=Random Marriages (Unofficial)
randomMarriagePanel.title=Random Marriages
lblRandomMarriageMethod.text=Random Marriage Method
lblRandomMarriageMethod.toolTipText=This is the method used to determine if an eligible person randomly marries.
chkUseRandomSameSexMarriages.text=Use Same-sex Random Marriage
Expand All @@ -472,15 +470,15 @@ chkUseRandomClanPersonnelMarriages.toolTipText=Allow clan-origin personnel to ra
chkUseRandomPrisonerMarriages.text=Use Random Prisoner Marriages
chkUseRandomPrisonerMarriages.toolTipText=Allow prisoners to randomly marry other prisoners. Bondsmen are treated as free personnel when it comes to this option, and are thus not affected by it.
lblRandomMarriageAgeRange.text=Random Marriage Age Range
lblRandomMarriageAgeRange.toolTipText=This plus/minus the age forms the possible range of ages for spouses in the forming of a random marriage.
percentageRandomMarriagePanel.title=Percentage Random Marriage
lblPercentageRandomMarriageOppositeSexChance.text=Opposite Sex Chance
lblPercentageRandomMarriageOppositeSexChance.toolTipText=This is the percent chance that a fitting member of your force will marry another fitting member of your force of the opposite sex.
lblPercentageRandomMarriageSameSexChance.text=Same Sex Chance
lblPercentageRandomMarriageSameSexChance.toolTipText=This is the percent chance that a fitting member of your force will marry another fitting member of your force of the same sex.
lblRandomMarriageAgeRange.toolTipText=This plus/minus age forms the possible range of ages for spouses in the forming of a random marriage.
percentageRandomMarriagePanel.title=Marriage Dice
lblRandomMarriageOppositeSexDiceSize.text=Opposite Sex Dice Size
lblRandomMarriageOppositeSexDiceSize.toolTipText=This determines the number of sides on the die rolled to determine whether a character gets married. Marriage occurs on a roll of 1. This die size is multiplied by 1 + the number of failed marriages the character has previously experienced. The default values provide a 25% chance of a character getting married every 3 years. Set to 0 to disable opposite sex marriages.
lblRandomMarriageSameSexDiceSize.text=Same Sex Dice Size
lblRandomMarriageSameSexDiceSize.toolTipText=This determines the number of sides on the die rolled to determine whether a character gets married. Marriage occurs on a roll of 1. This die size is multiplied by 1 + the number of failed marriages the character has previously experienced. The default values provide a 5% chance of a character getting married every 3 years. The difference between opposite sex and same sex dice chances are based on 2022 US census data. Set to 0 to disable opposite sex marriages.

# Divorce
divorcePanel.title=Divorce
divorcePanel.title=Divorce (Unofficial)
chkUseManualDivorce.text=Use Manual Divorce
chkUseManualDivorce.toolTipText=This allows the player to disable the Remove Spouse option in the personnel table mouse adapter.
chkUseClanPersonnelDivorce.text=Use Clan Personnel Divorce
Expand All @@ -489,7 +487,7 @@ chkUsePrisonerDivorce.text=Use Prisoner Divorce
chkUsePrisonerDivorce.toolTipText=Allow divorce when one or both of the couple are currently prisoners. Bondsmen are treated as free personnel when it comes to this option, and are thus not affected by it.
divorceSurnameWeightsPanel.title=Divorce Surname Weights
divorceSurnameWeightsPanel.toolTipText=<html>These are the weights used in determining the surname change, if any, when using the Weighted Divorce option. <br>They will be the percent chance if the values for the weights all add up to 100.</html>
randomDivorcePanel.title=Random Divorce (Unofficial)
randomDivorcePanel.title=Random Divorce
lblRandomDivorceMethod.text=Random Divorce Method
lblRandomDivorceMethod.toolTipText=This is the method used to determine if an eligible person randomly divorces.
chkUseRandomOppositeSexDivorce.text=Use Random Opposite Sex Divorce
Expand All @@ -500,11 +498,9 @@ chkUseRandomClanPersonnelDivorce.text=Use Random Clan Personnel Divorce
chkUseRandomClanPersonnelDivorce.toolTipText=Allow clan-origin personnel to randomly divorce, whether as the origin or the spouse.
chkUseRandomPrisonerDivorce.text=Use Random Prisoner Divorce
chkUseRandomPrisonerDivorce.toolTipText=Allow random divorce when one or both of the couple are currently prisoners. Bondsmen are treated as free personnel when it comes to this option, and are thus not affected by it.
percentageRandomDivorcePanel.title=Percentage Random Divorce
lblPercentageRandomDivorceOppositeSexChance.text=Opposite Sex Chance
lblPercentageRandomDivorceOppositeSexChance.toolTipText=This is the percent chance that a fitting member of your force will divorce their opposite sex spouse.
lblPercentageRandomDivorceSameSexChance.text=Same Sex Chance
lblPercentageRandomDivorceSameSexChance.toolTipText=This is the percent chance that a fitting member of your force will divorce their same-sex spouse.
percentageRandomDivorcePanel.title=Divorce Dice
lblRandomDivorceDiceSize.text=Divorce Dice Size
lblRandomDivorceDiceSize.toolTipText=This is the number of sides featured on the weekly die rolled to see whether a marriage ends in divorce. Divorce occurs on a roll of 1. Set to 0 to disable random divorces for all personnel.

# Procreation
procreationPanel.title=Procreation (Unofficial)
Expand Down Expand Up @@ -538,11 +534,11 @@ chkUseRandomClanPersonnelProcreation.text=Use Random Clan Personnel Procreation
chkUseRandomClanPersonnelProcreation.toolTipText=Allow clan-origin personnel to randomly procreate.
chkUseRandomPrisonerProcreation.text=Use Random Prisoner Procreation
chkUseRandomPrisonerProcreation.toolTipText=Allow prisoners to randomly procreate. Bondsmen are treated as free personnel when it comes to this option, and are thus not affected by it.
percentageRandomProcreationPanel.title=Percentage Random Procreation
lblPercentageRandomProcreationRelationshipChance.text=Relationship Chance
lblPercentageRandomProcreationRelationshipChance.toolTipText=This is the percent chance per day that a female member of your force in a relationship will have a baby when not deployed.
lblPercentageRandomProcreationRelationshiplessChance.text=Relationshipless Chance
lblPercentageRandomProcreationRelationshiplessChance.toolTipText=This is the percent chance per day that a female member of your force not in a relationship will have a baby when not deployed.
percentageRandomProcreationPanel.title=Procreation Dice
lblRandomProcreationRelationshipDiceSize.text=Relationship Dice Size
lblRandomProcreationRelationshipDiceSize.toolTipText=This is the number of sides on the die rolled weekly to determine whether a woman in a relationship will fall pregnant. A roll of 1 results in a pregnancy. Each child after the first will multiply this dice size by the number of children. Set to 0 to disable procreation within a relationship.
lblRandomProcreationRelationshiplessDiceSize.text=Relationshipless Dice Size
lblRandomProcreationRelationshiplessDiceSize.toolTipText=This is the number of sides on the die rolled weekly to determine whether a woman not in a relationship will fall pregnant. A roll of 1 results in a pregnancy. Each child after the first will multiply this dice size by the number of children. Set to 0 to disable procreation outside a relationship.

# Death
deathPanel.title=Death
Expand Down Expand Up @@ -685,17 +681,11 @@ lblTaxesPercentage.toolTipText=<html><body style='width: 300px'>The percentage o
\ Tax amount is based on profits recorded at the end of the financial term.\
\ Profits are calculated by comparing current funds against those from the prior financial term (or company starting funds).\
\ Starting Capital and End of Term Carryover sums are excluded from profit calculations.</body></html>
chkUseNotMercenaryExemption.text=Non-Mercenary Exemption
chkUseNotMercenaryExemption.toolTipText=Campaigns belonging to non-mercenary factions are exempt from paying taxes.
chkUseClanExemption.text=Clan Exemption
chkUseClanExemption.toolTipText=Campaigns belonging to a 'Clan' faction are exempt from paying taxes.

# Shares
sharesPanel.title=Shares System
chkUseShareSystem.text=Use Shares
chkUseShareSystem.toolTipText=Gives personnel a stake in the unit. This system lowers profits but can increase retention.
chkSharesExcludeLargeCraft.text=Large Craft Exemption
chkSharesExcludeLargeCraft.toolTipText=Exclude large craft from net worth when calculating share value.
chkSharesForAll.text=All Personnel Have Shares
chkSharesForAll.toolTipText=All combat and support personnel have shares rather than just MechWarriors
##end Finances Tab
Expand Down
12 changes: 6 additions & 6 deletions MekHQ/resources/mekhq/resources/Personnel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1015,20 +1015,20 @@ RandomDependentMethod.AGAINST_THE_BOT.toolTipText=This follows the dependent add
# RandomDivorceMethod
RandomDivorceMethod.NONE.text=Disabled
RandomDivorceMethod.NONE.toolTipText=Random divorce is disabled.
RandomDivorceMethod.PERCENTAGE.text=Percentage
RandomDivorceMethod.PERCENTAGE.toolTipText=This checks if a random value is lower than the percentage to determine if an eligible married person divorces on a given day.
RandomDivorceMethod.DICE_ROLL.text=Dice Roll
RandomDivorceMethod.DICE_ROLL.toolTipText=A die is rolled each week to determine whether a marriage ends in divorce. The options below determine how many sides this dice has. Divorce occurs on a roll of 1.

# RandomMarriageMethod Enum
RandomMarriageMethod.NONE.text=Disabled
RandomMarriageMethod.NONE.toolTipText=Random marriage is disabled.
RandomMarriageMethod.PERCENTAGE.text=Percentage
RandomMarriageMethod.PERCENTAGE.toolTipText=This checks if a random value is lower than the percentage to determine if an eligible person marries on a given day.
RandomMarriageMethod.DICE_ROLL.text=Dice Roll
RandomMarriageMethod.DICE_ROLL.toolTipText=A die is rolled each week to determine whether an eligible character gets married to another eligible character. The options below determine how many sides this dice has. Marriage occurs on a roll of 1.

# RandomProcreationMethod Enum
RandomProcreationMethod.NONE.text=Disabled
RandomProcreationMethod.NONE.toolTipText=Random procreation is disabled.
RandomProcreationMethod.PERCENTAGE.text=Percentage
RandomProcreationMethod.PERCENTAGE.toolTipText=This checks if a random value is lower than the percentage to determine if an eligible person procreates on a given day.
RandomProcreationMethod.DICE_ROLL.text=Dice Roll
RandomProcreationMethod.DICE_ROLL.toolTipText=Once per week roll a die with sides equal to those set below. On a roll of 1 the character falls pregnant.

# TurnoverTargetNumberMethod Enum
TurnoverTargetNumberMethod.FIXED.text=Fixed
Expand Down
16 changes: 7 additions & 9 deletions MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -3413,9 +3413,6 @@ public void processNewDayPersonnel() {
continue;
}

// Marriage
getMarriage().processNewDay(this, getLocalDate(), p);

p.resetMinutesLeft();
// Reset acquisitions made to 0
p.setAcquisition(0);
Expand Down Expand Up @@ -3465,11 +3462,12 @@ public void processNewDayPersonnel() {
}
}

// Divorce
getDivorce().processNewDay(this, getLocalDate(), p);

// Procreation
getProcreation().processNewDay(this, getLocalDate(), p);
// Divorce, Marriage, & Procreation
if (getLocalDate().getDayOfWeek() == DayOfWeek.MONDAY) {
getDivorce().processNewWeek(this, getLocalDate(), p);
getMarriage().processNewWeek(this, getLocalDate(), p);
getProcreation().processNewWeek(this, getLocalDate(), p);
}

// Anniversaries
if ((p.getRank().isOfficer()) || (!getCampaignOptions().isAnnounceOfficersOnly())) {
Expand Down Expand Up @@ -3671,7 +3669,7 @@ public boolean newDay() {
getPersonnelMarket().generatePersonnelForDay(this);

// TODO : AbstractContractMarket : Uncomment
//getContractMarket().processNewDay(this);
//getContractMarket().processNewWeek(this);
getUnitMarket().processNewDay(this);

// Process New Day for AtB
Expand Down
Loading