3232 */
3333package mekhq .campaign .randomEvents .prisoners ;
3434
35- import static java .lang .Math .round ;
3635import static megamek .common .MiscType .createBeagleActiveProbe ;
3736import static megamek .common .MiscType .createCLImprovedSensors ;
3837import static megamek .common .MiscType .createISImprovedSensors ;
6362import megamek .common .MapSettings ;
6463import megamek .common .TargetRoll ;
6564import megamek .common .annotations .Nullable ;
65+ import megamek .common .universe .HonorRating ;
6666import megamek .logging .MMLogger ;
6767import mekhq .campaign .Campaign ;
6868import mekhq .campaign .mission .Scenario ;
7171import mekhq .campaign .randomEvents .prisoners .enums .PrisonerStatus ;
7272import mekhq .campaign .universe .Faction ;
7373import mekhq .campaign .universe .Factions ;
74- import megamek .common .universe .HonorRating ;
75- import mekhq .utilities .ReportingUtilities ;
7674import mekhq .gui .baseComponents .immersiveDialogs .ImmersiveDialogSimple ;
75+ import mekhq .utilities .ReportingUtilities ;
7776
7877/**
7978 * Handles events and processes related to capturing prisoners.
@@ -234,7 +233,7 @@ public void processCaptureOfNPC(Person prisoner) {
234233 Faction campaignFaction = campaign .getFaction ();
235234 processPrisoner (prisoner , campaignFaction , prisonerCaptureStyle .isMekHQ (), true );
236235
237- // Have they been removed via Bondsref?
236+ // Have they been removed via Bondsref or Seppuku ?
238237 if (prisoner .getStatus ().isDead ()) {
239238 return ;
240239 }
@@ -330,43 +329,44 @@ void processPrisoner(Person prisoner, @Nullable Faction capturingFaction, boolea
330329 HonorRating prisonerHonorRating = prisoner .getOriginFaction ().getHonorRating (campaign );
331330
332331 int bondsmanRoll = d6 (1 );
333- if (capturingFaction != null && capturingFaction .isClan ()) {
334- if (isMekHQCaptureStyle && prisoner .isClanPersonnel () && (bondsmanRoll + d6 (1 ) == 2 )) {
335- if (isNPC ) {
336- campaign .addReport (getFormattedTextAt (RESOURCE_BUNDLE ,
337- "bondsref.report" ,
338- prisoner .getFullName (),
339- spanOpeningWithCustomColor (ReportingUtilities .getNegativeColor ()),
340- CLOSING_SPAN_TAG ));
341-
342- campaign .removePerson (prisoner );
343- } else {
344- prisoner .changeStatus (campaign , today , BONDSREF );
345- }
346- return ;
347- } else if (d6 (1 ) >= prisonerHonorRating .getBondsmanTargetNumber ()) {
348- if (isNPC ) {
349- prisoner .setPrisonerStatus (campaign , BECOMING_BONDSMAN , true );
350- prisoner .setBecomingBondsmanEndDate (today .plusWeeks (d6 (1 )));
351- } else {
352- prisoner .changeStatus (campaign , today , ENEMY_BONDSMAN );
332+ if (prisoner .isClanPersonnel ()) {
333+ if (capturingFaction != null && capturingFaction .isClan ()) {
334+ if (isMekHQCaptureStyle && (bondsmanRoll + d6 (1 ) == 2 )) {
335+ if (isNPC ) {
336+ campaign .addReport (getFormattedTextAt (RESOURCE_BUNDLE ,
337+ "bondsref.report" ,
338+ prisoner .getFullName (),
339+ spanOpeningWithCustomColor (ReportingUtilities .getNegativeColor ()),
340+ CLOSING_SPAN_TAG ));
341+ prisoner .setStatus (BONDSREF );
342+ } else {
343+ prisoner .changeStatus (campaign , today , BONDSREF );
344+ }
345+ return ;
346+ } else if (d6 (1 ) >= prisonerHonorRating .getBondsmanTargetNumber ()) {
347+ if (isNPC ) {
348+ prisoner .setPrisonerStatus (campaign , BECOMING_BONDSMAN , true );
349+ prisoner .setBecomingBondsmanEndDate (today .plusWeeks (d6 (1 )));
350+ } else {
351+ prisoner .changeStatus (campaign , today , ENEMY_BONDSMAN );
352+ }
353+ return ;
353354 }
354- return ;
355- }
356- } else if ( capturingFaction != null && capturingFaction . getHonorRating ( campaign ) == HonorRating . NONE ) {
357- if ( bondsmanRoll == 1 ) {
358- if ( isNPC ) {
359- campaign . addReport ( getFormattedTextAt ( RESOURCE_BUNDLE ,
360- "bondsref.report" ,
361- prisoner . getFullName (),
362- spanOpeningWithCustomColor ( ReportingUtilities . getNegativeColor ()),
363- CLOSING_SPAN_TAG ) );
364-
365- campaign . removePerson ( prisoner );
366- } else {
367- prisoner . changeStatus ( campaign , today , POW ) ;
355+ } else if ( capturingFaction != null && capturingFaction . getHonorRating ( campaign ) == HonorRating . NONE ) {
356+ if ( bondsmanRoll == 1 ) {
357+ if ( isNPC ) {
358+ campaign . addReport ( getFormattedTextAt ( RESOURCE_BUNDLE ,
359+ "bondsref.report" ,
360+ prisoner . getFullName () ,
361+ spanOpeningWithCustomColor ( ReportingUtilities . getNegativeColor ()) ,
362+ CLOSING_SPAN_TAG ));
363+
364+ prisoner . setStatus ( BONDSREF );
365+ } else {
366+ prisoner . changeStatus ( campaign , today , POW );
367+ }
368+ return ;
368369 }
369- return ;
370370 }
371371 }
372372
@@ -380,7 +380,7 @@ void processPrisoner(Person prisoner, @Nullable Faction capturingFaction, boolea
380380 spanOpeningWithCustomColor (ReportingUtilities .getNegativeColor ()),
381381 CLOSING_SPAN_TAG ));
382382
383- campaign . removePerson ( prisoner );
383+ prisoner . setStatus ( SEPPUKU );
384384 } else {
385385 prisoner .changeStatus (campaign , today , SEPPUKU );
386386 }
0 commit comments