I have a player movement script that handles basic movement via inputs as well as gravity and jumping abilities (jumping, double jumping, flying, gliding, and falling). Most things, except for jumping and falling, have a bool in the script to say when they can happen. Falling damage is handled through a script that doesn't reference the player movement script, so I can apply falling damage to any character regardless of what is controlling their movement. The falling damage script is a modified version of GiL's script here that adds a skill check to increase the damageThreshold variable based on the character's skills.
So here are the things I want to do and the questions attached to them:
1) I'd like to make things like double jump and flight abilities that you gain during gameplay. How do I set them up so that they are basically a bool value that I can check in my player movement script (that way if the player doesn't have the ability, the bool for double jumping in the script can never be set to true)? How do I set up the gliding ability so that its bool is dependent on whether or not you have a specific item in your inventory?
2) I'm trying to figure out how to separate the player movement controls from the non-player character movement and still achieve activating the falling damage script. Should jumping and falling be abilities in ORK too? My thinking here is that I can create a bool that tells the fall damage script when NPCs are falling (triggering the fall damage to be calculated from the script) and be able to do the same for the player from the player movement script.
3) Along that line of thinking, should I just make all the player logic in one separate script and make my player movement script inherit from that player logic? Wouldn't that, in theory, make it easier for me to make other player scripts for movement systems (like swimming, sneaking, or climbing) from all the same base logic that I gather for the basic player movement script?
I'd like to not rewrite a whole bunch of variables in each script that I'll likely use again to create locomotion underwater or on the side of a cliff. Does that make sense? I'm still getting my coding legs strong, so I just don't really know if I'm going about designing my code well or not yet.
Thanks to the everyone for being a generally amazing community. I feel like I can ask these newbie questions here without getting s**t for it and I appreciate that.