Skip to content

Commit

Permalink
RISC HS Override Kit: Gameplay
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbraginskiy committed Oct 29, 2024
1 parent f4d46cb commit afa24a6
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 7 deletions.
1 change: 1 addition & 0 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,7 @@ MekDisplay.SelectMulti.question=Which ammobin do you want to select?
MekDisplay.over=over
MekDisplay.NoTarget=No Target Selected
MekDisplay.AimingAt=Aiming at <b>%s</b>
MekDisplay.RiscKit=\ w/ RISC HS Override Kit

MekGroupView.title=Group View

Expand Down
2 changes: 2 additions & 0 deletions megamek/i18n/megamek/common/report-messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@
5541=Radical heat sinks failure check, needs <data>+, rolls: <data>, <msg:5542,5543>
5542=<span class='warning'>failure!</span>
5543=<span class='success'>success!</span>
5545=<span class='warning'>RISC Heat Sink Override Kit failure!</span> Determining critical hits.
5550=External heat reduced due to intact heat-dissipating armor!
5560=<data> takes over as <data> of <data> (<data>).
5600=<newline>Bomb Bay Explosions<newline>-------------------
Expand Down Expand Up @@ -893,6 +894,7 @@
6315=\ 1 location.
6320=\ 2 locations.
6325=\ 3 locations.
6328=\ <data> locations.
6330=<span class='warning'>HEAD BLOWN OFF</span> <data> blown off.
6335=Location is empty, so criticals transfer to <data>.
6340=Location has no more hittable critical slots.
Expand Down
2 changes: 1 addition & 1 deletion megamek/resources/megamek/common/templates/tro/mek.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ${formatBasicDataRow("Engine", engineName, engineMass)}
${qvType} Cruising MP: ${qvCruise}
${qvType} Flanking MP: ${qvFlank}
</#if>
${formatBasicDataRow(hsType, hsCount, hsMass)}
${formatBasicDataRow(hsType, hsCount, hsMass)}<#if riscKit> w/ RISC Heat Sink Override Kit</#if>
${formatBasicDataRow(gyroType, "", gyroMass)}
${formatBasicDataRow(cockpitType, "", cockpitMass)}
${formatBasicDataRow("Armor Factor" + armorType, armorFactor, armorMass)}
Expand Down
2 changes: 1 addition & 1 deletion megamek/resources/megamek/common/templates/tro/mek.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${qvType} Cruising MP:</td><td align="center">${qvCruise}</td><td></td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${qvType} Flanking MP:</td><td align="center">${qvFlank}</td><td></td></tr>
</#if>
<tr><td>${hsType}:</td><td align="center">${hsCount}</td><td align="center">${hsMass}</td></tr>
<tr><td>${hsType}:</td><td align="center">${hsCount}</td><td align="center">${hsMass}</td><#if riscKit??><td>w/ RISC Heat Sink Override Kit</td></#if></tr>
<tr><td>${gyroType}:</td><td></td><td align="center">${gyroMass}</td></tr>
<tr><td>${cockpitType}:</td><td></td><td align="center">${cockpitMass}</td></tr>
<tr><td>Armor Factor${armorType}:</td><td>${armorFactor}</td><td align="center">${armorMass}</td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ public void displayMek(Entity en) {
sinksR.append(Messages.getString("MekDisplay.activeSinksTextSingle", sinks));
}

if (m.hasRiscHeatSinkOverrideKit()) {
sinksR.append(Messages.getString("MekDisplay.RiscKit"));
}

boolean hasTSM = false;
boolean mtHeat = false;
if (((Mek) en).hasTSM(false)) {
Expand Down
3 changes: 3 additions & 0 deletions megamek/src/megamek/common/MekView.java
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ public MekView(final Entity entity, final boolean showDetail, final boolean useA
if (!aMek.formatHeat().equals(Integer.toString(aMek.heatSinks()))) {
hsString.append(" [").append(aMek.formatHeat()).append("]");
}
if (aMek.hasRiscHeatSinkOverrideKit()) {
hsString.append(" w/ RISC Heat Sink Override Kit");
}
if (aMek.damagedHeatSinks() > 0) {
hsString.append(" ").append(warningStart()).append("(")
.append(aMek.damagedHeatSinks())
Expand Down
3 changes: 3 additions & 0 deletions megamek/src/megamek/common/templates/MekTROView.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ protected void initModel(EntityVerifier verifier) {
setModelData("hsType", mek.getHeatSinkTypeName());
setModelData("hsCount",
mek.hasDoubleHeatSinks() ? mek.heatSinks() + " [" + (mek.heatSinks() * 2) + "]" : mek.heatSinks());
if (mek.hasRiscHeatSinkOverrideKit()) {
setModelData("riscKit", true);
}
setModelData("hsMass", NumberFormat.getInstance().format(testMek.getWeightHeatSinks()));
if (mek.getGyroType() == Mek.GYRO_STANDARD) {
setModelData("gyroType", mek.getRawSystemName(Mek.SYSTEM_GYRO));
Expand Down
59 changes: 54 additions & 5 deletions megamek/src/megamek/server/totalwarfare/TWGameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -15466,28 +15466,38 @@ else if ((entity.heat >= 14) && !entity.isShutDown()) {
entity.setShutDown(true);
} else {
int shutdown = (4 + (((entity.heat - 14) / 4) * 2)) - hotDogMod;
TargetRoll target;
if (mtHeat) {
shutdown -= 5;
target = new TargetRoll(shutdown, "Base tacops shutdown TN");
switch (entity.getCrew().getPiloting()) {
case 0:
case 1:
shutdown -= 2;
target.addModifier(-2, "Piloting skill");
break;
case 2:
case 3:
shutdown -= 1;
target.addModifier(-1, "Piloting skill");
break;
case 6:
case 7:
shutdown += 1;
target.addModifier(+1, "Piloting skill");
}
} else {
target = new TargetRoll(shutdown, "Base shutdown TN");
}
boolean riscKit = false;
Mek mek = (Mek) entity;
if (mek.hasRiscHeatSinkOverrideKit()) {
riscKit = true;
target.addModifier(-2, "RISC Heat Sink Override Kit");
}
Roll diceRoll = Compute.rollD6(2);
int rollValue = diceRoll.getIntValue();
r = new Report(5060);
r.subject = entity.getId();
r.addDesc(entity);
r.add(shutdown);
r.add(target);

if (entity.getCrew().hasActiveTechOfficer()) {
rollValue += 2;
Expand All @@ -15496,7 +15506,8 @@ else if ((entity.heat >= 14) && !entity.isShutDown()) {
} else {
r.add(diceRoll);
}
if (rollValue >= shutdown) {

if (rollValue >= target.getValue()) {
// avoided
r.choose(true);
addReport(r);
Expand All @@ -15512,6 +15523,44 @@ else if ((entity.heat >= 14) && !entity.isShutDown()) {
// okay, now mark shut down
entity.setShutDown(true);
}

if (diceRoll.getIntValue() == 2 && riscKit) {
r = new Report(5545);
r.subject(entity.getId());
addReport(r);

int hits = 0;
Roll diceRoll2 = Compute.rollD6(2);
r = new Report(6310);
r.subject = entity.getId();
r.add(diceRoll2);
r.newlines = 0;
addReport(r);

if ((diceRoll2.getIntValue() == 8) || (diceRoll2.getIntValue() == 9)) {
hits = 1;
} else if ((diceRoll2.getIntValue() == 10) || (diceRoll2.getIntValue() == 11)) {
hits = 2;
} else if (diceRoll2.getIntValue() == 12) {
hits = 3;
}

r = new Report(6328);
r.subject = entity.getId();
r.add("%d+1=%d".formatted(hits, hits+1));
addReport(r);

hits++;

for (int j = 0; (j < 12) && (hits > 0); j++) {
var crit = mek.getCritical(Mek.LOC_CT, j);
if ((crit.getType() == CriticalSlot.TYPE_SYSTEM)
&& (crit.getIndex() == Mek.SYSTEM_ENGINE) && crit.isHittable()) {
addReport(applyCriticalHit(entity, Mek.LOC_CT, crit, true, 0, false));
hits--;
}
}
}
}
}
}
Expand Down

0 comments on commit afa24a6

Please sign in to comment.