Skip to content

Commit

Permalink
WIP new prophunt ping system
Browse files Browse the repository at this point in the history
  • Loading branch information
VForiel committed Mar 18, 2024
1 parent b8ca98c commit c1a0592
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions minigames/data/prophunt/functions/__load__.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions minigames/data/prophunt/functions/ping/effect.mcfunction
Original file line number Diff line number Diff line change
@@ -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
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
2 changes: 1 addition & 1 deletion minigames/data/prophunt/functions/ping/raycast.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
execute unless block ~ ~ ~ air positioned ~-0.5 ~ ~-0.5 run function prophunt:ping/effect
12 changes: 9 additions & 3 deletions minigames/data/prophunt/functions/ping/trigger.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
2 changes: 2 additions & 0 deletions minigames/data/prophunt/functions/start/start.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c1a0592

Please sign in to comment.