• This project
    • Loading...
  • Sign in

tome / Tales of MajEyal · Merge Requests

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Builds 0
  • Graphs
  • Milestones
  • Merge Requests 37
  • Labels
  • Forks
  • Snippets
  • Network
Open
MR Merge Request !673 opened
2020-11-16 21:19:41 UTC by Ryan Yappert @RootOfAllThings

Refactors Actor:onTakeHit to move special-cased effect/talent behavior back into callbacks.

General re-ordering and re-factoring of Actor:onTakeHit

New order of operations:

  1. Invulnerability and chance negation of hits always happens first.

  2. Negative effects that break on damage (Daze, Sleep, Suspended).

  3. Frozen's ice-block damage now occurs before most other forms of onTakeHit mitigation, aside from Invulnerability. This is a balance change.

  4. Unconditional redirection and reduction: Stone Link, Shadow Empathy, Dismissal.

  5. Effects that trigger on damage and make sense to consider pre-shielded damage: Seethe, Vimsense, Stoneshield, Shield of Light.

  6. All Shield and Shield-like effects. Also includes pseudo-shields like Resonance Field, Eldritch Stone, and Deflection. Shields that only block part of the damage and shields that do other things will take precedence over more general shields.

  7. Effects that trigger based on a loss of life, rather than damage. Rampage, Hate and Feedback Gain, Solipsism, Bloodspring, etc.

  8. Stoned. Dying to Stoned should be a sure-kill outside of dedicated life-saving talents, not "Oops I shattered but I shrugged that off." because Rampage normally shrugs after Stoned sets the damage high.

  9. Threshold-triggered effects: Vitality, Second Life, Heartstart, Shadow Decoy, and Draconic Body.

  10. Several other generic properties: clone_on_hit, on_takehit, and the Actor:takeHit hook. These are pseudo-callbacks and so get lumped in here.

  11. lifesteal now applies only to post-mitigation damage. You can't steal life from a shield, and life gained should be directly correlated with the life actually lost.

  12. Size Matters and related achievements now triggers on post-mitigated damage. Might be better to move to pre-mitigated damage, but it being in the middle (After Resistances and Shields, but not other effects) is just bizarre.

  • Moves the vast majority of special cases in Actor:onTakeHit to independent callbacks with manually set weights to control order of events.

  • This only effects behaviors that were previously special-cased (and T_HIEMAL_SHIELD). Many behaviors already used callbackOnHit and were not touched or reordered.

Refactors Shield-like effects and talents

  1. The following talents/effects are "shield-like" for UI purposes.
    • EFF_RESONANCE_FIELD
    • EFF_DISPLACEMENT_SHIELD
    • EFF_TIME_SHIELD
    • EFF_ELDRITCH_STONE
    • EFF_DAMAGE_SHIELD
    • EFF_PSI_DAMAGE_SHIELD
    • T_DEFLECTION
    • T_HIEMAL_SHIELD
    • T_RETRIBUTION
    • EFF_RAMPAGE (with T_TENACITY) triggers with the shields but is not shield-like for UI purposes.
  2. Shield-like talents should all
    1. Denote their current power in effect icon by the charges or icon_overlay property. Damage Shield does this, everyone else should too when reasonable.
    2. Implement a shield_bar function that returns their current and max durability.
  3. The shield/life-bar UI no longer requires special casing for shield effects. All effects/sustains that implement a shield_bar function add to the bar.
  4. Moves the burden of tracking shield power from the Actor (e.g. self.damage_shield_absorb) to the effect (e.g. eff.power). Now you can just interact with the shield, instead of interacting with the shield and the actor.
  5. Damage types (like HEALING_POWER from T_BATHE_IN_LIGHT) and talents (like T_DIRGE_OF_PESTILENCE) are adjusted to work with the new framework.

Deprecates the attribute tags when used in the onTakeHit calculation.

  • speed_resist (no longer exists on Tarrasca)
  • invis_on_hit (only used by T_SECRETS_OF_THE_ETERNALS)
  • reduce_spell_cooldown_on_hit (unused)
  • life_leech_chance (only used by Netherworm Masses, should grant that creature lifesteal instead)
  • contingency (unused)
  • resource_leech_chance (unused)
  • hate_per_powerful_hit (unused, hate gain is a mess and this cleans it up)
  • incoming_reduce (see below)

As part of the shield reform:

  • displacement_shield_chance
  • displacement_shield
  • displacement_shield_target
  • time_shield_absorb
  • damage_shield_reflect
  • damage_shield_absorb
  • resonance_field_absorb
  • retribution_absorb

Changes some talent behaviors behind the scene.

  • T_SNIPE and T_SKIRMISHER_TRAINED_REACTIONS now use Absolute Resistance instead of incoming_reduce. The stacking between the two and Tarrasca is an incredibly niche overlap, and two talents doesn't justify a unique property when Absolute Resistance exists.
  • T_RESONANCE_FIELD now special-cases its feedback generation with a turn-proc, because of the reordering. It also applies prior to most general shields, so feedback generation is optimized.
  • T_SHIELD_OF_LIGHT no longer attempts to heal you if you're already at full Health, but triggers before shield mitigation.
  • T_SECRETS_OF_THE_ETERNALS no longer grants the invis_on_hit property, but has its own callback.
  • T_HEALING_LIGHT, T_WEAPON_OF_LIGHT, and T_DIRGE_OF_PESTILENCE tweaked to support the changes to damage shields.
  • T_BLOODSPRING now has a chat message when it triggers. Felt a little bland without it.
  • T_BLOODSPRING and T_DRACONIC_BODY moved off the antiquated trigger framework and just have regular callbacks.
  • The status effect generated from T_SEETHE and T_GRIM_RESOLVE (EFF_CURSED_FORM) now displays its number of stacks (which doubles as its duration).
  • Several other talents had their do_onHit-esque functions removed and just integrated into their callbacks.
Edited 2020-11-28 17:41:23 UTC
Check out branch Download as
  • Email Patches
  • Plain Diff
Request to merge RootOfAllThings:onTakeHit_refactor into master (7 commits behind)
×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://git.net-core.org/RootOfAllThings/t-engine4.git onTakeHit_refactor
git checkout -b RootOfAllThings/t-engine4-onTakeHit_refactor FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff RootOfAllThings/t-engine4-onTakeHit_refactor

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines

CI build passed for 3f24a812. View details
CI build skipped for 3f24a812. View details
CI build canceled for 3f24a812. View details
CI build failed for 3f24a812. View details
CI build running for 3f24a812. View details
CI build pending for 3f24a812. View details

Ready to be merged automatically

Ask someone with write access to this repository to merge this request.

  • Discussion 8
  • Commits 1
  • Builds 0
  • Changes 29
  • Martin Bienvenu
    @Lokean commented 2020-11-16 22:43:22 UTC

    I was literally about to start a similar refactoring process. Are you intending to work through the similar refactoring jobs elsewhere?

  • Ryan Yappert
    @RootOfAllThings commented 2020-11-16 23:26:37 UTC

    @Lokean At the moment, no. A couple places need it (Actor:attackTargetHitProcsin Combat.lua comes to mind, as does the default projector in damage_types.lua), but my next target is probably Archery.lua. I have a soft spot for Archery code and would really like to disentangle some of its parts so its a touch more modular and easily interfaced with.

    Other good targets for callbackification:

    • Several prodigies, including T_CAUTERIZE have dedicated trigger calls that could be moved into callbacks.
    • EFF_BECKONED and friends in Actor:act().
    • A few loose ends in Actor:move(). Would also like to beef up the power of that callback and let it pass a few more parameters back to the move function, but I think
    • Quite a bit in Actor:die(), which is surprisingly for how awful on-death effects are in ToME as a whole.
  • Martin Bienvenu
    @Lokean commented 2020-11-16 23:36:57 UTC

    @RootOfAllThings Good-o. I'll stick to the original plan then, which was to start with callbackOnMeleeAttackBonuses in attackTargetWith and spiral outwards. I am not in a rush though, so this will be a lazy few weeks/months, rather than your instant blitz! After that, it will be time to start unpicking the combat log... Good call on archery, the way weapon projectiles are handled in general feels like it could do with attention.

    Edited 2020-11-16 23:39:05 UTC
  • Please register or login to post a comment
673 of 698
Prev Next
Assignee
No assignee
Assign to
No
Milestone
None
Assign milestone
0
Labels
None
Assign labels
  • View labels
6
6 participants
Reference: tome/t-engine4!673