Advertisement
SUPERFIRE777

ギャンブルシステム/SUPERFIRESERVER

May 15th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. options:
  2. CurrencySingularForm: 炎
  3. CurrencyPluralForm: 炎
  4. function RegularMoneyNotation(number: number) :: text:
  5. if {_number} is 1:
  6. return "%{_number}%{@CurrencySingularForm}"
  7. else:
  8. return "%{_number}%{@CurrencyPluralForm}"
  9. function mod(a: number, b: number) :: number:
  10. return {_a} - floor({_a} / {_b}) * {_b}
  11. command /bet <number>:
  12. usage: /bet <賭け金>
  13. trigger:
  14. if {%player%.betted} isn't set:
  15. set {%player%.betted} to false
  16. if {%player%.betted} is false:
  17. if arg is more than player's money:
  18. message "【ベットシステム】この金額はベット出来ません。所持金以下にしてください。(所持金:%player's money%)"
  19. else if arg is less than 0:
  20. message "【ベットシステム】この金額はベット出来ません。正の数にして下さい。(入力値:%arg%)"
  21. else:
  22. set {%player%.betMoney} to arg
  23. remove arg from player's money
  24. set {%player%.betted} to true
  25. message "【ベットシステム】%RegularMoneyNotation({%player%.betMoney})%のベットに成功しました。"
  26. else:
  27. message "【ベットシステム】あなたは既にベットしています。"
  28. command /checkbet:
  29. trigger:
  30. if {%player%.betted} is true:
  31. message "【ベットシステム】あなたは既に%RegularMoneyNotation({%player%.betMoney})%ベットしています。"
  32. else:
  33. message "【ベットシステム】/betでベットしてください。"
  34. command /resetbet:
  35. trigger:
  36. add {%player%.betMoney} to player's money
  37. set {%player%.betMoney} to 0
  38. set {%player%.betted} to false
  39. message "【ベットシステム】ベットをリセットしました。"
  40. command /tyouhan <text>:
  41. usage: /tyouhan <丁|半>
  42. trigger:
  43. if {%player%.betted} is true:
  44. if arg is "丁" or "半":
  45. set {%player%.dice::1} to random integer between 1 and 6
  46. set {%player%.dice::2} to random integer between 1 and 6
  47. set {%player%.total} to {%player%.dice::1} + {%player%.dice::2}
  48. if mod({%player%.total}, 2) is 0:
  49. set {%player%.tyouhan} to "丁"
  50. else:
  51. set {%player%.tyouhan} to "半"
  52. message "【丁半】%{%player%.dice::1}%+%{%player%.dice::2}%=%{%player%.total}%(%{%player%.tyouhan}%)"
  53. if {%player%.tyouhan} is arg:
  54. add {%player%.betMoney} * 2 to player's money
  55. message "【丁半】当たり!"
  56. message "【丁半】%RegularMoneyNotation({%player%.betMoney} * 2)%獲得しました!"
  57. else:
  58. message "【丁半】外れ…。"
  59. set {%player%.betted} to false
  60. else:
  61. message "【丁半】丁か半で入力してください。"
  62. else:
  63. message "【丁半】先に/betコマンドでベットして下さい。"
  64. command /dicehit <integer>:
  65. usage: /dicehit <賭ける数 2-12>
  66. trigger:
  67. if {%player%.betted} is true:
  68. set {%player%.dice::1} to random integer between 1 and 6
  69. set {%player%.dice::2} to random integer between 1 and 6
  70. set {%player%.total} to {%player%.dice::1} + {%player%.dice::2}
  71. if arg is between 2 and 12:
  72. message "【ダイスヒット】%{%player%.dice::1}%+%{%player%.dice::2}%=%{%player%.total}%"
  73. if {%player%.total} is arg:
  74. if arg is 2 or 12:
  75. add {%player%.betMoney} * 36 to player's money
  76. message "【ダイスヒット】当たり!"
  77. message "【ダイスヒット】%RegularMoneyNotation({%player%.betMoney} * 36)%獲得しました!"
  78. if arg is 3 or 11:
  79. add {%player%.betMoney} * 18 to player's money
  80. message "【ダイスヒット】当たり!"
  81. message "【ダイスヒット】%RegularMoneyNotation({%player%.betMoney} * 18)%獲得しました!"
  82. if arg is 4 or 10:
  83. add {%player%.betMoney} * 12 to player's money
  84. message "【ダイスヒット】当たり!"
  85. message "【ダイスヒット】%RegularMoneyNotation({%player%.betMoney} * 12)%獲得しました!"
  86. if arg is 5 or 9:
  87. add {%player%.betMoney} * 9 to player's money
  88. message "【ダイスヒット】当たり!"
  89. message "【ダイスヒット】%RegularMoneyNotation({%player%.betMoney} * 9)%獲得しました!"
  90. if arg is 6 or 8:
  91. add floor({%player%.betMoney} * 7.2) to player's money
  92. message "【ダイスヒット】当たり!"
  93. message "【ダイスヒット】%RegularMoneyNotation(floor({%player%.betMoney} * 7.2))%獲得しました!"
  94. if arg is 7:
  95. add {%player%.betMoney} * 6 to player's money
  96. message "【ダイスヒット】当たり!"
  97. message "【ダイスヒット】%RegularMoneyNotation({%player%.betMoney} * 6)%獲得しました!"
  98. else:
  99. message "【ダイスヒット】外れ…。"
  100. set {%player%.betted} to false
  101. else:
  102. message "2〜12で入力してください。"
  103. else:
  104. message "【ダイスヒット】先に/betコマンドでベットして下さい。"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement