Skip to content

Commit

Permalink
Merge pull request #46 from Romitou/dev
Browse files Browse the repository at this point in the history
Multiples fixes
  • Loading branch information
Romain authored May 28, 2020
2 parents 24c6f2c + c998454 commit 4af3c53
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
2 changes: 2 additions & 0 deletions Wolfo/1-gui.sk
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ function wolfoMenuVote(role: text):
wolfoMenuVote({_role})
# DOCTOR -------------------------------------------
else if {_role} is "DOCTOR":
{wolfo::DOCTOR} != {_target}
make a gui slot {_loop} of {_voter} with {_target}'s skull named "&9%{_target}%" with lore "", "&7Protégez &b%{_target}%&7 du", "&7vote des &cLoup-Garous&7." and "" to run:
close {_voter}'s inventory
set {wolfo::timer} to 0
set {wolfo::results::DOCTOR} to {_target}
set {wolfo::DOCTOR} to {_target}
send join wolfoGetText("PREFIX.GENERAL", 1) and "Le joueur &b%{_target}%&f sera protégé." to {_voter}
# SEER -------------------------------------------
else if {_role} is "SEER" or "SEER_AURA":
Expand Down
4 changes: 2 additions & 2 deletions Wolfo/4-chat.sk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ on chat:
else:
send join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.MUTED", 2, player)
else:
broadcast "&8[&fJour&8] &7%player% &8» &7%message%"
send "&8[&fJour&8] &7%player% &8» &7%message%" to {wolfo::players::list::*}
else:
broadcast "&7%player% &8» &7%message%"
send "&7%player% &8» &7%message%" to {wolfo::players::list::*}
2 changes: 1 addition & 1 deletion Wolfo/5-main.sk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function wolfoJoin(p: player):

function wolfoLeave(p: player):
loop all players:
send join wolfoGetText("PREFIX.GENERAL", 1, loop-player), "&b%{_p}% ", wolfoGetText("MESSAGE.LEFT", 2, loop-player) and " &8(&7%amount of all players%&8/&75&8)" to loop-player
send join wolfoGetText("PREFIX.GENERAL", 1, loop-player), "&b%{_p}% ", wolfoGetText("MESSAGE.LEFT", 2, loop-player) and " &8(&7%amount of all players - 1%&8/&75&8)" to loop-player
wolfoSbPlayer({_p}, 1)
remove {_p} from {wolfo::role::list::%{wolfo::players::role_name::%{_p}%}%::*}
remove {_p} from {wolfo::players::list::*}
Expand Down
44 changes: 24 additions & 20 deletions Wolfo/7-game.sk
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ function wolfoResult() :: objects:
clear {_voted}
if {wolfo::results::WITCH} is true:
clear {_voted}
broadcast "&3&lWolfo &7&l▪ &f... la &aVoyante&f a aperçu un rôle %{wolfo::results::SEER}%&f..." if {wolfo::results::SEER} is set
broadcast "&3&lWolfo &7&l▪ &f... la &2Voyante Aura&f a aperçu une aura %{wolfo::results::SEER_AURA}%&f." if {wolfo::results::SEER_AURA} is set
send "&3&lWolfo &7&l▪ &f... la &aVoyante&f a aperçu un rôle %{wolfo::results::SEER}%&f..." to {wolfo::players::list::*} if {wolfo::results::SEER} is set
send "&3&lWolfo &7&l▪ &f... la &2Voyante Aura&f a aperçu une aura %{wolfo::results::SEER_AURA}%&f." to {wolfo::players::list::*} if {wolfo::results::SEER_AURA} is set
if {_voted} is set:
wolfoDebug("%{_voted}% was eliminated. (%{wolfo::players::role_name::%{_voted}%}%)")
broadcast "&3&lWolfo &7&l▪ &f... et &b%{_voted}%&f est &cmort&f. Son rôle était %{wolfo::players::role::%{_voted}%}%&f."
send "&3&lWolfo &7&l▪ &f... et &b%{_voted}%&f est &cmort&f. Son rôle était %{wolfo::players::role::%{_voted}%}%&f." to {wolfo::players::list::*}
clear {wolfo::results::*}
return {_voted}
else:
broadcast "&3&lWolfo &7&l▪ &f... et personne n'est mort !"
send "&3&lWolfo &7&l▪ &f... et personne n'est mort !" to {wolfo::players::list::*}
clear {wolfo::results::*}

function wolfoMostVoted() :: objects:
Expand Down Expand Up @@ -152,8 +152,9 @@ function wolfoMain(i: integer):
wolfoDebug("Vote of %loop-value-1% role.")
set {wolfo::vote::current} to loop-value-1
wolfoMenuVote(loop-value-1)
{wolfo::game::start} is true
set {wolfo::timer} to wolfoGetText("TIME.VOTE", 1) parsed as integer
while {wolfo::timer} is higher than 0:
while {wolfo::timer} is higher than or equal to 0:
loop {wolfo::players::list::*}:
set {_name} to wolfoGetText("ROLES.%loop-value-1%.NAME", 2, loop-value-2)
send action bar join "&8[&7%{wolfo::timer}%&8] &3Tour du rôle " and {_name} to loop-value-2
Expand Down Expand Up @@ -182,17 +183,18 @@ function wolfoMain(i: integer):
wolfoCheckWin()
{wolfo::game::start} is true
set {wolfo::timer} to wolfoGetText("TIME.DEBATE", 1) parsed as integer
while {wolfo::timer} is higher than 0:
while {wolfo::timer} is higher than or equal to 0:
wait 1 second
send action bar "&8[&7%{wolfo::timer}%&8] &3Discussion" to all players
remove 1 from {wolfo::timer}
clear {wolfo::vote::*}
clear {wolfo::results::*}
clear {wolfo::role::list::TOWNSFOLK::*}
{wolfo::game::start} is true
set {wolfo::vote::open} to true
wolfoDebug("Townsfolk vote open.")
set {wolfo::timer} to wolfoGetText("TIME.VOTE", 1) parsed as integer
while {wolfo::timer} is higher than 0:
while {wolfo::timer} is higher than or equal to 0:
wait 1 second
send action bar "&8[&7%{wolfo::timer}%&8] &3Vote des villageois" to all players
remove 1 from {wolfo::timer}
Expand All @@ -204,16 +206,17 @@ function wolfoMain(i: integer):
add {_target} and {_target} to {wolfo::vote::list::*}
close inventory of all players
clear {wolfo::role::list::TOWNSFOLK::*}
broadcast "&3&lWolfo &7&l▪ &fLe village s'est décidé ..."
{wolfo::game::start} is true
send "&3&lWolfo &7&l▪ &fLe village s'est décidé ..." to {wolfo::players::list::*}
set {_result::*} to wolfoMostVoted()
wolfoDebug("wolfoMain: %{_result::*}% was voted.")
# Dans tous les cas, si deux votes sont ex aequo, cette fonction
# retournera toujours quelque chose, faisant appel à l'aléatoire !
{_result::1} is not set:
broadcast "&3&lWolfo &7&l▪ &f... mais en fait non."
{_result::2} is not set:
send "&3&lWolfo &7&l▪ &f... mais en fait non." to {wolfo::players::list::*}
else:
# On parse as offline player pour garder la casse des pseudos.
broadcast "&3&lWolfo &7&l▪ &f... et élimine &b%{_result::1}%&f avec &6%{_result::2}% voix&f. Son rôle était %{wolfo::players::role::%{_result::1}%}%&f."
send "&3&lWolfo &7&l▪ &f... et élimine &b%{_result::1}%&f avec &6%{_result::2}% voix&f. Son rôle était %{wolfo::players::role::%{_result::1}%}%&f." to {wolfo::players::list::*}
{wolfo::players::role_name::%{_result::1}%} is "CRAZY":
wolfoCheckWin("CRAZY")
stop
Expand All @@ -224,7 +227,7 @@ function wolfoMain(i: integer):

function wolfoTimer(time: integer):
set {wolfo::timer} to {_time}
while {wolfo::timer} is not 0:
while {wolfo::timer} is higher than or equal to 0:
send action bar "&8[&7%{wolfo::timer}%&8] &3Décompte avant début" to all players
remove 1 from {wolfo::timer}
wait 1 second
Expand All @@ -246,8 +249,8 @@ function wolfoKill(p: player):
# si cette fonction ne fonctionne pas correctement, merci de nous
# signaler sur le forum ou sur Discord ! Merci !

function wolfoCheckWin(role: text = {_}):
{_role} is not set:
function wolfoCheckWin(role: text = ""):
{_role} is "":
if size of {wolfo::players::alive::*} is 0:
wolfoEnd()
else if size of {wolfo::players::alive::*} is 1:
Expand All @@ -261,17 +264,18 @@ function wolfoCheckWin(role: text = {_}):
wolfoSb({wolfo::players::list::*})
clear {wolfo::game::start}
loop {_winners::*}:
send title "&3&lWolfo &7&l▪" with subtitle "&aVous avez gagné !" to loop-value for 2 seconds
set {_role} to wolfoGetText("ROLES.%{wolfo::players::role_name::%loop-value%}%.NAME", 2, {_p})
broadcast "&3&lWolfo &7&l▪ &a%loop-value% &fa gagné la partie avec le rôle %{_role}%&f !"
send title "&3&lWolfo &7&l▪" with subtitle "&aVous avez gagné !" to loop-value-1 for 2 seconds
loop {wolfo::players::list::*}:
set {_role} to wolfoGetText("ROLES.%{wolfo::players::role_name::%loop-value-1%}%.NAME", 2, loop-value-2)
send "&3&lWolfo &7&l▪ &a%loop-value-1% &fa gagné la partie avec le rôle %{_role}%&f !" to {wolfo::players::list::*}
set {_players::*} to players
remove {_winners::*} from {_players::*}
loop {_players::*}:
send title "&3&lWolfo &7&l▪" with subtitle "&cVous avez perdu !" to loop-value for 2 seconds
send title "&3&lWolfo &7&l▪" with subtitle "&cVous avez perdu !" to loop-value-1 for 2 seconds
set {wolfo::timer} to 0
wait 1 second
wait 2 seconds # Sera amélioré prochainement.
set {wolfo::timer} to wolfoGetText("TIME.END", 1) parsed as integer
while {wolfo::timer} is higher than 0:
while {wolfo::timer} is higher than or equal to 0:
wait 1 second
send action bar "&8[&7%{wolfo::timer}%&8] &3Fermeture de la partie" to all players
remove 1 from {wolfo::timer}
Expand Down
6 changes: 3 additions & 3 deletions Wolfo/8-setup.sk
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ function wolfoMenuAction(p: player, loop: integer, action: text):
wolfoCheckStart({_p})
else if {_loop} is 13:
wolfoSetText("GAME.PRIVACY", "CLOSED")
broadcast join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.PRIVACY.CLOSED", 2, {_p})
send join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.PRIVACY.CLOSED", 2, {_p}) to {wolfo::players::list::*}
else if {_loop} is 14:
wolfoSetText("GAME.PRIVACY", "WHITELISTED")
broadcast join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.PRIVACY.WHITELISTED", 2, {_p})
send join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.PRIVACY.WHITELISTED", 2, {_p}) to {wolfo::players::list::*}
else if {_loop} is 15:
wolfoSetText("GAME.PRIVACY", "OPEN")
broadcast join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.PRIVACY.OPEN", 2, {_p})
send join wolfoGetText("PREFIX.GENERAL", 1) and wolfoGetText("MESSAGE.PRIVACY.OPEN", 2, {_p}) to {wolfo::players::list::*}
else:
if {_loop} is 11:
wolfoSetLoc("GAME.LOCATIONS.MIDDLE", position of {_p})
Expand Down

0 comments on commit 4af3c53

Please sign in to comment.