Well enum are just a tool, i think that is just make things “more readable”
lets say you have 14 spells in order and you use "a int " to call the spell you could go creazy in no time !
cast spell 1, if spell 1 hit spell 7 = reduce damage…
With enum
Cast spell fireball, if fireball hit fireshield = reduce damage
Well, yes you can use enums for work like booleans,
for example if you have 2 magic actions, you can just set the Action1 to Spellfire and action2 to Teleport when their animation ends, the slot can be set back to “nothing”
If you have more complex thing like “magicka” where you can merge a number of magic type in one spells
you can have a list of magictype in your enum and fill an array of enum with the “whole spell”
If you have a boolean for every spell you can cast you can also, use just 1 boolean for that and store what spell in another variable .
For example, 1 int and 1 bool
Spell_Selected=8 (the spell is selected and is the “firewall”)
Bool_0 (the spell is waiting to be casted)
Bool_1 (you are casting the spell)
Well, at this point i would like to add a cooldown or more stuff so , i dont feel very comfy with this way.
For Example 2 Enumerator
Spell_seleceed = SummonThunder (or Fireball , Firewall, Firesword, Firestorm, Firebeam…)
Spell_State= Cooldown ( or Ready, Castingsingle,Mutlicasting ,Focusing, Deactivated… ChargedBeam… )
Animations and timing and targets and stuff should be saved in safe place and referenced only,
I dont thinik you want to check the animation and the distance and the effect to spawn every time you want to castthe spell.
You want only to say , player will start casting the FireBlast, so get the animation and effects and stuff of that spell from a “database”
There are some cool way to store data take a look at structures!
Yes exactly , like in the example i made before , right?
You can create a “Switch on Enum” to run different part of the graph basedd on the enum,
BUT you can also create a “structure” that you can fill with all the data like
“Fireball” - Animation:Evocation_N2 … time_casting:1sec … Spawn_effect:Sparkles …Time_cooldown:1sec…
And you can create an event or function in wich pin in the Fireball and all the other variables will be inside.
I dont know ![]()
The enumerator are just a " set of constant names " or something like that,
Enumerators are just a list of keywords
you cant have booleans inside, or add specific value other than the keywords themself.
Maybe what you want to explore are structures
in wich you can add more variables and create a structure for spells like i mentioned before