View/Edit #6161:check_bust

Switch to edit mode.

Name(s): check_bust
1:  if (caller != this)
2:    raise(E_PERM)
3:  elseif (!(gs = this:gs(args[1])))
4:    return
5:  endif
6:  dealer = gs[4]
7:  person = gs[5]
8:  dt = this:tv(dealer)
9:  pt = this:tv(person)
10: if (pt > 21)
11:   this:mod(player, 12, 1)
12:   this:mod(player, 3, 1)
13:   this:streak(player, 0)
14:   player:tell("You have BUSTED.  The dealer wins.")
15: elseif (dt > 21)
16:   player:Tell("The dealer has BUSTED.  Congratulations, you win ", this:m_string(gs[8] * 2.0), "!")
17:   this:increase_money(player, gs[8] * 2.0)
18:   this.dealer_income = this.dealer_income - gs[8] * 2.0
19:   this:streak(player, 1)
20:   this:mod(player, 2, 1)
21:   this:mod(player, 13, 1)
22: else
23:   return 0
24: endif
25: if (qq = listassoc(this.splitters, player))
26:   "Woah horsey! You ain't done yet."
27:   player:tell("You go to your split card and continue playing.")
28:   this.games[$list_utils:iassoc(player, this.games)][5] = {qq[2], this:give_card(player, 0)}
29:   this.games[$list_utils:iassoc(player, this.games)][7] = 0
30:   this.splitters = setremove(this.splitters, qq)
31:   return 1
32: endif
33: this.games = setremove(this.games, this:gs(player))
34: "$md:Even(player);"
35: return 1
36: "Last modified by James (#6397) on Thu Mar 15 01:13:59 2007 EDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: James (#6397)

You are not logged in.

[home | help | who | search | setup | code]