Fix coin/pony chances
This commit is contained in:
parent
e922bb220e
commit
73fb0c65c9
@ -737,22 +737,19 @@
|
|||||||
"consecrate_success": "You have consecrated the body of \u0002{0}\u0002.",
|
"consecrate_success": "You have consecrated the body of \u0002{0}\u0002.",
|
||||||
"no_acting_on_succubus": "You may not {0} a succubus.",
|
"no_acting_on_succubus": "You may not {0} a succubus.",
|
||||||
"coin_toss": "\u0002{0}\u0002 tosses a coin into the air...",
|
"coin_toss": "\u0002{0}\u0002 tosses a coin into the air...",
|
||||||
"coin_choices": [
|
|
||||||
"heads",
|
|
||||||
"tails"
|
|
||||||
],
|
|
||||||
"coin_special": [
|
|
||||||
"its side",
|
|
||||||
"{bot_nick}"
|
|
||||||
],
|
|
||||||
"coin_land": "The coin lands on \u0002{0}\u0002.",
|
"coin_land": "The coin lands on \u0002{0}\u0002.",
|
||||||
|
"coin_choices": [
|
||||||
|
"tails",
|
||||||
|
"heads",
|
||||||
|
"its side"
|
||||||
|
],
|
||||||
"pony_toss": "\u0002{0}\u0002 tosses a pony into the air...",
|
"pony_toss": "\u0002{0}\u0002 tosses a pony into the air...",
|
||||||
|
"pony_land": "The pony lands on \u0002{0}\u0002.",
|
||||||
"pony_choices": [
|
"pony_choices": [
|
||||||
"hoof",
|
"hoof",
|
||||||
"plot",
|
"plot",
|
||||||
"{nick}"
|
"{nick}"
|
||||||
],
|
],
|
||||||
"pony_land": "The pony lands on \u0002{0}\u0002.",
|
|
||||||
"pony_fly": "The pony flies away.",
|
"pony_fly": "The pony flies away.",
|
||||||
"cat_toss": "\u0002{0}\u0002 tosses a cat into the air...",
|
"cat_toss": "\u0002{0}\u0002 tosses a cat into the air...",
|
||||||
"cat_land": "The cat lands on its \u0002feet\u0002.",
|
"cat_land": "The cat lands on its \u0002feet\u0002.",
|
||||||
|
@ -6833,10 +6833,15 @@ def coin(cli, nick, chan, rest):
|
|||||||
"""It's a bad idea to base any decisions on this command."""
|
"""It's a bad idea to base any decisions on this command."""
|
||||||
|
|
||||||
reply(cli, nick, chan, messages["coin_toss"].format(nick))
|
reply(cli, nick, chan, messages["coin_toss"].format(nick))
|
||||||
coin = random.choice(messages["coin_choices"])
|
rnd = random.random()
|
||||||
specialty = random.randrange(0,10)
|
print(rnd)
|
||||||
if specialty < 2:
|
# 59/29/12 split, 59+29=88
|
||||||
coin = messages["coin_special"][specialty].format(bot_nick=botconfig.NICK)
|
if rnd < 0.59:
|
||||||
|
coin = messages["coin_choices"][0]
|
||||||
|
elif rnd < 0.88:
|
||||||
|
coin = messages["coin_choices"][1]
|
||||||
|
else:
|
||||||
|
coin = messages["coin_choices"][2]
|
||||||
cmsg = messages["coin_land"].format(coin)
|
cmsg = messages["coin_land"].format(coin)
|
||||||
reply(cli, nick, chan, cmsg)
|
reply(cli, nick, chan, cmsg)
|
||||||
|
|
||||||
@ -6845,13 +6850,20 @@ def pony(cli, nick, chan, rest):
|
|||||||
"""Toss a magical pony into the air and see what happens!"""
|
"""Toss a magical pony into the air and see what happens!"""
|
||||||
|
|
||||||
reply(cli, nick, chan, messages["pony_toss"].format(nick))
|
reply(cli, nick, chan, messages["pony_toss"].format(nick))
|
||||||
|
# 59/29/7/5 split
|
||||||
if random.random() < 1 / (len(messages["pony_choices"]) + 1):
|
rnd = random.random()
|
||||||
reply(cli, nick, chan, messages["pony_fly"])
|
print(rnd)
|
||||||
|
if rnd < 0.59:
|
||||||
|
pony = messages["pony_choices"][0]
|
||||||
|
elif rnd < 0.88:
|
||||||
|
pony = messages["pony_choices"][1]
|
||||||
|
elif rnd < 0.95:
|
||||||
|
pony = messages["pony_choices"][2].format(nick=nick)
|
||||||
else:
|
else:
|
||||||
pony = random.choice(messages["pony_choices"]).format(nick=nick)
|
reply(cli, nick, chan, messages["pony_fly"])
|
||||||
cmsg = messages["pony_land"].format(pony)
|
return
|
||||||
reply(cli, nick, chan, cmsg)
|
cmsg = messages["pony_land"].format(pony)
|
||||||
|
reply(cli, nick, chan, cmsg)
|
||||||
|
|
||||||
@cmd("cat", pm=True, old_api=True)
|
@cmd("cat", pm=True, old_api=True)
|
||||||
def cat(cli, nick, chan, rest):
|
def cat(cli, nick, chan, rest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user