multiple types of damage

Started by rein_of_fire, October 02, 2015, 03:11:38 AM

Previous topic - Next topic
is there a way to have multiple different damages to give vulnerability/invulnerability/resistance to enemy's?

i would love to use the engine but this is essential to the game i want to make

-thanks in advance

You can customize all damages (enemies or hero) via functions like http://www.solarus-games.org/doc/latest/lua_api_enemy.html#lua_api_enemy_on_hurt or http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_on_taking_damage

See https://github.com/Renkineko/solarus-nrfh/blob/master/data/physical_condition.lua#L95 for an example of the use of hero:on_taking_damage : if he is frozen, damage is tripled. You can set in this kind of script the element vulnerability of the hero (depending on everything you want), and use it. The engine is very permissive with the calculation of damages :)

Thanks for the fast reply! That's great.