nosas / OmniToon

[WIP] ToonTown AI - Python Plays ToonTown
3 stars 0 forks source link

Design usage of "propBonus" during Battles #20

Open nosas opened 3 years ago

nosas commented 3 years ago

The if propAndOrganicBonusStack: if/else block needs to be evaluated. I think we should keep propBonus (gag bonus) and incorporate it into our model and simulations.

def get_gag_damage(gag_track: int, gag_level: int, exp: int) -> int:
    """Calculate and return Gag damage, given gag_track#, gag_level# and exp

    Args:
        gag_track (int): Index number of the Gag Track <0-6>
        gag_level (int): Level of the Gag <0-6>
        exp (int): Current EXP of the Gag Track <0-10000?>

    Returns:
        int: Damage of Gag
    """
    min_dmg = GAG_DAMAGE[gag_track][gag_level][0][0]
    max_dmg = GAG_DAMAGE[gag_track][gag_level][0][1]
    min_exp = GAG_DAMAGE[gag_track][gag_level][1][0]
    max_exp = GAG_DAMAGE[gag_track][gag_level][1][1]
    exp_val = min(exp, max_exp)
    exp_per_hp = float(max_exp - min_exp + 1) / float(max_dmg - min_dmg + 1)
    damage = math_floor((exp_val - min_exp) / exp_per_hp) + min_dmg
    if damage <= 0:
        damage = min_dmg
    if propAndOrganicBonusStack:
        originalDamage = damage
        if organicBonus:
            damage += getDamageBonus(originalDamage)
        if propBonus:
            damage += getDamageBonus(originalDamage)
    elif organicBonus or propBonus:
        damage += getDamageBonus(damage)
    return damage
nosas commented 3 years ago

We'll assume for now that propBonus includes bonus damage for lured Cogs

nosas commented 4 months ago

I still think this could be useful. The Battle UI highlights which track is subject to prop bonus damage.