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

Standardised explosives #113

Merged
merged 11 commits into from
Sep 28, 2021
Merged

Conversation

grufkork
Copy link
Collaborator

Draft for a generic explosive node. Used by cannonballs, should be easily repurposed for grenades and mines.

The explode-function does not yet actually blow anything up, but the particles are pretty
Added back the cannon, using the functionality provided by the rewrite.
Added screenshake to cannon. Resolved conflicts and made cannon work with newest codebase
Currently used by cannonballs, should work for grenades and mines as well
src/utils.rs Outdated Show resolved Hide resolved
src/nodes/explosive.rs Outdated Show resolved Hide resolved
@not-fl3
Copy link
Collaborator

not-fl3 commented Sep 23, 2021

Is this intended to be merged on top or instead #104 ?
If on top - maybe rebase this PR on top of cannon-reimplementation-fixed branch?

@grufkork
Copy link
Collaborator Author

Well, all the previous pulls are based of each other. I'll close those

src/nodes/fxses.rs Outdated Show resolved Hide resolved
This was referenced Sep 23, 2021
Removed utils.rs for now, and moved the containing code to explosive.rs. Also formatting
@kindaro
Copy link
Collaborator

kindaro commented Sep 25, 2021

I tested this and it appears to me that setting fuse to 0 in DetonationParameters results in immediate explosion rather than the mine staying there forever. This is contrary to the comment at that field in the definition of the structure. Possibly this field should have type Option for clarity? Some 0. would indicate immediate explosion, while None would indicate that the explosive only explodes when triggered.

kindaro added a commit to kindaro/FishFight that referenced this pull request Sep 25, 2021
Resolve fishfolk#99.

* Checked out from 3ba21b6 — the last
  commit where this weapon existed.

* Uses work in progress from fishfolk#113 for explosive projectiles.
@kindaro kindaro mentioned this pull request Sep 25, 2021
kindaro added a commit to kindaro/FishFight that referenced this pull request Sep 25, 2021
Resolve fishfolk#99.

* Checked out from 3ba21b6 — the last
  commit where this weapon existed.

* Uses work in progress from fishfolk#113 for explosive projectiles.
@grufkork
Copy link
Collaborator Author

I realise I never actually tested that... Options are probably the cleanest way to handle it. I'm fairly busy the next days but I might be able to sneak in some work tonight and fix it.

Added options to fuse and trigger radius, fixed unfused explosives detonating immediately.

Also restructured explosive.rs so that it is not a mod.
@grufkork
Copy link
Collaborator Author

There we go. This should be done now, unfused explosives work correctly. Also I figured out how imports and stuff works so explosive.rs doesn't use a mod any more.

@grufkork grufkork marked this pull request as ready for review September 26, 2021 16:57
Copy link
Collaborator

@kindaro kindaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

  • With fuse: Some (0.), the explosive explodes immediately.
  • With fuse: None, the explosive stays around indefinitely, waiting to be triggered.

This aligns with my expectations.


I did not look at the rest of the code thoroughly — I do not really know Rust anyway.

With a pedant hat on, I should suggest splitting the pull request into 2:

  • Add standardized explosives. (This pull request, with changes pertinent to the cannon left out.)
  • Add the cannon. (Another pull request, containing the changes left out of this one.)

I should also suggest squash merging.

@grufkork
Copy link
Collaborator Author

Alright, the commits contain changes for both cannon and explosive so I'll just squash it all. But I'll keep it in mind for next time!

@grufkork grufkork merged commit deb3559 into fishfolk:main Sep 28, 2021
@grufkork grufkork deleted the standardised-explosives branch September 28, 2021 10:40
kindaro added a commit to kindaro/FishFight that referenced this pull request Sep 29, 2021
Resolve fishfolk#99.

* Checked out from 3ba21b6 — the last
  commit where this weapon existed.

* Uses work in progress from fishfolk#113 for explosive projectiles.
kindaro added a commit to kindaro/FishFight that referenced this pull request Sep 29, 2021
Resolve fishfolk#99.

* Checked out from 3ba21b6 — the last
  commit where this weapon existed.

* Uses work in progress from fishfolk#113 for explosive projectiles.
erlend-sh pushed a commit that referenced this pull request Sep 29, 2021
Resolve #99.

* Checked out from 3ba21b6 — the last
  commit where this weapon existed.

* Uses work in progress from #113 for explosive projectiles.
@erlend-sh erlend-sh mentioned this pull request Sep 29, 2021
11 tasks
This was referenced Sep 29, 2021
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

3 participants