Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spell casting system #9

Merged
merged 13 commits into from Jul 31, 2022
Merged

Add spell casting system #9

merged 13 commits into from Jul 31, 2022

Conversation

M0rica
Copy link
Owner

@M0rica M0rica commented Jul 31, 2022

This PR adds a spell casting system to let a player cast spells without needing to type in a command.
How it works:

  • Cast a spell:

    When a player is holding a stick with the custom name "Magic Wand" in the main hand while sneaking, the system records a point where the player is looking at. Now the player moves his head to draw a pattern in front of him. Once the player stopps sneaking, the system analyses the pattern and tries to map it to a known pattern which will cast a spell. A pattern consists of an infinte sequence of lines with each line being one of 8 types: up, down, left, right, up-left, up-right, down-left or down-right.
  • Bind a spell to a custom pattern:

    To bind a spell to a custom pattern, the player needs to typ in the command /spell bind <SpellName>. Now the player just needs to draw the pattern he wants to bind the spell to and after that, the custom pattern will trigger the spell. It is possible to bind the same spell to multiple patterns, however binding a spell to a pattern bound to another spell will override which spell is bound to the pattern.

@M0rica M0rica merged commit c9a7b9b into main Jul 31, 2022
@M0rica M0rica deleted the feature/spell_casting_system branch July 31, 2022 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant