Bug - Not A Bug Smooth Movement is missing Combat Rate modifier

zarqon

Well-known member
> ash foreach e in $effects[] if (numeric_modifier(e,"Combat Rate") != 0) print(e+" => "+numeric_modifier(e,"Combat Rate"))

Fresh Scent => -5.0
Hippy Stench => 5.0
The Sonata of Sneakiness => -5.0
Carlweather's Cantata of Confrontation => 5.0
Smooth Movements => -5.0
Musk of the Moose => 5.0
Inky Camouflage => -5.0
Simply Invisible => -5.0
Simply Irresistible => 5.0
Song of Solitude => -20.0
Song of Battle => 20.0
Returned: void

> ash foreach s in $skills[] if (numeric_modifier(s,"Combat Rate") != 0) print(s+" => "+numeric_modifier(s,"Combat Rate"))

Musk of the Moose => 5.0
The Sonata of Sneakiness => -5.0
Carlweather's Cantata of Confrontation => 5.0
Song of Solitude => -20.0
Song of Battle => 20.0
Returned: void

I was actually somewhat surprised that any of the skills had that listed, but if those 5 do, then Smooth Movement should as well.
 

Veracity

Developer
Staff member
I was actually somewhat surprised that any of the skills had that listed, but if those 5 do, then Smooth Movement should as well.
You misunderstand what was happening. Modifiers are keyed by "name" - a string. The numeric_modifier() function can take a skill or an effect, but it simply takes the name of the skill or effect and looks up the modifier by that name.

The skill Musk of the Moose creates the effect Musk of the Moose, so the name is the same for both.
The skill Smooth Movement creates the effect Smooth Movements, and only the latter has a combat rate.

To do this correctly, your second example should use to_effect( skill ) to get the name of the effect, rather than using the name of the skill directly.

This script:
Code:
foreach s in $skills[] {
    effect e = s.to_effect();
    if (e != $effect[none] && numeric_modifier(e,"Combat Rate") != 0)
	print(e+" => "+numeric_modifier(e,"Combat Rate"));
}
yields:
> te

Musk of the Moose => 5.0
Smooth Movements => -5.0
The Sonata of Sneakiness => -5.0
Carlweather's Cantata of Confrontation => 5.0
Song of Solitude => -20.0
Song of Battle => 20.0
 

zarqon

Well-known member
Oh, that makes a lot more sense. I did note that it was the only skill-granted effect which differed from the name of the skill granting it, and figured that might have had something to do with why it was "omitted." Thanks for the clear explanation.
 
Top