Open nsmryan opened 2 years ago
This change will likely involve:
types.rs new UseAction variant UseSkill actions.rs handle_skill, on skills that use use-mode, needs to set settings.use_action to UseSkill, log a UseAction msg, and change state to use. actions.rs function finalize_use_item needs to handle UseSkill. This will mostly involve logging the same messages as before, but they will need to include the target position and use it instead of the player facing.
There should be a more general discussion of use-mode and skills- we talked a while back about converting all skills to use-mode, but we will have to look through their effects to make sure that this is true.
Currently need to implement: level.rs calculate_use_skill to determine reach and directions of use-mode per skill. actions.rs finalize_use_skill to determine the result of using a skill with a chosen direction.
I'm made some progress on a branch where skills can enter use-mode. However, I'm not clear on how this will work exactly. We may have had this conversation before, and if so perhaps this is already resolved.
Currently skills can be pressed at any time, and they will use the player's current facing to determine a position to act on (the position next to the player in the direction that they are facing). In addition, you can use a skill in cursor mode, which will target the cursor position. This will not always use the cursors exact position- a grass wall for example will just appear in the direction of the cursor position. However, some skills might benefit from cursor selection. The only one I can see right now in the mechanics spreadsheet is ping, which benefits from making a sound at any tile and not just a tile in a particular direction.
If we move to using use-mode for all skills (except skills that occur immediately and have no need for a selection), then a skill like ping or whirlwind would have to choose a tile a certain distance from you in a direction. We could use the shift key to allow the player two choices of tiles, near and far, which is pretty good. It is not as flexible as choosing any tile, but its not that bad either.
Finally, there is some chance of maintaining both options. A skill could be used in normal mode, in which case you enter use-mode, but it could also be used in cursor mode. In this case, in cursor mode you would either use the given tile, for skills where this makes sense, or you would do the same thing that use-mode does if you had selected the direction from the player towards the cursor tile.
I have a branch with this concept implemented, as a proof of concept. It is not complete- all skills use the next tile over from the player instead of a number of tiles based on the skill. This is useful for checking out the concept however.
Leave cursor mode skills. If press skill that only works in cursor mode- enter cursor mode where the skill is remembered. Press enter to apply.
In this concept there is no mixed cursor mode/use mode for any skill - it is all one or the other. This applies to stones as well.
In cursor mode, if you select a stone you just throw it.
We talked about removing the idea of throwing weapons- it complicates the input system and doesn't add all that much capability.
The use-mode stuff should now work for skills, but I haven't worked on the cursor idea at all.
Cursor mode throwing for stones now works, and for skills like whirlwind.
grass wall should use use-mode instead of current direction.