I’m trying to build a system where the player can configure the bullet used by its gun in a highly customizable way.
I would like to have options for:
- The status effect applied by the bullet (none, burning, freezing, poisoning)
- The way it handles collisions (pierce targets, explodes, bounces)
- Trajectory modifiers (none, follow mouse position, autro track enemies)
I’ve done this using enums (I have one enum for each one of these categories), but I will have to configure some attributes according to what is selected. Example:
- For an explosive round, I will have to configure the radius of the explosion and its damage
- For a burning round, I will have to determine the duration of the DoT effect and its damage
… and so on
I was wondering what is the most effective way of handling this in a OOP approach. I don’t expect you guys to do all the work for me, but if you could guide my through the best approach (e.g. “create a class”/“use scriptable objects”/other) it would be really helpful.