would my hypothetical patch have a greater than 0% chance of at least being considered?
Base stats are possible currently on everything, including scaling monsters. The 'normal' commands should give results based on current ML levels.
The question is whether or not we want to have commands to be able to predict stats if we have different ML levels...
There is a nonzero chance, yes.
Probably something like this, for monsters who don't have an ML cap:If there's a way to get the unmodified (i.e. not multiplied by .9) defense out of KoLmafia without parsing it directly from monsters.txt, I'll be both grateful and impressed if you can tell me what it is.
int defense = ceil( ( monster_defense( $monster[ dairy goat ] ) - numeric_modifier( "Monster Level" ) ) / 0.9);
So since I have a somewhat less than 100% acceptance rate when I post a patch,
If it's any consolation i think just about every dev has committed something that was subsequently reverted or modified because the original was deemed Not A Good Thing.
The good news is my new job includes writing code. The bad news is I no longer have a single minded compulsion to tweak mafia because it is my only chance to write code. Thus I don't always seek out patches other people have done and decide whether I should commit them or not. However I do react to PMs. So, if you or anyone else, has a patch that is languishing and want some attention send me a PM that includes a link to the thread with the patch. I will either review and commit, tell you why I won't or post something in the thread. My general rule is that I have to understand the problem the patch solves or the feature it adds, I have to feel that unintended side effects are unlikely and I have to sense from the comments in the thread that more than one person is interested and none of the people whose opinions matter to me object.
Because defense is an int, dividing by .9 regularly ends up being a number that's 1 less than the original defense. This same effect is the only source of uncertainty when deducing a monster's defense based on "how much damage did I just punch it for". Yes, for real.Probably something like this, for monsters who don't have an ML cap:
PHP:int defense = ceil( ( monster_defense( $monster[ dairy goat ] ) - numeric_modifier( "Monster Level" ) ) / 0.9);
ash for x from 100 to 111 { int y = x * .9; print_html(x + " => " + y + " => " + ceil(y / .9)); }
But why would you want the "not 90%" defense? KoL doesn't use it... why do we care? Unless we're trying to show that the wiki got it wrong again...
> ash for x from 100 to 111 { float y = x * .9; print_html(x + " => " + y + " => " + ceil(y / .9)); }
100 => 90.0 => 100
101 => 90.9 => 101
102 => 91.8 => 102
103 => 92.7 => 103
104 => 93.60000000000001 => 104
105 => 94.5 => 105
106 => 95.4 => 106
107 => 96.3 => 107
108 => 97.2 => 108
109 => 98.10000000000001 => 109
110 => 99.0 => 110
111 => 99.9 => 111
Returned: void
FTFY. 0.9 can't be represented exactly as a float/double, and x * 0.9 will almost definitely end up being slightly wrong, and (x * 0.9) / 0.9 *might* round to the "correct" answer, but isn't guaranteed to do that.That happens because your x * 0.9 is stored with finite precision]
Mafia itself gives you y as an int.