Ruin0x11 / OpenNefia

(Archived) Moddable engine reimplementation of the Japanese roguelike Elona.
MIT License
116 stars 18 forks source link

Redesign skill querying API #5

Closed Ruin0x11 closed 3 years ago

Ruin0x11 commented 4 years ago

The skill querying API in ICharaSkills.lua is too confusing. Currently it looks like this:

chara:skill_level(skill_id)
chara:magic_level(magic_id)
chara:resist_level(element_id)

These three functions do nearly the same thing, but operate on different data types. Instead it should look like this:

chara:skill_level(skill_id)
chara:skill_level(magic_id, "elona.magic")
chara:skill_level(element_id, "base.element")

That way new methods don't have to be defined if another mod wants to use the skill/potential system.

Ruin0x11 commented 3 years ago

The way we define skill querying now works well. It is separated into skills for base.skill and resistances for base.element.