Added new required addon: Skript-reflect
Added border mechanics and did some progress on the game loopmain
parent
29e972c489
commit
2dcd9ec74a
|
@ -43,6 +43,11 @@
|
||||||
# 40 za kill
|
# 40 za kill
|
||||||
# 10 za přežití
|
# 10 za přežití
|
||||||
|
|
||||||
|
# imports for Skript-reflect aka Java-skript :D
|
||||||
|
|
||||||
|
import:
|
||||||
|
org.bukkit.World
|
||||||
|
|
||||||
|
|
||||||
command /minigame_skybattle_start:
|
command /minigame_skybattle_start:
|
||||||
description: Zapni celou minihru skybattle
|
description: Zapni celou minihru skybattle
|
||||||
|
@ -103,6 +108,9 @@ command /minigame_skybattle_start:
|
||||||
|
|
||||||
if {skybattle::current_arena} is 1:
|
if {skybattle::current_arena} is 1:
|
||||||
set {skybattle::stop_players} to "True"
|
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(1, 1) #team, spawner
|
||||||
spawnteam(2, 2)
|
spawnteam(2, 2)
|
||||||
spawnteam(3, 3)
|
spawnteam(3, 3)
|
||||||
|
@ -116,29 +124,35 @@ command /minigame_skybattle_start:
|
||||||
|
|
||||||
if {skybattle::current_arena} is 2:
|
if {skybattle::current_arena} is 2:
|
||||||
set {skybattle::stop_players} to "True"
|
set {skybattle::stop_players} to "True"
|
||||||
spawnteam(1, 1)
|
execute console command "/scoreboard players set Kola XD 2"
|
||||||
spawnteam(2, 2)
|
setbordercenter()
|
||||||
spawnteam(3, 3)
|
changeborder(200, 1)
|
||||||
spawnteam(4, 4)
|
spawnteam(1, 8)
|
||||||
|
spawnteam(2, 6)
|
||||||
|
spawnteam(3, 7)
|
||||||
|
spawnteam(4, 1)
|
||||||
spawnteam(5, 5)
|
spawnteam(5, 5)
|
||||||
spawnteam(6, 6)
|
spawnteam(6, 4)
|
||||||
spawnteam(7, 7)
|
spawnteam(7, 2)
|
||||||
spawnteam(8, 8)
|
spawnteam(8, 3)
|
||||||
spawnteam(9, 9)
|
spawnteam(9, 10)
|
||||||
spawnteam(10, 10)
|
spawnteam(10, 9)
|
||||||
|
|
||||||
if {skybattle::current_arena} is 3:
|
if {skybattle::current_arena} is 3:
|
||||||
set {skybattle::stop_players} to "True"
|
set {skybattle::stop_players} to "True"
|
||||||
spawnteam(1, 1)
|
execute console command "/scoreboard players set Kola XD 3"
|
||||||
spawnteam(2, 2)
|
setbordercenter()
|
||||||
spawnteam(3, 3)
|
changeborder(200, 1)
|
||||||
spawnteam(4, 4)
|
spawnteam(1, 6)
|
||||||
spawnteam(5, 5)
|
spawnteam(2, 4)
|
||||||
spawnteam(6, 6)
|
spawnteam(3, 9)
|
||||||
|
spawnteam(4, 5)
|
||||||
|
spawnteam(5, 10)
|
||||||
|
spawnteam(6, 1)
|
||||||
spawnteam(7, 7)
|
spawnteam(7, 7)
|
||||||
spawnteam(8, 8)
|
spawnteam(8, 8)
|
||||||
spawnteam(9, 9)
|
spawnteam(9, 3)
|
||||||
spawnteam(10, 10)
|
spawnteam(10, 2)
|
||||||
|
|
||||||
if {skybattle::current_arena} is 4:
|
if {skybattle::current_arena} is 4:
|
||||||
set {skybattle::game_status} to "end"
|
set {skybattle::game_status} to "end"
|
||||||
|
@ -159,6 +173,8 @@ command /minigame_skybattle_start:
|
||||||
play sound "custom.cas2" at volume 50 to all players
|
play sound "custom.cas2" at volume 50 to all players
|
||||||
|
|
||||||
set {skybattle::stop_players} to "False"
|
set {skybattle::stop_players} to "False"
|
||||||
|
set {skybattle::game_status} to "playing"
|
||||||
|
changeborder(5, 240)
|
||||||
|
|
||||||
set {skybattle::timer} to {skybattle::time}
|
set {skybattle::timer} to {skybattle::time}
|
||||||
|
|
||||||
|
@ -166,7 +182,7 @@ command /minigame_skybattle_start:
|
||||||
|
|
||||||
if {skybattle::game_status} is "playing":
|
if {skybattle::game_status} is "playing":
|
||||||
send action bar "§4§lČas: §7%{skybattle::timer}%" to all players
|
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:
|
if {skybattle::timer} is 0:
|
||||||
|
@ -195,6 +211,20 @@ command /minigame_skybattle_start:
|
||||||
make console execute command "/function sky:battle"
|
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 <number>:
|
command /skybattle_setborder <number>:
|
||||||
description: Set center of border for map x
|
description: Set center of border for map x
|
||||||
usage: /skybattle_setborder <id of border/arena>
|
usage: /skybattle_setborder <id of border/arena>
|
||||||
|
@ -284,6 +314,8 @@ function spawnteam(team: number, spawner: number):
|
||||||
|
|
||||||
# !!! POPULATE INVENTORY !!!
|
# !!! POPULATE INVENTORY !!!
|
||||||
give loop-value iron pickaxe of efficiency 3
|
give loop-value iron pickaxe of efficiency 3
|
||||||
|
give loop-value stone sword
|
||||||
|
give loop-value 8 of steak
|
||||||
if {_team} is 1:
|
if {_team} is 1:
|
||||||
give loop-value 64 red concrete# named "§7Blocks"
|
give loop-value 64 red concrete# named "§7Blocks"
|
||||||
if {_team} is 2:
|
if {_team} is 2:
|
||||||
|
|
Loading…
Reference in New Issue