Bug - Fixed Fancypants Scarecrow and Mad Hatrack equip effects listed under "effect" modifier

rlbond86

Member
Fancypants Scarecrow and Mad Hatrack equip effects listed under "effect" modifier

I guess I think this is kind of weird and was wondering if this was a mistake or intentional.

The "effect" property, for a potion, says any status effect it grants:

Code:
> ash print(string_modifier("spooky lipstick", "effect"))

Gothy

But the same property, for pants or a hat, shows what effect the pants/hat would have on a scarecrow/hatrack:

Code:
> ash print(string_modifier("eyepatch", "effect"))

3xBarrr, cap 6

It seems weird to use one modifier for two very different purposes, especially when it could easily be split into two different modifiers with a single purpose. It also makes a few scripts blow up without special handling.
 

Theraze

Active member
Seems like it's behaving as intended, so not a bug, and you're asking for the FEATURE of having two different strings. Yes?
 

lostcalpolydude

Developer
Staff member
Code:
> ash string_modifier("eyepatch", "Modifiers")

Returned: Moxie: +2, Familiar Effect: "3xBarrr, cap 6"

Code:
> ash string_modifier("spooky lipstick", "Modifiers")

Returned: Effect: "Gothy", Effect Duration: 10
As that shows, one of them is Effect while the other is Familiar Effect. You probably want to use "Modifiers" and parse for what you're looking for.
 

rlbond86

Member
Code:
> ash string_modifier("eyepatch", "Modifiers")

Returned: Moxie: +2, Familiar Effect: "3xBarrr, cap 6"

Code:
> ash string_modifier("spooky lipstick", "Modifiers")

Returned: Effect: "Gothy", Effect Duration: 10
As that shows, one of them is Effect while the other is Familiar Effect. You probably want to use "Modifiers" and parse for what you're looking for.

Seems like it's behaving as intended, so not a bug, and you're asking for the FEATURE of having two different strings. Yes?


Well then I guess the actual bug is that string_modifier() does not work as expected.

Also, that technique does not seem to work in reverse:

Code:
> ash print(string_modifier("eyepatch", "Familiar Effect"))

Returned: void

In addition, the interface is inconsistent. Consumables don't use modifiers at all, for example, even though they probably should.
 
Last edited:

Theraze

Active member
As you expect. It works exactly as the developers planned. :)

Not meeting your expectations doesn't mean that the program is inherently flawed. ;)
 

rlbond86

Member
As you expect. It works exactly as the developers planned. :)

Not meeting your expectations doesn't mean that the program is inherently flawed. ;)

Well, the other problem is that the "Modifiers" method doesn't always work either.

Code:
> ash print(string_modifier("C.H.U.M. lantern", "modifiers"))

Stench Damage: +17, Item Drop: [30*loc(Sewer Tunnels)]

And your comment sounds awfully like "It's not a bug, it's a feature"... :)
 

Theraze

Active member
Which is exactly what I said before. :) You're making a Feature Request, to change something that's working as the developers intended to be something that makes more sense to you. :)
 

Theraze

Active member
Or you could do something like this:
> ash string full = string_modifier("eyepatch", "Modifiers"); int found = index_of(full, "Familiar Effect: "); int ending = index_of(full, "\"", found+18); substring(full, found+18, ending);

Returned: 3xBarrr, cap 6
Want to make it easy? Turn it into an alias.
> alias modifierfam => ashq string full = string_modifier(to_item("%%"), "Modifiers"); int found = index_of(full, "Familiar Effect: "); if (found > 0) { int ending = index_of(full, "\"", found+18); print_html(substring(full, found+18, ending)); }

String successfully aliased.
modifierfam => ashq string full = string_modifier(to_item("%%"), "Modifiers"); int found = index_of(full, "Familiar Effect: "); if (found > 0) { int ending = index_of(full, "\"", found+18); print_html(substring(full, found+18, ending)); }

> modifierfam eyepatch

3xBarrr, cap 6

> modifierfam spooky lipstick
and
> alias modifiereff => ashq string full = string_modifier(to_item("%%"), "Modifiers"); int found = index_of(full, "Effect Duration: "); if (found > 0) { found = index_of(full, "Effect: "); int ending = index_of(full, "\"", found+9); print_html(substring(full, found+9, ending)); }

String successfully aliased.
modifiereff => ashq string full = string_modifier(to_item("%%"), "Modifiers"); int found = index_of(full, "Effect Duration: "); if (found > 0) { found = index_of(full, "Effect: "); int ending = index_of(full, "\"", found+9); print_html(substring(full, found+9, ending)); }

> modifiereff eyepatch

> modifiereff spooky lipstick

Gothy
 

jasonharper

Developer
What the hell are you people talking about? Having the Familiar Effect modifier returned when the Effect modifier is requested is quite obviously a bug. And "parse Modifiers yourself" is absolutely horrible advice...

The fix is to put "(?:^|, )" in front of the "Effect:" pattern, just as was done to "Spell Damage:" to disambiguate it from "Hot Spell Damage:", etc. I'm at work right now, so can't actually commit this at the moment.
 

Theraze

Active member
Looks like stringModifiers will need to have Familiar Effect added to the array then, since currently Effect or the whole modifiers string is the only way to match for it.
 

slyz

Developer
r10926
Code:
> ashq print(string_modifier("eyepatch", "familiar effect"))

3xBarrr, cap 6

> ashq print(string_modifier("eyepatch", "effect"))
 
Top