I have a slash-em-up game in the works and am working on enemy AI.
I have a very black and white system where one hit kills and parries block all damage. This makes camping very easy for the player to just sit still and slash away at incoming enemies.
But I want to change that, so I have put a global variable that increases and decreases based on whether the player is sitting still, or jumping about and getting more involved.
This design is intended to have the player make choices as to wether to be sitting still and risk enemies trying to jump over them, or have them use ranged weapons (which require a different kind of block).
the player can jump about and the enemies will be less likely to used ranged weapons/jump, but more likely to swamp the player in other ways.
So I have global variable that goes positive in the player sits still for too long.
I want each enemy to have a "chance" to either charge & jump, or use a weapon when within a distance to the player and when the player has been sitting still.
Currently, ALL of the enemies jump or used ranged weapons when the player has sat still, but I need to think of a way to make it a % "chance" for each individual enemy based on the global variable.
Are there any handy conditions or expressions people can recommend I take a look at?
Please refrain from explaining exactly how to do the above, as I learn better when I am pointed in the right direction, but don't have to follow specific instructions.