Skip to content

Commit

Permalink
v7.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazawrath authored Feb 26, 2023
2 parents 6931da8 + eb03e36 commit 70b798c
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 69 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Overwatch-Genji-Dodgeball
**Current Version: v7.8.1**
**Deathmatch Code: 3TSCP**
**Current Version: v7.9.0**
**Deathmatch Code: C9RMM**

Genji Dodgeball is a minigame inspired by the TF2 game pyro dodgeball.
When the ball is red it is targeting you! Use your deflect to target someone else. Look at the person you want to target next while deflecting. Use bouncepads to get extra air and style points.

## Team Deathmatch
**Team Deathmatch Code: A95F5**
**Team Deathmatch Code: YKCR7**
The Team Deathmatch version is a version where passing is enabled by default. To pass, hold the Secondary Fire button. The ball with pass to another teammate or if none are alive, it will pass it to yourself. Each pass will cost 100 health, you can get healed by deflecting the ball to a enemy, or someone on either team dies.

## How to compile
Expand All @@ -18,5 +18,15 @@ I am the founder of this game, although many names have influenced this game.
I have done 100% of the development of this game for free and I will always do it for free. Please do not be pressured to donate, this is only for if you want to go above and beyond. But if you appreciate what I create, and have funds to spare, I will appreciate any amount that you give.
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Q5Q64CGIL)

## Credit to others
Special thanks to the following for updating the game and improving it for everyone:
- u/FearlessKat
- u/Blink
- u/TheRedstoneBlaze
- ELIMINATED#1572
- T1mur4TR#6594
- DazNachbarzkind#2265
- And everyone else not named here who contributed.

## YouTube Video
[![YouTube video](http://img.youtube.com/vi/mQmDIZGKKR8/0.jpg)](http://www.youtube.com/watch?v=mQmDIZGKKR8)
83 changes: 53 additions & 30 deletions src/Genji-Dodgeball.opy
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

settings {
"main": {
"modeName": "Genji Dodgeball v7.8.1",
"description": "Genji Dodgeball v7.8.1. Developed by Mazawrath. Numerous updates by u/FearlessKat, u/Blink, u/TheRedstoneBlaze, and ELIMINATED#1572. Deflect the ball when it is red to target someone else! Use jump pads to get air!"
"modeName": "<FG32CD32FF>Genji Dodgeball v7.9.0",
"description": "Genji Dodgeball v7.9.0. Developed by Mazawrath. Credit for others avaliable in GitHub repository https://github.com/Mazawrath/Overwatch-Genji-Dodgeball. Deflect the ball when it is red to target someone else! Use jump pads to get air!"
},
"lobby": {
"allowPlayersInQueue": true,
Expand All @@ -19,7 +19,8 @@ settings {
"gamemodes": {
"ffa": {
"enabledMaps": [
"workshopIslandNight"
"workshopIslandNight",
"workshopIsland"
],
"gameLengthInMn": 15,
"enableSelfInitiatedRespawn": false
Expand Down Expand Up @@ -188,6 +189,7 @@ subroutine DeflectFailed 2
subroutine ShortFun 3
subroutine LongFun 4
subroutine StartBreak 5
subroutine BallCurve 6


#Activated extensions
Expand All @@ -199,7 +201,7 @@ subroutine StartBreak 5


rule "// SETTINGS":
perspectiveMode = createWorkshopSetting(enum["1st Person", "3rd Person", "Toggle 1st/3rd Person"], "Dodgeball Settings", "Perspective Mode", 2, 0)
perspectiveMode = createWorkshopSetting(enum["Toggle 1st/3rd Person", "1st Person", "3rd Person"], "Dodgeball Settings", "Perspective Mode", 0, 0)
rulesetMode = createWorkshopSetting(enum["Modern", "Retro"], "Dodgeball Settings", "Genji Dodgeball Ruleset", 0, 1)
arenaType = createWorkshopSetting(enum["Standard", "Airbending", "Earth/waterbending", "Firebending"], "Dodgeball Settings", "Arena Type", 0, 2)
startingBallSpeed = createWorkshopSetting(int[30:100], "Dodgeball Settings", "Starting Ball Speed", 40, 3)
Expand Down Expand Up @@ -319,7 +321,7 @@ rule "Disable Scoreboard":
rule "// Not enough players testing":
if not watermarkEnabled:
goto lbl_0
hudSubheader(getAllPlayers(), "Original by {0}. Version 7.8.1".format(name), HudPosition.LEFT, -1000, Color.AQUA, HudReeval.VISIBILITY, SpecVisibility.ALWAYS)
hudSubheader(getAllPlayers(), "Original by {0}. Version 7.9.0".format(name), HudPosition.LEFT, -1000, Color.AQUA, HudReeval.VISIBILITY, SpecVisibility.ALWAYS)
lbl_0:


Expand Down Expand Up @@ -793,11 +795,6 @@ rule "Modern ball motion":
chase(ballPosition, ballPosition + ballDirection * ballSpeed, rate=ballSpeed, ChaseReeval.DESTINATION_AND_RATE)
chase(ballDirection, directionTowards(ballPosition, targetedPlayer.getEyePosition()), rate=ballDirectionRate, ChaseReeval.DESTINATION_AND_RATE)
chase(ballSpeed, maxBallSpeed, rate=0.25, ChaseReeval.DESTINATION_AND_RATE)
#This should remove the terrible client prediction chases have
wait(0.05)
if RULE_CONDITION:
goto RULE_START


rule "Retro ball motion":
@Condition rulesetMode == 1
Expand Down Expand Up @@ -873,22 +870,16 @@ rule "Ball reaches player":
# Check if player is passing and if passing is enabled
if previousTargetedPlayer.isHoldingButton(Button.SECONDARY_FIRE) and passingEnabled:
isPassingTeam1 = true
playEffect(getAllPlayers(), DynamicEffect.RING_EXPLOSION, Color.SKY_BLUE, previousTargetedPlayer.getPosition(), 10)
if not invisiblePlayers:
playEffect(getAllPlayers(), DynamicEffect.RING_EXPLOSION, Color.SKY_BLUE, previousTargetedPlayer.getPosition(), 10)
playEffect(previousTargetedPlayer, DynamicEffect.MOIRA_FADE_DISAPPEAR_SOUND, Color.WHITE, previousTargetedPlayer.getPosition(), 100)
previousTargetedPlayer.setHealth(passingDamage)
targetedPlayer = previousTargetedPlayer
else:
isPassingTeam1 = false
heal(previousTargetedPlayer, null, passingDamage)
targetedPlayer = ((sorted([player for player in getLivingPlayers(Team.ALL) if player != previousTargetedPlayer and player.getCurrentHero() != ballHero], lambda i: angleBetweenVectors(targetedPlayer.getFacingDirection(), directionTowards(targetedPlayer, i.getPosition()))))[0])
if rulesetMode == 0:
ballDirectionRate = 6
wait(0.032)
ballDirectionRate = 1.75
# pls Blizzard let me do if RULE_CONDITION and rulesetMode == 1:
if rulesetMode == 1:
if RULE_CONDITION:
goto RULE_START
async(BallCurve(), AsyncBehavior.RESTART)


rule "Ball reaches player -TEAMS":
Expand Down Expand Up @@ -927,7 +918,8 @@ rule "Ball reaches player -TEAMS":
# Check if player is passing and if passing is enabled
if previousTargetedPlayer.isHoldingButton(Button.SECONDARY_FIRE) and passingEnabled:
#if previousTargetedPlayer.isHoldingButton(Button.SECONDARY_FIRE):
playEffect(getAllPlayers(), DynamicEffect.RING_EXPLOSION, Color.SKY_BLUE, previousTargetedPlayer.getPosition(), 10)
if not invisiblePlayers:
playEffect(getAllPlayers(), DynamicEffect.RING_EXPLOSION, Color.SKY_BLUE, previousTargetedPlayer.getPosition(), 10)
playEffect(previousTargetedPlayer, DynamicEffect.MOIRA_FADE_DISAPPEAR_SOUND, Color.WHITE, previousTargetedPlayer.getPosition(), 100)
previousTargetedPlayer.setHealth(passingDamage)
stopAssist(passingAssistId)
Expand Down Expand Up @@ -960,12 +952,16 @@ rule "Ball reaches player -TEAMS":
isPassingTeam1 = false
isPassingTeam2 = false
targetedPlayer = ((sorted([player for player in getLivingPlayers(getOppositeTeam(previousTargetedPlayer.getTeam())) if player != previousTargetedPlayer], lambda i: angleBetweenVectors(targetedPlayer.getFacingDirection(), directionTowards(targetedPlayer, i.getPosition()))))[0])
async(BallCurve(), AsyncBehavior.RESTART)


def BallCurve():
if rulesetMode == 0:
ballDirectionRate = 6
wait(0.032)
wait(0.05)
ballDirectionRate = 1.75
# Hey, what do you know, that comment I had here for months actually ended up correct when I readded retro!
if rulesetMode == 1:
elif rulesetMode == 1:
if RULE_CONDITION:
goto RULE_START

Expand Down Expand Up @@ -1075,6 +1071,7 @@ def UpdatedDeathEffects():
rule "Final duel":
@Condition getCurrentGamemode() == Gamemode.FFA
@Condition isGameInProgress() == true
@Condition roundInProgress
@Condition len([player for player in getLivingPlayers(Team.ALL) if player.hasMoved and player.getCurrentHero() != ballHero]) == 2
@Condition isEnoughPlayersToStart == true
@Condition isInFinalDuel == false
Expand Down Expand Up @@ -1113,6 +1110,7 @@ rule "Final duel":
rule "Final duel - TEAMS":
@Condition getCurrentGamemode() == Gamemode.TDM
@Condition isGameInProgress() == true
@Condition roundInProgress
#@Condition len([player for player in getLivingPlayers(Team.ALL) if player.hasMoved]) == 2
@Condition (len([player for player in getLivingPlayers(Team.1) if player.hasMoved]) == 1 and len([player for player in getLivingPlayers(Team.2) if player.hasMoved]) == 1) == true
@Condition isEnoughPlayersToStart == true
Expand Down Expand Up @@ -1155,6 +1153,7 @@ rule "Create passing aura - TEAMS":
@Condition eventPlayer.isHoldingButton(Button.SECONDARY_FIRE)
@Condition passingEnabled
@Condition passingAuraToggle
@Condition not invisiblePlayers

createEffect([player for player in getPlayers(eventPlayer.getTeam()) if player != eventPlayer and not player.isDead()], Effect.BAD_AURA, Color.SKY_BLUE, eventPlayer.getEyePosition(), 1.5, EffectReeval.POSITION_AND_RADIUS)
eventPlayer.passingSignal = getLastCreatedEntity()
Expand Down Expand Up @@ -1186,6 +1185,7 @@ rule "Check for last player surviving":
stopChasingVariable(getAllPlayers().bouncePadCooldown)
bigMessage(getAllPlayers(), "{0} has won the round!".format([player for player in getLivingPlayers(Team.ALL) if player.getCurrentHero() != ballHero]))
wait(2)
roundInProgress = false
if not tieBreakerActive:
getDeadPlayers(Team.ALL).resurrect()
else:
Expand All @@ -1198,15 +1198,15 @@ rule "Check for last player surviving":
bigMessage(getAllPlayers(), "Tiebreaker!")
if not isEnoughPlayersToStart:
return
roundInProgress = false
getAllPlayers().bouncePadCooldown = bouncePadCooldownLengthStart
currentRound += 1
if currentRound - 1 < maxRounds and (tournamentMode and breaksEnabled and (currentRound - 1) % breakFrequency == 0):
StartBreak()
else:
ballSpawnCountdown = 5
wait(1)
wait(0.025)
roundInProgress = true
wait(0.975)
if not bouncepadDashingEnabled:
goto lbl_0
getAllPlayers().isDashEnabled = false
Expand Down Expand Up @@ -1241,6 +1241,7 @@ rule "Team 1 Last Surviving - TEAMS":
stopChasingVariable(getAllPlayers().bouncePadCooldown)
bigMessage(getAllPlayers(), "{0} has won the round!".format(Team.1))
wait(2)
roundInProgress = false
if not tieBreakerActive:
getDeadPlayers(Team.ALL).resurrect()
else:
Expand All @@ -1254,12 +1255,12 @@ rule "Team 1 Last Surviving - TEAMS":
heal(getAllPlayers(), null, 200)
if not isEnoughPlayersToStart:
return
roundInProgress = false
currentRound += 1
getAllPlayers().bouncePadCooldown = bouncePadCooldownLengthStart
ballSpawnCountdown = 5
wait(1)
wait(0.025)
roundInProgress = true
wait(0.975)
if not bouncepadDashingEnabled:
goto lbl_0
getAllPlayers().isDashEnabled = false
Expand Down Expand Up @@ -1294,6 +1295,7 @@ rule "Team 2 Last Surviving - TEAMS":
stopChasingVariable(getAllPlayers().bouncePadCooldown)
bigMessage(getAllPlayers(), "{0} has won the round!".format(Team.2))
wait(2)
roundInProgress = false
if not tieBreakerActive:
getDeadPlayers(Team.ALL).resurrect()
else:
Expand All @@ -1307,12 +1309,12 @@ rule "Team 2 Last Surviving - TEAMS":
heal(getAllPlayers(), null, 200)
if not isEnoughPlayersToStart:
return
roundInProgress = false
currentRound += 1
getAllPlayers().bouncePadCooldown = bouncePadCooldownLengthStart
ballSpawnCountdown = 5
wait(1)
wait(0.025)
roundInProgress = true
wait(0.975)
if not bouncepadDashingEnabled:
goto lbl_0
getAllPlayers().isDashEnabled = false
Expand Down Expand Up @@ -1505,14 +1507,17 @@ rule "Toggle 3rd person":
@Condition not breakInProgress
@Condition eventPlayer.isHoldingButton(Button.RELOAD) == true
@Condition eventPlayer.isAlive() == true
@Condition perspectiveMode == 2
@Condition perspectiveMode == 0

if not eventPlayer.thirdPerson:
eventPlayer.thirdPerson = true
wait(0.01)
eventPlayer.startCamera(eventPlayer + worldVector(vect(-0.75, 0.25, -0.25), eventPlayer, Transform.ROTATION) + Vector.UP * 1.5 + eventPlayer.getFacingDirection() * -2, eventPlayer + eventPlayer.getFacingDirection() * 1000, 0)
else:
eventPlayer.stopCamera()
if invisiblePlayers:
eventPlayer.startCamera(updateEveryTick(eventPlayer.getEyePosition()), updateEveryTick(eventPlayer + eventPlayer.getFacingDirection() * 1000), 0)
else:
eventPlayer.stopCamera()
eventPlayer.thirdPerson = false


Expand All @@ -1532,6 +1537,24 @@ rule "3rd person respawn":
eventPlayer.startCamera(eventPlayer + worldVector(vect(-0.75, 0.25, -0.25), eventPlayer, Transform.ROTATION) + Vector.UP * 1.5 + eventPlayer.getFacingDirection() * -2, eventPlayer + eventPlayer.getFacingDirection() * 1000, 0)


rule "Player dead 1st person during invisible players":
@Event playerDied
@Condition invisiblePlayers
@Condition not eventPlayer.thirdPerson

eventPlayer.stopCamera()


rule "1st person respawn during invisible players":
@Event eachPlayer
@Condition invisiblePlayers
@Condition eventPlayer.hasSpawned() == true
@Condition roundInProgress == false
@Condition not eventPlayer.thirdPerson

eventPlayer.startCamera(updateEveryTick(eventPlayer.getEyePosition()), updateEveryTick(eventPlayer + eventPlayer.getFacingDirection() * 1000), 0)


rule "Measure Latency":
@Event eachPlayer
@Condition roundInProgress == true
Expand Down
Loading

0 comments on commit 70b798c

Please sign in to comment.