Skip to content
Snippets Groups Projects
Commit e5684e0d authored by mcmlxxix's avatar mcmlxxix
Browse files

added BUYIN and BALANCE cmds.

some more fixes. I still think this should
be in /xtrn/ but digitalman disagrees.
but he's from california. what does he
know?
parent ffc681cf
No related branches found
No related tags found
No related merge requests found
......@@ -84,14 +84,15 @@ Bot_Commands["BET"].command = function (target,onick,ouh,srv,lvl,cmd) {
srv.o(onick,"You don't have that much money! Balance: $" + poker.users[onick].money,"NOTICE");
return;
}
if(cmd[1]<poker.min_bet) {
if(cmd[1]<poker.current_bet) {
srv.o(onick,"Your bet must meet the minimum! Minimum bet: $" + poker.min_bet,"NOTICE");
return;
}
srv.o(target,onick + " bets $" + cmd[1]);
poker.users[onick].money-=Number(cmd[1]);
poker.users[onick].bet+=Number(cmd[1]);
poker.current_bet=Number(cmd[1]);
poker.current_bet+=Number(cmd[1]);
srv.o(target,"Current bet: $" + poker.current_bet);
srv.o(onick,"Balance: $" + poker.users[onick].money,"NOTICE");
poker_next_turn(target,srv);
return;
......@@ -227,3 +228,37 @@ Bot_Commands["INVITE"].command = function (target,onick,ouh,srv,lvl,cmd) {
+ "! /J " + target + " to join.");
return;
}
Bot_Commands["BALANCE"] = new Bot_Command(0,false,false);
Bot_Commands["BALANCE"].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]) {
srv.o(target, onick + ", I have no record for you.");
return;
}
srv.o(onick, "Your balance: $" + poker_games[target].users[onick].money,"NOTICE");
return;
}
Bot_Commands["BUYIN"] = new Bot_Command(50,false,false);
Bot_Commands["BUYIN"].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]) {
srv.o(target, onick + ", I have no record for you.");
return;
}
if(poker_games[target].users[onick].money>10) {
srv.o(target, onick + ", you already have money in the bank.");
return;
}
poker_games[target].users[onick].money=100;
srv.o(onick, "Your balance: $" + poker_games[target].users[onick].money,"NOTICE");
return;
}
......@@ -188,11 +188,12 @@ function poker_init_hand(target,srv) {
srv.o(target,poker.users_map[poker.dealer] + " is the dealer for this hand.");
poker.users[poker.users_map[small_blind]].bet+=poker.sm_blind;
poker.users[poker.users_map[small_blind]].money-=poker.sm_blind;
srv.o(target,"Small blind: " + poker.users_map[small_blind] + " $" + poker.sm_blind);
poker.users[poker.users_map[large_blind]].bet+=poker.lg_blind;
poker.users[poker.users_map[large_blind]].money-=poker.lg_blind;
srv.o(target,"Large blind: " + poker.users_map[large_blind] + " $" + poker.lg_blind);
poker.turn=get_next_player(poker,large_blind);
poker.min_bet=poker.lg_blind;
}
function load_scores() {
......@@ -256,7 +257,8 @@ function poker_reset_game(target,srv) {
}
poker.dealer=get_next_player(poker,poker.dealer);
poker.round=-1;
poker.current_bet=poker.min_bet/2;
poker.current_bet=poker.min_bet;
poker.community_cards=[];
poker.pot=0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment