Esempio n. 1
0
 def defender_roll(self, unit):
     #roll = ((randint(0,10) + randint(0,10) + randint(0,10))/3)
     roll = dice.diceroll(die_tries=3)
     bonus = (unit.defense * unit.gov_defense) + (unit.speed / 2 *
                                                  unit.gov_speed)
     roll += bonus
     return (roll)
Esempio n. 2
0
async def ovaroll(modifier : int):
    try:
        if modifier >= 0:
            rolls = [ diceroll(6).result for i in range(2+modifier) ]
            results = [ sum([ x for x in rolls if x == i]) for i in [1,2,3,4,5,6] ]
            rollstr = str(sorted(rolls))
            res = max(results)
        else:
            rolls = [ diceroll(6).result for i in range(abs(modifier)) ]
            rollstr = str(sorted(rolls))
            res = min(rolls)
        await nepbot.reply("```{} ({})```".format(res, rollstr))
    except Exception as e:
        if str(e) is not "":
            await nepbot.reply(str(e))
        else:
            await nepbot.reply(_getError().lower())        
Esempio n. 3
0
def main():
	print("This program serves as a helper for Dungeons and Dragons DMs (version 5, no homebrewing). Type 'help' for a list of commands.")
	char_creator()
	turncount = encount_begin()
	while True:
		x= input("\nWhat would you like to do next? ")
		x = x.lower().rstrip()
		if x=="end turn":
			turncount += 1
			print("Current turn:", turncount)
		elif x == "add character":
			char_creator()
		elif x == "roll dice":
			dice.diceroll()
		elif x == "end encounter":
			break
		elif x == "help":
			help()
		else:
			print("I don't understand", "'"+x+"'.", "Type 'help' for a list of commands. ")
	print("\nGoodbye!")
Esempio n. 4
0
def main():
    print(
        "This program serves as a helper for Dungeons and Dragons DMs (version 5, no homebrewing). Type 'help' for a list of commands."
    )
    char_creator()
    turncount = encount_begin()
    while True:
        x = input("\nWhat would you like to do next? ")
        x = x.lower().rstrip()
        if x == "end turn":
            turncount += 1
            print("Current turn:", turncount)
        elif x == "add character":
            char_creator()
        elif x == "roll dice":
            dice.diceroll()
        elif x == "end encounter":
            break
        elif x == "help":
            help()
        else:
            print("I don't understand", "'" + x + "'.",
                  "Type 'help' for a list of commands. ")
    print("\nGoodbye!")
Esempio n. 5
0
async def _capt(**kwargs):
    for key in kwargs:
        last_params[key] = kwargs[key]

    cr = 10 + sum(last_params.values())
    await nepbot.reply("The Capture Rate is `{}`!".format(cr))
    res = diceroll(20).result
    success = res == 20 or res >= cr
    for shakes, check in [("once", res-cr > 3), ("twice", res-cr > 2), ("thrice", res-cr > 1)]:
        nepbot.type()
        await asyncio.sleep(1)
        if check:
            await nepbot.reply("Shook {}...".format(shakes))
        else:
            await nepbot.reply("{}! The Pokemon broke free...".format(_getExplicitive().capitalize()))
            return
    nepbot.type()
    await asyncio.sleep(1)
    if success:
        await nepbot.reply("Gotcha! The Wild Pokemon was caught! `({})`".format(res))
    else:
        await nepbot.reply("{}! The Pokemon broke free... ({})".format(_getExplicitive().capitalize(), res))
Esempio n. 6
0
import dice

dice.diceroll()
dice.diceroll()
Esempio n. 7
0
 def initiative_roll(unit):
     roll = dice.diceroll()
     #bonus = unit.gov_initiative + (unit.speed/2* unit.gov_initiative)
     bonus = 1
     roll += bonus
     return (roll)
Esempio n. 8
0
 def attacker_roll(self, unit):
     roll = dice.diceroll(die_tries=3)
     bonus = (unit.attack * unit.gov_attack) + (unit.speed / 2 *
                                                unit.gov_speed)
     roll += bonus
     return (roll)
Esempio n. 9
0
import dice

print("Your first dice roll is: " + str(dice.diceroll()))
print("Your second dice roll is: " + str(dice.diceroll()))
Esempio n. 10
0
 def initiative_roll(unit):
     roll = dice.diceroll()
     # bonus = unit.gov_initiative + (unit.speed/2* unit.gov_initiative)
     bonus = 1
     roll += bonus
     return roll
Esempio n. 11
0
 def defender_roll(self, unit):
     # roll = ((randint(0,10) + randint(0,10) + randint(0,10))/3)
     roll = dice.diceroll(die_tries=3)
     bonus = (unit.defense * unit.gov_defense) + (unit.speed / 2 * unit.gov_speed)
     roll += bonus
     return roll
Esempio n. 12
0
 def attacker_roll(self, unit):
     roll = dice.diceroll(die_tries=3)
     bonus = (unit.attack * unit.gov_attack) + (unit.speed / 2 * unit.gov_speed)
     roll += bonus
     return roll