I've started another variant:
Unfortunately I seem to be in over my head already.
So: player specialties. Depending on which specialty you pick, you get bonuses when certain things happen. A swordmaster can parry and riposte when attacked; a device specialist will get buffs from using devices; a kickboxer will get melee bonuses for wearing sturdy boots; etc. etc.
I can see how to implement this. The problem is, I can't see how to implement it in a way that isn't a spectacular mess. I don't want to have checks for different specialties spread throughout the code.
Is there any way to do this in a neater, more centralized fashion? Preferably without rewriting the whole Angband code base?
I have some vague (and vaguely similar) ideas, based on my experiences with Neoband - object-like structs, polymorphism, callback functions, etc. But they either require extensive modification to the existing code; lack flexibility; or are just plain ugly.
Anyone willing to give me some tips? I know O, FA, and ToME 2 all have stuff like this, but that seems to be based on if/else checks spread out everywhere, from what I've seen of their sources.
Unfortunately I seem to be in over my head already.
So: player specialties. Depending on which specialty you pick, you get bonuses when certain things happen. A swordmaster can parry and riposte when attacked; a device specialist will get buffs from using devices; a kickboxer will get melee bonuses for wearing sturdy boots; etc. etc.
I can see how to implement this. The problem is, I can't see how to implement it in a way that isn't a spectacular mess. I don't want to have checks for different specialties spread throughout the code.
Is there any way to do this in a neater, more centralized fashion? Preferably without rewriting the whole Angband code base?
I have some vague (and vaguely similar) ideas, based on my experiences with Neoband - object-like structs, polymorphism, callback functions, etc. But they either require extensive modification to the existing code; lack flexibility; or are just plain ugly.
Anyone willing to give me some tips? I know O, FA, and ToME 2 all have stuff like this, but that seems to be based on if/else checks spread out everywhere, from what I've seen of their sources.
Comment