Switch to edit mode.
Name(s): break1: if (this.location != player.location)
2: player:tell("You'll have to drop the table first.")
3: return
4: elseif (this.broken)
5: player:tell("The table has already been broken. It's time to play.")
6: return
7: endif
8: "DETERMINE IF ANY OF THE BALLS ARE SUNK AND WHERE THE OTHERS ARE"
9: atleastonesunk = 0
10: if (this.chalked)
11: chance = 9
12: else
13: chance = 5
14: endif
15: for q in [1..15]
16: if (random(100) < chance)
17: if (length(this.balls[q]) < 3)
18: player:tell("You sink the " + this.balls[q] + " on the break!")
19: this.location:announce(player.name + " sinks the " + this.balls[q] + " on the break!")
20: this.balls[q] = this.balls[q] + " - SUNK"
21: this.ballsontable = this.ballsontable - 1
22: atleastonesunk = 1
23: endif
24: endif
25: this.ballinfo[q][1] = random(7)
26: y = random(10)
27: if (y > 5)
28: this.ballinfo[q][2] = 0
29: else
30: this.ballinfo[q][2] = this.shotneededtypes[random(length(this.shotneededtypes))]
31: endif
32: endfor
33: if (!atleastonesunk)
34: player:tell("You make no balls on the break.")
35: this.location:announce(player.name + " makes no balls on the break.")
36: endif
37: this.broken = 1
38: this.chalked = 0