Feature - Implemented Scaling monster function or proxy field

Fluxxdog

Active member
I keep forgetting to bring this up, but I would like to identify scaling monsters, either by function or by proxy. Something that denotes its values are based on player stats, such as experience. I was trying to think of a monster who changes whether it scales or not but none come to mind.
Code:
$monster[x].scales returns boolean
boolean monster_scales(monster m)
Since the information is generally static, proxy would be the better option, wouldn't it?
 
Currently mafia doesn't know that. It does know the difference between a calculated attack, defence etc and a fixed one, I guess.

What would you be using this for? Any decision making routine I could envisage would also need to know caps or floors in addition (most scaling monsters have them), as well as how much +/- stat you get on top of the scaling. A Boolean for scaling doesn't sound like it gives you much other than a reason for further requests for useful functions !
 
Here's what I'm thinking: If I can identify that an area will scale, such as the Hamburglaris Shield Generator or a Romantic monster that scales in an area without scaling monster, I can have scripts better prepare for them, such as maximizing my mainstat and/or pulling out a sombrero-type familiar, rather than worry about a defense value that will constantly change each time I change gear.

The floors and caps may be useful also, though I can't think of how currently.
 
If I did implement something, the most likely thing would be to expose the calculation used as well as the stat, quite possibly just as the whole string, and let you play with it at will.

There are just so many monsters with such varied equations.
 
What things scale?

Atk/Def/HP/Exp. Seems like you could have proxy fields - attack_expression, defense_expression, hp_expression - which are strings. You could pass such a string to expression_eval() to evaluate it, or process the expression yourself to extract caps and such.

That'd be the least work for us and would expose every bit of information we have to your script.
 
You could implement this by returning the information through string_modifier()....

Code:
[COLOR="#808000"]> ash string_modifier($monster[Video Game Minion (weak)], "Modifiers")[/COLOR]

Returned: HP: [0.75*(min(MUS-7+max(ML,0),10000))] Atk: [min(MOX-7+max(ML,0),10000)] Def: [min(MUS-7+max(ML,0),10000)] Exp: [(min(STAT-7+max(ML,0),10000))/4]

[COLOR="#808000"]> ash string_modifier($monster[Video Game Minion (weak)], "Atk")[/COLOR]

Returned: Atk: [min(MOX-7+max(ML,0),10000)]

This is in line with other ways that Mafia exposes underlying mechanics since it will do the exact same thing for items and effects.
 
Last edited:
If I did implement something, the most likely thing would be to expose the calculation used as well as the stat, quite possibly just as the whole string, and let you play with it at will.

There are just so many monsters with such varied equations.
Ooh! That sounds excellent! Yes, give us the mud to play with! No really, that does sound like a better option.
What things scale?

Atk/Def/HP/Exp. Seems like you could have proxy fields - attack_expression, defense_expression, hp_expression - which are strings. You could pass such a string to expression_eval() to evaluate it, or process the expression yourself to extract caps and such.

That'd be the least work for us and would expose every bit of information we have to your script.
Less work? Sounds great ^^
 
Is there really any reason to create additional proxy fields when the values are already available, as Bale pointed out? Well, if that's actually working... with r14699, I get this:
> ash string_modifier($monster[Video Game Minion (weak)], "Modifiers")

Returned:

> ash string_modifier($monster[Video Game Minion (weak)], "Atk")

Returned:

But when it's working, you should be able to just do something like:
ash (string_modifier($monster[Video Game Minion (weak)], "Atk") != "")
to validate that attack is a scaling stat for that monster...
 
Modifiers only describes values in modifiers.txt. Even if this stuff could be added to those functions, it's probably easier to do it differently.
 
r14837

The attribute string is now available in monster proxy, .attributes.

If you want to know if a monster scales, Scale: will appear in that string for normal scaling monsters that do not have special expressions (ie. not Dreadsylvania, Wormwood etc)
 
Back
Top