[v1.1.0+] Pragmatic Heroism

A place to post your add ons and ideas for them

Moderator: Moderator

Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.1.0+] Pragmatic Heroism

#1 Post by Zizzo »

We've all seen it. It's the bane of everyone trying to kill that one orc or vampire that just. won't. die. It's the reason I wouldn't touch heroism infusions or the Last Stand talent. It's spelled "HP: unknown" --- or at least it was, until my new Pragmatic Heroism addon. :wink:

This addon modifies the actor tooltips to show their exactive negative HP, and their exact negative die-at threshold. [There wasn't an obvious angle for the percentage display, so I went with f.i. (-70%) at -30/-100 and (-10%) at -90/-100.] This should work for both the player and NPCs, and with any effect that reduces the die-at threshold to below 0HP.

And this one probably won't be going into ZOmnibus, as I can imagine that some would consider it cheating.

[Technical data:]

Code: Select all

Superload:
  mod.class.Actor:
    tooltip() [to replace "HP: unknown" in the tooltip, obviously]
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#2 Post by Zizzo »

Release v2, just pushed out, adds a nice feature that I had wanted from the start but only just recently got working: when you're below zero life, your life bar now displays your negative life and die-at threshold, as shown below:
negative-life-bar.png
negative-life-bar.png (85.82 KiB) Viewed 6641 times
The black "life" meter expanding from the right as your life decreases is just an extra flourish. :twisted:
"Blessed are the yeeks, for they shall inherit Arda..."

astralInferno
Uruivellas
Posts: 757
Joined: Mon Jan 27, 2014 10:40 am

Re: [v1.1.0+] Pragmatic Heroism

#3 Post by astralInferno »

You deserve some kudos for that black life flourish, that's an amazing touch. xD

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#4 Post by Zizzo »

astralInferno wrote:You deserve some kudos for that black life flourish, that's an amazing touch. xD
*blush* (bows)

Did just find a bug, though: invisible actors apparently have nil tooltips, which means attempting to modify them is almost certainly going to end badly. :wink: That's fixed in v2a, just pushed out.
"Blessed are the yeeks, for they shall inherit Arda..."

Row
Higher
Posts: 54
Joined: Mon Aug 20, 2012 10:57 am

Re: [v1.1.0+] Pragmatic Heroism

#5 Post by Row »

And this one probably won't be going into ZOmnibus, as I can imagine that some would consider it cheating.
How about include it in ZOmnibus, but make it configurable so that it can be turned off. There are more options in ZOmnibus that can be considered cheating, such as always evade all patrols.

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#6 Post by Zizzo »

Row wrote:How about include it in ZOmnibus, but make it configurable so that it can be turned off. There are more options in ZOmnibus that can be considered cheating, such as always evade all patrols.
A fair point, I suppose; I don't think I was thinking about that sort of thing way back when I first created ZOmnibus. Anyone else have an opinion?
"Blessed are the yeeks, for they shall inherit Arda..."

Zeranamu
Posts: 1
Joined: Thu Feb 11, 2016 9:54 am

Re: [v1.1.0+] Pragmatic Heroism

#7 Post by Zeranamu »

I've only just started playing, and haven't even experienced being able to go negative HP yet, but I do use the ZOmnibus pack and would say add it. I like stuff, and if it can be turned on or off then I don't see a problem with it.

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#8 Post by Zizzo »

Okay, you've convinced me. :wink: v2b, just pushed out, adds the "Show negative life in tooltips" option under the UI tab of the Game Options dialog — and that's enough to let us merge into ZOmnibus. We Apologize for the Convenience.™ :mrgreen:
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#9 Post by Zizzo »

Aaand greater exposure via ZOmnibus apparently means more stupid bugs found faster… :oops: Pushing out v2b.1 to fix display of shield info in the life bar while you're below zero life. We Apologize for the Error.™
"Blessed are the yeeks, for they shall inherit Arda..."

Row
Higher
Posts: 54
Joined: Mon Aug 20, 2012 10:57 am

Re: [v1.1.0+] Pragmatic Heroism

#10 Post by Row »

When using classic UI and Plenum tooltip addon, there is no way to tell how much in the negative life you are.
It should display the negative life number also in:
  • * classic ui life bar
    * character sheet

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#11 Post by Zizzo »

Row wrote:When using classic UI and Plenum tooltip addon, there is no way to tell how much in the negative life you are.
Wait, so with Plenum, you're not getting e.g. "HP: -13/-100" in the player's tooltip? Is it still saying "HP: unknown"? I'll need to investigate that. But you're right, support of the Classic UI is something I really should have done by now.
Last edited by Zizzo on Wed Mar 02, 2016 4:18 am, edited 1 time in total.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#12 Post by Zizzo »

Well, supporting the Classic UI turned out not to be quite as hard as I'd feared:
classic-lifebar.png
classic-lifebar.png (9.49 KiB) Viewed 6299 times
That's going out as v2c. As for Plenum, I think I'm going to need to bring Hachem_Muche in on this…
"Blessed are the yeeks, for they shall inherit Arda..."

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: [v1.1.0+] Pragmatic Heroism

#13 Post by Hachem_Muche »

Zizzo, got your poast RE: Plenum Tooltip.

What you're doing with the actor tooltip should work fine on the PTT created tooltip.

Any reason you set your addon weight to 50?

PTT runs at a weight of 150 to make sure the effects of other addon's are taken into account, and because it's not game-breaking if another addon breaks it (It can be disabled from the game menu.).

I think both addon's should be compatible if you set the weight of PH to 151.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Zizzo
Sher'Tul Godslayer
Posts: 2009
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.1.0+] Pragmatic Heroism

#14 Post by Zizzo »

Hachem_Muche wrote:Any reason you set your addon weight to 50?
(scratches head) I'm… pretty sure that's what most or all of the other addons I've looked at use. For that matter, I pretty much had to have copied it from somewhere.
Hachem_Muche wrote:PTT runs at a weight of 150 to make sure the effects of other addon's are taken into account,
See, this is the bit that confuses me. Because the way you've got it implemented currently, you're effectively discarding the effects of other addons and rebuilding the tooltip from scratch (hence the problem, in fact). That's why I offered to have Pragmatic Heroism pass information "downstream" to Plenum, to use in its tooltip reconstruction.
Hachem_Muche wrote:I think both addon's should be compatible if you set the weight of PH to 151.
I considered that briefly, but Pragmatic is also part of ZOmnibus, so I'd also have to change ZOmnibus' weight, and I shudder to imagine what that might break. :?
"Blessed are the yeeks, for they shall inherit Arda..."

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: [v1.1.0+] Pragmatic Heroism

#15 Post by Hachem_Muche »

But why not change the weight of everything?
Sounds like a debugging adventure!

Actually I thought Zomnibus had a way to change the weight of each individual addon.
The default weight for addons (is supposed to be) 100.

PTT does override other addons, because it pretty much replaces the entire tooltip for actors. Another addon (at a higher weight) that tried to modify the normal ToME tooltip would probably break.
Have you tested PH with a higher weight than PTT to confirm it works?

The next (rather sloppy) option I can think of is defining something like a new mod.Actor._life_text(self) function that returns the string you want to display, and then using that in your search and replace code to update actor life in the tooltip. It would then be easy enough to have PTT check for that function and use it.

Also note that if the player really needs to see the negative life of an npc, he can temporarily disable PTT's actor tooltip and the normal tooltip (using PH) will be displayed.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Post Reply