Overwatch-1-Emulator / ow1-emulator

OverPy source code for "Overwatch 1 Emulator" Workshop gamemode
https://workshop.codes/KHTG0
BSD 2-Clause "Simplified" License
9 stars 9 forks source link

feat: Impulse based (instead of force player position) indicator slam + more accurate slam damage - [merged] #1559

Closed MaxwellJung closed 4 months ago

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:34

_Merges indicatorrework -> staging

To-do:

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:38

added 2 commits

Compare with previous version

MaxwellJung commented 11 months ago

You can safely delete this code (it's prserved in version history)

MaxwellJung commented 11 months ago
        eventPlayer.applyImpulse(directionTowards(eventPlayer.getPosition(), eventPlayer.indicator_slam_position), OW1_DOOMFIST_INDICATOR_SEISMIC_SLAM_SPEED, Relativity.TO_WORLD, Impulse.CANCEL_CONTRARY_MOTION)

Replace magic number with constant

MaxwellJung commented 11 months ago
        eventPlayer.applyImpulse(-eventPlayer.getVelocity(), eventPlayer.getSpeed() - OW1_DOOMFIST_INDICATOR_SEISMIC_SLAM_SPEED, Relativity.TO_WORLD, Impulse.INCORPORATE_CONTRARY_MOTION) # somewhat prevents doom from speeding up after getting caught on objects

Another magic number

MaxwellJung commented 11 months ago
    cancelMomentum(eventPlayer)

Replace with macrofunction from utilities/macro_functions.opy for readability

MaxwellJung commented 11 months ago

Why is this conditional on only ground slam? Why not just remove if check?

MaxwellJung commented 11 months ago
    if (eventPlayer.isUsingAbility1()): return
    eventPlayer.setGravity(50)

Shorten to single line (I just like it better asthetically)

MaxwellJung commented 11 months ago
    if (eventPlayer.isUsingAbility1()): return

Same comment as before

MaxwellJung commented 11 months ago
#Conditions for when to stop an indicator slam and drop the player
#!define indicatorCanContinue() \
    (distance(eventPlayer.getPosition(), eventPlayer.indicator_slam_position) > 2) \
and (eventPlayer.isUsingAbility1()) \
and (eventPlayer.getSpeed() > 0) \

Indent for clarity

MaxwellJung commented 11 months ago

Overall logic looks good; just need some changes to match code styling guidelines.

MaxwellJung commented 11 months ago

requested review from @MaxwellJung

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:56

Commented on src/ow1/heroes/doomfist/slam.opy line 216

The wait only fixes ground slam damage and not indicator

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:58

Commented on src/ow1/heroes/doomfist/slam.opy line 178

changed this line in version 3 of the diff

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:58

Commented on src/ow1/heroes/doomfist/slam.opy line 192

changed this line in version 3 of the diff

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:58

Commented on src/ow1/heroes/doomfist/slam.opy line 198

changed this line in version 3 of the diff

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:58

Commented on src/ow1/heroes/doomfist/uppercut.opy line 60

changed this line in version 3 of the diff

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:58

added 1 commit

Compare with previous version

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:59

Commented on src/ow1/heroes/doomfist/slam.opy line 172

changed this line in version 4 of the diff

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 15:59

added 1 commit

Compare with previous version

MaxwellJung commented 11 months ago

If the intent of that code is to delay the damage ramp up by 1 tick, I think it applies to both ground and indicator slam and the if statement can be removed.

MaxwellJung commented 11 months ago
    waitUntil(not eventPlayer.isOnGround(), Math.INFINITY)
    if eventPlayer.slam_to_use == SlamType.GROUND: # Makes ground slam damage 49    
        wait()
MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 16:05

Commented on src/ow1/heroes/doomfist/slam.opy line 216

Max range indicator damage gives 65 damage as is most of the time, sometimes I get 67 but any changes that reduce slam damage makes indicator always 63 damage and I can't get it up to 65. Indicator damage is very finicky for some reason

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 16:09

Commented on src/ow1/heroes/doomfist/slam.opy line 216

changed this line in version 5 of the diff

MaxwellJung commented 11 months ago

In GitLab by @hikiru on Nov 6, 2023, 16:09

added 1 commit

Compare with previous version

MaxwellJung commented 11 months ago

resolved all threads

MaxwellJung commented 11 months ago

marked this merge request as ready

MaxwellJung commented 11 months ago

approved this merge request

MaxwellJung commented 11 months ago

mentioned in commit 216e6018abfa27febce9f579bb49a8cf41db49a2

MaxwellJung commented 11 months ago

In GitLab by @ghost1 on Nov 7, 2023, 11:03

:tada: This MR is included in version 1.10.0 :tada:

The release is available on GitLab release.

Your semantic-release bot :package: :rocket:

MaxwellJung commented 11 months ago

fixes #367 #297 #116 #104