Whenever you are in a case you want to inherit two classes, then you should change your design (especially when the language doesn't let you do multiple inheritance). Inheritance does that often and it's the reason why I avoid it nowadays except for API, especially in games.
You could find a common denominator. If you do, you're in luck.
You could copy/paste but that's a sign of future doom :p
What I usually do is compose logic. Your damageable objects could be recognized as having a child "Damageable" node (just of type Node
), that handles damage taking. This way you can compose it on your scenes without having to inherit a fixed type that does everything or nothing you need.
Another way is to use duck typing, a pattern widely used in Python. Whatever your object is, if it has a take_damage
function, then it can certainly take damage. These calls are made like that:
if obj.has_method("take_damage"):
obj.take_damage(42)
It's like interfaces, but the GDScript/Python way.