Skip to content

Commit

Permalink
replace finger gun strings/comments with bomb
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAfroOfDoom committed Jan 9, 2024
1 parent 0007c59 commit 5cf9f7b
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Set scores
scoreboard players set @s attack.clock.i -1
scoreboard players operation @s attack.speed.z = #attack-finger-guns attack.speed.z
scoreboard players operation @s attack.speed.z = #attack-bomb attack.speed.z

# Play bullet shoot sound
playsound omega-flowey:attack.finger-guns.shoot hostile @a ~ ~ ~ 5 1
playsound omega-flowey:attack.bomb.shoot hostile @a ~ ~ ~ 5 1

# Set pitch and yaw from input
execute store result entity @s Rotation[0] float 0.01 run data get storage attack:finger-guns yaw
execute store result entity @s Rotation[1] float 0.01 run data get storage attack:finger-guns pitch
execute store result entity @s Rotation[0] float 0.01 run data get storage attack:bomb yaw
execute store result entity @s Rotation[1] float 0.01 run data get storage attack:bomb pitch

# Start animation
function animated_java:finger_gun_bullet/animations/shoot/play
function animated_java:bomb_bullet/animations/shoot/play

# Remove tags
tag @s remove attack-bullet-new
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ data merge storage utils:damage { damage: 2, radius: 1 }
execute positioned ~ ~-1.5 ~ run function entity:utils/damage with storage utils:damage

# Move forward
function entity:hostile/omega-flowey/attack/finger-guns/bullet/loop/move
function entity:hostile/omega-flowey/attack/bomb/bullet/loop/move

# TODO(60): validate/determine a value for how long until the finger-guns bullets terminate
# TODO(60): validate/determine a value for how long until the bomb bullets terminate
# Terminate after X seconds
execute if score @s attack.clock.i matches 60.. run function entity:hostile/omega-flowey/attack/finger-guns/bullet/terminate
execute if score @s attack.clock.i matches 60.. run function entity:hostile/omega-flowey/attack/bomb/bullet/terminate
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
## Terminate bullet
function animated_java:finger_gun_bullet/remove/this
function animated_java:bomb_bullet/remove/this
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Set scores
scoreboard players set @s attack.clock.i -1

scoreboard players operation @s attack.executor.clock.length = #attack-finger-guns attack.executor.clock.length
scoreboard players operation @s attack.executor.rate = #attack-finger-guns attack.executor.rate
scoreboard players operation @s attack.executor.clock.length = #attack-bomb attack.executor.clock.length
scoreboard players operation @s attack.executor.rate = #attack-bomb attack.executor.rate

# Remove tags
tag @s remove attack-executor-new
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ execute if score @s attack.clock.i matches ..-1 run return 0
# Summon an indicator at a random player every `attack.executor.rate` ticks
scoreboard players operation @s math.0 = @s attack.clock.i
scoreboard players operation @s math.0 %= @s attack.executor.rate
execute if score @s math.0 matches 0 run function entity:hostile/omega-flowey/attack/finger-guns/executor/loop/indicator/presummon
execute if score @s math.0 matches 0 run function entity:hostile/omega-flowey/attack/bomb/executor/loop/indicator/presummon

# Terminate
execute if score @s attack.clock.i = @s attack.executor.clock.length run function entity:hostile/omega-flowey/attack/finger-guns/executor/terminate
execute if score @s attack.clock.i = @s attack.executor.clock.length run function entity:hostile/omega-flowey/attack/bomb/executor/terminate
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ scoreboard players set @s attack.position.y 3300
execute store result score @s attack.position.z run random value -35..195

# Store new position and yaw
execute store result storage attack:finger-guns x double 0.01 run scoreboard players get @s attack.position.x
execute store result storage attack:finger-guns y double 0.01 run scoreboard players get @s attack.position.y
execute store result storage attack:finger-guns z double 0.1 run scoreboard players get @s attack.position.z
execute store result storage attack:finger-guns yaw float 0.01 run scoreboard players get @s attack.indicator.yaw
execute store result storage attack:bomb x double 0.01 run scoreboard players get @s attack.position.x
execute store result storage attack:bomb y double 0.01 run scoreboard players get @s attack.position.y
execute store result storage attack:bomb z double 0.1 run scoreboard players get @s attack.position.z
execute store result storage attack:bomb yaw float 0.01 run scoreboard players get @s attack.indicator.yaw
# flat pitch
data merge storage attack:finger-guns { pitch: 0.0f }
data merge storage attack:bomb { pitch: 0.0f }

function entity:hostile/omega-flowey/attack/finger-guns/executor/loop/indicator/summon with storage attack:finger-guns
function entity:hostile/omega-flowey/attack/bomb/executor/loop/indicator/summon with storage attack:bomb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Summon indicator
$execute positioned $(x) $(y) $(z) rotated $(yaw) $(pitch) run function animated_java:finger_gun/summon
$execute positioned $(x) $(y) $(z) rotated $(yaw) $(pitch) run function animated_java:bomb/summon

# Initialize indicator
execute as @e[tag=attack-indicator-new] at @s run function entity:hostile/omega-flowey/attack/finger-guns/indicator/initialize
execute as @e[tag=attack-indicator-new] at @s run function entity:hostile/omega-flowey/attack/bomb/indicator/initialize
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
execute as @e[tag=boss_fight] run function entity:hostile/omega-flowey/attack/finger-guns/executor/terminate/boss_fight
execute as @e[tag=boss_fight] run function entity:hostile/omega-flowey/attack/bomb/executor/terminate/boss_fight

kill @s
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Set scores
scoreboard players set @s attack.clock.i -1
scoreboard players operation @s attack.clock.i -= #attack-finger-guns attack.indicator.clock.delay
scoreboard players operation @s attack.clock.i -= #attack-bomb attack.indicator.clock.delay

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

# Set group ID
function entity:group/set

# Start animation
function animated_java:finger_gun/animations/grow/play
function animated_java:bomb/animations/grow/play

# Remove tags
tag @s remove attack-indicator-new
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ scoreboard players add @s attack.clock.i 1
execute if score @s attack.clock.i matches ..-1 run return 0

# Summon laser after `attack.indicator.clock.delay`
execute if score @s attack.clock.i matches 0 run function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop/laser/presummon
execute if score @s attack.clock.i matches 0 run function entity:hostile/omega-flowey/attack/bomb/indicator/loop/laser/presummon

# Summon a bullet
execute if score @s attack.clock.i matches 5 run function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop/bullet/presummon
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
execute if score @s attack.clock.i >= @s attack.indicator.clock.length run function entity:hostile/omega-flowey/attack/finger-guns/indicator/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,12 +1,12 @@
# Bullet summoning setup
execute store result storage attack:finger-guns x double 0.01 run data get entity @s Pos[0] 100
execute store result storage attack:finger-guns z double 0.01 run data get entity @s Pos[2] 100
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

# Terminate associated laser
function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop/laser/terminate
function entity:hostile/omega-flowey/attack/bomb/indicator/loop/laser/terminate

# Play shoot animation
function animated_java:finger_gun/animations/shoot/play
function animated_java:bomb/animations/shoot/play

# Summon bullet
function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop/bullet/summon with storage attack:finger-guns
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,8 +1,8 @@
# Summon bullet
$execute positioned $(x) 35 $(z) run function animated_java:finger_gun_bullet/summon
$execute positioned $(x) 35 $(z) run function animated_java:bomb_bullet/summon

# Copy yaw to bullet
execute store result storage attack:finger-guns yaw float 1 run data get entity @s Rotation[0] 100
execute store result storage attack:bomb yaw float 1 run data get entity @s Rotation[0] 100

# Initialize bullet
execute as @e[tag=attack-bullet-new] run function entity:hostile/omega-flowey/attack/finger-guns/bullet/initialize
execute as @e[tag=attack-bullet-new] run function entity:hostile/omega-flowey/attack/bomb/bullet/initialize
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
function entity:group/copy with storage group

# Play laser sound (blink) once
playsound omega-flowey:attack.finger-guns.laser hostile @a ~ ~ ~ 5 1 1
playsound omega-flowey:attack.bomb.laser hostile @a ~ ~ ~ 5 1 1

# Remove tags
tag @s remove finger-guns-laser-new
tag @s remove bomb-laser-new
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Summon laser at same z-position as indicator
execute store result storage attack:finger-guns z double 0.01 run data get entity @s Pos[2] 100
execute store result storage attack:bomb z double 0.01 run data get entity @s Pos[2] 100

function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop/laser/summon with storage attack:finger-guns
function entity:hostile/omega-flowey/attack/bomb/indicator/loop/laser/summon with storage attack:bomb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Summon laser
$execute positioned 0.5 33.5 $(z) run function animated_java:finger_gun_laser/summon
$execute positioned 0.5 33.5 $(z) run function animated_java:bomb_laser/summon

# Copy group id to laser
execute store result storage group id int 1 run scoreboard players get @s group.id

# Initialize laser
execute as @e[tag=finger-guns-laser-new] run function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop/laser/initialize with storage attack:finger-guns
execute as @e[tag=bomb-laser-new] run function entity:hostile/omega-flowey/attack/bomb/indicator/loop/laser/initialize with storage attack:bomb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function entity:group/start
execute as @e[tag=finger-guns-laser,scores={group.id=0}] run function animated_java:finger_gun_laser/remove/this
execute as @e[tag=bomb-laser,scores={group.id=0}] run function animated_java:bomb_laser/remove/this
function entity:group/end
Original file line number Diff line number Diff line change
@@ -1 +1 @@
function animated_java:finger_gun/remove/this
function animated_java:bomb/remove/this
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Set fake player scores back to defaults (if they were changed by a pre-initialize attack function)
# TODO(60): validate these attack parameters
# (66 / 3) + 1 = 22 + 1 = 23 indicators
scoreboard players set #attack-finger-guns attack.executor.clock.length 66
scoreboard players set #attack-finger-guns attack.executor.rate 3
scoreboard players set #attack-finger-guns attack.indicator.clock.delay 14
scoreboard players set #attack-bomb attack.executor.clock.length 66
scoreboard players set #attack-bomb attack.executor.rate 3
scoreboard players set #attack-bomb attack.indicator.clock.delay 14
# lifespan of indicator after summoning laser
scoreboard players set #attack-finger-guns attack.indicator.clock.length 40
scoreboard players set #attack-finger-guns attack.speed.z 110
scoreboard players set #attack-bomb attack.indicator.clock.length 40
scoreboard players set #attack-bomb attack.speed.z 110
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Summon finger-guns executor
summon minecraft:marker ~ ~ ~ {CustomName: '"Finger-Guns Executor"', Tags:["omega-flowey-remastered","hostile","omega-flowey","attack","attack-executor","attack-executor-new","finger-guns"]}
## Summon bomb executor
summon minecraft:marker ~ ~ ~ {CustomName: '"Bomb Executor"', Tags:["omega-flowey-remastered","hostile","omega-flowey","attack","attack-executor","attack-executor-new","bomb"]}

# Initialize attack-executor
execute as @e[tag=attack-executor-new] at @s run function entity:hostile/omega-flowey/attack/finger-guns/executor/initialize
execute as @e[tag=attack-executor-new] at @s run function entity:hostile/omega-flowey/attack/bomb/executor/initialize
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
execute if entity @s[tag=attack-bullet] run function entity:hostile/omega-flowey/attack/finger-guns/bullet/loop
execute if entity @s[tag=attack-executor] run function entity:hostile/omega-flowey/attack/finger-guns/executor/loop
execute if entity @s[tag=attack-indicator] run function entity:hostile/omega-flowey/attack/finger-guns/indicator/loop
execute if entity @s[tag=attack-bullet] run function entity:hostile/omega-flowey/attack/bomb/bullet/loop
execute if entity @s[tag=attack-executor] run function entity:hostile/omega-flowey/attack/bomb/executor/loop
execute if entity @s[tag=attack-indicator] run function entity:hostile/omega-flowey/attack/bomb/indicator/loop

0 comments on commit 5cf9f7b

Please sign in to comment.