Compare commits

...

3 Commits

Author SHA1 Message Date
Anorak_1 5b852342b2 Added reset of all team and player
specific variables to gama_status "init"
2022-11-09 16:39:34 +01:00
Anorak_1 a3aae36ba7 Added some more stuff to main loop
Added plans for variables to implement
mainly in the main loop
2022-11-09 16:33:11 +01:00
Anorak_1 cb583be76e Added basic mechanics for setting up variables 2022-11-09 16:12:03 +01:00
1 changed files with 125 additions and 8 deletions

View File

@ -1,14 +1,38 @@
# border, spawny pro 3 různé lokace map, inventář
# skybattle::gaming_players::* - players in IDList1-10 [list of all players]
# skybattle::game_status - identifies game status [init, next, playing, end]
# skybattle::game_on - identifies if the game is playing [True, False]
# skybattle::intro - identifies if intro is playing rn [True, False]
# skybattle::stop_players - triggers a function that stops players from moving [True, False]
# skybattle::borders::border[1-3] - stores center of borders 1-3 [coords]
# skybattle::deadplayers::* - stores all dead players in current round [list of players]
# skybattle::current_arena - stores current round/arena [1-3]
# skybattle::introlocation - stores intro location [coords] ! must have barrier to stand on !
# skybattle::spectatorlocation[1-3] - stores location for spectators to spawn on [coords]
# skybattle::lobbylocation - stores location of lobby [coords]
# skybattle::current_arena - stores current round/arena [1-3]
# ---------------- Variables specific for each arena ----------------
# skybattle::arena:: - folder for all variables specific to each arena (border center, etc...)
# skybattle::arena[1-3]::spectatorlocation - stores location of spectator spawn [coords]
# skybattle::arena[1-3]::border - stores center location of border [coords]
# skybattle::arena[1-3]::spawn_location::* [1-10] - stores spawner locations [coords]
# ---------------- Variables specific for each team ----------------
# skybattle::team[1-10]:: - folders for all variables specific to each team (list of players, etc.)
# skybattle::team[1-10]::players - stores every player from team [list of players] - probably implemented on minigame startup
#! skybattle::team[1-10]::alive_players - list of players alive
#! skybattle::team[1-10]::alive_number - number of players alive in team [int]
#! skybattle::team[1-10]::kills - number of kills of the whole team [int]
# ---------------- Variables specific for each player ----------------
# skybattle::players::[player_uuid]:: - folder for all variables specific to players (kills, deaths, etc.)
#! skybattle::players::[player_uuid]::kills_number - number of kills of a player [int]
#! skybattle::players::[player_uuid]::deaths - number of deaths of a player
#! skybattle::players::[player_uuid]::kills_names - names of players killed
command /minigame_skybattle_start:
description: Zapni celou minihru skybattle
@ -21,6 +45,7 @@ command /minigame_skybattle_start:
loop 10 times:
loop entries of team "IDList%loop-number%":
add loop-value2 to {skybattle::gaming_players::*}
add loop-value2 to {skybattle::team%%loop-number::players::*}
broadcast "Načítám minihru Sky Battle"
send title "§2Sky Battle" to all players
set {skybattle::game_status} to "init"
@ -32,6 +57,20 @@ command /minigame_skybattle_start:
set gamemode of {skybattle::gaming_players::*} to adventure
teleport {skybattle::gaming_players::*} to {skybattle::introlocation}
set {skybattle::stop_players} to "True"
hide {skybattle::gaming_players::*}
wait 1 second
send "§e----------- Sky Battle -----------" to {gaming_players::*}
send " V této minihře máte za úkol §cpřežít§r a zabít co nejvíce svých §cprotivníků." to {gaming_players::*}
wait 10 seconds
reveal {skybattle::gaming_players::*}
set {skybattle::stop_players} to "False"
while {skybattle::game_on} is "True":
if {skybattle::game_status} is "init":
execute console command "/scoreboard players set MaxKolo XD 9"
resetplayers()
resetteams()
command /skybattle_setborder <number>:
description: Set center of border for map x
@ -39,18 +78,96 @@ command /skybattle_setborder <number>:
permission: skript.op
trigger:
if arg-1 is 1:
set {skybattle::borders::border1} to player's location
set {skybattle::arena1::border} to player's location
send "Border 1 set to your location" to player
else if arg-1 is 2:
set {skybattle::borders::border2} to player's location
set {skybattle::arena2::border} to player's location
send "Border 2 set to your location" to player
else if arg-1 is 3:
set {skybattle::borders::border3} to player's location
set {skybattle::arena3::border} to player's location
send "Border 3 set to your location" to player
else:
send "The only valid options for id of border are 1, 2, 3" to player
on death of player:
command /skybattle_setintroloc:
description: Set Intro location
permission: skript.op
trigger:
set {skybattle::introlocation} to player's location
send "Lokace Intra pro Sky Battle nastavena"
command /skybattle_setlobbyloc:
description: Set Lobby location
permission: skript.op
trigger:
set {skybattle::lobbylocation} to player's location
send "Lokace Lobby pro Sky Battle nastavena"
command /skybattle_setspectatorspawn <number>:
permission: skript.op
trigger:
if arg-1 is 1:
set {skybattle::arena1::spectatorlocation} to player's location
send "Spectator pro arenu 1 nastaven"
if arg-1 is 2:
set {skybattle::arena2::spectatorlocation} to player's location
send "Spectator pro arenu 2 nastaven"
if arg-1 is 3:
set {skybattle::arena3::spectatorlocation} to player's location
send "Spectator pro arenu 3 nastaven"
if arg-1 is not 1 or arg-1 is not 2 or arg-1 is not 3:
send "You need to specify arena 1-3"
command /skybattle_setspawner <number> <number>:
description: Set one of the spawn positions
usage: /skybattle_setspawner <arena id 1-3> <spawner id 1-10>
permission: skript.op
trigger:
if arg-2 < 11:
if arg-1 is 1:
set {skybattle::arena1::spawn_location::%arg-2%} to player's location
send "Set spawn location %arg-1%" to player
if arg-1 is 2:
set {skybattle::arena2::spawn_location::%arg-2%} to player's location
send "Set spawn location %arg-1%" to player
if arg-1 is 3:
set {skybattle::arena3::spawn_location::%arg-2%} to player's location
send "Set spawn location %arg-2% for Sky Battle" to player
if arg-1 is not 1 or arg-1 is not 2 or arg-1 is not 3:
send "You must specify arena 1-3"
if arg-2 < 0:
send "You must specify a number from 1-10"
if arg-2 > 10:
send "You can only set 10 spawn positions"
command /skybattle_listspawners <number>:
description: List all spawn positions for arena
permission: skript.op
trigger:
loop 10 times:
send "Spawn points for arena %arg-1%"
send "Spawn point %loop-number%:" to player
send {skybattle::arena%arg-1%::spawn_location::%loop-number%} to player
function spawnteam(team: integer, spawner: integer):
loop entries of team "IDList%{_team}%":
teleport loop-value to location at {skybattle::arena%{skybattle::current_arena}%::spawn_location::%{_spawner}%}
set loop-value's gamemode to adventure
# !!! POPULATE INVENTORY !!!
function resetteams():
loop 10 times:
clear {skybattle::team%loop-value%::*}
function resetplayers():
clear {skybattle::players::*}
on death of player: # victim, attacker
add victim's uuid to {skybattle::deadplayers::*}
launch ball large coloured yellow fading to light green and black at victim's location with duration 0
@ -58,7 +175,7 @@ on respawn:
if {skybattle::deadplayers::*} contains player's uuid:
clear player's inventory
set player's gamemode to spectator
teleport player to {skybattle::spectatorlocation%{skybattle::current_arena}%}
teleport player to {skybattle::arena%{skybattle::current_arena}%::spectatorlocation}
wait 20 ticks
set player's gamemode to adventure
set player's gamemode to spectator