Exemple #1
0
def gen_Corpsebits(x, y, origin):
    i = Useable(x,
                y,
                '{0} bits'.format(origin.name),
                '~',
                colors.red,
                description='Little chunks of a {0}'.format(origin.name),
                use_function=iu.eat_corpse,
                params=origin.name)
    i.render_order = RenderOrder.CORPSE
    return i
Exemple #2
0
def gen_Corpse(x, y, origin):
    i = Useable(x,
                y,
                '{0} corpse'.format(origin.name),
                '%',
                colors.red,
                description='The brutalized corpse of a {0}'.format(
                    origin.name),
                use_function=iu.eat_corpse,
                params=origin.name)
    i.render_order = RenderOrder.CORPSE
    return i
Exemple #3
0
def gen_Scr_Ltng(x, y):
    name = 'scroll of lightning bolt'
    descr = 'A scroll of lightning bolt. It will strike one of the nearest enemies.'
    pwr = randint(8, 10)
    spell_range = 3
    i = Useable(x,
                y,
                name,
                CHAR_SCROLL,
                COLOR_SCROLL,
                description=descr,
                use_function=iu.cast_lightning,
                params=(pwr, spell_range))  # power/radius
    return i
Exemple #4
0
def gen_Scr_Frb(x, y):
    name = 'scroll of fireball'
    pwr = 12
    spell_range = 3
    i = Useable(
        x,
        y,
        name,
        CHAR_SCROLL,
        COLOR_SCROLL,
        description=
        'A scroll of fireball. It will burn anything in a small radius.',
        use_function=iu.cast_fireball,
        params=(pwr, spell_range))  # power/radius
    return i
Exemple #5
0
def gen_P_Heal(x, y):
    ''' basic healing potion '''

    name = 'healing potion'
    pwr = randint(6, 10)
    descr = 'This potion will heal you for a small amount.'

    i = Useable(x,
                y,
                name,
                CHAR_POTION,
                colors.violet,
                description=descr,
                use_function=iu.cast_heal,
                params=pwr)
    return i
Exemple #6
0
def gen_Scr_Mami(x, y):
    name = 'scroll of magic missile'
    pwr = randint(4, 8)
    spell_range = 6
    i = Useable(
        x,
        y,
        name,
        CHAR_SCROLL,
        COLOR_SCROLL,
        description=
        'A scroll of magic missile. Inflicts direct damage on a single enemy.',
        use_function=iu.cast_magicmissile,
        params=(pwr, spell_range)  # power/radius
    )
    return i
Exemple #7
0
def gen_Scr_Conf(x, y):
    name = 'scroll of confusion'
    pwr = randint(4, 6)
    if randint(0, 100) > 85:  # 15% chance to be cursed
        spell_range = -1
    else:
        spell_range = 3
    i = Useable(
        x,
        y,
        name,
        CHAR_SCROLL,
        COLOR_SCROLL,
        description=
        'A scroll of confusion. It will turn a foes brain into mush temporarily.',
        use_function=iu.cast_confusion,
        params=(pwr, spell_range)  # power/radius
    )
    return i
Exemple #8
0
def gen_P_Power(x, y):
    ''' basic power potion - can be cursed '''

    name = 'potion of power'
    descr = 'A potion of power will heighten your strength.'

    if randint(0, 100) > 20:
        pwr = 1
    else:  # 20% chance of being cursed
        pwr = -1

    i = Useable(x,
                y,
                name,
                CHAR_POTION,
                colors.red,
                description=descr,
                use_function=iu.cast_powerup,
                params=pwr)
    return i