Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi target shooting #1329

Merged
merged 3 commits into from
Apr 20, 2019
Merged

Conversation

NickAragua
Copy link
Member

This set of changes allows the bot to consider shooting at multiple targets, as long as the unit doing the shooting isn't subject to secondary target penalties (incorporating secondary target penalties is a lot more difficult).

This affects large spacecraft, multi-crewed vehicles (when the appropriate tacops rule is turned on), units with the MultiTrac quirk and units with the MultiTasker SPA, greatly increasing their effectiveness on the field.

A side effect is that the bot will also incorporate the "combat computer" quirk into its firing plan for those units.

Copy link
Contributor

@sixlettervariables sixlettervariables left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question.

for(Targetable target : getTargetableEnemyEntities(weapon.getEntity(), owner.getGame(), owner.getFireControlState())) {
final int ownerID = (target instanceof Entity) ? ((Entity) target).getOwnerId() : -1;
if(owner.getHonorUtil().isEnemyBroken(target.getTargetId(), ownerID, owner.getBehaviorSettings().isForcedWithdrawal())) {
owner.log(getClass(), "MultiTargetFireControl.getBestShot", LogLevel.INFO, target.getDisplayName() + " is broken - ignoring");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be WARN or DEBUG instead of Info?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's "INFO" in the other places where isEnemyBroken is invoked, so I followed that pattern. I could be convinced to call it DEBUG as well.

@NickAragua NickAragua merged commit f7df4a5 into MegaMek:master Apr 20, 2019
@NickAragua NickAragua deleted the multi_target_shooting branch July 20, 2019 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants