Skip to content

Commit

Permalink
Merge pull request #239 from Gunivers/fix-worldborder-control
Browse files Browse the repository at this point in the history
fixed the worldborder size trigger
  • Loading branch information
Loumardes authored Nov 17, 2023
2 parents d897fe7 + 7f26e6a commit d40eac3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ scoreboard objectives add option_use_time_limit trigger
execute unless score UseTimeLimit options matches 0..1 run scoreboard players set UseTimeLimit options 0
scoreboard objectives add option_use_score_limit trigger
execute unless score UseScoreLimit options matches 0..1 run scoreboard players set UseScoreLimit options 0
scoreboard objectives add option_wb_size_add trigger
scoreboard objectives add option_worldborder_size trigger
execute unless score WBSize options matches 25..165 run scoreboard players set WBSize options 95
scoreboard objectives add option_worldborder_shrink trigger
execute unless score WorldborderShrink options matches 0..1 run scoreboard players set WorldborderShrink options 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ execute unless score #admin.exist options matches 1 as @a run function scaffoldi

execute if score #admin.exist options matches 1 as @a[tag=admin] run function scaffolding_rush:options/test_options

execute as @s[tag=game_options_enabled] store result score @s usedTrigger run scoreboard players enable @s option_worldborder_start_time

execute if score #gameplay.regeneration.enabled options matches 1 run effect give @a regeneration infinite 0 true
execute if score #gameplay.regeneration.enabled options matches 0 run effect clear @a regeneration
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ scoreboard players enable @s option_vil_resp_cd
scoreboard players enable @s option_instant_pil
scoreboard players enable @s option_perf_mode
scoreboard players enable @s option_team_egg
scoreboard players enable @s option_wb_size_add
scoreboard players enable @s option_worldborder_size
scoreboard players enable @s option_regen
scoreboard players enable @s option_fall_damage
scoreboard players enable @s option_random_team
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ scoreboard players reset @s option_vil_resp_cd
scoreboard players reset @s option_instant_pil
scoreboard players reset @s option_perf_mode
scoreboard players reset @s option_team_egg
scoreboard players reset @s option_wb_size_add
scoreboard players reset @s option_worldborder_size
scoreboard players reset @s option_regen
scoreboard players reset @s option_fall_damage
scoreboard players reset @s option_random_team
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Change wb size by number of teams
execute if score TeamNumber options matches 2 run scoreboard players operation WBSize options = WBSize2 options
execute if score TeamNumber options matches 3 run scoreboard players operation WBSize options = WBSize3 options
execute if score TeamNumber options matches 4 run scoreboard players operation WBSize options = WBSize4 options

function scaffolding_rush:options/map/wb_size_refresh
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Change wb size by number of teams
execute if score TeamNumber options matches 2 run scoreboard players operation WBSize options = WBSize2 options
execute if score TeamNumber options matches 3 run scoreboard players operation WBSize options = WBSize3 options
execute if score TeamNumber options matches 4 run scoreboard players operation WBSize options = WBSize4 options

# normalize values
execute if score WBAddTemp options matches ..-5 run scoreboard players set WBAddTemp options -5
execute if score WBAddTemp options matches 5.. run scoreboard players set WBAddTemp options 5
Expand Down Expand Up @@ -58,4 +53,4 @@ scoreboard players operation -WBbyTwo data -= WBbyTwo data

# reset values
scoreboard players set WBAddTemp options 0
scoreboard players set @a option_wb_size_add 0
scoreboard players set @a option_worldborder_size 0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scoreboard players enable @a option_wb_size_add
scoreboard players enable @a option_worldborder_size

scoreboard players operation WBAddTemp options = @s option_wb_size_add
scoreboard players operation WBSize options = @s option_worldborder_size

execute unless entity @a[tag=inTutorial] run function scaffolding_rush:options/map/wb_size_refresh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ execute if score @s option_preset matches ..-1 run function scaffolding_rush:opt
scoreboard players set @s option_preset 0
scoreboard players enable @s option_preset

execute unless entity @a[tag=inTutorial] run function scaffolding_rush:options/map/wb_size_refresh
execute unless entity @a[tag=inTutorial] run function scaffolding_rush:options/map/wb_match_team_count
function scaffolding_rush:options/refresh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ execute as @s[scores={option_perf_mode=1..}] run function scaffolding_rush:optio
execute as @s[scores={option_team_egg=1..}] run function scaffolding_rush:options/team/team_egg
execute as @s[scores={option_vil_resp_cd=1..}] run function scaffolding_rush:options/villager/vil_resp_cd
execute as @s[scores={option_vil_respawn=1..}] run function scaffolding_rush:options/villager/vil_respawn
execute if score WBAddTemp options matches 0 as @s[scores={option_wb_size_add=1..}] run function scaffolding_rush:options/map/wb_size_add
execute if score WBAddTemp options matches 0 as @s[scores={option_wb_size_add=..-1}] run function scaffolding_rush:options/map/wb_size_add
execute as @s[scores={option_worldborder_size=1..}] run function scaffolding_rush:options/map/wb_size_set
execute as @s[scores={option_regen=1..}] run function scaffolding_rush:options/gameplay/regen
execute as @s[scores={option_fall_damage=1..}] run function scaffolding_rush:options/gameplay/fall_damage
execute as @s[scores={option_random_team=1..}] run function scaffolding_rush:options/team/random_team
Expand All @@ -35,12 +34,12 @@ execute as @s[scores={option_score_limit=1..}] run function scaffolding_rush:opt
execute as @s[scores={option_use_time_limit=1..}] run function scaffolding_rush:options/map/use_time_limit
execute as @s[scores={option_use_score_limit=1..}] run function scaffolding_rush:options/map/use_score_limit
execute as @s[scores={option_worldborder_shrink=1..}] run function scaffolding_rush:options/map/worldborder_shrink
execute as @s[scores={option_worldborder_start_time=1..}] run function scaffolding_rush:options/map/worldborder_start_time
execute as @s[scores={option_worldborder_start_time=..-1}] run function scaffolding_rush:options/map/worldborder_start_time
execute store result score @s[tag=game_options_enabled] usedTrigger run scoreboard players enable @s option_worldborder_start_time
execute as @s[scores={usedTrigger=1..}] run function scaffolding_rush:options/map/worldborder_start_time
execute as @s[scores={option_worldborder_time_to_shrink=1..}] run function scaffolding_rush:options/map/worldborder_time_to_shrink
execute as @s[scores={option_worldborder_time_to_shrink=..-1}] run function scaffolding_rush:options/map/worldborder_time_to_shrink
execute as @s[scores={option_lava_speed=1..}] run function scaffolding_rush:options/map/lava_speed
execute as @s[scores={option_lava_speed=..-1}] run function scaffolding_rush:options/map/lava_speed
execute store result score @s[tag=game_options_enabled] usedTrigger run scoreboard players enable @s option_lava_speed
execute as @s[scores={usedTrigger=1..}] run function scaffolding_rush:options/map/lava_speed
execute as @s[scores={option_fast_climb=1..}] run function scaffolding_rush:options/gameplay/fast_climb
execute as @s[scores={option_movable_villager=1..}] run function scaffolding_rush:options/villager/movable_villager
execute as @s[scores={option_invulnerable_villager=1..}] run function scaffolding_rush:options/villager/invulnerable_villager
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ execute as @s[scores={option_perf_mode=1..}] run function scaffolding_rush:optio
execute as @s[scores={option_team_egg=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_vil_resp_cd=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_vil_respawn=1..}] run function scaffolding_rush:options/msg_unauthorized
execute if score WBAddTemp options matches 0 as @s[scores={option_wb_size_add=1..}] run function scaffolding_rush:options/msg_unauthorized
execute if score WBAddTemp options matches 0 as @s[scores={option_wb_size_add=..-1}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_worldborder_size=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_regen=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_fall_damage=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_random_team=1..}] run function scaffolding_rush:options/msg_unauthorized
Expand All @@ -34,12 +33,13 @@ execute as @s[scores={option_time_limit=1..}] run function scaffolding_rush:opti
execute as @s[scores={option_score_limit=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_use_time_limit=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_use_score_limit=1..}] run function scaffolding_rush:options/msg_unauthorized
execute store result score @s[tag=game_options_enabled] usedTrigger run scoreboard players enable @s option_worldborder_start_time
execute as @s[scores={usedTrigger=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_worldborder_shrink=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_worldborder_start_time=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_worldborder_start_time=..-1}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_worldborder_time_to_shrink=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_worldborder_time_to_shrink=..-1}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_lava_speed=1..}] run function scaffolding_rush:options/msg_unauthorized
execute store result score @s[tag=game_options_enabled] usedTrigger run scoreboard players enable @s option_lava_speed
execute as @s[scores={usedTrigger=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_lava_speed=..-1}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_fast_climb=1..}] run function scaffolding_rush:options/msg_unauthorized
execute as @s[scores={option_movable_villager=1..}] run function scaffolding_rush:options/msg_unauthorized
Expand Down

0 comments on commit d40eac3

Please sign in to comment.