Ejemplo n.º 1
0
def apply_blessing(engine, hero):
    if hero.gold >= int(
            20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]:
        engine.score += 0.2
        hero.gold -= int(
            20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]
        if random.randint(0, 1) == 0:
            engine.hero = Objects.Blessing(hero)
            engine.notify("Blessing applied")
    else:
        engine.score -= 0.1
Ejemplo n.º 2
0
 def cast(cls, engine, hero):
     val = int(20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]
     if hero.gold >= val:
         engine.score += 0.2
         hero.gold -= val
         if randint(0, 1) == 0:
             engine.hero = Objects.Blessing(hero)
             engine.notify({"info": "Blessing applied"})
         else:
             engine.hero = Objects.Berserk(hero)
             engine.notify({"info": "Berserk applied"})
     else:
         engine.score -= 0.1
def apply_blessing(engine, hero):
    temp = int(20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]
    if hero.gold >= temp:
        hero.gold -= temp
        _rand = random.randint(0, 2)
        if _rand == 0:
            engine.hero = Objects.Blessing(hero)
            engine.notify("Blessing applied")
        elif _rand == 1:
            engine.hero = Objects.Berserk(hero)
            engine.notify("Berserk applied")
        else:
            engine.hero = Objects.Happy(hero)
            engine.notify("")
    engine.score += 30
def apply_blessing(engine, hero):
    need_gold = int(20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]
    if hero.gold >= need_gold:
        engine.score += 0.2
        hero.gold -= need_gold
        if random.randint(0, 1) == 0:
            engine.hero = Objects.Blessing(hero)
            engine.notify("Blessing applied")
        else:
            engine.hero = Objects.Berserk(hero)
            engine.notify("Berserk applied")
        engine.hero.calc_max_HP()
    else:
        engine.score -= 0.1
        engine.notify(f"Need {need_gold} gold")
Ejemplo n.º 5
0
def apply_blessing(engine, hero):
    if hero.gold >= int(20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]:
        engine.score += 0.2
        hero.gold -= int(20 * 1.5**engine.level) - \
            2 * hero.stats["intelligence"]
        if random.randint(0, 1) == 0:
            engine.hero = Objects.Blessing(hero)
            engine.notify("Blessing applied")
        else:
            engine.hero = Objects.Berserk(hero)
            engine.notify("Berserk applied")
    else:
        engine.score -= 0.1

    if hero.hp <= 0:
        engine.notify("GAME OVER")
        engine.notify("Press R for restart")
        engine.game_process = False
Ejemplo n.º 6
0
def apply_blessing(engine, hero):
    if hero.gold >= int(
            20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]:
        engine.score += 0.2
        hero.gold -= int(20 * 1.5**engine.level) - \
            2 * hero.stats["intelligence"]
        r = random.randint(0, 2)
        if r == 0:
            engine.hero = Objects.Blessing(hero)
            engine.notify("Blessing applied")
        elif r == 1:
            engine.hero = Objects.Berserk(hero)
            engine.notify("Berserk applied")
        else:
            engine.hero = Objects.EvilEye(hero)
            engine.notify("You got the Evil Eye")
    else:
        engine.score -= 0.1
Ejemplo n.º 7
0
def apply_blessing(engine, hero):
    if hero.gold >= int(
            20 * 1.5**engine.level) - 2 * hero.stats["intelligence"]:
        engine.score += 0.2
        hero.gold -= int(20 * 1.5**engine.level) - \
            2 * hero.stats["intelligence"]
        rnd = random.randint(0, 5)
        if rnd <= 1:
            engine.hero = Objects.Blessing(hero)
            engine.notify("Blessing applied")
        elif rnd <= 4:
            engine.hero = Objects.Berserk(hero)
            engine.notify("Berserk applied")
        else:
            engine.hero = Objects.Amnesia(hero)
            engine.notify("Amnesia applied")
    else:
        engine.score -= 0.1
        engine.notify("Not enough gold")