def fProccedCast(pCast, pMod):
    vCastValue, vAttValue0, vAttValue1, vAttValue2 = fgetCastValue(pCast)
    vRet = vCastValue - pMod
    vThrow0, vThrow1, vThrow2 = throw(1, 20), throw(1, 20), throw(1, 20)
    vHoleThrow = np.array([vThrow0, vThrow1, vThrow2])

    if vRet < 0:
        vMali = -vRet
    else:
        vMali = 0

    if vThrow0 > vAttValue0 - vMali:
        vRet = vRet - (vThrow0 - vAttValue0 + vMali)
    if vThrow1 > vAttValue1 - vMali:
        vRet = vRet - (vThrow1 - vAttValue1 + vMali)
    if vThrow2 > vAttValue2 - vMali:
        vRet = vRet - (vThrow2 - vAttValue2 + vMali)

    if vRet >= vCastValue - pMod:
        vRet = 0

    if len(vHoleThrow[vHoleThrow == 20]) == 2:
        if vRet > 0:
            vRet = -15
        print('Kritischer Misserfolg bei einer {}-Probe!'.format(pCast))
    elif len(vHoleThrow[vHoleThrow == 1]) == 2:
        if vRet < 0:
            vRet += 15
        print('Kritischer Erfolg bei einer {}-Probe!'.format(pCast))

    if vRet > vCastValue:
        vRet = vCastValue

    return vRet
def fProccedRegeneration(pCurLeP, pCurAsP):
    vCurLeP, vCurAsP = pCurLeP, pCurAsP
    vAddLeP, vAddAsP = throw(1, 6), 11

    if fProofMeditationSuccess() == True:
        vAddAsP += 3
        vAddLeP += -(3 + throw(0, 2))
    else:
        vAddLeP += -(3 + throw(0, 2)) / 2

    if fProofAttribute(zKo):
        vAddLeP += 1
    if fProofAttribute(zIn):
        vAddAsP += 1

    if vCurLeP + vAddLeP < zMaxLeP:
        vCurLeP += vAddLeP
    elif vCurLeP < zMaxLeP:
        vCurLeP = zMaxLeP

    if vCurAsP + vAddAsP < zMaxAsP:
        vCurAsP += vAddAsP
    elif vCurAsP < zMaxAsP:
        vCurAsP = zMaxAsP

    return vCurLeP, vCurAsP
Ejemplo n.º 3
0
async def on_message(message):
    if message.content.startswith('roll'):
        split = message.content.split(' ')
        result = str(throw(1, int(split[1])))
        print(
            f"{Fore.LIGHTCYAN_EX + message.author.name + Fore.BLUE} rolled a {Fore.LIGHTCYAN_EX + split[1] + Fore.BLUE} sided die and got a {Fore.LIGHTCYAN_EX + result}"
        )
        await message.channel.send(
            f"**{message.author.name}** rolled a **{split[1]}** sided die and got a __**{result}**__ from the throw"
        )
def fProofMeditationSuccess():
    vRet, vRit = True, zRitualkenntnis
    vThrow0, vThrow1, vThrow2 = throw(1, 20), throw(1, 20), throw(1, 20)
    vHoleThrow = np.array([vThrow0, vThrow1, vThrow2])

    if vThrow0 > zIn:
        vRit = vRit - (vThrow0 - zIn)
    if vThrow1 > zCh:
        vRit = vRit - (vThrow1 - zCh)
    if vThrow2 > zKo:
        vRit = vRit - (vThrow2 - zKo)

    if len(vHoleThrow[vHoleThrow == 20]) == 2:
        vRet = False
        print('Kritischer Misserfolg bei einer Ritualkenntnis-Probe!')
    elif len(vHoleThrow[vHoleThrow == 1]) == 2:
        print('Kritischer Erfolg bei einer Ritualkenntnis-Probe!')
    elif vRit < 0:
        vRet = False

    return vRet
def fProofControl(pMod):
    if throw(1, 20) < (zKontroll - pMod):
        return True
    else:
        return False
def fProofAttribute(pValue):
    if pValue < throw(1, 20):
        return False
    else:
        return True