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

Feat/auto combat #57

Merged
merged 16 commits into from
Feb 22, 2024
Merged

Feat/auto combat #57

merged 16 commits into from
Feb 22, 2024

Conversation

justindujardin
Copy link
Owner

@justindujardin justindujardin commented Nov 27, 2022

  • Add an auto-combat option that automatically selects player actions when enabled.
  • Show defeated players in combat, but facing down on the ground
  • Clean up item use and add animation

@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Attention: 63 lines in your changes are missing coverage. Please review.

Comparison is base (d3c2dc2) 68.74% compared to head (08e85b1) 68.42%.
Report is 1 commits behind head on main.

Files Patch % Lines
...routes/combat/states/combat-choose-action.state.ts 55.38% 27 Missing and 2 partials ⚠️
src/app/scene/render/tile-object-renderer.ts 30.76% 7 Missing and 2 partials ⚠️
src/app/core/state-machine.ts 0.00% 8 Missing ⚠️
src/app/routes/combat/combat.component.ts 40.00% 5 Missing and 1 partial ⚠️
...p/routes/combat/behaviors/choose-action.machine.ts 33.33% 4 Missing ⚠️
...s/combat/behaviors/actions/combat-item.behavior.ts 90.00% 2 Missing ⚠️
src/app/routes/world/world.component.ts 0.00% 2 Missing ⚠️
src/app/models/mechanics.ts 66.66% 1 Missing ⚠️
src/app/routes/combat/combat-player.component.ts 50.00% 0 Missing and 1 partial ⚠️
src/app/routes/combat/states/combat-start.state.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   68.74%   68.42%   -0.32%     
==========================================
  Files         165      165              
  Lines        5391     5514     +123     
  Branches      868      890      +22     
==========================================
+ Hits         3706     3773      +67     
- Misses       1557     1606      +49     
- Partials      128      135       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

 - this was noticeable in dark areas, where the darkness vignette would not cover the whole screen.
 - an old bit of interface that got lost somewhere in refactoring. it's not needed so drop it
 - when called, it exits any current state and cleans up.
 - there's a floating action button on the combat view now. When pressed it automatically selects combat actions for the party.
 - currently it just attacks, and everyone targets the first enemy in the enemies array. This works pretty well to take enemies out of combat quickly.
 - TODO: some useful abstraction for choosing actions that enemies and players can use.
 - choose the first alive party member to move through the world with
 - this was noticeable in dark areas, where the darkness vignette would not cover the whole screen.
 - this replaces the old "fix" and inflates the camera clip to make sure it covers the whole area. It's simpler but also less precise. 🤷
 - before the combat started immediately when loaded, and it felt too fast.
 - wait almost a second before starting
 - add `chooseMove` helper to determine which actions to select.
 - use heal spell when party members are injured if it's owned
 - use push spell to damage enemies if there are no injured party members and it's owned
 - use a potion on injured party members if one is owned
 - attack the enemy with the least HP as a final resort
 - add tests
 - use animation component to show image of item used
 - it's weird when they disappear entirely
 - idk if this is quite the right solution. I think you want to set the entity enabled=False to avoid selection. 🤷
@justindujardin justindujardin merged commit 15df6db into main Feb 22, 2024
8 checks passed
@justindujardin justindujardin deleted the feat/auto-combat branch February 22, 2024 17:59
Copy link

🎉 This PR is included in version 0.3.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant