From 4e92282857a5ed17de3c3d154a44374fe9d134f8 Mon Sep 17 00:00:00 2001 From: TheAfroOfDoom Date: Sat, 6 Jan 2024 23:05:28 -0500 Subject: [PATCH] add `finger-guns` to randomized-attack logic tested by manually adding it to the boss_fight.phase.0 weights --- .../omega-flowey/attack/random/choose_attack.mcfunction | 4 ++++ .../attack/random/choose_attack/finger-guns.mcfunction | 5 +++++ .../omega-flowey/attack/random/reduce_weights.mcfunction | 3 +++ .../attack/random/remove_previous_tags.mcfunction | 1 + .../omega-flowey/attack/random/reset_weights.mcfunction | 1 + .../omega-flowey/attack/random/sum_weights.mcfunction | 1 + 6 files changed, 15 insertions(+) create mode 100644 datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack/finger-guns.mcfunction diff --git a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack.mcfunction b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack.mcfunction index 3d516b367..4a14aeffa 100644 --- a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack.mcfunction +++ b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack.mcfunction @@ -8,6 +8,10 @@ scoreboard players operation @s math.0 -= #attack-dentata-snakes attack.weight execute if score #attack-dentata-snakes attack.weight matches 1.. if score @s math.0 matches ..0 run function entity:hostile/omega-flowey/attack/random/choose_attack/dentata-snakes execute if score #attack-dentata-snakes attack.weight matches 1.. if score @s math.0 matches ..0 run return 0 +scoreboard players operation @s math.0 -= #attack-finger-guns attack.weight +execute if score #attack-finger-guns attack.weight matches 1.. if score @s math.0 matches ..0 run function entity:hostile/omega-flowey/attack/random/choose_attack/finger-guns +execute if score #attack-finger-guns attack.weight matches 1.. if score @s math.0 matches ..0 run return 0 + scoreboard players operation @s math.0 -= #attack-friendliness-pellets attack.weight execute if score #attack-friendliness-pellets attack.weight matches 1.. if score @s math.0 matches ..0 run function entity:hostile/omega-flowey/attack/random/choose_attack/friendliness-pellets execute if score #attack-friendliness-pellets attack.weight matches 1.. if score @s math.0 matches ..0 run return 0 diff --git a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack/finger-guns.mcfunction b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack/finger-guns.mcfunction new file mode 100644 index 000000000..5ccfc4961 --- /dev/null +++ b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/choose_attack/finger-guns.mcfunction @@ -0,0 +1,5 @@ +execute if entity @s[tag=attack.random.consider_previous_trials] run function entity:hostile/omega-flowey/attack/random/remove_previous_tags +execute if entity @s[tag=attack.random.consider_previous_trials] run tag @s add attack.random.previous_attack.finger-guns + +# Start attack +function entity:hostile/omega-flowey/attack/finger-guns/start diff --git a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reduce_weights.mcfunction b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reduce_weights.mcfunction index a4a36e69e..54fc50a05 100644 --- a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reduce_weights.mcfunction +++ b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reduce_weights.mcfunction @@ -2,6 +2,9 @@ execute if entity @s[tag=attack.random.previous_attack.dentata-snakes] run scoreboard players remove #attack-dentata-snakes attack.weight 1 execute if entity @s[tag=attack.random.previous_attack.dentata-snakes] run tag @s remove attack.random.previous_attack.dentata-snakes +execute if entity @s[tag=attack.random.previous_attack.finger-guns] run scoreboard players remove #attack-finger-guns attack.weight 1 +execute if entity @s[tag=attack.random.previous_attack.finger-guns] run tag @s remove attack.random.previous_attack.finger-guns + execute if entity @s[tag=attack.random.previous_attack.friendliness-pellets] run scoreboard players remove #attack-friendliness-pellets attack.weight 1 execute if entity @s[tag=attack.random.previous_attack.friendliness-pellets] run tag @s remove attack.random.previous_attack.friendliness-pellets diff --git a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/remove_previous_tags.mcfunction b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/remove_previous_tags.mcfunction index 62367b731..e487d9cc1 100644 --- a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/remove_previous_tags.mcfunction +++ b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/remove_previous_tags.mcfunction @@ -1,4 +1,5 @@ tag @s remove attack.random.previous_attack.dentata-snakes +tag @s remove attack.random.previous_attack.finger-guns tag @s remove attack.random.previous_attack.friendliness-pellets tag @s remove attack.random.previous_attack.homing-vines tag @s remove attack.random.previous_attack.x-bullets-lower diff --git a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reset_weights.mcfunction b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reset_weights.mcfunction index 2dbd1b372..1ac98c18b 100644 --- a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reset_weights.mcfunction +++ b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/reset_weights.mcfunction @@ -1,5 +1,6 @@ # Reset all weights scoreboard players reset #attack-dentata-snakes attack.weight +scoreboard players reset #attack-finger-guns attack.weight scoreboard players reset #attack-friendliness-pellets attack.weight scoreboard players reset #attack-homing-vines attack.weight scoreboard players reset #attack-x-bullets-lower attack.weight diff --git a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/sum_weights.mcfunction b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/sum_weights.mcfunction index 75fb18349..426a77f4b 100644 --- a/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/sum_weights.mcfunction +++ b/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/random/sum_weights.mcfunction @@ -1,6 +1,7 @@ ## Sum `attack.weight`s in `math.0` scoreboard players set @s math.0 0 scoreboard players operation @s math.0 += #attack-dentata-snakes attack.weight +scoreboard players operation @s math.0 += #attack-finger-guns attack.weight scoreboard players operation @s math.0 += #attack-friendliness-pellets attack.weight scoreboard players operation @s math.0 += #attack-homing-vines attack.weight scoreboard players operation @s math.0 += #attack-x-bullets-lower attack.weight