Page 1 of 1

Ego / mbonus / mbonus_level help

Posted: Mon Mar 14, 2016 1:07 am
by ibanix
So one of the things that is long overdue on the wiki is updating ego descriptions. Many of them are far out of date.

It's easy enough for me to find the egos, it is less easy for me to understand them. For example, from lite.lua:

Code: Select all

newEntity{
	power_source = {arcane=true},
	name = " of the sun", suffix=true, instant_resolve=true,
	keywords = {sun=true},
	level_range = {30, 50},
	greater_ego = 1,
	rarity = 30,
	cost = 30,
	resolvers.charmt(Talents.T_SUN_FLARE, 3, 30),
	wielder = {
		inc_damage={
			[DamageType.LIGHT] = resolvers.mbonus_material(10, 5),
		},
		resists={
			[DamageType.DARKNESS] = resolvers.mbonus_material(10, 5),
		},
		lite=resolvers.mbonus_material(2, 1),
		damage_affinity = { [DamageType.LIGHT] = 5 },
	},
}
It's the mbonus functions that are giving me trouble here. I can track them back to mod/resolvers.lua, and that's when I start having trouble. I'd like to be able to turn something like

Code: Select all

resolvers.mbonus_material(10, 5),
into "x to y increase" or the like.

So my questions here are:

1) How do I 'read' the mbonus family of functions? What do the inputs mean?
2) Is there an easy mapping from the function input to "gives x to y" output?
3) There is no question 3. :lol:

Thank you much!

Re: Ego / mbonus / mbonus_level help

Posted: Mon Mar 14, 2016 2:12 am
by HousePet
mbonus is a magical black box that returns a value scaled by the level of the item or creature it was called from.

For mbonus_material(x, y), the return value is something like (1 to x) * m / 5 + y, where m is the material tier.
So it is simply y to x+y.

Re: Ego / mbonus / mbonus_level help

Posted: Mon Mar 14, 2016 3:42 am
by ibanix
Excellent! Thank you!