Base implementation of barrage turbine #6850
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
Closes #4822
Background
Automaton Attachments
AUTOMATON_ATTACHMENT_CHECK
event listener with a function to execute when the event occurs./src/map/ai/controllers/automaton_controller.cpp
->DoCombatTick
has aTryAction
block that callsTryAttachment
.TryAttachment
calls any listeners currently subscribed toAUTOMATON_ATTACHMENT_CHECK
.useMobAbility
from/src/map/lua/lua_baseentity.cpp
.onAutomatonAbility
function in/scripts/actions/abilities/pets/automaton
catches this and actually performs the ability.Automaton Ranged Attack
xi.autows.doAutoRangedWeaponskill
is used to carry out the ranged attack. It sets up some necessary variables and then calls in to standard weaponskill functionsxi.weaponskills.calculateRawWSDmg
andxi.weaponskills.takeWeaponskillDamage
.8
hits. And this is how the code is setup up withinxi.weaponskills.calculateRawWSDmg
./src/map/utils/battleutils.cpp
TakeWeaponskillDamage()
.General Implementation
List Adjustments
automaton_abilities.sql
reqframe = 22
andskilllevel = 0
.mob_skills.sql
for barrage turbine (2746)mob_skill_distance
to25.0
(previously 7.0) to match the regular ranged attackmob_valid_targets
to4
(previously 16). Without the latter change barrage turbine will only be able to do damage to the automaton instead of the enemy.BARRAGE_TURBINE
to thexi.automaton.abilities
list in/scripts/globals/automaton.lua
. The ID is 2746.Do NOT add to
mob_skill_lists.sql
because Barrage Turbine is not a TP move in the traditional sense and we don't want it mixed in with the automaton's weaponskill lineup.Barrage Turbine Capture
onEquip
ListeneruseMobAbility
.onAutomatonAbility
180 seconds
(3 minutes) between barrage turbine activation.xi.element.WIND
for now. The burden handling may require a bit more (future) thought as all of the actions in the standard xi.automaton.onUseManeuver handling may not be appropriate for the burden added by barrage turbine. For example, barrage turbine does not come with an overload chance message and I've never seen barrage turbine cause an overload (can it?).Barrage Implementation
As automaton ranged attacks are considered weaponskills, and a barrage is a series of ranged attacks, it would be prudent to take advantage of the existing automaton ranged attack code,
xi.autows.doAutoRangedWeaponskill
, to perform the barrage. This works generally, but there is the matter of damage and TP gain.I needed to create a new element,
isBarrage
, within the parameter table passed intoxi.autows.doAutoRangedWeaponskill
. I used that new element within the remaining hitswhile
loop ofxi.weaponskills.calculateRawWSDmg
to increase the amount oftpHitsLanded
. I needed to usetpHitsLanded
because it's used inTakeWeaponskillDamage()
which calculates the return TP. The other option wasextraHitsLanded
, but those hits only get multipied by10
instead of thebaseTp
,Problem # 1
The max number of shots in the barrage is 9. The multi-hit weaponskill cap is 8. So, as-is I cannot generate a 9 shot hit. If I remove the cap in the remaining hits
while
loop withinxi.weaponskills.calculateRawWSDmg
I am able to get the correct amount of hits, but I didn't want to perform too much surgery.Problem # 2
Retail testing shows that the TP gained from Barrage Turbine is nice multiples of the base ranged attack TP proportional to the number of active maneuvers. My implementation is close, but not quite perfect. They are just a bit shy of the expected value. The existing TP calculations, perhaps in
battleutils.cpp
, may need to be adjusted to better handle the TP return of weaponskill based barrage. Or maybe a net new handler needs to implemented somewhere.Testing
The same sample size was 5 tests for each set (5 ranged, 5 with one maneuver, etc.). Not an extensive sample size, but it does take three minutes between each barrage on retail. The data spread seemed like 5 tests should be good enough.
TP Return
This Implementation
* Note that 3 maneuvers is 8 because of the weaponskill multi-hit cap instead of the expected 9.
Retail
Damage
In this implementation the individual barrage hits outperform the the regular ranged hits a bit.
* Note that 3 maneuvers is 8 because of the weaponskill multi-hit cap instead of the expected 9.
In Retail the individual barrage hits underperform regular ranged hits a bit.
Barrage Turbine Delay
I did some testing on how long it takes before the initial barrage turbine can be used. After several different scenarios I can say this about the delay:
Battle Scenario Testing
Initial Delay Testing (Zone vs. Activation)
* Barrage turbine occurs 3 minutes after activation.
TODOs
while
loop ofxi.weaponskills.calculateRawWSDmg
(or some other strategy) to allow for 9 hits. Right now it's capped at 8.