Skip to content

Commit

Permalink
Merge pull request #325 from scottStinger/hotfix
Browse files Browse the repository at this point in the history
Weapon heat string format reactive. 
Fixed hardened armor run speed and iJJ max capacity. 
Fix run speed on main when changing to from hardened armor.
  • Loading branch information
WEKarnesky authored Sep 19, 2024
2 parents 85ddf6e + 4d81f1e commit 327c892
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
17 changes: 12 additions & 5 deletions ssw/src/main/java/ssw/gui/frmMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -856,11 +856,11 @@ private void FixJJSpinnerModel() {
}

if( CurMech.GetJumpJets().IsImproved() ) {
if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
max = CurMech.GetRunningMP() - 1;
} else {
// if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
// max = CurMech.GetRunningMP() - 1;
// } else {
max = CurMech.GetRunningMP();
}
// }
} else {
max = CurMech.GetWalkingMP();
}
Expand Down Expand Up @@ -1796,6 +1796,8 @@ private void RecalcArmor() {
}
}
SetPatchworkArmor();
// Included to update run speed if hardened armor is added/removed.
FixWalkMPSpinner();
}

private void SetPatchworkArmor() {
Expand Down Expand Up @@ -2163,7 +2165,12 @@ public void RefreshInfoPane() {
txtInfoTonnage.setText( "Tons: " + CurMech.GetCurrentTons() );
txtInfoFreeTons.setText( "Free Tons: " + ( CurMech.GetTonnage() - CurMech.GetCurrentTons() ) );
}
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
// Change to make string format reactive.
if(CurMech.GetMaxHeat() % 2 == 0) {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.0f", CurMech.GetMaxHeat() ) );
} else {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
}
txtInfoHeatDiss.setText( "Heat Dissipation: " + CurMech.GetHeatSinks().TotalDissipation() );
txtInfoFreeCrits.setText( "Free Crits: " + CurMech.GetLoadout().FreeCrits() );
txtInfoUnplaced.setText( "Unplaced Crits: " + CurMech.GetLoadout().UnplacedCrits() );
Expand Down
17 changes: 12 additions & 5 deletions ssw/src/main/java/ssw/gui/frmMainWide.java
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,11 @@ private void FixJJSpinnerModel() {
}

if( CurMech.GetJumpJets().IsImproved() ) {
if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
max = CurMech.GetRunningMP() - 1;
} else {
// if( CurMech.GetArmor().IsHardened() && !CurMech.GetJumpJets().IsImproved() ) {
// max = CurMech.GetRunningMP() - 1;
// } else {
max = CurMech.GetRunningMP();
}
// }
} else {
max = CurMech.GetWalkingMP();
}
Expand Down Expand Up @@ -1790,6 +1790,8 @@ private void RecalcArmor() {
}
}
SetPatchworkArmor();
// Included to update run speed if hardened armor is added/removed.
FixWalkMPSpinner();
}

private void SetPatchworkArmor() {
Expand Down Expand Up @@ -2157,7 +2159,12 @@ public void RefreshInfoPane() {
txtInfoTonnage.setText( "Tons: " + CurMech.GetCurrentTons() );
txtInfoFreeTons.setText( "Free Tons: " + ( CurMech.GetTonnage() - CurMech.GetCurrentTons() ) );
}
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
// Change to make string format reactive.
if(CurMech.GetMaxHeat() % 2 == 0) {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.0f", CurMech.GetMaxHeat() ) );
} else {
txtInfoMaxHeat.setText( "Max Heat: " + String.format( "%1$,.1f", CurMech.GetMaxHeat() ) );
}
txtInfoHeatDiss.setText( "Heat Dissipation: " + CurMech.GetHeatSinks().TotalDissipation() );
txtInfoFreeCrits.setText( "Free Crits: " + CurMech.GetLoadout().FreeCrits() );
txtInfoUnplaced.setText( "Unplaced Crits: " + CurMech.GetLoadout().UnplacedCrits() );
Expand Down
7 changes: 6 additions & 1 deletion sswlib/src/main/java/Print/PrintMech.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,12 @@ private void DrawMechData( Graphics2D graphics ) {
graphics.drawString( String.format( "%1$,d", CurMech.GetCurrentBV() ), p[PrintConsts.BV2].x, p[PrintConsts.BV2].y );
else
graphics.drawString( String.format( "%1$,.0f (Base: %2$,d)", BV, CurMech.GetCurrentBV() ), p[PrintConsts.BV2].x, p[PrintConsts.BV2].y );
graphics.drawString( String.format( "Weapon Heat (%1$,.1f)", CurMech.GetWeaponHeat() ), p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y-7 );
// Change to make string format reactive.
if (CurMech.GetWeaponHeat() % 2 == 0) {
graphics.drawString( String.format( "Weapon Heat (%1$,.0f)", CurMech.GetWeaponHeat() ), p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y-7 );
} else {
graphics.drawString( String.format( "Weapon Heat (%1$,.1f)", CurMech.GetWeaponHeat() ), p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y-7 );
}
graphics.drawString( "Dissipation (" + CurMech.GetHeatSinks().TotalDissipation() + ")", p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y+1 );
//graphics.drawString( "Weapon Heat (" + CurMech.GetWeaponHeat(false, false, true, false) + ")", p[PrintConsts.MAX_HEAT].x-1, p[PrintConsts.MAX_HEAT].y );
graphics.setFont( PrintConsts.SmallFont );
Expand Down
14 changes: 11 additions & 3 deletions sswlib/src/main/java/components/Mech.java
Original file line number Diff line number Diff line change
Expand Up @@ -1982,11 +1982,19 @@ public void SetWalkMP( int mp ) throws Exception {
}

public int GetRunningMP() {
return (int) Math.floor( GetWalkingMP() * 1.5 + 0.5 );
if(CurArmor.IsHardened()) {
return (int) Math.floor( GetWalkingMP() * 1.5 - 0.5 );
} else {
return (int) Math.floor( GetWalkingMP() * 1.5 + 0.5 );
}
}

public int GetRunningMP( int MiniMult ) {
return (int) Math.floor( ( GetWalkingMP() * MiniMult ) * 1.5 + 0.5 );
if(CurArmor.IsHardened()) {
return (int) Math.floor( ( GetWalkingMP() * MiniMult ) * 1.5 - 0.5 );
} else {
return (int) Math.floor( ( GetWalkingMP() * MiniMult ) * 1.5 + 0.5 );
}
}

public int GetAdjustedRunningMP( boolean BV, boolean MASCTSM ) {
Expand Down Expand Up @@ -2292,7 +2300,7 @@ public double GetWeaponHeat()
return GetWeaponHeat(Prefs.getBoolean("HeatExcludeOS", false),
Prefs.getBoolean( "HeatExcludeRear", false),
Prefs.getBoolean( "HeatACFullRate", false),
Prefs.getBoolean( "HeatStreaksHalfRate", false),
Prefs.getBoolean( "HeatStreaksHalfRate", false),
Prefs.getBoolean( "HeatExcludeEquips", false));
}

Expand Down

0 comments on commit 327c892

Please sign in to comment.