Skip to content

Commit

Permalink
Merge pull request ryosan-470#25 from index30/yusei
Browse files Browse the repository at this point in the history
国士無双の夢
  • Loading branch information
ryosan-470 committed Jun 19, 2015
2 parents 24d2951 + e1c6a43 commit 7889915
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions scripts/mahjong.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ module.exports = (robot) ->
tibody = tibody.concat(tihead1)

tirandom = Math.floor(Math.random()*20)+1
#tirandom = 7
tb1 = tibody.shift()
tb2 = tibody.shift()
tb3 = tibody.shift()
Expand All @@ -227,11 +228,29 @@ module.exports = (robot) ->
tb6 = tibody.shift()

#国士実装

kokusirandom = Math.floor(Math.random()*15)+1
#kokusirandom = 13
kokusibody = ":1man::9man::1so::9so::1pin::9pin::hai-ton::hai-nan::hai-sha::hai-pei::hai-haku::hai-hatsu::hai-chun:"
kokushijork = Math.floor(Math.random()*2)+1
if kokushijork == 1
kr = Math.floor(Math.random()*3)+1
kor = kr-1
khai = Math.floor(Math.random()*2)+1
if khai == 1
kokusipin = hands1[kor][0]
else
kokusipin = hands1[kor][8]
else
jkr = Math.floor(Math.random()*7)+1
jikor = jkr-1
kokusipin = jhands1[jikor]


if tirandom == 7 || tirandom == 14
msg.send "#{head1} #{tb1} #{tb2} #{tb3} #{tb4} #{tb5} #{tb6}"
if kokusirandom == 13
msg.send "#{kokusibody} #{kokusipin}"
else
msg.send "#{head1} #{tb1} #{tb2} #{tb3} #{tb4} #{tb5} #{tb6}"
else
msg.send "#{head1} #{b1} #{b2} #{b3} #{b4}"

Expand Down

0 comments on commit 7889915

Please sign in to comment.