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

ticketize current TODOs in codebase #50

Merged
merged 11 commits into from
Dec 22, 2023
Merged
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: validate

on: [push, workflow_dispatch]

# TODO: add linting
# TODO(37): add linting
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -11,4 +11,4 @@ jobs:
- uses: CarbonSmasher/packtest_runner@86d606f25d2bd2faa08b017326fe99964ac3aa5c
with:
packs: 'datapacks/omega-flowey'
packtest-url: 'https://github.com/misode/packtest/releases/download/v1.0.0-beta5/packtest-1.0.0-beta5.jar'
packtest-url: 'https://github.com/misode/packtest/releases/download/v1.0/packtest-1.0-mc1.20.4.jar'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Since then I've gained a lot of skills both in Minecraft map development and in
1. Download the [Fabric mod loader](https://fabricmc.net/) and install a new profile to your Minecraft launcher
2. Download the [Fabric API](https://www.curseforge.com/minecraft/mc-mods/fabric-api/files) jar
3. Download the latest release jar of [`packtest`](https://github.com/misode/packtest/releases)
1. You should probably download the same version that we're currently specifying in `./.github/workflows/validate.yml`
4. Move the `Fabric API` and `packtest` jars into your `mods` folder in the Minecraft directory (typically `%appdata%/.minecraft/mods`)
5. Run the new profile in your Minecraft launcher to launch a (lightly) modded instance that's able to run `packtest`'s new commands designed for testing
1. Try: `test runall`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ execute unless entity @s[x=-21,dx=42,z=-3,dz=21] run function entity:hostile/ome
execute store result storage utils:move z float 0.01 run scoreboard players get @s attack.speed.z
function entity:utils/move_forward with storage utils:move

# TODO: validate/determine a value for how long the dentata-snakes can bounce
# TODO(42): validate/determine a value for how long the dentata-snakes can bounce
# Allow bullet to escape arena after X seconds
execute if score @s attack.clock.i matches 100 run tag @s add can-escape-arena

# TODO: validate/determine a value for how long until the dentata-snakes terminate
# TODO(42): validate/determine a value for how long until the dentata-snakes terminate
# Terminate after X seconds
execute if score @s attack.clock.i matches 200.. run function entity:hostile/omega-flowey/attack/dentata-snakes/bullet/terminate
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Bounces the dentata-snake against the walls of the arena (flips x-direction/y-direction as necessary)

# TODO: adjust arena bounds based on new animated java model (visually, it clips into the wall right now)
# TODO(42): adjust arena bounds based on new animated java model (visually, it clips into the wall right now)

# 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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set scores
# TODO determine how to control how long we wait until ceding control back to the boss fight director
# after an attack-executor stops looping
# TODO(49): determine how to control how long we wait after this attack finishes before
# letting boss fight start a new attack
scoreboard players set @s boss-fight.attack.delay 20

# Remove tags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
# TODO(42): validate these attack parameters
# (16 / 8) + 1 = 2 + 1 = 3 indicators
scoreboard players set #attack-dentata-snakes attack.bullets.clock.delay 4
scoreboard players set #attack-dentata-snakes attack.bullets.scale 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# Summon indicator
execute at @r[team=player] run summon minecraft:marker ~ 33.0 ~ {CustomName: '"Friendliness-Pellets Indicator"', Tags:["omega-flowey-remastered","groupable","hostile","omega-flowey","attack","attack-indicator","attack-indicator-new","friendliness-pellets"], Passengers: [{id:"minecraft:item_display",Tags:["omega-flowey-remastered","hostile","omega-flowey","attack","friendliness-pellets"],transformation:[-1f,0f,1.2246467991473532e-16f,0f,0f,1f,0f,-0.125f,-1.2246467991473532e-16f,0f,-1f,0f,0f,0f,0f,1f],interpolation_duration:1,item_display:"head",item:{id:"minecraft:golden_sword",Count:1b,tag:{CustomModelData:4}}}]}

# TODO: this is so unbelievably hacky
# TODO(43): this is so unbelievably hacky
# first indicator is 6 ticks slower before it starts summoning bullets
execute if score @s attack.clock.i matches 0 run scoreboard players add #attack-friendliness-pellets attack.indicator.clock.delay 6

# Initialize indicator
execute as @e[tag=attack-indicator-new] at @s run function entity:hostile/omega-flowey/attack/friendliness-pellets/indicator/initialize

# TODO: this is so unbelievably hacky
# TODO(43): this is so unbelievably hacky
execute if score @s attack.clock.i matches 0 run scoreboard players remove #attack-friendliness-pellets attack.indicator.clock.delay 6
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set scores
# TODO determine how to control how long we wait until ceding control back to the boss fight director
# after an attack-executor stops looping
# TODO(49): determine how to control how long we wait after this attack finishes before
# letting boss fight start a new attack
scoreboard players set @s boss-fight.attack.delay 20

# Remove tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

scoreboard players add @s attack.clock.i 1

# TODO(45): refactor repeated `attack.clock.i` conditionals into separate functions
# Change ring variant at tick index
execute if score @s attack.clock.i = @s attack.indicator.animation.index run function entity:group/start
execute if score @s attack.clock.i = @s attack.indicator.animation.index as @e[tag=friendliness-pellet-ring,scores={group.id=0}] run function animated_java:friendliness_pellet_ring/apply_variant/finished_blinking
Expand All @@ -13,6 +14,7 @@ execute if score @s attack.clock.i matches ..-1 run playsound omega-flowey:attac
# Ignore bullet summoning logic while `attack.clock.i` is negative
execute if score @s attack.clock.i matches ..-1 run return 0

# TODO(45): refactor repeated `attack.clock.i` conditionals into separate functions
# Delete ring when we start summoning bullets
execute if score @s attack.clock.i matches 0 run function entity:group/start
execute if score @s attack.clock.i matches 0 as @e[tag=friendliness-pellet-ring,scores={group.id=0}] run function animated_java:friendliness_pellet_ring/remove/this
Expand All @@ -25,5 +27,5 @@ execute if score @s attack.bullets.count < @s attack.bullets.total run function
execute if score @s attack.bullets.count = @s attack.bullets.total run scoreboard players add @s attack.bullets.clock.i 1

# After `attack.bullets.clock.delay` ticks, terminate (and activate all bullets)
# TODO: this could be off by one tick (might need to be `attack.bullets.clock.delay - 1`?)
# TODO(44): this could be off by one tick (might need to be `attack.bullets.clock.delay - 1`?)
execute if score @s attack.bullets.clock.i = @s attack.bullets.clock.delay run function entity:hostile/omega-flowey/attack/friendliness-pellets/indicator/terminate
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
# TODO(44): validate these attack parameters
scoreboard players set #attack-friendliness-pellets attack.bullets.clock.delay 4
scoreboard players set #attack-friendliness-pellets attack.bullets.total 10
# (42 / 14) + 1 = 3 + 1 = 4 indicators
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scoreboard players add @s attack.clock.i 1

# TODO: this hitbox is inaccurate -- needs to be a bounding box that is NOT axis aligned
# TODO(40): this hitbox is inaccurate -- needs to be a bounding box that is NOT axis aligned
# > make some functions to represent the shape and check if the player's coordinates pass the function checks
# inputs: { rectangle_width, current_position, initial_position (bullet summon position) }
data merge storage utils:damage { damage: 2, radius: 1 }
Expand All @@ -9,6 +9,6 @@ function entity:utils/damage with storage utils:damage
# Move while inside arena
execute if entity @s[x=-25,dx=50,y=32,dy=10,z=-5,dz=23] run function entity:hostile/omega-flowey/attack/homing-vines/bullet/loop/move

# TODO: validate/determine a value for how long until the homing-vines bullets terminate
# TODO(41): validate/determine a value for how long until the homing-vines bullets terminate
# Terminate after X seconds
execute if score @s attack.clock.i matches 20.. run function entity:hostile/omega-flowey/attack/homing-vines/bullet/terminate
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set scores
# TODO determine how to control how long we wait until ceding control back to the boss fight director
# after an attack-executor stops looping
# TODO(49): determine how to control how long we wait after this attack finishes before
# letting boss fight start a new attack
scoreboard players set @s boss-fight.attack.delay 20

# Remove tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scoreboard players operation @s attack.bullets.total = #attack-homing-vines atta
playsound omega-flowey:attack.homing-vines.blinking hostile @a ~ ~ ~ 3 1 1

# Randomize delta-x position to summon bullet at (x: player.Position.x, dx: [-15.00..15.00])
# TODO: validate this dx range
# TODO(41): validate this dx range
execute store result score @s attack.position.x run data get entity @s Pos[0] 100
execute store result score @s math.0 run random value -1500..1500
scoreboard players operation @s attack.position.x += @s math.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
# TODO(41): validate these attack parameters
scoreboard players set #attack-homing-vines attack.bullets.total 1
# (13 / 1) + 1 = 13 + 1 = 14 indicators
scoreboard players set #attack-homing-vines attack.executor.clock.length 13
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Play eye sheen particles
# TODO: this should be summoned at a specific position relative to the eye model (TBD where exactly)
# TODO: make better expanding-sheen model with transparency (see todo in `scratch.txt`)
# TODO(36): this should be summoned at a specific position relative to the eye model (TBD where exactly)
# TODO(36): make better expanding-sheen model with transparency
particle minecraft:explosion ~ ~ ~ 0 0 0 10 1 force

playsound omega-flowey:attack.x-bullets.start hostile @a ~ ~ ~ 3 1 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set scores
# TODO determine how to control how long we wait until ceding control back to the boss fight director
# after an attack-executor stops looping
# TODO(49): determine how to control how long we wait after this attack finishes before
# letting boss fight start a new attack
scoreboard players set @s boss-fight.attack.delay 20

# Remove tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Toggle between dark-eye and bright-eye variants
scoreboard players operation @s math.0 = @s attack.bullets.remaining
scoreboard players operation @s math.0 %= #2 mathf.const
# TODO this needs to NOT be a distance check
# TODO(47): this needs to NOT be a distance check
execute if score @s math.0 matches 0 as @e[tag=aj.lower_eye.root,sort=nearest,limit=1] run function animated_java:lower_eye/apply_variant/dark
execute if score @s math.0 matches 1 as @e[tag=aj.lower_eye.root,sort=nearest,limit=1] run function animated_java:lower_eye/apply_variant/bright

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO this needs to NOT be a distance check
# TODO(47): this needs to NOT be a distance check
execute as @e[tag=aj.lower_eye.root,sort=nearest,limit=1] run function animated_java:lower_eye/apply_variant/colorful

# Kill the indicator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
## Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
# TODO(46): validate these attack parameters
scoreboard players set #attack-x-bullets-lower attack.bullets.clock.delay 1
scoreboard players set #attack-x-bullets-lower attack.bullets.total 7
scoreboard players set #attack-x-bullets-lower attack.clock.length 56
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Summon x-bullets-lower executor
# TODO(48): add error when try to start `x-bullets` attack when the corresponding eye entity model doesn't exist
summon minecraft:marker ~ ~ ~ {CustomName: '"X-Bullets-Lower Executor"', Tags:["omega-flowey-remastered","hostile","omega-flowey","attack","attack-executor","attack-executor-new","x-bullets-lower"]}

# Initialize attack-executor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Play eye sheen particles
# TODO: this should be summoned at a specific position relative to the eye model (TBD where exactly)
# TODO: make better expanding-sheen model with transparency (see todo in `scratch.txt`)
# TODO(36): this should be summoned at a specific position relative to the eye model (TBD where exactly)
# TODO(36): make better expanding-sheen model with transparency
particle minecraft:explosion ~ ~ ~ 0 0 0 10 1 force

playsound omega-flowey:attack.x-bullets.start hostile @a ~ ~ ~ 3 1 1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set scores
# TODO determine how to control how long we wait until ceding control back to the boss fight director
# after an attack-executor stops looping
# TODO(49): determine how to control how long we wait after this attack finishes before
# letting boss fight start a new attack
scoreboard players set @s boss-fight.attack.delay 20

# Remove tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Toggle between dark-eye and bright-eye variants
scoreboard players operation @s math.0 = @s attack.bullets.remaining
scoreboard players operation @s math.0 %= #2 mathf.const
# TODO this needs to NOT be a distance check
# TODO(47): this needs to NOT be a distance check
execute if score @s math.0 matches 0 as @e[tag=aj.upper_eye.root,sort=nearest,limit=1] run function animated_java:upper_eye/apply_variant/dark
execute if score @s math.0 matches 1 as @e[tag=aj.upper_eye.root,sort=nearest,limit=1] run function animated_java:upper_eye/apply_variant/bright

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO this needs to NOT be a distance check
# TODO(47): this needs to NOT be a distance check
execute as @e[tag=aj.upper_eye.root,sort=nearest,limit=1] run function animated_java:upper_eye/apply_variant/colorful

# Kill the indicator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
## Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
# TODO(46): validate these attack parameters
scoreboard players set #attack-x-bullets-upper attack.bullets.clock.delay 1
scoreboard players set #attack-x-bullets-upper attack.bullets.total 3
scoreboard players set #attack-x-bullets-upper attack.clock.length 56
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Summon x-bullets-upper executor
# TODO(48): add error when try to start `x-bullets` attack when the corresponding eye entity model doesn't exist
summon minecraft:marker ~ ~ ~ {CustomName: '"X-Bullets-Upper Executor"', Tags:["omega-flowey-remastered","hostile","omega-flowey","attack","attack-executor","attack-executor-new","x-bullets-upper"]}

# Initialize attack-executor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO remove these `unless entity @e[tag=boss_fight]`/`if entity @e[tag=boss_fight]` checks when boss fight is fully setup
# TODO(39): remove these `unless entity @e[tag=boss_fight]`/`if entity @e[tag=boss_fight]` checks when boss fight is fully setup
# we have it here for development so that the boss entity (omega-flowey)
# does not need to exist for attacks to damage.
# `by @e[tag=boss_fight,limit=1]` is needed to have proper damage knockback + death messages ("killed by Omega Flowey")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO parameterize this function's yaw/pitch ranges
# TODO evaluate if these ranges (0.5..5 deg yaw, 0.5..2 deg pitch) are too little/too much screen shake
# TODO(38): parameterize this function's yaw/pitch ranges
# TODO(42): evaluate if these ranges (0.5..5 deg yaw, 0.5..2 deg pitch) are too little/too much screen shake
# Shake player yaw anywhere from 0.5..5.0 degrees (can also be negative)
execute store result score @s math.0 run random value 5..50
execute store result score @s math.1 run random value 0..1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TODO: remove the `vector.dot` function if we don't end up using it for the homing-vines hitbox
# TODO(40): remove the `vector.dot` function if we don't end up using it for the homing-vines hitbox
# inputs:
# u: vector: {x, y, z}: {x: float, y: float, z: float}
# v: vector: {x, y, z}: {x: float, y: float, z: float}
Expand Down
6 changes: 0 additions & 6 deletions scratch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,5 @@ float = 26 ticks
pulsate = 44 ticks
LCM = 572 ticks = 28.6s

TODO use UUID macros for entity selection instead of target selectors
https://discord.com/channels/154777837382008833/1137512428112977981/1138254289135997058

datapack performance benchmarking?
https://github.com/SnaveSutit/mcworld-performance-dp/tree/test-tag-branch-selection-vs-macro-uuid-list-selection

TODO animated transparency for AJ models??
https://discord.com/channels/154777837382008833/1180732170529153165/1180762422953398404