-
Notifications
You must be signed in to change notification settings - Fork 294
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
Fix 4520 princess only fires aero tag #5020
Fix 4520 princess only fires aero tag #5020
Conversation
I'll have another commit tomorrow with fixes for the above, and hopefully filtering out homing attacks by distance. |
A fun turn testing with this code: Teammate, a friendly Princess, detected two previously-fired Homing AIVs and a bunch of LG bombs nearby, so used the relatively poorly-armed Centurions to TAG for the Homing rounds and the Sabutai's dive bomb attack, as well spotting for indirect Thunderbolt fire (not shown). |
Awesome to see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts/feedback.
This change updates a few things:
compute
as a genericcomputeTotalDamage
function, and include bombs in the computation.Since the implementation of step 2 is pretty simplistic, that part can be excised for a later patch without affecting the fix to this issue.
In short, for each Aerospace with TAG that Princess controls, Princess will now calculate and cache a list of
A) all incoming guided artillery impacting this turn;
B) all Laser-Guided Bombs on other units on the board;
C) all Indirect Fire-capable weapons on all other (non-Aerospace) units on the board;
these lists will be used to compute the maximum possible damage deriving from using a given Aerospace unit's TAG rather than firing its weapons normally. The Aero unit will attempt to TAG if its expected damage is equal to or less than the potential damage from incoming guided munitions this turn. Otherwise, TAG will not be used.
NOTE: This calculation does not take into account the distance from a given TAG target to each incoming munition's target point (needed for precise assessment of e.g. Homing Arrow IV or Copperhead rounds). It also does not take into account whether prospective targets are even within firing range of Indirect-Fire-capable friendly ground units. However, adding these checks to
computeGuidedWeapons
would not cause much additional computation time overall because each list is calculated once and then cached for later re-use by the turn-planning code.tl;dr: fix works, and Princess will be slightly smarter about using TAG.
Testing:
-- Also included off-board Copperhead and Homing Arrow IV units.
close #4520