34
34
import static mekhq .campaign .personnel .enums .GenderDescriptors .HE_SHE_THEY ;
35
35
import static mekhq .campaign .personnel .enums .GenderDescriptors .HIM_HER_THEM ;
36
36
import static mekhq .campaign .personnel .enums .GenderDescriptors .HIS_HER_THEIR ;
37
- import static mekhq .campaign .randomEvents .personalities .enums .Intelligence .*;
37
+ import static mekhq .campaign .randomEvents .personalities .enums .Reasoning .*;
38
38
39
39
import java .util .ArrayList ;
40
40
import java .util .Arrays ;
46
46
import mekhq .campaign .randomEvents .personalities .enums .Aggression ;
47
47
import mekhq .campaign .randomEvents .personalities .enums .Ambition ;
48
48
import mekhq .campaign .randomEvents .personalities .enums .Greed ;
49
- import mekhq .campaign .randomEvents .personalities .enums .Intelligence ;
50
49
import mekhq .campaign .randomEvents .personalities .enums .PersonalityQuirk ;
50
+ import mekhq .campaign .randomEvents .personalities .enums .Reasoning ;
51
51
import mekhq .campaign .randomEvents .personalities .enums .Social ;
52
52
53
53
/**
54
54
* This class is responsible for generating and managing personalities for characters. It assigns traits such as
55
- * aggression, ambition, greed, social behavior, intelligence , and personality quirks to a person, and generates a
55
+ * aggression, ambition, greed, social behavior, reasoning , and personality quirks to a person, and generates a
56
56
* descriptive personality summary.
57
57
*
58
58
* <p>Additionally, this class includes methods for handling fallback personality logic, generating
@@ -76,12 +76,12 @@ public class PersonalityController {
76
76
* </ul>
77
77
*/
78
78
public enum PersonalityTraitType {
79
- AGGRESSION , AMBITION , GREED , SOCIAL , INTELLIGENCE , PERSONALITY_QUIRK ;
79
+ AGGRESSION , AMBITION , GREED , SOCIAL , REASONING , PERSONALITY_QUIRK ;
80
80
}
81
81
82
82
/**
83
83
* Generates a personality for the given person by assigning various personality characteristics such as aggression,
84
- * ambition, greed, social behavior, intelligence , and optional quirks.
84
+ * ambition, greed, social behavior, reasoning , and optional quirks.
85
85
*
86
86
* <p>The method ensures that each personality characteristic is generated with a specified
87
87
* probability (1 in 6 by default). If no characteristic is assigned, a fallback mechanism generates at least one
@@ -132,8 +132,8 @@ public static void generatePersonality(Person person) {
132
132
person .setPersonalityQuirk (PersonalityQuirk .NONE );
133
133
}
134
134
135
- // INTELLIGENCE
136
- person .setIntelligence ( generateIntelligence (randomInt (8346 )));
135
+ // REASONING
136
+ person .setReasoning ( generateReasoning (randomInt (8346 )));
137
137
138
138
// finally, write the description
139
139
writePersonalityDescription (person );
@@ -150,15 +150,15 @@ public static void generatePersonality(Person person) {
150
150
* Generates an expansive "big" personality for a major character, Ronin, or hero.
151
151
*
152
152
* <p>This method creates a detailed set of personality traits for the given person,
153
- * selecting and assigning a combination of major traits, a quirk, and intelligence . It ensures the generated
153
+ * selecting and assigning a combination of major traits, a quirk, and reasoning . It ensures the generated
154
154
* personality reflects a high degree of uniqueness and depth.</p>
155
155
*
156
156
* <p>The method proceeds as follows:
157
157
* <ul>
158
158
* <li>Randomly selects up to four major traits (Aggression, Ambition, Greed, Social).</li>
159
159
* <li>Assigns the selected traits to the person's corresponding personality attributes.</li>
160
160
* <li>Generates and applies a unique personality quirk to the person.</li>
161
- * <li>Generates an intelligence score using the maximum of two random values.</li>
161
+ * <li>Generates a reasoning score using the maximum of two random values.</li>
162
162
* <li>Writes a personality description based on the generated traits and attributes.</li>
163
163
* </ul>
164
164
*
@@ -225,10 +225,10 @@ public static void generateBigPersonality(Person person) {
225
225
// PERSONALITY QUIRK
226
226
generateAndApplyPersonalityQuirk (person );
227
227
228
- // INTELLIGENCE
229
- int firstIntelligence = randomInt (8346 );
230
- int secondIntelligence = randomInt (8346 );
231
- person .setIntelligence ( generateIntelligence (max (firstIntelligence , secondIntelligence )));
228
+ // REASONING
229
+ int firstReasoning = randomInt (8346 );
230
+ int secondReasoning = randomInt (8346 );
231
+ person .setReasoning ( generateReasoning (max (firstReasoning , secondReasoning )));
232
232
233
233
// finally, write the description
234
234
writePersonalityDescription (person );
@@ -324,14 +324,12 @@ public static void writePersonalityDescription(Person person) {
324
324
person .getSocial (),
325
325
person .getSocialDescriptionIndex ());
326
326
327
- // Intelligence and personality quirk are handled differently to general personality traits.
328
- // INTELLIGENCE
329
- Intelligence intelligence = person .getIntelligence ();
330
- String intelligenceDescription = "" ;
331
- if (!intelligence .isAverageType ()) {
332
- intelligenceDescription = intelligence .getDescription (person .getIntelligenceDescriptionIndex (),
333
- gender ,
334
- givenName );
327
+ // Reasoning and personality quirk are handled differently to general personality traits.
328
+ // REASONING
329
+ Reasoning reasoning = person .getReasoning ();
330
+ String reasoningDescription = "" ;
331
+ if (!reasoning .isAverageType ()) {
332
+ reasoningDescription = reasoning .getDescription (person .getReasoningDescriptionIndex (), gender , givenName );
335
333
}
336
334
337
335
// PERSONALITY QUIRK
@@ -369,11 +367,11 @@ public static void writePersonalityDescription(Person person) {
369
367
}
370
368
}
371
369
372
- if (!intelligenceDescription .isBlank ()) {
370
+ if (!reasoningDescription .isBlank ()) {
373
371
if (!personalityDescription .toString ().isBlank ()) {
374
- personalityDescription .append ("<p>" ).append (intelligenceDescription ).append ("</p>" );
372
+ personalityDescription .append ("<p>" ).append (reasoningDescription ).append ("</p>" );
375
373
} else {
376
- personalityDescription .append (intelligenceDescription );
374
+ personalityDescription .append (reasoningDescription );
377
375
}
378
376
}
379
377
@@ -389,9 +387,9 @@ public static void writePersonalityDescription(Person person) {
389
387
}
390
388
391
389
/**
392
- * Retrieves the descriptions of all personality traits (other than Intelligence and Quirks) for the given person.
393
- * This method processes various personality traits such as aggression, ambition, greed, and social behavior,
394
- * generating descriptions based on the specified indices, gender, and given name of the person.
390
+ * Retrieves the descriptions of all personality traits (other than Reasoning and Quirks) for the given person. This
391
+ * method processes various personality traits such as aggression, ambition, greed, and social behavior, generating
392
+ * descriptions based on the specified indices, gender, and given name of the person.
395
393
*
396
394
* <p>Descriptions for traits that are not assigned or are empty will be excluded from the
397
395
* returned list. This ensures only meaningful and applicable descriptions are included.
@@ -416,10 +414,8 @@ public static void writePersonalityDescription(Person person) {
416
414
* the given person; traits without meaningful descriptions are excluded
417
415
*/
418
416
private static List <String > getTraitDescriptions (Gender gender , String givenName , Aggression aggression ,
419
- int aggressionDescriptionIndex , Ambition ambition ,
420
- int ambitionDescriptionIndex , Greed greed ,
421
- int greedDescriptionIndex , Social social ,
422
- int socialDescriptionIndex ) {
417
+ int aggressionDescriptionIndex , Ambition ambition , int ambitionDescriptionIndex , Greed greed ,
418
+ int greedDescriptionIndex , Social social , int socialDescriptionIndex ) {
423
419
List <String > traitDescriptions = new ArrayList <>();
424
420
425
421
// AGGRESSION
@@ -461,18 +457,24 @@ private static List<String> getTraitDescriptions(Gender gender, String givenName
461
457
return traitDescriptions ;
462
458
}
463
459
460
+
461
+ /**
462
+ * @deprecated replaced by {@link #getReasoning()}
463
+ */
464
+ @ Deprecated (since = "0.50.05" , forRemoval = true )
465
+
466
+
464
467
/**
465
- * Generates an Intelligence enum value for a person based on a randomly rolled value. Each intelligence level is
466
- * mapped to a specific range of values, with lower rolls producing less intelligent results and higher rolls
467
- * producing more intelligent results.
468
+ * Generates an {@link Reasoning} enum value for a person based on a randomly rolled value. Each reasoning
469
+ * level is mapped to a specific range of values, with lower rolls producing less intelligent results and higher
470
+ * rolls producing more intelligent results.
468
471
*
469
- * @param roll the random roll value used to determine the Intelligence enum value
472
+ * @param roll the random roll value used to determine the {@link Reasoning} enum value
470
473
*
471
- * @return the Intelligence enum value corresponding to the rolled range
474
+ * @return the {@link Reasoning} enum value corresponding to the rolled range
472
475
*
473
476
* @throws IllegalStateException if the roll exceeds the expected value range
474
- */
475
- private static Intelligence generateIntelligence (int roll ) {
477
+ */ private static Reasoning generateReasoning (int roll ) {
476
478
if (roll < 1 ) {
477
479
return BRAIN_DEAD ;
478
480
} else if (roll < 2 ) {
@@ -525,7 +527,7 @@ private static Intelligence generateIntelligence(int roll) {
525
527
return GENIUS ;
526
528
} else {
527
529
throw new IllegalStateException (
528
- "Unexpected value in mekhq/campaign/personnel/randomEvents/PersonalityController.java/generateIntelligence : " +
530
+ "Unexpected value in mekhq/campaign/personnel/randomEvents/PersonalityController.java/generateReasoning : " +
529
531
roll );
530
532
}
531
533
}
@@ -549,7 +551,7 @@ private static Intelligence generateIntelligence(int roll) {
549
551
* are not enabled
550
552
*/
551
553
public static int getPersonalityValue (final boolean isUseRandomPersonalities , final Aggression aggression ,
552
- final Ambition ambition , final Greed greed , final Social social ) {
554
+ final Ambition ambition , final Greed greed , final Social social ) {
553
555
if (!isUseRandomPersonalities ) {
554
556
return 0 ;
555
557
}
0 commit comments