Feature - Implemented Add modifier_eval text function haveskill()

zarqon

Well-known member
As I've been looking through all the "fvars" that BatBrain sets to provide extra information to formulas, I've realized that I could eliminate a not insignificant number of them were mafia to provide a "haveskill()" text function for use in these formulas.

Ideally, it would function as the current "effect()" text function, accepting either a string or a number, and it would return 1 if you have the skill, or 0 if you don't.

Formulas for sauceror spells would be much easier as we could use the new function twice -- for checking both Bringing Up the Rear and Intrinsic Spiciness. Seal Clubber smacks would be able to check for Cold Shoulder. Sauceror curses would be able to check for Itchy Trigger Finger when determining the stun duration. We could check in the formula whether your Bellows are Intimidating.

...And so forth. Myriad uses within BatBrain, at least. :)
 

lostcalpolydude

Developer
Staff member
I believe skill() is what you want. As far as I know, the functions available for modifier_eval are the same ones available to parse mafia's data files, and that is all documented in modifiers.txt.
 

Veracity

Developer
Staff member
If a "text" function is one whose argument is described as "text":

> ash modifier_eval( "effect(ode)" )

Returned: 9.0

> ash modifier_eval( "effect(ode)+effect(ode)" )

Returned: 18.0
then I'd say the restriction is no longer there.
 

zarqon

Well-known member
Ah, our Wiki is sorely out of date. I'll go update it now.

Also, wow. There is a lot of extremely useful functionality there which was heretofore unknown to me.

Looks like the only part of my feature request which didn't already exist is to make skill() work with numbers (just tested and it doesn't). I can't have those skill-name-introduced spaces in my formulae.
 
Last edited:

lostcalpolydude

Developer
Staff member
Looks like the only part of my feature request which didn't already exist is to make skill() work with numbers (just tested and it doesn't). I can't have those skill-name-introduced spaces in my formulae.

You should probably never edit posts on this forum when it's part of the last reply (except for fixing typos or whatever). The only reason I saw this bit is that I was confused by your post in the BatBrain thread.
 

zarqon

Well-known member
Yeah, I debated that when editing, decided that forum social mores being what they are I ought to edit rather than double post. Good to know things are less strict in that regard here.

So, here in this new post, I'll request that we make skill() work with numbers, as effect() currently does. It would allow me to greatly simplify a good number of things in batfactors.
 

Veracity

Developer
Staff member
Yeah, I debated that when editing, decided that forum social mores being what they are I ought to edit rather than double post.
I participate in many forums. The KoL official forums are, literally, the only ones I've ever seen with a "no double posting" rule.

lost nailed the "social mores" we have here: Double posting is not discouraged. In fact, if you are adding something new to the discussion, it is encouraged, because anybody who has already read your note will otherwise miss your new content, since there is no indication from the forum that your post has changed since they last read it.
 
Top