Skip to content

Commit

Permalink
Merge branch 'master' into autoAwards_warAgainstPiracy
Browse files Browse the repository at this point in the history
  • Loading branch information
IllianiCBT authored Jun 21, 2024
2 parents 5215e54 + 941cff3 commit 79d7ba5
Show file tree
Hide file tree
Showing 24 changed files with 268 additions and 67 deletions.
12 changes: 7 additions & 5 deletions MekHQ/data/universe/academies/Prestigious Academies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
<name>Addicks University</name>
<type>University</type>
<description>Located in the heart of the Inner Sphere, Addicks University is celebrated for its progressive liberal arts education, particularly in teacher training. The institution uniquely integrates its academic programs with community schools, allowing student teachers to gain invaluable hands-on experience.</description>
<factionDiscount>0</factionDiscount>
<isFactionRestricted>true</isFactionRestricted>
<locationSystem>Addicks</locationSystem>
<constructionYear>2400</constructionYear>
<destructionYear>2777</destructionYear>
Expand All @@ -34,6 +32,9 @@
<educationLevelMin>High School</educationLevelMin>
<educationLevelMax>College</educationLevelMax>
<ageMin>16</ageMin>
<qualification>Teaching Graduate</qualification>
<curriculum>Leadership</curriculum>
<qualificationStartYear>2300</qualificationStartYear>
<baseAcademicSkillLevel>0</baseAcademicSkillLevel>
</academy>
<academy>
Expand Down Expand Up @@ -1795,7 +1796,6 @@
<qualification>Semester One Curriculum</qualification>
<curriculum>Small Arms</curriculum>
<qualificationStartYear>2300</qualificationStartYear>
<qualificationStartYear>2300</qualificationStartYear>
<baseAcademicSkillLevel>-1</baseAcademicSkillLevel>
</academy>
<academy>
Expand Down Expand Up @@ -2324,7 +2324,6 @@
<qualification>Armored Infantry Graduate</qualification>
<curriculum>Gunnery/Battlesuit, Anti-Mech</curriculum>
<qualificationStartYear>3058</qualificationStartYear>
<qualificationStartYear>3058</qualificationStartYear>
<qualification>Aerospace Graduate</qualification>
<curriculum>Piloting/Aerospace, Gunnery/Aerospace</curriculum>
<qualificationStartYear>2490</qualificationStartYear>
Expand Down Expand Up @@ -2422,12 +2421,15 @@
<locationSystem>Terra</locationSystem>
<constructionYear>2300</constructionYear>
<destructionYear>2777</destructionYear>
<tuition>#N/A</tuition>
<tuition>7500</tuition>
<durationDays>1200</durationDays>
<facultySkill>5</facultySkill>
<educationLevelMin>High School</educationLevelMin>
<educationLevelMax>Doctorate</educationLevelMax>
<ageMin>16</ageMin>
<qualification>Intergalactic Diplomacy in the Modern Age</qualification>
<curriculum>Negotiation, Leadership</curriculum>
<qualificationStartYear>2300</qualificationStartYear>
<baseAcademicSkillLevel>0</baseAcademicSkillLevel>
</academy>
<academy>
Expand Down
4 changes: 4 additions & 0 deletions MekHQ/data/universe/factions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,8 @@ successor - unimplemented tag describing another faction code as the specified f
<faction>
<shortname>FC</shortname>
<fullname>Federated Commonwealth</fullname>
<altNamesByYear year='3028'>Federated Commonwealth Alliance</altNamesByYear>
<altNamesByYear year='3055'>Federated Commonwealth</altNamesByYear>
<alternativeFactionCodes>FS,LA</alternativeFactionCodes>
<startingPlanet>New Avalon</startingPlanet>
<eraMods>0,0,0,1,2,2,1,0,0</eraMods>
Expand All @@ -1110,6 +1112,8 @@ successor - unimplemented tag describing another faction code as the specified f
<layeredForceIconLogoFilename>Federated Commonwealth.png</layeredForceIconLogoFilename>
<colorRGB>248,212,44</colorRGB>
<tags>is,super,playable</tags>
<start>3028</start>
<end>3068</end>
</faction>
<faction>
<shortname>FVC</shortname>
Expand Down
4 changes: 4 additions & 0 deletions MekHQ/data/universe/planetary_systems/system_events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -932465,6 +932465,10 @@
<date>3064-01-05</date>
<faction source="canon">FC</faction>
</event>
<event>
<date>3063-01-01</date>
<faction source="noncanon">LA</faction>
</event>
<event>
<date>3070-01-01</date>
<population source="noncanon">5162011707</population>
Expand Down
Binary file modified MekHQ/docs/Personnel Modules/Turnover & Retention Module.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions MekHQ/docs/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ MEKHQ VERSION HISTORY:
+ Fix #4235: Fixed Invalid Parsing of Early Childhood when Loading Personnel
+ PR #4242: Added Prestigious Academies D-F
+ PR #4246: Added Prestigious Academies G-J
+ PR #4248: Fixed Missing Qualification from James McKenna University

0.49.19.1 (2024-05-14 1800 UTC)
+ Milestone Release. Backported fixes.
Expand Down
3 changes: 3 additions & 0 deletions MekHQ/resources/mekhq/resources/Education.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ typeInstitute.text=Institute
typeUniversity.text=University
typePolytechnic.text=Polytechnic
typeSchool.text=School
typeSchoolBoarding.text=Boarding School
typeFinishingSchool.text=Finishing School
typePreparatorySchool.text=Preparatory School

#### Academy Suffix
suffixTechnology.text=Technology
Expand Down
11 changes: 9 additions & 2 deletions MekHQ/resources/mekhq/resources/GUI.properties
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ UnresolvedStratConContactsNagDialog.text=You have unresolved contacts on the Str
cargoCapacityNagDialog.title=Exceeded Cargo Capacity
cargoCapacityNagDialog.text=You have exceeded your available cargo capacity. Do you really wish to advance the day?

### FactionDestroyedNagDialog Class
InvalidFactionNagDialog.title=Invalid Faction
InvalidFactionNagDialog.text=Your campaign faction is invalid. Either it has not yet been created, or it has been destroyed.\n\nPlease pick a new faction in campaign options.\nAdvance day anyway?

#### Report Dialogs
### CargoReportDialog Class
CargoReportDialog.title=Cargo Report
Expand Down Expand Up @@ -713,6 +717,8 @@ optionOutstandingScenariosNag.text=Hide Outstanding Scenarios Nag
optionOutstandingScenariosNag.toolTipText=This allows you to ignore the daily warning for having unfinished scenarios on the current day.
optionCargoCapacityNag.text=Hide Exceeded Cargo Capacity Nag
optionCargoCapacityNag.toolTipText=This allows you to ignore the daily warning for having exceeded your available cargo capacity.
optionInvalidFactionNag.text=Hide Invalid Faction Nag
optionInvalidFactionNag.toolTipText=This allows you to ignore the daily warning for having an invalid faction.
## Miscellaneous Tab
miscellaneousTab.title=Miscellaneous Options
lblUserDir.text=User Files Directory:
Expand Down Expand Up @@ -1287,8 +1293,9 @@ chkFilterByPercentageOfCost.text=Show only units at
chkFilterByPercentageOfCost.toolTipText=Filter out units above the specified percentage of market value.
spnFilterByPercentageOfCost.toolTipText=Filter out units with market value above this percentage when the filter is enabled.
lblCostPercentageThreshold.text=% of market value or lower
### Black Market Panel
lblBlackMarketWarning.text=<html><b>Open Market & Mercenary Auction:</b> The public sale of units available to your campaign faction\
### Market Description Panel
lblMarketDescriptions.text=<html><b>Open Market:</b> The public sale of units available to your campaign faction\
<br><b>Mercenary Auction:</b> The sale of unwanted units sold through the MRBC (or the era-appropriate equivalent)\
<br><b>Employer Market:</b> Units or salvage no longer wanted by your employer\
<br><b>Factory Line:</b> Brand-new units fresh off the production line\
<br><b>Black Market:</b> Potentially brand-new units which come with the risk of being swindled</html>
Expand Down
1 change: 1 addition & 0 deletions MekHQ/src/mekhq/MHQConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public final class MHQConstants extends SuiteConstants {
public static final String NAG_UNRESOLVED_STRATCON_CONTACTS = "nagUnresolvedStratConContacts";
public static final String NAG_OUTSTANDING_SCENARIOS = "nagOutstandingScenarios";
public static final String NAG_CARGO_CAPACITY = "nagCargoCapacity";
public static final String NAG_INVALID_FACTION = "nagInvalidFaction";
//endregion Nag Tab

//region Miscellaneous Options
Expand Down
6 changes: 6 additions & 0 deletions MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,12 @@ public Person newDependent(boolean baby) {
Gender.RANDOMIZE);
}

if (person.getAge(getLocalDate()) <= 16) {
person.setEduHighestEducation(EducationLevel.EARLY_CHILDHOOD);
} else {
person.setEduHighestEducation(EducationLevel.HIGH_SCHOOL);
}

return person;
}

Expand Down
1 change: 1 addition & 0 deletions MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ public void resolveScenario(ScenarioStatus resolution, String report) {
person.getHyperlinkedName()));
}

// prisoners should generate with lower than average loyalty, so only roll 2d6
person.generateLoyalty(Compute.d6(2));
} else {
continue;
Expand Down
42 changes: 42 additions & 0 deletions MekHQ/src/mekhq/campaign/market/enums/UnitMarketType.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,49 @@ public String toString() {
return name;
}

/**
* Calculates the price percentage based on a given modifier and d6 roll.
*
* @param modifier the modifier to adjust the price (a negative modifier decreases price, positive increases price)
* @return the calculated price
* @throws IllegalStateException if the roll value is unexpected
*/
public static int getPricePercentage(int modifier) {
int roll = Compute.d6(2);
int value;

switch (roll) {
case 2:
value = modifier + 3;
break;
case 3:
value = modifier + 2;
break;
case 4:
case 5:
value = modifier + 1;
break;
case 6:
case 7:
case 8:
value = modifier;
break;
case 9:
case 10:
value = modifier - 1;
break;
case 11:
value = modifier - 2;
break;
case 12:
value = modifier - 3;
break;
default:
throw new IllegalStateException("Unexpected value in mekhq/campaign/market/unitMarket/AtBMonthlyUnitMarket.java/getPrice: " + roll);
}

return 100 + (value * 5);
}

/**
* Returns the quality of a unit based on the given market type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import java.util.Collection;
import java.util.List;

import static mekhq.campaign.market.enums.UnitMarketType.getPricePercentage;

public class AtBMonthlyUnitMarket extends AbstractUnitMarket {
//region Constructors
public AtBMonthlyUnitMarket() {
Expand Down Expand Up @@ -76,70 +78,70 @@ public void generateUnitOffers(final Campaign campaign) {
Faction faction = campaign.getFaction();

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.OPEN, UnitType.MEK,
faction, IUnitRating.DRAGOON_F, 6);
faction, IUnitRating.DRAGOON_F, 1);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.OPEN, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_F, 6);
faction, IUnitRating.DRAGOON_F, 1);

addOffers(campaign, getMarketItemCount("very common"), UnitMarketType.OPEN, UnitType.TANK,
faction, IUnitRating.DRAGOON_F, 6);
faction, IUnitRating.DRAGOON_F, 1);

addOffers(campaign, getMarketItemCount("common"), UnitMarketType.OPEN, UnitType.CONV_FIGHTER,
faction, IUnitRating.DRAGOON_F, 6);
faction, IUnitRating.DRAGOON_F, 1);

if ((contract != null) && (campaign.getLocalDate().isAfter(contract.getStartDate().minusDays(1)))) {
// Employer Market
faction = contract.getEmployerFaction();

addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.EMPLOYER, UnitType.MEK,
faction, IUnitRating.DRAGOON_D, 8);
faction, IUnitRating.DRAGOON_D, -1);

addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.EMPLOYER, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_D, 8);
faction, IUnitRating.DRAGOON_D, -1);

addOffers(campaign, getMarketItemCount("common"), UnitMarketType.EMPLOYER, UnitType.TANK,
faction, IUnitRating.DRAGOON_D, 8);
faction, IUnitRating.DRAGOON_D, -1);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.EMPLOYER, UnitType.CONV_FIGHTER,
faction, IUnitRating.DRAGOON_D, 8);
faction, IUnitRating.DRAGOON_D, -1);

// Unwanted Salvage Market
faction = contract.getEnemy();

addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.EMPLOYER, UnitType.MEK,
faction, IUnitRating.DRAGOON_F, 5);
faction, IUnitRating.DRAGOON_F, 2);

addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.EMPLOYER, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_F, 5);
faction, IUnitRating.DRAGOON_F, 2);

addOffers(campaign, getMarketItemCount("common"), UnitMarketType.EMPLOYER, UnitType.TANK,
faction, IUnitRating.DRAGOON_F, 5);
faction, IUnitRating.DRAGOON_F, 2);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.EMPLOYER, UnitType.CONV_FIGHTER,
faction, IUnitRating.DRAGOON_F, 5);
faction, IUnitRating.DRAGOON_F, 2);
}

// Mercenary Market
if (!campaign.getFaction().isClan()) {
faction = Factions.getInstance().getFaction("MERC");

int modifier = -1;
int modifier = 1;

if (campaign.getFaction().isMercenary()) {
modifier = 1;
modifier = -1;
}

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.MERCENARY, UnitType.MEK,
faction, IUnitRating.DRAGOON_C, 7 + modifier);
faction, IUnitRating.DRAGOON_C, modifier);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.MERCENARY, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_C, 7 + modifier);
faction, IUnitRating.DRAGOON_C, modifier);

addOffers(campaign, getMarketItemCount("very common"), UnitMarketType.MERCENARY, UnitType.TANK,
faction, IUnitRating.DRAGOON_C, 7 + modifier);
faction, IUnitRating.DRAGOON_C, modifier);

addOffers(campaign, getMarketItemCount("common"), UnitMarketType.MERCENARY, UnitType.CONV_FIGHTER,
faction, IUnitRating.DRAGOON_C, 7 + modifier);
faction, IUnitRating.DRAGOON_C, modifier);
}

// Factory Market
Expand All @@ -149,16 +151,16 @@ public void generateUnitOffers(final Campaign campaign) {

if ((!campaign.getFaction().isClan()) && (faction != null) && (!faction.isClan())) {
addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.FACTORY, UnitType.MEK,
faction, IUnitRating.DRAGOON_A, 6);
faction, IUnitRating.DRAGOON_A, 2);

addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.FACTORY, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_A, 6);
faction, IUnitRating.DRAGOON_A, 2);

addOffers(campaign, getMarketItemCount("common"), UnitMarketType.FACTORY, UnitType.TANK,
faction, IUnitRating.DRAGOON_A, 6);
faction, IUnitRating.DRAGOON_A, 2);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.FACTORY, UnitType.CONV_FIGHTER,
faction, IUnitRating.DRAGOON_A, 6);
faction, IUnitRating.DRAGOON_A, 2);
}
}

Expand All @@ -167,13 +169,13 @@ public void generateUnitOffers(final Campaign campaign) {
// Clan Factory Market
if ((faction.isClan()) && (campaign.getCurrentSystem().getFactionSet(campaign.getLocalDate()).contains(faction))) {
addOffers(campaign, getMarketItemCount("very common"), UnitMarketType.FACTORY, UnitType.MEK,
faction, IUnitRating.DRAGOON_A, 9);
faction, IUnitRating.DRAGOON_A, -4);

addOffers(campaign, getMarketItemCount("common"), UnitMarketType.FACTORY, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_A, 9);
faction, IUnitRating.DRAGOON_A, -4);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.FACTORY, UnitType.TANK,
faction, IUnitRating.DRAGOON_A, 9);
faction, IUnitRating.DRAGOON_A, -4);
}

// Black Market
Expand All @@ -182,16 +184,16 @@ public void generateUnitOffers(final Campaign campaign) {
.getFactionSet(campaign.getLocalDate()));

addOffers(campaign, getMarketItemCount("very rare"), UnitMarketType.BLACK_MARKET, UnitType.MEK,
faction, IUnitRating.DRAGOON_A, 9);
faction, IUnitRating.DRAGOON_A, -8);

addOffers(campaign, getMarketItemCount("very rare"), UnitMarketType.BLACK_MARKET, UnitType.AEROSPACEFIGHTER,
faction, IUnitRating.DRAGOON_A, 9);
faction, IUnitRating.DRAGOON_A, -8);

addOffers(campaign, getMarketItemCount("uncommon"), UnitMarketType.BLACK_MARKET, UnitType.TANK,
faction, IUnitRating.DRAGOON_A, 9);
addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.BLACK_MARKET, UnitType.TANK,
faction, IUnitRating.DRAGOON_A, -8);

addOffers(campaign, getMarketItemCount("rare"), UnitMarketType.BLACK_MARKET, UnitType.CONV_FIGHTER,
faction, IUnitRating.DRAGOON_A, 9);
faction, IUnitRating.DRAGOON_A, -8);
}

writeRefreshReport(campaign);
Expand Down Expand Up @@ -224,7 +226,7 @@ private int getMarketItemCount(String rarity) {
@Override
public void addOffers(final Campaign campaign, final int num, UnitMarketType market,
final int unitType, @Nullable Faction faction, final int quality,
final int priceTarget) {
final int priceModifier) {
if (faction == null) {
faction = RandomFactionGenerator.getInstance().getEmployerFaction();
}
Expand Down Expand Up @@ -268,8 +270,7 @@ public void addOffers(final Campaign campaign, final int num, UnitMarketType mar
}
}

final int percent = 100 - (Compute.d6(2) - priceTarget) * 5;
addSingleUnit(campaign, market, unitType, faction, quality, movementModes, missionRoles, percent);
addSingleUnit(campaign, market, unitType, faction, quality, movementModes, missionRoles, getPricePercentage(priceModifier));
}
}

Expand Down
Loading

0 comments on commit 79d7ba5

Please sign in to comment.