Skip to content

Commit

Permalink
adjust indicator to use bomb logic
Browse files Browse the repository at this point in the history
- summons 3 bombs at randomized XZ locations, once bomb per tick
  • Loading branch information
TheAfroOfDoom committed Jan 13, 2024
1 parent 4677d52 commit d9779f9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Set scores
scoreboard players set @s attack.clock.i -1
scoreboard players operation @s attack.clock.i -= #attack-bomb attack.indicator.clock.delay

scoreboard players operation @s attack.indicator.clock.length = #attack-bomb attack.indicator.clock.length

# Set group ID
function entity:group/set

# Remove tags
tag @s remove attack-indicator-new
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
scoreboard players add @s attack.clock.i 1

# Ignore bullet summoning logic while `attack.clock.i` is negative
execute if score @s attack.clock.i matches ..-1 run return 0
# Summon and initialize 2 bullets each tick
function entity:hostile/omega-flowey/attack/bomb/indicator/loop/bullet/presummon
function entity:hostile/omega-flowey/attack/bomb/indicator/loop/bullet/presummon

# Summon a bullet
execute if score @s attack.clock.i matches 5 run function entity:hostile/omega-flowey/attack/bomb/indicator/loop/bullet/presummon

# Terminate after finger-gun shoot animation finishes
# Terminate
execute if score @s attack.clock.i >= @s attack.indicator.clock.length run function entity:hostile/omega-flowey/attack/bomb/indicator/terminate
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Bullet summoning setup
execute store result storage attack:bomb x double 0.01 run data get entity @s Pos[0] 100
execute store result storage attack:bomb z double 0.01 run data get entity @s Pos[2] 100
# Randomize x-position to summon bullet at (x: [-22..22])
execute store result score @s attack.position.x run random value -220..220

# Randomize z-position to summon bullet at (z: [-4..19])
execute store result score @s attack.position.z run random value -40..190

# Store position
execute store result storage attack:bomb x double 0.1 run scoreboard players get @s attack.position.x
execute store result storage attack:bomb z double 0.1 run scoreboard players get @s attack.position.z

# Summon bullet
function entity:hostile/omega-flowey/attack/bomb/indicator/loop/bullet/summon with storage attack:bomb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Summon bullet
$execute positioned $(x) 45 $(z) rotated 0 0 run function animated_java:bomb/summon

# Initialize bullet
execute as @e[tag=attack-bullet-new] run function entity:hostile/omega-flowey/attack/bomb/bullet/initialize
# Summon and initialize bullet
$execute positioned $(x) 60 $(z) run function animated_java:bomb/summon
execute as @e[tag=attack-bullet-new] at @s run function entity:hostile/omega-flowey/attack/bomb/bullet/initialize
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# TODO(): validate these attack parameters
scoreboard players set #attack-bomb attack.executor.clock.length 54
scoreboard players set #attack-bomb attack.executor.rate 6
scoreboard players set #attack-bomb attack.indicator.clock.length 2

0 comments on commit d9779f9

Please sign in to comment.