blueboy / portal

This portal repo is for development purposes only
http://github.com/blueboy/portal
GNU General Public License v2.0
27 stars 24 forks source link

Expand HealTarget, GetHealTarget usage #19

Closed kennumen closed 11 years ago

kennumen commented 11 years ago

First adapt GetHealTarget() to take extra input:

Copy GetHealTarget() into GetResurrectTarget() code.

Find a way to generalize HealTarget. It's mostly the same code. Can it be done with a simple 'minHP, spellToCast' table passed along?

kennumen commented 11 years ago

https://github.com/blueboy/portal/commit/32454079bf11a8c489a533aded362520f542e0ca

kennumen commented 11 years ago

HealTarget (HealPlayer now) now holds error checks in PlayerbotClassAI. It's not easily possible to extract out all the code as there can be quite a few exceptions. Some spells require checks (has this target received a priest's shield in the past X seconds), others extra checks (is the priest's own health low as well? Is this a tank or healer?), and future integration of group healing (are there at least 3 party members worth healing? -> group heal) would be made more difficult by this. I'll leave it at that.

As far as this issue is concerned, that leaves GetResurrectTarget and GetBuffTarget code as a TODO.

kennumen commented 11 years ago

https://github.com/blueboy/portal/commit/0cddeff4c10f6eeb867b3fbf72283edbc1e6c466

GetResurrectTarget() is done and in use.

This [i]may[/i] cause problems with buffing and as such the new GetTargetWithoutBuff code (and use thereof) is my top priority now.

kennumen commented 11 years ago

https://github.com/blueboy/portal/commit/fc960c4b99e43027e684bf1e924b769297f0290d

Framework and Paladin done.

Druid, Priest, Mage to go. Pretty sure that's all of them then, will need to check.

kennumen commented 11 years ago

https://github.com/blueboy/portal/commit/af6d50a15ab92b58ea235b8888417166581bd2b4 Druid

https://github.com/blueboy/portal/commit/6b4e8ea349c03ebc97b8d7e1bfc5c4b1e08b121b Priest & Mage

Both times save half the code. The DoNonCombatManeuver() functions are certainly a lot clearer. Had to take out a 'mana users only' check for the priest spirit buff. The mage buff doesn't have this check but could use it as well. Will solve this with a new JOB_TYPE right now.

... https://github.com/blueboy/portal/commit/a1a9a4ac385f67dfc319211a8e7ea0d0c1a587f4 And done.