-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4dca8e
commit 39d7c3a
Showing
12 changed files
with
65 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ile/omega-flowey/attack/dentata-snakes/bullet/loop/after_bounce_as_bullet_head.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# If we bounced, play bounce sound | ||
# Only the bullet-head makes bounce sounds/shakes the player's screen (see `maybe_bounce.mcfunction`) | ||
playsound omega-flowey:attack.dentata-snakes.bounce hostile @a ~ ~ ~ 5 1 | ||
execute as @a unless entity @s[team=!player,team=!dead,team=!spectator] at @s run function entity:utils/shake_screen |
34 changes: 0 additions & 34 deletions
34
...entity/functions/hostile/omega-flowey/attack/dentata-snakes/bullet/loop/bounce.mcfunction
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
.../functions/hostile/omega-flowey/attack/dentata-snakes/bullet/loop/maybe_bounce.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Don't bounce if we've already escaped the arena (past top wall) | ||
execute if entity @s[x=-1000,dx=2000,y=30,dy=10,z=-4,dz=-1000,tag=can-escape-arena] run return 0 | ||
|
||
# TODO(42): adjust arena bounds based on new animated java model (visually, it clips into the wall right now) | ||
data merge storage attack:dentata-snakes.bounce { x_negative_x: -21, x_negative_dx: 50 } | ||
data merge storage attack:dentata-snakes.bounce { x_positive_x: 21, x_positive_dx: -50 } | ||
data merge storage attack:dentata-snakes.bounce { z_negative_z: -3, z_negative_dz: 25 } | ||
data merge storage attack:dentata-snakes.bounce { z_positive_z: 18, z_positive_dz: -25 } | ||
data merge storage attack:dentata-snakes.bounce { y: 30, dy: 10 } | ||
data merge storage attack:dentata-snakes.bounce { command_after_bouncing: 'execute if entity @s[tag=attack-bullet-head] run function entity:hostile/omega-flowey/attack/dentata-snakes/bullet/loop/after_bounce_as_bullet_head' } | ||
|
||
function entity:utils/bounce with storage attack:dentata-snakes.bounce |
36 changes: 36 additions & 0 deletions
36
datapacks/omega-flowey/data/entity/functions/utils/bounce.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Reflects an entity's facing direction (yaw only) against the walls of a specified bounding box | ||
# i.e. (flips x-direction/z-direction as necessary) | ||
# --- | ||
# params: | ||
# * x_negative_x: x coordinate for the bounding box's safe region outside of the -X wall | ||
# * x_negative_dx: x width for the bounding box's safe region outside of the -X wall | ||
# * x_positive_x: x coordinate for the bounding box's safe region outside of the +X wall | ||
# * x_positive_dx: x width for the bounding box's safe region outside of the +X wall | ||
# * z_negative_z: z coordinate for the bounding box's safe region outside of the -Z wall | ||
# * z_negative_dz: z width for the bounding box's safe region outside of the -Z wall | ||
# * z_positive_z: z coordinate for the bounding box's safe region outside of the +Z wall | ||
# * z_positive_dz: z width for the bounding box's safe region outside of the +Z wall | ||
# * y/dy: generous y lower-bound + height for each bounding box | ||
# (y/dy need to be generous because of target selectors being janky with volume selections) | ||
|
||
# Save initial yaw | ||
execute store result score @s util.bounce.yaw.initial run data get entity @s Rotation[0] | ||
scoreboard players operation @s util.bounce.yaw = @s util.bounce.yaw.initial | ||
|
||
# -X wall | ||
$execute unless entity @s[x=$(x_negative_x),dx=$(x_negative_dx),y=$(y),dy=$(dy),z=-1000,dz=2000] if entity @s[y_rotation=0..180] run function entity:utils/bounce/x_negative | ||
|
||
# +X wall | ||
$execute unless entity @s[x=$(x_positive_x),dx=$(x_positive_dx),y=$(y),dy=$(dy),z=-1000,dz=2000] if entity @s[y_rotation=-180..0] run function entity:utils/bounce/x_positive | ||
|
||
# -Z wall | ||
$execute unless entity @s[x=-1000,dx=2000,y=$(y),dy=$(dy),z=$(z_negative_z),dz=$(z_negative_dz)] unless entity @s[y_rotation=-90..90] run function entity:utils/bounce/z_negative | ||
|
||
# +Z wall | ||
$execute unless entity @s[x=-1000,dx=2000,y=$(y),dy=$(dy),z=$(z_positive_z),dz=$(z_positive_dz)] if entity @s[y_rotation=-90..90] run function entity:utils/bounce/z_positive | ||
|
||
# Store bounced angle | ||
execute store result entity @s Rotation[0] float 1 run scoreboard players get @s util.bounce.yaw | ||
|
||
# If `util.bounce.yaw != util.bounce.yaw.initial`, we bounced | ||
$execute unless score @s util.bounce.yaw = @s util.bounce.yaw.initial run $(command_after_bouncing) |
1 change: 1 addition & 0 deletions
1
datapacks/omega-flowey/data/entity/functions/utils/bounce/shared/x.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
scoreboard players operation @s util.bounce.yaw *= #-1 mathf.const |
2 changes: 2 additions & 0 deletions
2
datapacks/omega-flowey/data/entity/functions/utils/bounce/shared/z.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
scoreboard players operation @s util.bounce.yaw -= #180 mathf.const | ||
scoreboard players operation @s util.bounce.yaw *= #-1 mathf.const |
1 change: 1 addition & 0 deletions
1
datapacks/omega-flowey/data/entity/functions/utils/bounce/x_negative.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function entity:utils/bounce/shared/x |
1 change: 1 addition & 0 deletions
1
datapacks/omega-flowey/data/entity/functions/utils/bounce/x_positive.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function entity:utils/bounce/shared/x |
1 change: 1 addition & 0 deletions
1
datapacks/omega-flowey/data/entity/functions/utils/bounce/z_negative.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function entity:utils/bounce/shared/z |
1 change: 1 addition & 0 deletions
1
datapacks/omega-flowey/data/entity/functions/utils/bounce/z_positive.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
function entity:utils/bounce/shared/z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters