Skip to content

Commit

Permalink
add finger-guns to randomized-attack logic
Browse files Browse the repository at this point in the history
tested by manually adding it to the boss_fight.phase.0 weights
  • Loading branch information
TheAfroOfDoom committed Jan 7, 2024
1 parent f4492d6 commit 4e92282
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4e92282

Please sign in to comment.