Skip to content

Commit

Permalink
Issue 6252: Allow princess to unjam weapon-crits for offboard artillery
Browse files Browse the repository at this point in the history
  • Loading branch information
psikomonkie committed Dec 19, 2024
1 parent c307bf0 commit 22efef7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions megamek/src/megamek/client/bot/princess/FireControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -3560,6 +3560,9 @@ public Vector<EntityAction> getUnjamWeaponPlan(Entity shooter) {
if (weaponDamage == WeaponType.DAMAGE_BY_CLUSTERTABLE) {
weaponDamage = ((WeaponType) mounted.getType()).getRackSize();
}
if (weaponDamage == WeaponType.DAMAGE_ARTILLERY){
weaponDamage = 1; //Set it to something
}

if (weaponDamage > maxJammedDamage) {
maxDamageWeaponID = shooter.getEquipmentNum(mounted);
Expand Down
10 changes: 9 additions & 1 deletion megamek/src/megamek/client/bot/princess/Princess.java
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,15 @@ protected void calculateTargetingOffBoardTurn() {

FiringPlan firingPlan = getArtilleryTargetingControl().calculateIndirectArtilleryPlan(entityToFire, getGame(), this);

sendAttackData(entityToFire.getId(), firingPlan.getEntityActionVector());
if (!firingPlan.getEntityActionVector().isEmpty()) {
sendAttackData(entityToFire.getId(), firingPlan.getEntityActionVector());
}
else {
if (this.fireControls == null) {
initializeFireControls();
}
sendAttackData(entityToFire.getId(), getFireControl(entityToFire).getUnjamWeaponPlan(entityToFire));
}
sendDone(true);
}

Expand Down

0 comments on commit 22efef7

Please sign in to comment.