From 2dcd9ec74aabdf88cde88942378b1c28d32b2e61 Mon Sep 17 00:00:00 2001 From: Anorak_1 Date: Sat, 12 Nov 2022 21:43:05 +0100 Subject: [PATCH] Added new required addon: Skript-reflect Added border mechanics and did some progress on the game loop --- plugins/scripts/scripts/skybattle.sk | 68 ++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/plugins/scripts/scripts/skybattle.sk b/plugins/scripts/scripts/skybattle.sk index 45d86ef..cd79aea 100644 --- a/plugins/scripts/scripts/skybattle.sk +++ b/plugins/scripts/scripts/skybattle.sk @@ -43,6 +43,11 @@ # 40 za kill # 10 za přežití +# imports for Skript-reflect aka Java-skript :D + +import: + org.bukkit.World + command /minigame_skybattle_start: description: Zapni celou minihru skybattle @@ -103,6 +108,9 @@ command /minigame_skybattle_start: if {skybattle::current_arena} is 1: set {skybattle::stop_players} to "True" + execute console command "/scoreboard players set Kola XD 1" + setbordercenter() + changeborder(200, 1) spawnteam(1, 1) #team, spawner spawnteam(2, 2) spawnteam(3, 3) @@ -116,29 +124,35 @@ command /minigame_skybattle_start: if {skybattle::current_arena} is 2: set {skybattle::stop_players} to "True" - spawnteam(1, 1) - spawnteam(2, 2) - spawnteam(3, 3) - spawnteam(4, 4) + execute console command "/scoreboard players set Kola XD 2" + setbordercenter() + changeborder(200, 1) + spawnteam(1, 8) + spawnteam(2, 6) + spawnteam(3, 7) + spawnteam(4, 1) spawnteam(5, 5) - spawnteam(6, 6) - spawnteam(7, 7) - spawnteam(8, 8) - spawnteam(9, 9) - spawnteam(10, 10) + spawnteam(6, 4) + spawnteam(7, 2) + spawnteam(8, 3) + spawnteam(9, 10) + spawnteam(10, 9) if {skybattle::current_arena} is 3: set {skybattle::stop_players} to "True" - spawnteam(1, 1) - spawnteam(2, 2) - spawnteam(3, 3) - spawnteam(4, 4) - spawnteam(5, 5) - spawnteam(6, 6) + execute console command "/scoreboard players set Kola XD 3" + setbordercenter() + changeborder(200, 1) + spawnteam(1, 6) + spawnteam(2, 4) + spawnteam(3, 9) + spawnteam(4, 5) + spawnteam(5, 10) + spawnteam(6, 1) spawnteam(7, 7) spawnteam(8, 8) - spawnteam(9, 9) - spawnteam(10, 10) + spawnteam(9, 3) + spawnteam(10, 2) if {skybattle::current_arena} is 4: set {skybattle::game_status} to "end" @@ -159,6 +173,8 @@ command /minigame_skybattle_start: play sound "custom.cas2" at volume 50 to all players set {skybattle::stop_players} to "False" + set {skybattle::game_status} to "playing" + changeborder(5, 240) set {skybattle::timer} to {skybattle::time} @@ -166,7 +182,7 @@ command /minigame_skybattle_start: if {skybattle::game_status} is "playing": send action bar "§4§lČas: §7%{skybattle::timer}%" to all players - set {skybattle::timer} to {skybattle::timer} -1 + set {skybattle::timer} to {skybattle::timer} - 1 if {skybattle::timer} is 0: @@ -195,6 +211,20 @@ command /minigame_skybattle_start: make console execute command "/function sky:battle" +function setbordercenter(): + set {_x} to {skybattle::arena%{skybattle::current_arena}%::border}'s x coord + set {_z} to {skybattle::arena%{skybattle::current_arena}%::border}'s z coord + set {_w} to world("021") + set {_b} to {_w}.getWorldBorder() + {_b}.setDamageBuffer(0) + {_b}.setCenter({_x}, {_z}) + +function changeborder(size: number, time: number): + set {_w} to world("021") + set {_b} to {_w}.getWorldBorder() + {_b}.setSize({_size}, {_time}) + + command /skybattle_setborder : description: Set center of border for map x usage: /skybattle_setborder @@ -284,6 +314,8 @@ function spawnteam(team: number, spawner: number): # !!! POPULATE INVENTORY !!! give loop-value iron pickaxe of efficiency 3 + give loop-value stone sword + give loop-value 8 of steak if {_team} is 1: give loop-value 64 red concrete# named "§7Blocks" if {_team} is 2: