diff --git a/minigames/data/prophunt/functions/__load__.mcfunction b/minigames/data/prophunt/functions/__load__.mcfunction index 1cb7ef0..c15a6dc 100644 --- a/minigames/data/prophunt/functions/__load__.mcfunction +++ b/minigames/data/prophunt/functions/__load__.mcfunction @@ -27,6 +27,8 @@ scoreboard objectives add prophunt.dash_cooldown dummy # Ping scoreboard objectives add prophunt.use_item_trigger minecraft.used:minecraft.carrot_on_a_stick +scoreboard objectives add prophunt.ping_cooldown dummy +scoreboard objectives add prophunt.ping_stack dummy # Ultimate scoreboard objectives add prophunt.ultimate_points dummy diff --git a/minigames/data/prophunt/functions/ping/effect.mcfunction b/minigames/data/prophunt/functions/ping/effect.mcfunction index fca70e2..b5e22fb 100644 --- a/minigames/data/prophunt/functions/ping/effect.mcfunction +++ b/minigames/data/prophunt/functions/ping/effect.mcfunction @@ -1,8 +1,12 @@ # Executed as and at the pinging player tellraw @a {"text":"prophunt:ping/run"} -effect give @s glowing 1 1 true -summon armor_stand ~ ~ ~ {Glowing:1b,block_state:{Name:"minecraft:grass"},Tags:["prophunt.ping","prophunt.ping.new"]} +effect give @s glowing 2 1 true +summon block_display ~ ~ ~ {Glowing:1b,block_state:{Name:"minecraft:lightning_rod"},Tags:["prophunt.ping","prophunt.ping.new"]} +scoreboard players set @e[type=block_display,tag=prophunt.ping.new] bs.ttl 40 team join prophunt @e[type=block_display,tag=prophunt.ping.new] playsound minecraft:block.note_block.bell master @a[tag=prophunt.is_hunter] ~ ~ ~ 2 1 1 -scoreboard players set @s prophunt.use_item_trigger 0 \ No newline at end of file +scoreboard players set @s prophunt.use_item_trigger 0 +tag @e[type=block_display,tag=prophunt.ping.new] remove prophunt.ping.new + +scoreboard players remove @s prophunt.ping_stack 1 \ No newline at end of file diff --git a/minigames/data/prophunt/functions/ping/raycast.mcfunction b/minigames/data/prophunt/functions/ping/raycast.mcfunction index b52bff5..9b3cec2 100644 --- a/minigames/data/prophunt/functions/ping/raycast.mcfunction +++ b/minigames/data/prophunt/functions/ping/raycast.mcfunction @@ -4,4 +4,4 @@ tellraw @a {"text":"prophunt:ping/raycast"} scoreboard players remove #prophunt.ping.raycast ctx 1 particle minecraft:end_rod ~ ~ ~ 0 0 0 0 1 force execute if score #prophunt.ping.raycast ctx matches 1.. if block ~ ~ ~ air positioned ^ ^ ^0.5 run function prophunt:ping/raycast -execute unless block ~ ~ ~ air align xyz positioned ~ ~0.5 ~ run function prophunt:ping/effect \ No newline at end of file +execute unless block ~ ~ ~ air positioned ~-0.5 ~ ~-0.5 run function prophunt:ping/effect \ No newline at end of file diff --git a/minigames/data/prophunt/functions/ping/trigger.mcfunction b/minigames/data/prophunt/functions/ping/trigger.mcfunction index 5cb1286..b7e3c7d 100644 --- a/minigames/data/prophunt/functions/ping/trigger.mcfunction +++ b/minigames/data/prophunt/functions/ping/trigger.mcfunction @@ -2,6 +2,12 @@ # tellraw @a {"text":"prophunt:ping/trigger"} scoreboard players set #prophunt.ping.raycast ctx 0 -execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..}] run scoreboard players add #prophunt.ping.raycast ctx 50 -execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..}] at @s anchored eyes positioned ^ ^ ^ run function prophunt:ping/raycast -scoreboard players set @a[tag=prophunt.is_hunter] prophunt.use_item_trigger 0 \ No newline at end of file +execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..,ping_stack=1..}] run scoreboard players add #prophunt.ping.raycast ctx 50 +execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..,ping_stack=1..}] at @s anchored eyes positioned ^ ^ ^ run function prophunt:ping/raycast + +execute as @a[tag=prophunt.is_hunter,scores={prophunt.use_item_trigger=1..,ping_stack=1..}] + +scoreboard players set @a[tag=prophunt.is_hunter] prophunt.use_item_trigger 0 + +scoreboard players remove @a[team=prophunt,scores={prophunt.ping_cooldown=1..}] prophunt.ping_cooldown 1 +scoreboard players set @a[team=prophunt,scores={prophunt.ping_cooldown=..0,prophunt.ping_stack=..2}] prophunt.ping_cooldown 100 \ No newline at end of file diff --git a/minigames/data/prophunt/functions/start/start.mcfunction b/minigames/data/prophunt/functions/start/start.mcfunction index 578ad64..b8b3904 100644 --- a/minigames/data/prophunt/functions/start/start.mcfunction +++ b/minigames/data/prophunt/functions/start/start.mcfunction @@ -14,6 +14,8 @@ scoreboard players add @a prophunt.climb 0 scoreboard players add @a prophunt.prop_type 0 scoreboard players add @a prophunt.stun_hunters_cooldown 0 scoreboard players set @a prophunt.stop.timer 0 +scoreboard players set @a prophunt.ping_stack 0 +scoreboard players set @a prophunt.ping_cooldown 0 # Make teams scoreboard players set $prophunt.player_count data 0