Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
f948b2bc
Commit
f948b2bc
authored
14 years ago
by
cyan
Browse files
Options
Downloads
Patches
Plain Diff
* Plenty of updates
parent
f393b9ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
exec/ircbots/poker/poker_commands.js
+26
-2
26 additions, 2 deletions
exec/ircbots/poker/poker_commands.js
exec/ircbots/poker/poker_functions.js
+3
-6
3 additions, 6 deletions
exec/ircbots/poker/poker_functions.js
exec/ircbots/poker/pokerbot.js
+1
-1
1 addition, 1 deletion
exec/ircbots/poker/pokerbot.js
with
30 additions
and
9 deletions
exec/ircbots/poker/poker_commands.js
+
26
−
2
View file @
f948b2bc
...
...
@@ -24,7 +24,7 @@ this.Bot_Commands["GO"].command = function (target,onick,ouh,srv,lvl,cmd) {
srv
.
o
(
target
,
"
No poker game to 'GO' with. Type '
"
+
get_cmd_prefix
()
+
"
DEAL' to
"
+
"
start a new one.
"
);
return
;
}
else
if
(
poker_games
[
target
].
round
>
0
)
{
}
else
if
(
poker_games
[
target
].
round
>
=
0
)
{
srv
.
o
(
target
,
"
This hand has already started.
"
);
return
;
}
...
...
@@ -32,6 +32,7 @@ this.Bot_Commands["GO"].command = function (target,onick,ouh,srv,lvl,cmd) {
srv
.
o
(
target
,
"
At least two players are necessary to start the game.
"
);
return
;
}
poker_games
[
target
].
round
=
0
;
poker_init_hand
(
target
);
poker_deal_hole_cards
(
target
,
srv
);
poker_prompt_player
(
target
,
srv
);
...
...
@@ -46,10 +47,12 @@ this.Bot_Commands["FOLD"].command = function (target,onick,ouh,srv,lvl,cmd) {
}
else
if
(
!
poker_games
[
target
].
users
[
onick
.
toUpperCase
()])
{
srv
.
o
(
target
,
onick
+
"
, you aren't playing this game.
"
);
return
;
}
else
if
(
poker_games
[
target
].
round
<
1
)
{
}
else
if
(
poker_games
[
target
].
round
<
0
)
{
srv
.
o
(
target
,
onick
+
"
, the game hasn't started yet.
"
);
return
;
}
if
(
!
poker_verify_game_status
(
target
,
srv
,
onick
))
return
;
delete
poker_games
[
target
].
users
[
onick
.
toUpperCase
()];
srv
.
o
(
target
,
onick
+
"
folded their hand.
"
);
...
...
@@ -151,3 +154,24 @@ this.Bot_Commands["LIST"].command = function (target,onick,ouh,srv,lvl,cmd) {
return
;
}
this
.
Bot_Commands
[
"
SHOW
"
]
=
new
Bot_Command
(
0
,
false
,
false
);
this
.
Bot_Commands
[
"
SHOW
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lvl
,
cmd
)
{
if
(
!
poker_games
[
target
])
{
srv
.
o
(
target
,
"
There is no active game.
"
);
return
;
}
if
(
!
poker_games
[
target
].
users
[
onick
.
toUpperCase
()])
{
srv
.
o
(
target
,
onick
+
"
, you aren't playing this game.
"
);
return
;
}
if
(
poker_games
[
target
].
round
<
0
)
{
srv
.
o
(
target
,
onick
+
"
, the game hasn't started yet.
"
);
return
;
}
srv
.
o
(
target
,
onick
+
"
shows:
"
+
poker_show_card
(
poker_games
[
target
].
users
[
onick
.
toUpperCase
()].
cards
[
0
])
+
poker_show_card
(
poker_games
[
target
].
users
[
onick
.
toUpperCase
()].
cards
[
1
])
);
}
This diff is collapsed.
Click to expand it.
exec/ircbots/poker/poker_functions.js
+
3
−
6
View file @
f948b2bc
...
...
@@ -76,7 +76,6 @@ function poker_next_turn(target,srv) {
function
poker_deal_flop
(
target
,
srv
)
{
var
poker_game
=
poker_games
[
target
];
poker_game
.
round
=
2
;
poker_game
.
community_cards
[
0
]
=
poker_game
.
deck
.
deal
();
poker_game
.
community_cards
[
1
]
=
poker_game
.
deck
.
deal
();
poker_game
.
community_cards
[
2
]
=
poker_game
.
deck
.
deal
();
...
...
@@ -89,7 +88,6 @@ function poker_deal_flop(target,srv) {
function
poker_deal_turn
(
target
,
srv
)
{
var
poker_game
=
poker_games
[
target
];
poker_game
.
round
=
3
;
poker_game
.
community_cards
[
3
]
=
poker_game
.
deck
.
deal
();
srv
.
o
(
target
,
"
The Turn:
"
+
poker_show_card
(
poker_game
.
community_cards
[
0
])
...
...
@@ -101,7 +99,6 @@ function poker_deal_turn(target,srv) {
function
poker_deal_river
(
target
,
srv
)
{
var
poker_game
=
poker_games
[
target
];
poker_game
.
round
=
4
;
poker_game
.
community_cards
[
4
]
=
poker_game
.
deck
.
deal
();
srv
.
o
(
target
,
"
The River:
"
+
+
poker_show_card
(
poker_game
.
community_cards
[
0
])
...
...
@@ -113,7 +110,7 @@ function poker_deal_river(target,srv) {
}
function
poker_show_card
(
card
)
{
return
(
card
.
color
+
"
[
"
+
card
.
char
+
"
]
"
);
return
(
card
.
color
+
"
[
"
+
card
.
char
+
"
]
"
);
}
function
poker_load_pot
(
target
,
srv
)
{
...
...
@@ -129,9 +126,9 @@ function poker_load_pot(target,srv) {
function
poker_prompt_player
(
target
,
srv
)
{
var
poker
=
poker_games
[
target
];
var
turn
=
poker
.
users_map
[
poker
.
turn
];
srv
.
o
(
turn
,
"
It is your turn. You may CHECK, CALL, BET, RAISE or FOLD
"
srv
.
o
(
turn
,
"
It is your turn. You may CHECK, CALL, BET, RAISE or FOLD.
"
+
"
Minimum bet: $
"
+
poker
.
current_bet
,
"
NOTICE
"
);
srv
.
o
(
turn
,
"
Minimum bet: $
"
+
poker
.
current_bet
,
"
NOTICE
"
);
}
function
poker_verify_game_status
(
target
,
srv
,
onick
)
{
...
...
This diff is collapsed.
Click to expand it.
exec/ircbots/poker/pokerbot.js
+
1
−
1
View file @
f948b2bc
...
...
@@ -46,7 +46,7 @@ function Poker_Game()
this
.
sm_blind
=
5
;
this
.
min_bet
=
this
.
sm_blind
;
this
.
current_bet
=
this
.
min_bet
;
this
.
round
=
0
;
this
.
round
=
-
1
;
this
.
deck
=
new
Deck
();
this
.
community_cards
=
new
Array
();
this
.
paused
=
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment