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

add soul event infrastructure for boss fight #84

Merged
merged 35 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1270b66
add tv static sound
TheAfroOfDoom Feb 19, 2024
d5ac716
add objective setup and `reset_scores` functions to run on `/reload`
TheAfroOfDoom Feb 19, 2024
1a3a311
refactor AJ removal function calls into standalone function
TheAfroOfDoom Feb 19, 2024
e5e13b4
adjust WARNING animation interpolation to look more accurate to under…
TheAfroOfDoom Feb 19, 2024
26db866
add convenience function to stop the boss fight
TheAfroOfDoom Feb 19, 2024
5463aa3
refactor adding a phase tag into the relevant phase's initialization …
TheAfroOfDoom Feb 19, 2024
8bb96a1
add `tv_screen.boss_fight` tag to main tv_screen model entity so we c…
TheAfroOfDoom Feb 19, 2024
4bd40fc
refactor tv_screen model removal command into separate function
TheAfroOfDoom Feb 19, 2024
eee2715
add `soul` phase to boss fight
TheAfroOfDoom Feb 19, 2024
e7e8e33
add state transfer for boss fight phases
TheAfroOfDoom Feb 19, 2024
23bfa11
add summon and animate functions for `soul` tv_screen
TheAfroOfDoom Feb 19, 2024
ea23dd6
add `static` variant to `tv_screen` model
TheAfroOfDoom Feb 19, 2024
65f55d4
add static variant to boss fight commands
TheAfroOfDoom Feb 19, 2024
e3581d4
add platform for soul arena
TheAfroOfDoom Feb 19, 2024
f2eb721
move `player...` objectives to be in alphabetical order on the list
TheAfroOfDoom Feb 21, 2024
ec7fd0f
make boss-fight director wait for `soul-executor` to tell it to progr…
TheAfroOfDoom Feb 23, 2024
9be543b
add `soul` heart model
TheAfroOfDoom Feb 23, 2024
f23afc5
add locator to `tv_screen` model for us to summon `soul` at
TheAfroOfDoom Feb 23, 2024
097c563
add soul model to AJ model removal function
TheAfroOfDoom Feb 23, 2024
5c39aae
rename `soul` model variants to use soul index as name instead of color
TheAfroOfDoom Feb 23, 2024
e890444
move `tv_screen` summon/animate files around
TheAfroOfDoom Feb 23, 2024
0801ab7
move `execute as` out of animate function so we only filter `@e` once
TheAfroOfDoom Feb 23, 2024
9011e69
summon `soul` model and begin `shake` animation during `warning` boss…
TheAfroOfDoom Feb 23, 2024
a69ee60
upscale soul by 2x
TheAfroOfDoom Feb 23, 2024
da8021b
summon `soul` model and begin `float` animation during `soul` boss f…
TheAfroOfDoom Feb 23, 2024
78fc3b9
adjust `tv_screen`'s `warning` and `soul_event` locators to more accu…
TheAfroOfDoom Feb 23, 2024
376ec31
change `soul` `float` animation to be faster and float a larger y-ran…
TheAfroOfDoom Feb 23, 2024
f36d384
remove datapack test workflow requiring datapack lint workflow to pas…
TheAfroOfDoom Feb 25, 2024
1a73212
let `attack-flies` trigger next boss-fight attack sooner
TheAfroOfDoom Feb 26, 2024
41fd133
world backup -- some stuff with soul arena? idk TODO make this commit…
TheAfroOfDoom Feb 26, 2024
d627f8e
change sound category of static sound
TheAfroOfDoom Feb 29, 2024
eb0cf97
remove TODO since we will resolve it when we add soul event 0
TheAfroOfDoom Feb 29, 2024
69c7269
change warning sound from `hostile` to `ambient` sound category
TheAfroOfDoom Feb 29, 2024
a0d30c5
add missing models to `remove_animated_java_models`
TheAfroOfDoom Feb 29, 2024
56c00e0
re-backup world with new soul arena
TheAfroOfDoom Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/datapack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:

test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
1 change: 1 addition & 0 deletions datapacks/omega-flowey/data/_/functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This directory contains convenience functions for developers for quicker calls t
- `attack`: runs the pre-defined attack's `start` function
- `attack/random/n`: randomly starts an attack from the `boss_fight`'s attack phase `n` (e.g. `n = 0`)
- `boss_fight`: starts the vanilla boss fight
- `boss_fight/stop`: stops any currently running boss fights
- `heal`: heals the executing player to full, fills the hunger bar, and applies infinite night vision
- `reset_scores`: resets the `omega-flowey` boss's attack score parameters
- `reset`: calls `omega-flowey:reset`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function entity:remove_animated_java_models
kill @e[tag=boss_fight]
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ scoreboard players set @s boss-fight.attack.phase.total 6
scoreboard players set @s boss-fight.progress.phase.i 0
scoreboard players set @s boss-fight.progress.phase.total 6

# Add tags
tag @s add boss_fight.phase.attack

# Remove tag
tag @s remove boss_fight_new

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

# Run loop logic based on what phase the boss_fight is in
execute if entity @s[tag=boss_fight.phase.attack] run function entity:directorial/boss_fight/vanilla/phase/attack/loop
execute if entity @s[tag=boss_fight.phase.soul] run function entity:directorial/boss_fight/vanilla/phase/soul/loop
execute if entity @s[tag=boss_fight.phase.warn] run function entity:directorial/boss_fight/vanilla/phase/warn/loop
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ execute if score @s boss-fight.attack.phase.i matches 1 run function entity:dire

# Set scores
scoreboard players set @s boss-fight.attack.clock.i -1

# Add tags
tag @s add boss_fight.phase.attack

# Remove tv_screen.soul model(s) if they exist
execute as @e[tag=aj.tv_screen.root,tag=tv_screen.soul] run function animated_java:tv_screen/remove/this
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Set scores
# Length of music (up to the WARNING sound)
scoreboard players set @s boss-fight.attack.clock.total 410
scoreboard players set @s boss-fight.attack.clock.total 414

# Play music
playsound omega-flowey:music.phase.1 record @a ~ ~ ~ 10 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ scoreboard players add @s boss-fight.attack.phase.i 1
# Wrap around total phases (6)
scoreboard players operation @s boss-fight.attack.phase.i %= @s boss-fight.attack.phase.total

# Next phase
function entity:directorial/boss_fight/vanilla/phase/warn/initialize

# Remove tags
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Split on phase score
execute if score @s boss-fight.progress.phase.i matches 0 run function entity:directorial/boss_fight/vanilla/phase/soul/initialize/0

## Set scores
# the negative time duration is how long the static length lasts (25 ticks)
scoreboard players set @s boss-fight.progress.clock.i -26
scoreboard players set @s boss-fight.progress.clock.total 27

function entity:directorial/boss_fight/vanilla/phase/soul/static

# Move players to soul arena
execute as @a at @s unless entity @s[team=!player,team=!spectator] run teleport @s ~ ~ ~-75.0

# Add tags
tag @s add boss_fight.phase.soul

# Delete main flowey models for performance reasons
function entity:hostile/omega-flowey/summon/remove_preexisting_models/except_tv_screen
execute as @e[tag=aj.soul.root,tag=soul.warning] run function animated_java:soul/remove/this
execute as @e[tag=aj.tv_screen.root,tag=tv_screen.boss_fight] run function animated_java:tv_screen/remove/this
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# we check the score's larger range first because we could otherwise unintentionally
# run both loop functions in one tick if `pre_static` incremented the score from -1 -> 0
execute if score @s boss-fight.progress.clock.i matches 0.. run function entity:directorial/boss_fight/vanilla/phase/soul/loop/post_static
execute if score @s boss-fight.progress.clock.i matches ..-1 run function entity:directorial/boss_fight/vanilla/phase/soul/loop/pre_static
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tag @s remove has_active_soul_event

function entity:directorial/boss_fight/vanilla/phase/soul/static

# Delete floating soul model
execute as @e[tag=aj.soul.root,tag=soul.soul_event] run function animated_java:soul/remove/this
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Split on phase score
execute if score @s boss-fight.progress.phase.i matches 0 run function entity:directorial/boss_fight/vanilla/phase/soul/loop/next_event/0

# Change tv screen variant
execute as @e[tag=aj.tv_screen.root,tag=tv_screen.soul] run function animated_java:tv_screen/apply_variant/default

# Summon and begin animating soul heart model in front of soul screen
execute store result storage animate:soul soul_index int 1 run scoreboard players get @s boss-fight.progress.phase.i
function entity:hostile/omega-flowey/summon/soul/soul with storage animate:soul
execute as @e[tag=aj.soul.root,tag=soul.soul_event] run function entity:hostile/omega-flowey/animate/soul/soul
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function entity:soul/soul_0/start
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# wait until the soul event finishes before continuing the boss_fight's loop
execute if entity @s[tag=has_active_soul_event] run return 0

scoreboard players add @s boss-fight.progress.clock.i 1

execute if score @s boss-fight.progress.clock.i = @s boss-fight.progress.clock.total run function entity:directorial/boss_fight/vanilla/phase/soul/terminate
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Initial TV screen static, before the soul event starts
scoreboard players add @s boss-fight.progress.clock.i 1

# Start new soul event at clock index 0
execute if score @s boss-fight.progress.clock.i matches 0 run function entity:directorial/boss_fight/vanilla/phase/soul/loop/next_event

# Add tags
tag @s add has_active_soul_event
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
execute as @e[tag=aj.tv_screen.root,tag=tv_screen.soul] at @s run function entity:directorial/boss_fight/vanilla/phase/soul/static/as_root
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Play static sound
playsound omega-flowey:boss-fight.static ambient @a ~ ~ ~ 10

function animated_java:tv_screen/apply_variant/static
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Remove tags
tag @s remove boss_fight.phase.soul

# Next phase
function entity:directorial/boss_fight/vanilla/phase/attack/initialize

# Move players to main arena
execute as @a at @s unless entity @s[team=!player,team=!spectator] run teleport @s ~ ~ ~75.0

# Re-summon main Omega Flowey models
function entity:hostile/omega-flowey/summon
function entity:hostile/omega-flowey/animate
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Play WARNING sound
execute at @e[tag=aj.tv_screen.root] run playsound omega-flowey:boss-fight.alarm hostile @a ~ ~ ~ 10 1
execute at @e[tag=aj.tv_screen.root,tag=tv_screen.boss_fight] run playsound omega-flowey:boss-fight.alarm ambient @a ~ ~ ~ 10 1

# Set Omega Flowey to WARNING variant
function entity:hostile/omega-flowey/animate/tv-screen/warning
# Set tv screen to WARNING variant
execute as @e[tag=aj.tv_screen.root,tag=tv_screen.boss_fight] run function entity:hostile/omega-flowey/animate/warning/tv_screen

execute store result storage animate:soul soul_index int 1 run scoreboard players get @s boss-fight.progress.phase.i

# Set applicable petal-pipe to soul-color variant
execute store result storage animate:pipe soul_index int 1 run scoreboard players get @s boss-fight.progress.phase.i
function entity:hostile/omega-flowey/animate/pipe with storage animate:pipe
function entity:hostile/omega-flowey/animate/pipe with storage animate:soul

# Summon and begin animating soul heart model in front of WARNING screen
function entity:hostile/omega-flowey/summon/warning/soul with storage animate:soul
execute as @e[tag=aj.soul.root,tag=soul.warning] run function entity:hostile/omega-flowey/animate/warning/soul

# Summon and begin animating soul tv_screen in other arena
function entity:hostile/omega-flowey/summon/soul/tv_screen
execute as @e[tag=aj.tv_screen.root,tag=tv_screen.soul] run function entity:hostile/omega-flowey/animate/soul/tv_screen
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Remove tags
tag @s remove boss_fight.phase.warn

# Next phase
function entity:directorial/boss_fight/vanilla/phase/soul/initialize
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function animated_java:soul/animations/float/play
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function animated_java:tv_screen/animations/move/play
function animated_java:tv_screen/apply_variant/default

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function animated_java:soul/animations/shake/play
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function animated_java:tv_screen/apply_variant/warning
execute on passengers if entity @s[tag=aj.tv_screen.bone.screen] run data merge entity @s { brightness: { block: 15, sky: 0 } }
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## terminate if there are no more associated flies
## terminate indicator if there are no more associated flies
# (`function entity:group/start` has already been ran by the bullet who called this function)
scoreboard players set #attack.flies.count math.0 0
execute as @e[scores={group.id=0},tag=attack-bullet,tag=flies] run scoreboard players add #attack.flies.count math.0 1
execute if score #attack.flies.count math.0 matches 1 run scoreboard players set @s attack.clock.i -1
execute if score #attack.flies.count math.0 matches 1 run tag @s add flies_are_done

# let boss fight perform next attack if there are 5 flies remaining
execute if score #attack.flies.count math.0 matches 5 as @e[tag=boss_fight] run function entity:hostile/omega-flowey/attack/flies/indicator/terminate/boss_fight
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
execute as @e[tag=boss_fight] run function entity:hostile/omega-flowey/attack/flies/indicator/terminate/boss_fight

function animated_java:venus_fly_trap/remove/this
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ execute positioned 0 37 -13 rotated 0 10 run function animated_java:nose/summon

## TV-screen
execute positioned 0 49 -6 rotated 0 45 run function animated_java:tv_screen/summon
tag @e[tag=aj.tv_screen.root,tag=!tv_screen.soul,tag=!tv_screen.boss_fight] add tv_screen.boss_fight

## Upper eyes
# Right-eye
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
function animated_java:large_side_vine/remove/all
function animated_java:lower_eye/remove/all
function animated_java:nose/remove/all
function animated_java:petal_pipe_circle/remove/all
function animated_java:petal_pipe_middle/remove/all
function entity:hostile/omega-flowey/summon/remove_preexisting_models/except_tv_screen
function animated_java:tv_screen/remove/all
function animated_java:upper_eye/remove/all
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function animated_java:large_side_vine/remove/all
function animated_java:lower_eye/remove/all
function animated_java:nose/remove/all
function animated_java:petal_pipe_circle/remove/all
function animated_java:petal_pipe_middle/remove/all
function animated_java:upper_eye/remove/all
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Soul heart (soul_event)
$execute at @e[tag=aj.tv_screen.locator.soul_event] run function animated_java:soul/summon/$(soul_index)
tag @e[tag=aj.soul.root,tag=!soul.soul_event,tag=!soul.warning] add soul.soul_event
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
execute positioned 0 49 -81 rotated 0 45 run function animated_java:tv_screen/summon
tag @e[tag=aj.tv_screen.root,tag=!tv_screen.soul,tag=!tv_screen.boss_fight] add tv_screen.soul
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Soul heart (warning)
$execute at @e[tag=aj.tv_screen.locator.warning] run function animated_java:soul/summon/$(soul_index)
tag @e[tag=aj.soul.root,tag=!soul.soul_event,tag=!soul.warning] add soul.warning
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Omega Flowey model
function entity:hostile/omega-flowey/summon/remove_preexisting_models

# Attack models
function animated_java:bomb/remove/all
function animated_java:dentata_snake_ball/remove/all
function animated_java:finger_gun/remove/all
function animated_java:finger_gun_bullet/remove/all
function animated_java:finger_gun_laser/remove/all
function animated_java:friendliness_pellet/remove/all
function animated_java:friendliness_pellet_ring/remove/all
function animated_java:homing_vine/remove/all
function animated_java:homing_vine_blinking_lane/remove/all
function animated_java:housefly/remove/all
function animated_java:projectile_star/remove/all
function animated_java:venus_fly_trap/remove/all

# Soul models
function animated_java:soul/remove/all
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
## Remove all animated java entities
# Omega Flowey model
function entity:hostile/omega-flowey/summon/remove_preexisting_models

# Attack models
function animated_java:dentata_snake_ball/remove/all
function animated_java:friendliness_pellet/remove/all
function animated_java:friendliness_pellet_ring/remove/all
function animated_java:projectile_star/remove/all
function entity:remove_animated_java_models

## Kill all `omega-flowey-remastered` entities
kill @e[tag=omega-flowey-remastered]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"omega-flowey:setup/objectives",
"_:reset_scores"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ scoreboard objectives add boss-fight.attack.delay dummy
scoreboard objectives add boss-fight.attack.phase.i dummy
# total number of attack phases before we wrap the index
scoreboard objectives add boss-fight.attack.phase.total dummy
scoreboard objectives add boss-fight.progress.clock.i dummy
# total duration (in ticks) of the progress phase
scoreboard objectives add boss-fight.progress.clock.total dummy
# index of the progress phase
scoreboard objectives add boss-fight.progress.phase.i dummy
# total number of progress phases in the boss fight
Expand All @@ -81,9 +84,9 @@ scoreboard objectives add math.0 dummy
scoreboard objectives add math.1 dummy
scoreboard objectives add math.2 dummy

scoreboard objectives add player.shake.pitch dummy
scoreboard objectives add player.shake.yaw dummy

scoreboard objectives add random dummy
scoreboard objectives add random.min dummy
scoreboard objectives add random.range dummy

scoreboard objectives add player.shake.pitch dummy
scoreboard objectives add player.shake.yaw dummy
Loading