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

Added QF_DAMAGEFALLOFF and damagemultiplier, thrustmultiplier, and damage properties to earthquakes. #1924

Merged

Conversation

inkoalawetrust
Copy link
Contributor

@inkoalawetrust inkoalawetrust commented Jan 8, 2023

This PR adds 4 new features to earthquakes:

  • QF_DAMAGEFALLOFF: This flag makes the damage and actor thrusting earthquakes produce fall off with distance. It works exactly like how the distance falloff for the actual screenshake effect works*. So the falloff property also needs to be given a value besides 0 for the falloff to work.
  • damageMultiplier: This is a new property for earthquakes that acts as a multiplier for the damage they perform to players and actors. It can be used to make earthquakes more or less harmful, such as making a very strong earthquake do more damage. Default is 1.0 (Normal damage)
  • thrustMultiplier: Like damageMultiplier, this property allows you to increase or decrease how much earthquakes push actors around. It can also be set to 0 to disable actor pushing entirely. Default is 0.5.
  • damage: When this property is set to anything above 0, the earthquake will do the exact amount of damage specified, instead of the default randomized damage. This will also account for damage falloff and the damage multiplier.

In addition, since earthquake damage can now go to 0 or below, the damage is clamped to be at least one hit point when the victim is in the damage radius. So that damage falloff or a damage multiplier of 0 won't produce quakes that do no damage despite being within their damage radius. For the latter you can simply use the QF_SHAKEONLY flag.

Also, the code includes a fix that makes QF_AFFECTACTORS use an FMultiBlockThingsIterator instead of a ThinkerIterator, which stops the earthquake from trying to shake objects it shouldn't like items that are in actors' inventories.

This PR also comes with this update to ACCs' definitions.

An example map is also included, this map produces an earthquake with damage and thrust falloff, the earthquake also does exactly 3 damage, which is then multiplied by 2. And also produces very little pushing.

Earthquake falloff example.zip

*Except that for damage and thrusting falloff, it uses the damage radius instead of the tremor radius.

@inkoalawetrust inkoalawetrust changed the title Added QF_DAMAGEFALLOFF and damagemultipler, thrustmultiplier, and damage properties to earthquakes. Added QF_DAMAGEFALLOFF and damagemultiplier, thrustmultiplier, and damage properties to earthquakes. Jan 8, 2023
@MajorCooke
Copy link
Contributor

Merge conflicts prevent me from adapting this to QZDoom. Please fix them.

@inkoalawetrust
Copy link
Contributor Author

inkoalawetrust commented Jan 21, 2023

Alright, I'll fix the merge conflicts with this PR and your decimal earthquake intensity commit sometime later. I'm currently busy with getting a live Linux installation running on my old PC.

@inkoalawetrust
Copy link
Contributor Author

inkoalawetrust commented Jan 22, 2023

Okay, I made a new commit to the branch that fixes the merge conflicts.

Edit: Nevermind, #1900 seems to not work on earthquakes created by ACS scripts. So I'll be amending the latest commit to be a fix for that PR. Instead of simply catching up to it to allow merging this PR.

@inkoalawetrust inkoalawetrust force-pushed the earthquake_improvements_2 branch from 8e1b6e2 to 2d422ef Compare January 22, 2023 17:21
@inkoalawetrust
Copy link
Contributor Author

Okay, I've also fixed the decimal earthquake intensities not working with ACS.

@MajorCooke
Copy link
Contributor

MajorCooke commented Jan 22, 2023

I'm postponing merging this into QZDoom until the merge conflicts are resolved.

This flag makes it so that the damage and actor thrusting of earthquakes fades with distance like the screen shake effect does.
These properties allow for scaling the amount of damage an earthquake does and how much it pushes actors around.
@inkoalawetrust inkoalawetrust force-pushed the earthquake_improvements_2 branch from 2d422ef to 04068b4 Compare January 23, 2023 00:22
@inkoalawetrust
Copy link
Contributor Author

halle-fucking-lujah I finally managed to babysit Git into actually letting me fix those stupid merge conflicts. You should be able to merge this into QZDoom now.

MajorCooke added a commit to ZDoom/qzdoom that referenced this pull request Jan 23, 2023
@MajorCooke MajorCooke mentioned this pull request Jan 23, 2023
17 tasks
When this property is set to any value above 0. The earthquake does the exact amount of damage specified, instead of a random amount.
@inkoalawetrust inkoalawetrust force-pushed the earthquake_improvements_2 branch from 04068b4 to 1c078cc Compare February 2, 2023 01:17
@inkoalawetrust
Copy link
Contributor Author

Okay, @MajorCooke showed me on Discord that lines 195 and 198 on a_quake.cpp caused double-to-integer conversion warnings on the MSVC compiler (And presumably on GCC too, can't find any warnings on the old compile checks though.). So I've force pushed the last commit on the branch to fix those with explicit conversion to ints.

@madame-rachelle madame-rachelle merged commit a7f76fe into ZDoom:master Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants