One interesting challenge i've set myself up with for Riptide Manor:
Certain attacks have a usage limit on them. Think consumable items, spells with a set number of uses per level, that sort of thing.
However.
Because i'm using custom Resources to define attack types, they get shared between enemy instances, and between instances of being picked up by the player.
How do games usually deal with something like that?
thinking i might stick the quantity tracker on whatever is holding the reference to the attack type
i.e. for enemies, it'd be on the individual component of the ai/behaviour list
and for the player it'd be stored on the ui button for selecting that attack
the unfortunate thing is this just kicks the can down the road in terms of how to get the character using the attack to update its quantities.
if attacks were stored as part of the character, that'd be easier.
i'd need to redo all the selection code for the player (might not be too hard) but for enemies it gets messier because then the enemy ai scripts would need to reference some list indirectly instead of having the attack built in, which is awkward.
although
attack types are definitely light enough that i could get away with duplicating it on the fly whenever a new enemy is spawned/whenever the player switches equipment...
to be honest that might be the best solution here
AND now that i think of it
this would only be relevant when the attack type even has a quantity
if it's infinite use, it'll just get left as is.