Ego / mbonus / mbonus_level help

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
ibanix
Wyrmic
Posts: 244
Joined: Thu May 23, 2013 12:25 am

Ego / mbonus / mbonus_level help

#1 Post 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!
Last edited by ibanix on Mon Mar 14, 2016 3:38 am, edited 1 time in total.
Please help with the ToME wiki!

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Ego / mbonus / mbonus_level help

#2 Post 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.
My feedback meter decays into coding. Give me feedback and I make mods.

ibanix
Wyrmic
Posts: 244
Joined: Thu May 23, 2013 12:25 am

Re: Ego / mbonus / mbonus_level help

#3 Post by ibanix »

Excellent! Thank you!
Please help with the ToME wiki!

Post Reply