So , i'm developing a game where an undead enemy has 3 abilities to choose from :
1 - Normal Attack
2 - Life Drain ( 25 MP ) ( Can only be used when < 50% maximum HP )
3 - Dark Shield ( 40 MP )
To select which one will be used , I created a variable .
Depending on his current MP , some abilities might not be available .
My problem is : If his MP is higher than 65 ( 25 + 40 ) he should be able to select any of those 3 abilities . So this variable sets its value to round(random(1,3)) . If the result is one , the game should pick a normal attack . If the result is 2 , the game should pick life drain . If the result is 3 , the game should pick dark shield .
But what if the Undead has 100% HP , but enough mana to use dark shield ?
So , the only abilities usable would be Normal attack ( 1 ) and Dark shield ( 3 )
So i tried setting the variable to this : round(random(1,3))
The problem is , by doing that , is also includes 2 ( Life Drain ) .
So , in short terms : I need the game to only pick "1" or "3" , without including "2".
How do i do that ?