Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- SYSTEM_PREFIX: &7》
- GAME_PREFIX: &9》
- MATCH_TIME: 120
- STICK_TIME: 30
- SHOWDOWN_TIME: 60
- DEATHMATCH_TIME: 90
- CHEST_ROWS: 6
- command /sumoadm [<text>] [<text>]:
- permission: admin
- permission message: §7》 §c必要な権限を持っていません
- trigger:
- if arg 1 is "waitingpoint":
- set {stage.waitingPoint} to location of player
- message "{@SYSTEM_PREFIX}&7待機場所を&a%location of player%&7に設定しました"
- else if arg 1 is "lobby":
- set {lobby} to location of player
- message "{@SYSTEM_PREFIX}&7ロビーを&a%location of player%&7に設定しました"
- else if arg 1 is "standpoint":
- if arg 2 is "A":
- set {stage.standPoint::A} to location of player
- message "{@SYSTEM_PREFIX}&7プレイヤー&eA&7のスタート地点を&a%location of player%&7に設定しました"
- else if arg 2 is "B":
- set {stage.standPoint::B} to location of player
- message "{@SYSTEM_PREFIX}&7プレイヤー&eB&7のスタート地点を&a%location of player%&7に設定しました"
- else:
- message "&c使用方法: /sumoadm standpoint <A / B>"
- else if arg 1 is "start":
- clear {game.result::*}
- clear {game.firstJoiners::*}
- clear {game.totalRateChange::*}
- clear {game.matchTime}
- set {game.isStarted} to true
- clear inventory of {game.joiners::*}
- teleport {game.joiners::*} to {stage.waitingpoint}
- set {game.mode} to "RANKED"
- loop {game.joiners::*}:
- add loop-value to {game.firstJoiners::*}
- set slot 4 of player to nether star named "&e総当たり表を確認する"
- loop {game.joiners::*}:
- if loop-value-1 is not loop-value-2:
- set {game.result::%loop-value-1%::%loop-value-2%} to "NONE"
- else:
- set {game.result::%loop-value-1%::%loop-value-2%} to "MYSELF"
- gameLoop()
- else if arg 1 is "stop":
- loop {game.joiners::*}:
- clear inventory of loop-value
- set slot 4 of loop-value to slimeball named "&a参加する"
- teleport {game.joiners::*} to {lobby}
- clear {game.joiners::*}
- clear {game.firstJoiners::*}
- clear {game.result::*}
- clear {game.totalRateChange::*}
- set {game.isStarted} to false
- command /join:
- trigger:
- if {game.joiners::*} doesn't contain player:
- if {game.isStarted} is false:
- add player to {game.joiners::*}
- play sound "UI_BUTTON_CLICK" to player with volume 1 and pitch 8
- broadcast "{@GAME_PREFIX}&e%player%&7がゲームに参加しました"
- else:
- message "{@GAME_PREFIX}&c既に開始しています"
- else:
- message "{@GAME_PREFIX}&c既に参加しています"
- command /evaluate <text>:
- permission: admin
- trigger:
- evaluate "%arg%"
- command /oi <text> <integer> <integer>:
- executable by: console
- trigger:
- openTable(arg 1 parsed as player, arg 2, arg 3)
- on drop:
- cancel event
- on damage:
- if {game.isStarted} is false:
- cancel event
- else if {game.joiners::*} doesn't contain victim:
- cancel event
- else if {game.isMatching::%attacker%} is false:
- cancel event
- else if {game.isMatching::%victim%} is false:
- cancel event
- else if "%damage cause%" is "void":
- set {_list::*} to getMatchingPlayers()
- remove victim from {_list::*}
- finishMatch(getSinglePlayer({_list::*}), victim, "O")
- else if {game.moveable} is false:
- cancel event
- else if {game.harmable} is false:
- heal victim
- else:
- if damage cause is projectile:
- set damage to damage * 0.3
- else if damage cause is attack:
- set damage to damage * 0.6
- else:
- cancel event
- on death:
- if {game.isMatching::%victim%} is true:
- heal victim
- set {_list::*} to getMatchingPlayers()
- remove victim from {_list::*}
- finishMatch(getSinglePlayer({_list::*}), victim, "O")
- on quit:
- set the quit message to "{@SYSTEM_PREFIX}&6%player%&7が退出しました"
- if {game.joiners::*} contains player:
- if {game.isStarted} is true:
- remove player from {game.joiners::*}
- if {game.isMatching::%player%} is true:
- set {_list::*} to getMatchingPlayers()
- remove player from {_list::*}
- finishMatch(getSinglePlayer({_list::*}), player, "O")
- loop {game.result::%player%::*}:
- set {game.result::%player%::%loop-index%} to "LOSE"
- set {game.result::%loop-index%::%player%} to "WIN"
- on join:
- set the join message to "{@SYSTEM_PREFIX}&6%player%&7がサーバーに参加しました"
- if {stats.rate::%uuid of player%} is not set:
- set {stats.rate::%uuid of player%} to 5000
- if {stats.playedTimes::%uuid of player%} is not set:
- set {stats.playedTimes::%uuid of player%} to 0
- clear player's inventory
- set slot 4 of player to 1 of slimeball named "&a参加する"
- on chat:
- cancel event
- broadcast "&e%player%&f》 %message%"
- on rightclick:
- if tool of player is nether star named "&e総当たり表を確認する":
- if {game.joiners::*} contains player:
- openTable(player, 1, 1)
- else:
- message "{@GAME_PREFIX}&cそのアイテムは参加者以外は使えません"
- else if tool of player is slimeball:
- make player execute command "join"
- function getSinglePlayer(p: players) :: player:
- loop {_p::*}:
- if loop-value is set:
- return loop-value
- function openTable(player: player, pageX: integer, pageY: integer):
- open chest with {@CHEST_ROWS} rows named "総当たり表(%{_pageX}%, %{_pageY}%)" to {_player}
- wait a tick
- set {_a} to 0
- loop {game.firstJoiners::*}:
- add 1 to {_a}
- if floor(({_a} - 1) / 6) + 1 is {_pageX}:
- set {_slot} to mod(({_a} - 1), 6) + 2
- format slot {_slot} of {_player} with skull of loop-value named "&c%loop-value%" with lore "&f" and "&7レート: &a%{stats.rate::%uuid of loop-value%}%" to be unstealable
- if floor(({_a} - 1) / ({@CHEST_ROWS} - 1)) + 1 is {_pageY}:
- set {_slot} to ((mod(({_a} - 1), ({@CHEST_ROWS} - 1)) + 1) * 9) + 1
- format slot {_slot} of {_player} with skull of loop-value named "&e%loop-value%" with lore "&f" and "&7レート: &a%{stats.rate::%uuid of loop-value%}%" to be unstealable
- set {_b} to 0
- loop {game.firstJoiners::*}:
- add 1 to {_b}
- set {_value2} to loop-value-2
- set {_value1} to loop-value-1
- if floor(({_b} - 1) / 6) + 1 is {_pageX}:
- set {_slot} to (mod({_a} - 1, {@CHEST_ROWS} - 1) + 1) * 9 + 2 + mod({_b} - 1, 6)
- #broadcast "1: %loop-value-1% 2: %loop-value-2% slot: %{_slot}%"
- if loop-value-1 is not loop-value-2:
- if {game.result::%loop-value-1%::%loop-value-2%} is "WIN":
- format slot {_slot} of {_player} with 1 of white stained glass pane named "&e%loop-value-1%" with lore "&f" and "&f&l勝利" to be unstealable
- else if {game.result::%loop-value-1%::%loop-value-2%} is "LOSE":
- format slot {_slot} of {_player} with 1 of black stained glass pane named "&e%loop-value-1%" with lore "&f" and "&0&l敗北" to be unstealable
- else if {game.result::%loop-value-1%::%loop-value-2%} is "DRAW":
- format slot {_slot} of {_player} with 1 of light gray stained glass pane named "&e%loop-value-1%" with lore "&f" and "&7&l引き分け" to be unstealable
- else if {game.result::%loop-value-1%::%loop-value-2%} is "NONE":
- format slot {_slot} of {_player} with 1 of glass pane named "&e%loop-value-1%" with lore "&f" and "&7&lまだ試合が行われていません" to be unstealable
- else:
- format slot {_slot} of {_player} with 1 of barrier named "&c" to be unstealable
- else:
- format slot {_slot} of {_player} with 1 of barrier named "&c" to be unstealable
- if {_pageY} > 1:
- format slot 0 of {_player} with 1 arrow named "&e上ページへ行く" to run "oi %{_player}% %{_pageX}% %{_pageY} - 1%"
- if {_pageX} > 1:
- format slot 27 of {_player} with 1 arrow named "&e左ページへ行く" to run "oi %{_player}% %{_pageX} - 1% %{_pageY}%"
- if {_pageY} < floor((size of {game.firstJoiners::*} - 1) / ({@CHEST_ROWS} - 1)) + 1:
- format slot 53 of {_player} with 1 arrow named "&e下ページへ行く" to run "oi %{_player}% %{_pageX}% %{_pageY} + 1%"
- if {_pageX} < floor((size of {game.firstJoiners::*} - 1) / 6) + 1:
- format slot 26 of {_player} with 1 arrow named "&e右ページへ行く" to run "oi %{_player}% %{_pageX} + 1% %{_pageY}%"
- function gameLoop():
- set {_isGameFinished} to true
- loop {game.joiners::*}:
- if {game.result::%loop-value%::*} contains "NONE":
- set {_isGameFinished} to false
- exit a loop
- if {_isGameFinished} is true:
- wait 1 second
- finishGame()
- else:
- makeMatch()
- function finishGame():
- message "{@GAME_PREFIX}&7すべての試合が終了しました" to {game.joiners::*}
- play sound "ENTITY_ENDERDRAGON_AMBIENT" to {game.joiners::*} with volume 1 and pitch 7
- clear {_data::*}
- loop {game.firstJoiners::*}:
- set {_wins} to 0
- set {_loses} to 0
- loop {game.result::%loop-value%::*}:
- if loop-value-2 is "WIN":
- add 1 to {_wins}
- else if loop-value-2 is "LOSE":
- add 1 to {_loses}
- set {_data::%loop-value%::wins} to {_wins}
- set {_data::%loop-value%::loses} to {_loses}
- loop {game.firstJoiners::*}:
- set {_point} to {_data::%loop-value%::wins} - {_data::%loop-value%::loses}
- broadcast "%loop-value% : %{_point}%"
- set {_place} to 1
- loop {game.firstJoiners::*}:
- set {_comparedPoint} to {_data::%loop-value-2%::wins} - {_data::%loop-value-2%::loses}
- if {_point} < {_comparedPoint}:
- add 1 to {_place}
- set {_data::%loop-value%::place} to {_place}
- loop {game.joiners::*}:
- send loop-value title "&a---- GAME END ----" with subtitle "&eあなたは &6&l##%{_data::%loop-value%::place}%&eでした" for 3 seconds
- message "&7----------------------------" to {game.joiners::*}
- message "&f" to {game.joiners::*}
- message "{@GAME_PREFIX}&a&l最終結果" to {game.joiners::*}
- message "&f" to {game.joiners::*}
- set {_number} to 1
- loop size of {game.firstJoiners::*} times:
- loop {game.firstJoiners::*}:
- if {_number} is {_data::%loop-value-2%::place}:
- message "{@GAME_PREFIX}&e&l##%{_number}% &6%loop-value-2% &7(&f%{_data::%loop-value-2%::wins}%&7勝 &0%{_data::%loop-value-2%::loses}%&7敗)" to {game.joiners::*}
- add 1 to {_number}
- message "&f" to {game.joiners::*}
- message "&7----------------------------" to {game.joiners::*}
- if {game.mode} is "RANKED":
- message "&7----------------------------" to {game.joiners::*}
- message "&f" to {game.joiners::*}
- message "{@GAME_PREFIX}&a&lレート変動" to {game.joiners::*}
- message "&f" to {game.joiners::*}
- loop {game.firstJoiners::*}:
- if {game.totalRateChange::%loop-value%} < 0:
- message "{@GAME_PREFIX}&6%loop-value% &e%{stats.rate::%uuid of loop-value%}% &f> &c%{game.totalRateChange::%loop-value%}% &f> &4&l%{stats.rate::%uuid of loop-value%} + {game.totalRateChange::%loop-value%}%" to {game.joiners::*}
- else if {game.totalRateChange::%loop-value%} > 0:
- message "{@GAME_PREFIX}&6%loop-value% &e%{stats.rate::%uuid of loop-value%}% &f> &b+%{game.totalRateChange::%loop-value%}% &f> &9&l%{stats.rate::%uuid of loop-value%} + {game.totalRateChange::%loop-value%}%" to {game.joiners::*}
- else:
- message "{@GAME_PREFIX}&6%loop-value% &e%{stats.rate::%uuid of loop-value%}% &f> &a±0 &f> &f&l%{stats.rate::%uuid of loop-value%} + {game.totalRateChange::%loop-value%}%" to {game.joiners::*}
- add {game.totalRateChange::%loop-value%} to {stats.rate::%uuid of loop-value%}
- add 1 to {stats.playedTimes::%uuid of loop-value%}
- message "&f" to {game.joiners::*}
- message "&7----------------------------" to {game.joiners::*}
- command "sumoadm stop"
- function makeMatch():
- set {_a} to random element out of {game.joiners::*}
- while {game.result::%{_a}%::*} doesn't contain "NONE":
- set {_a} to random element out of {game.joiners::*}
- while 1 is 1:
- if {_a} is not {_b}:
- if {game.result::%{_b}%::%{_a}%} is "NONE":
- exit a loop
- else:
- set {_b} to random element out of {game.joiners::*}
- else:
- set {_b} to random element out of {game.joiners::*}
- loop random integer between 5 and 20 times:
- play sound "ENTITY_EXPERIENCE_ORB_PICKUP" to {game.joiners::*} with volume 1 and pitch 8
- send {game.joiners::*} title "&e%random element out of {game.joiners::*}% &8> vs < &e%random element out of {game.joiners::*}%" with subtitle "&7抽選中です..." for 2 seconds
- wait 4 ticks
- set {_list::*} to {game.joiners::*}
- remove {_a} and {_b} from {_list::*}
- play sound "ENTITY_PLAYER_LEVELUP" to {game.joiners::*} with volume 1 and pitch 1
- send {_a} title "&6&l%{_a}% &8> vs < &e%{_b}%" with subtitle "&a試合に出場します" for 4 seconds
- message "{@GAME_PREFIX}&6&l%{_a}% &8> vs < &e%{_b}%" to {_a}
- send {_b} title "&e%{_a}% &8> vs < &6&l%{_b}%" with subtitle "&a試合に出場します" for 4 seconds
- message "{@GAME_PREFIX}&e%{_a}% &8> vs < &6&l%{_b}%" to {_b}
- send {_list::*} title "&e%{_a}% &8> vs < &e%{_b}%" with subtitle "&7試合を観戦します" for 4 seconds
- message "{@GAME_PREFIX}&e%{_a}% &8> vs < &e%{_b}%" to {_list::*}
- wait 3 seconds
- startMatch({_a}, {_b})
- function changeTablist(p: player):
- set {_u} to uuid of {_p}
- set tablist name of {_p} to "&7[%{stats.rate::%{_u}%}%]"
- function startMatch(a: player, b: player):
- set {game.isMatching::%{_a}%} to true
- set {game.isMatching::%{_b}%} to true
- set {game.matching} to false
- set {game.harmable} to false
- set {game.moveable} to false
- set {game.stopMatch} to false
- set {game.matchTime} to 0
- teleport {_a} to {stage.standPoint::A}
- teleport {_b} to {stage.standPoint::B}
- clear inventory of getMatchingPlayers()
- set {_str} to "%random number between 0.9 and 4.0% seconds"
- set {_wait} to {_str} parsed as time span
- send getMatchingPlayers() title "&8---- &8&lREADY &8----" with subtitle "&f" for {_wait}
- wait {_wait}
- send getMatchingPlayers() title "&8---! &6&lFIGHT &8!---" with subtitle "&f" for {_wait}
- set {game.moveable} to true
- loop {@MATCH_TIME} times:
- wait 1 second
- add 1 to {game.matchTime}
- if {game.matchTime} is {@STICK_TIME}:
- giveStick()
- else if {game.matchTime} is {@SHOWDOWN_TIME}:
- showDown()
- else if {game.matchTime} is {@DEATHMATCH_TIME}:
- deathMatch()
- if {game.stopMatch} is true:
- stop
- finishMatch({_a}, {_b}, "X")
- function giveStick():
- give stick of sharpness 2 and knockback 1 named "&6タオルの腕" to be unbreakable to getMatchingPlayers()
- function showDown():
- send {game.joiners::*} title "&8--!! &c&lSHOWDOWN &8!!--" with subtitle "&7弓矢が使用可能になった" for 2 seconds
- message "{@GAME_PREFIX}&cショーダウン!!" to {game.joiners::*}
- give bow of infinity 1 and punch 1 named "&6タオルの胸" to be unbreakable to getMatchingPlayers()
- give arrow named "&7タオルの脚" to getMatchingPlayers()
- function deathMatch():
- send {game.joiners::*} title "&8-!!! &4&lDEATHMATCH &8!!!-" with subtitle "&7ダメージを受けるようになった" for 2 seconds
- message "{@GAME_PREFIX}&4デスマッチ!!!" to {game.joiners::*}
- set {game.harmable} to true
- function finishMatch(winner: player, loser: player, xo: text):
- if {_xo} is "X":
- send {game.joiners::*} title "&8--- &a&lDRAW &8---" with subtitle "&7時間切れ" for 4 seconds
- set {game.result::%{_winner}%::%{_loser}%} to "DRAW"
- set {game.result::%{_loser}%::%{_winner}%} to "DRAW"
- else if {_xo} is "O":
- send {game.joiners::*} title "&8--- &7WINNER: &6&l%{_winner}% &8---" with subtitle "&7試合時間: &6%{game.matchTime}%&7秒" for 4 seconds
- message "{@SYSTEM_PREFIX}&6%{_winner}% &e》 勝利 》 &8%{_loser}%" to {game.joiners::*}
- set {_UUIDOfWinner} to uuid of {_winner}
- set {_UUIDOfLoser} to uuid of {_loser}
- set {game.result::%{_winner}%::%{_loser}%} to "WIN"
- set {game.result::%{_loser}%::%{_winner}%} to "LOSE"
- add 1 to {stats.aganist::%{_UUIDOfLoserWinner}%::%{_UUIDOfLoser}%::wins}
- add 1 to {stats.aganist::%{_UUIDOfLoser}%::%{_UUIDOfLoserWinner}%::loses}
- if {game.mode} is "RANKED":
- set {_x} to {stats.rate::%{_UUIDOfWinner}%} - {stats.rate::%{_UUIDOfLoser}%}
- add getRateChange({_x}) * 1 to {game.totalRateChange::%{_winner}%}
- add getRateChange({_x}) * -1 to {game.totalRateChange::%{_loser}%}
- set {game.matching} to false
- set {game.moveable} to false
- set {game.harmable} to false
- set {game.stopMatch} to true
- loop getMatchingPlayers():
- heal loop-value
- clear loop-value's inventory
- set slot 4 of loop-value to nether star named "&e総当たり表を確認する"
- teleport loop-value to {stage.waitingPoint}
- set {game.isMatching::%loop-value%} to false
- wait 1.5 seconds
- gameLoop()
- function getMatchingPlayers() :: players:
- clear {_temp::*}
- loop {game.joiners::*}:
- if {game.isMatching::%loop-value%} is true:
- add loop-value to {_temp::*}
- return {_temp::*}
- function getRateChange(val: number) :: integer:
- if {_val} > 6590:
- return 0
- else if {_val} > 4999:
- return 1
- else if {_val} > 3963:
- return 2
- else if {_val} > 3233:
- return 3
- else if {_val} > 2671:
- return 4
- else if {_val} > 2212:
- return 5
- else if {_val} > 1819:
- return 6
- else if {_val} > 1476:
- return 7
- else if {_val} > 1168:
- return 8
- else if {_val} > 889:
- return 9
- else if {_val} > 633:
- return 10
- else if {_val} > 395:
- return 11
- else if {_val} > 174:
- return 12
- else if {_val} > -34:
- return 13
- else if {_val} > -231:
- return 14
- else if {_val} > -418:
- return 15
- else if {_val} > -596:
- return 16
- else if {_val} > -767:
- return 17
- else if {_val} > -931:
- return 18
- else if {_val} > -1090:
- return 19
- else if {_val} > -1243:
- return 20
- else if {_val} > -1392:
- return 21
- else if {_val} > -1536:
- return 22
- else if {_val} > -1676:
- return 23
- else if {_val} > -1813:
- return 24
- else if {_val} > -1946:
- return 25
- else if {_val} > -2076:
- return 26
- else if {_val} > -2203:
- return 27
- else if {_val} > -2329:
- return 28
- else if {_val} > -2450:
- return 29
- else if {_val} > -2569:
- return 30
- else if {_val} > -2687:
- return 31
- else if {_val} > -2803:
- return 32
- else if {_val} > -2915:
- return 33
- else if {_val} > -3027:
- return 34
- else if {_val} > -3136:
- return 35
- else if {_val} > -3245:
- return 36
- else if {_val} > -3353:
- return 37
- else if {_val} > -3456:
- return 38
- else if {_val} > -3557:
- return 39
- else if {_val} > -3682:
- return 40
- else if {_val} > -3760:
- return 41
- else if {_val} > -3861:
- return 42
- else if {_val} > -3959:
- return 43
- else if {_val} > -4055:
- return 44
- else if {_val} > -4150:
- return 45
- else if {_val} > -4252:
- return 46
- else if {_val} > -4344:
- return 47
- else if {_val} > -4443:
- return 48
- else if {_val} > -4525:
- return 49
- else if {_val} > -4608:
- return 50
- else if {_val} > -4697:
- return 51
- else if {_val} > -4804:
- return 52
- else if {_val} > -4895:
- return 53
- else if {_val} > -4958:
- return 54
- else if {_val} > -5050:
- return 55
- else if {_val} > -5133:
- return 56
- else if {_val} > -5252:
- return 57
- else if {_val} > -5301:
- return 58
- else if {_val} > -5419:
- return 59
- else if {_val} > -5487:
- return 60
- else if {_val} > -5551:
- return 61
- else if {_val} > -5641:
- return 62
- else if {_val} > -5723:
- return 63
- else if {_val} > -5793:
- return 64
- else if {_val} > -5882:
- return 65
- else if {_val} > -5966:
- return 66
- else if {_val} > -6046:
- return 67
- else if {_val} > -6117:
- return 68
- else if {_val} > -6208:
- return 69
- else if {_val} > -6299:
- return 70
- else if {_val} > -6341:
- return 71
- else if {_val} > -6420:
- return 72
- else if {_val} > -6504:
- return 73
- else if {_val} > -6596:
- return 74
- else if {_val} > -6691:
- return 75
- else if {_val} > -6728:
- return 76
- else if {_val} > -6834:
- return 77
- else if {_val} > -6912:
- return 78
- else if {_val} > -7017:
- return 79
- else if {_val} > -7066:
- return 80
- else if {_val} > -7204:
- return 81
- else if {_val} > -7286:
- return 82
- else if {_val} > -7324:
- return 83
- else if {_val} > -7427:
- return 84
- else if {_val} > -7495:
- return 85
- else if {_val} > -7534:
- return 86
- else if {_val} > -7631:
- return 87
- else if {_val} > -7708:
- return 88
- else if {_val} > -7784:
- return 89
- else if {_val} > -7834:
- return 90
- else if {_val} > -8011:
- return 91
- else if {_val} > -8109:
- return 92
- else if {_val} > -8133:
- return 93
- else if {_val} > -8216:
- return 94
- else if {_val} > -8275:
- return 95
- else if {_val} > -8411:
- return 96
- else if {_val} > -8505:
- return 97
- else if {_val} > -8615:
- return 98
- else if {_val} > -8764:
- return 99
- else if {_val} > -8844:
- return 100
- else if {_val} > -8936:
- return 101
- else if {_val} > -9054:
- return 102
- else if {_val} > -9144:
- return 103
- else if {_val} > -9240:
- return 104
- else if {_val} > -9349:
- return 105
- else if {_val} > -9472:
- return 106
- else if {_val} > -9582:
- return 107
- else if {_val} > -9693:
- return 108
- else if {_val} > -9845:
- return 109
- else if {_val} > -9959:
- return 110
- else:
- return 111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement