intégration deacoudre à la commande /party

This commit is contained in:
Mylloon 2021-06-28 14:04:44 +02:00
parent 2b86363c28
commit 4b59075402
2 changed files with 27 additions and 23 deletions

View file

@ -2,36 +2,37 @@ command deacoudre: # lancement de la partie
executable by: players executable by: players
description: Lance une partie de dé à coudre. description: Lance une partie de dé à coudre.
trigger: trigger:
if player is op: if {party.player.%uuid of player%} is set:
if {thimble} is true: if {thimble} is true:
delete {thimble} delete {thimble}
teleport player to location at 101.5, 83, -314 in world "world" teleport player to location at 101.5, 83, -314 in world "world"
execute player command "fill 103 57 -313 99 57 -305 water" execute player command "fill 103 57 -313 99 57 -305 water"
broadcast "&cPartie de dé à coudre terminée." loop {party.list::*}:
set gamemode of all players to creative send "&cPartie de dé à coudre terminée." to loop-value
set gamemode of loop-value to creative
else: else:
set {thimble} to true set {thimble} to true
broadcast "&aDémarrage de la partie de dé à coudre !" loop {party.list::*}:
loop all players: send "&aDémarrage de la partie de dé à coudre !" to loop-value
teleport loop-player to location at 101.5, 83, -314 in world "world" teleport loop-value to location at 101.5, 83, -314 in world "world"
set gamemode of loop-player to adventure set gamemode of loop-value to adventure
feed loop-player feed loop-value
heal loop-player heal loop-value
cure loop-player cure loop-value
else: else:
send option("errorMessage") send "&4Tu n'es pas dans une partie."
every 0.5 second in "world": # pose du bloc et téléporatation every 0.5 second in "world": # pose du bloc et téléporatation
if {thimble} is not true: if {thimble} is not true:
stop stop
loop all players: loop {party.list::*}:
set action bar of loop-player to "&dEn partie de &lDé à coudre&r&d." set action bar of loop-value to "&dEn partie de &lDé à coudre&r&d."
if block at loop-player is water: if block at loop-value is water:
set {_xLocationBlock1} to difference between X-location of block at loop-player and 103.5 set {_xLocationBlock1} to difference between X-location of block at loop-value and 103.5
set {_xLocationBlock2} to difference between X-location of block at loop-player and 99.5 set {_xLocationBlock2} to difference between X-location of block at loop-value and 99.5
set {_zLocationBlock1} to difference between Z-location of block at loop-player and -312.5 set {_zLocationBlock1} to difference between Z-location of block at loop-value and -312.5
set {_zLocationBlock2} to difference between Z-location of block at loop-player and -304.5 set {_zLocationBlock2} to difference between Z-location of block at loop-value and -304.5
set {_yLocationBlock} to difference between Y-location of block at loop-player and 57.5 set {_yLocationBlock} to difference between Y-location of block at loop-value and 57.5
if {_xLocationBlock1} and {_xLocationBlock2} and {_zLocationBlock1} and {_zLocationBlock2} <= 0: if {_xLocationBlock1} and {_xLocationBlock2} and {_zLocationBlock1} and {_zLocationBlock2} <= 0:
continue continue
if {_xLocationBlock1} and {_xLocationBlock2} >= 4: if {_xLocationBlock1} and {_xLocationBlock2} >= 4:
@ -40,7 +41,7 @@ every 0.5 second in "world": # pose du bloc et téléporatation
continue continue
if {_zLocationBlock1} and {_zLocationBlock2} >= 8: if {_zLocationBlock1} and {_zLocationBlock2} >= 8:
continue continue
set block at loop-player to wool set block at loop-value to wool
teleport loop-player to location at 101.5, 83, -314 in world "world" teleport loop-value to location at 101.5, 83, -314 in world "world"
feed loop-player feed loop-value
heal loop-player heal loop-value

View file

@ -31,6 +31,7 @@ command party [<player>] [<text>]: # commande party
send "%player%&c a quitté la partie." to loop-value send "%player%&c a quitté la partie." to loop-value
remove player from {party.list::*} remove player from {party.list::*}
send "&cTu as quitté la partie." send "&cTu as quitté la partie."
stop
else: else:
send "&4Tu n'es pas dans la partie." send "&4Tu n'es pas dans la partie."
stop stop
@ -50,6 +51,8 @@ command party [<player>] [<text>]: # commande party
if arg-2 is "delete": if arg-2 is "delete":
if player is {party.creator}: if player is {party.creator}:
if {party} is set: if {party} is set:
if {thimble} is true:
execute player command "deacoudre"
loop {party.list::*}: loop {party.list::*}:
delete {party.player.%uuid of loop-value%} delete {party.player.%uuid of loop-value%}
send "&cPartie supprimée." to loop-value send "&cPartie supprimée." to loop-value