Timeline for RPG Item Design
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 24, 2018 at 14:19 | comment | added | jzx | You could totally use the interface approach, I just prefer flags because of my own experience learning to use other people's systems. In the case of healing items, it isn't necessary for the caller to know what the item does. In your case, the item's consumable aspect handles the healing, not the caller. So you would assign the amount to the type of consumable, and when its "OnConsume" event was called with the character, it would apply that value to the character. The character, in turn, may need its own handling - say for undead creatures that take damage from healing. | |
Jun 17, 2018 at 16:56 | comment | added | Grant Upson | Wouldn't it make sense for things like armour/weapons to have an interface such as Equippable that they implement rather than having flag values on every item that aren't necessary or am I missing the point? Also, I'm still confused on where and how each item use effect would be as it could be majorly different for items of the same category and there could be a thousand or more, where would this event come from and for example if it was a healing effect, how would it know how much?. | |
Jun 17, 2018 at 15:58 | history | edited | jzx | CC BY-SA 4.0 |
added 236 characters in body
|
Jun 17, 2018 at 15:52 | history | answered | jzx | CC BY-SA 4.0 |