Exemple #1
0
    if not state_checks.is_affected(victim, const.skill_table['plague']):
        if victim == ch:
            ch.send("You aren't ill.\n")
        else:
            handler_game.act("$N doesn't appear to be diseased.", ch, None,
                             victim, merc.TO_CHAR)
        return

    if handler_magic.check_dispel(level, victim, const.skill_table['plague']):
        victim.send("Your sores vanish.\n")
        handler_game.act("$n looks relieved as $s sores vanish.", victim, None,
                         None, merc.TO_ROOM)
        return

    ch.send("Spell failed.\n")


const.register_spell(
    const.skill_type("cure disease", {
        'mage': 53,
        'cleric': 13,
        'thief': 53,
        'warrior': 14
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_cure_disease, merc.TAR_CHAR_DEFENSIVE, merc.POS_STANDING, None,
                     const.SLOT(501), 20, 12, "", "!Cure Disease!", ""))
Exemple #2
0
            handler_game.act("$N is already shifted out of phase.", ch, None,
                             victim, merc.TO_CHAR)
        return

    af = handler_game.AFFECT_DATA()
    af.where = merc.TO_AFFECTS
    af.type = sn
    af.level = level
    af.duration = game_utils.number_fuzzy(level // 4)
    af.location = merc.APPLY_NONE
    af.modifier = 0
    af.bitvector = merc.AFF_PASS_DOOR
    victim.affect_add(af)
    handler_game.act("$n turns translucent.", victim, None, None, merc.TO_ROOM)
    victim.send("You turn translucent.\n")


const.register_spell(
    const.skill_type("pass door", {
        'mage': 24,
        'cleric': 32,
        'thief': 25,
        'warrior': 37
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_pass_door, merc.TAR_CHAR_SELF, merc.POS_STANDING, None,
                     const.SLOT(74), 20, 12, "", "You feel solid again.", ""))
Exemple #3
0
import state_checks


def spell_teleport(sn, level, ch, victim, target):
    if victim.in_room == None \
            or state_checks.IS_SET(victim.in_room.room_flags, merc.ROOM_NO_RECALL) \
            or ( victim != ch and victim.imm_flags.is_set(merc.IMM_SUMMON)) \
            or ( not ch.is_npc() and victim.fighting is not None ) \
            or ( victim != ch \
                         and ( handler_magic.saves_spell(level - 5, victim, merc.DAM_OTHER))):
        ch.send("You failed.\n")
        return

    random_room = handler_room.get_random_room(victim)

    if victim != ch:
        victim.send("You have been teleported! \n")

    handler_game.act("$n vanishes! ", victim, None, None, merc.TO_ROOM)
    victim.in_room.get(victim)
    random_room.put(victim)
    handler_game.act("$n slowly fades into existence.", victim, None, None, merc.TO_ROOM)
    victim.do_look("auto")


const.register_spell(const.skill_type("teleport",
                          {'mage': 13, 'cleric': 22, 'thief': 25, 'warrior': 36},
                          {'mage': 1, 'cleric': 1, 'thief': 2, 'warrior': 2},
                          spell_teleport, merc.TAR_CHAR_SELF, merc.POS_FIGHTING, None,
                          const.SLOT(2), 35, 12, "", "!Teleport!", ""))
                                 None, None, merc.TO_CHAR)
                return

            last_vict = ch
            handler_game.act("The bolt arcs to $n...whoops! ", ch, None, None,
                             merc.TO_ROOM)
            ch.send("You are struck by your own lightning! \n")
            dam = game_utils.dice(level, 6)
            if handler_magic.saves_spell(level, ch, merc.DAM_LIGHTNING):
                dam = dam // 3
            fight.damage(ch, ch, dam, sn, merc.DAM_LIGHTNING, True)
            level = level - 4  # decrement damage */
            if ch == None:
                return


const.register_spell(
    const.skill_type("chain lightning", {
        'mage': 33,
        'cleric': 53,
        'thief': 39,
        'warrior': 36
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_chain_lightning, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(500), 25, 12, "lightning", "!Chain Lightning!",
                     ""))
import const
import handler_game
import merc
import object_creator


def spell_create_spring(sn, level, ch, victim, target):
    spring = object_creator.create_item(
        instance.item_templates[merc.OBJ_VNUM_SPRING], 0)
    spring.timer = level
    ch.in_room.put(spring)
    handler_game.act("$p flows from the ground.", ch, spring, None,
                     merc.TO_ROOM)
    handler_game.act("$p flows from the ground.", ch, spring, None,
                     merc.TO_CHAR)


const.register_spell(
    const.skill_type("create spring", {
        'mage': 14,
        'cleric': 17,
        'thief': 23,
        'warrior': 20
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_create_spring, merc.TAR_IGNORE, merc.POS_STANDING, None,
                     const.SLOT(80), 20, 12, "", "!Create Spring!", ""))
def spell_magic_missile(sn, level, ch, victim, target):
    dam_each = [
        0, 3, 3, 4, 4, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9,
        9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 13,
        13, 13, 13, 13, 14, 14, 14, 14, 14
    ]

    level = min(level, len(dam_each) - 1)
    level = max(0, level)
    dam = random.randint(dam_each[level] // 2, dam_each[level] * 2)
    if handler_magic.saves_spell(level, victim, merc.DAM_ENERGY):
        dam = dam // 2
    fight.damage(ch, victim, dam, sn, merc.DAM_ENERGY, True)


const.register_spell(
    const.skill_type("magic missile", {
        'mage': 1,
        'cleric': 53,
        'thief': 2,
        'warrior': 2
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_magic_missile, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(32), 15, 12, "magic missile",
                     "!Magic Missile!", ""))
Exemple #7
0
import const
import fight
import game_utils
import merc


def spell_cause_serious(sn, level, ch, victim, target):
    fight.damage(ch, victim,
                 game_utils.dice(2, 8) + level // 2, sn, merc.DAM_HARM, True)
    return


const.register_spell(
    const.skill_type("cause serious", {
        'mage': 53,
        'cleric': 7,
        'thief': 53,
        'warrior': 10
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_cause_serious, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(64), 17, 12, "spell", "!Cause Serious!", ""))
Exemple #8
0
import const
import fight
import game_utils
import handler_magic
import merc


def spell_harm(sn, level, ch, victim, target):
    dam = max(20, victim.hit - game_utils.dice(1, 4))
    if handler_magic.saves_spell(level, victim, merc.DAM_HARM):
        dam = min(50, dam // 2)
    dam = min(100, dam)
    fight.damage(ch, victim, dam, sn, merc.DAM_HARM, True)


const.register_spell(const.skill_type("harm",
                          {'mage': 53, 'cleric': 23, 'thief': 53, 'warrior': 28},
                          {'mage': 1, 'cleric': 1, 'thief': 2, 'warrior': 2},
                          spell_harm, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                          const.SLOT(27), 35, 12, "harm spell", "!Harm!", ""))
Exemple #9
0
import const
import merc
import state_checks


def spell_mass_healing(sn, level, ch, victim, target):
    for gch_id in ch.in_room.people:
        gch = instance.characters[gch_id]
        if (ch.is_npc() and gch.is_npc() ) or (not ch.is_npc() and not gch.is_npc()):
            const.skill_table['heal'].spell_fun('heal', level, ch, gch, merc.TARGET_CHAR)
            const.skill_table['refresh'].spell_fun('refresh', level, ch, gch, merc.TARGET_CHAR)


const.register_spell(const.skill_type("mass healing",
                          {'mage': 53, 'cleric': 38, 'thief': 53, 'warrior': 46},
                          {'mage': 2, 'cleric': 2, 'thief': 4, 'warrior': 4},
                          spell_mass_healing, merc.TAR_IGNORE, merc.POS_STANDING, None,
                          const.SLOT(508), 100, 36, "", "!Mass Healing!", ""))
Exemple #10
0
                         merc.TO_CHAR)
        ch.unequip(stone.equipped_to)
        ch.get(stone)
        stone.extract()

    portal = object_creator.create_item(
        instance.item_templates[merc.OBJ_VNUM_PORTAL], 0)
    portal.timer = 2 + level // 25
    portal.value[3] = victim.in_room.instance_id

    ch.in_room.put(portal)

    handler_game.act("$p rises up from the ground.", ch, portal, None,
                     merc.TO_ROOM)
    handler_game.act("$p rises up before you.", ch, portal, None, merc.TO_CHAR)


const.register_spell(
    const.skill_type("portal", {
        'mage': 35,
        'cleric': 30,
        'thief': 45,
        'warrior': 40
    }, {
        'mage': 2,
        'cleric': 2,
        'thief': 4,
        'warrior': 4
    }, spell_portal, merc.TAR_IGNORE, merc.POS_STANDING, None, const.SLOT(519),
                     100, 24, "", "!Portal!", ""))
Exemple #11
0
import game_utils
import handler_game
import merc


def spell_control_weather(sn, level, ch, victim, target):
    if victim.lower() == "better":
        handler_game.weather_info.change += game_utils.dice(level // 3, 4)
    elif victim.lower() == "worse":
        handler_game.weather_info.change -= game_utils.dice(level // 3, 4)
    else:
        ch.send("Do you want it to get better or worse?\n")

    ch.send("Ok.\n")
    return


const.register_spell(
    const.skill_type("control weather", {
        'mage': 15,
        'cleric': 19,
        'thief': 28,
        'warrior': 22
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_control_weather, merc.TAR_IGNORE, merc.POS_STANDING, None,
                     const.SLOT(11), 25, 12, "", "!Control Weather!", ""))
Exemple #12
0
                            victim.get(item)
                            victim.in_room.put(item)
                            fail = False
                        else:  # can! drop */
                            handler_game.act("Your skin is seared by $p! ",
                                             victim, item, None, merc.TO_CHAR)
                            dam += (random.randint(1, item.level) // 2)
                            fail = False
    if fail:
        ch.send("Your spell had no effect.\n")
        victim.send("You feel momentarily warmer.\n")
    else:  # damage!  */
        if handler_magic.saves_spell(level, victim, merc.DAM_FIRE):
            dam = 2 * dam // 3
        fight.damage(ch, victim, dam, sn, merc.DAM_FIRE, True)


const.register_spell(
    const.skill_type("heat metal", {
        'mage': 53,
        'cleric': 16,
        'thief': 53,
        'warrior': 23
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_heat_metal, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(516), 25, 18, "spell", "!Heat Metal!", ""))
Exemple #13
0
import const
import fight
import game_utils
import handler_magic
import merc


def spell_acid_blast(sn, level, ch, victim, target):
    dam = game_utils.dice(level, 12)
    if handler_magic.saves_spell(level, victim, merc.DAM_ACID):
        dam = dam // 2
    fight.damage(ch, victim, dam, sn, merc.DAM_ACID, True)


const.register_spell(
    const.skill_type("acid blast", {
        'mage': 28,
        'cleric': 53,
        'thief': 35,
        'warrior': 32
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_acid_blast, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(70), 20, 12, "acid blast", "!Acid Blast!", ""))
Exemple #14
0
    handler_game.act("$n has arrived through a gate.", ch, None, None,
                     merc.TO_ROOM)
    ch.do_look("auto")

    if gate_pet:
        handler_game.act("$n steps through a gate and vanishes.", ch.pet, None,
                         None, merc.TO_ROOM)
        instance.characters[ch.pet].send(
            "You step through a gate and vanish.\n")
        instance.characters[ch.pet].in_room.get(instance.characters[ch.pet])
        ch.in_room.put(instance.characters[ch.pet])
        handler_game.act("$n has arrived through a gate.", ch.pet, None, None,
                         merc.TO_ROOM)
        ch.pet.do_look("auto")


const.register_spell(
    const.skill_type("gate", {
        'mage': 27,
        'cleric': 17,
        'thief': 32,
        'warrior': 28
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_gate, merc.TAR_IGNORE, merc.POS_FIGHTING, None, const.SLOT(83),
                     80, 12, "", "!Gate!", ""))
                             merc.TO_CHAR)
            return

        item.flags.glow = True
        handler_game.act("$p glows with a white light.", ch, light, None,
                         merc.TO_ALL)
        return

    light = object_creator.create_object(
        instance.item_templates[merc.OBJ_VNUM_LIGHT_BALL], 0)
    ch.in_room.put(light)
    handler_game.act("$n twiddles $s thumbs and $p appears.", ch, light, None,
                     merc.TO_ROOM)
    handler_game.act("You twiddle your thumbs and $p appears.", ch, light,
                     None, merc.TO_CHAR)


const.register_spell(
    const.skill_type("continual light", {
        'mage': 6,
        'cleric': 4,
        'thief': 6,
        'warrior': 9
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_continual_light, merc.TAR_IGNORE, merc.POS_STANDING, None,
                     const.SLOT(57), 7, 12, "", "!Continual Light!", ""))
Exemple #16
0

def spell_fireball(sn, level, ch, victim, target):
    dam_each = [
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 35, 40, 45, 50, 55,
        60, 65, 70, 75, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104,
        106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130
    ]

    level = min(level, len(dam_each) - 1)
    level = max(0, level)
    dam = random.randint(dam_each[level] // 2, dam_each[level] * 2)
    if handler_magic.saves_spell(level, victim, merc.DAM_FIRE):
        dam = dam // 2
    fight.damage(ch, victim, dam, sn, merc.DAM_FIRE, True)


const.register_spell(
    const.skill_type("fireball", {
        'mage': 22,
        'cleric': 53,
        'thief': 30,
        'warrior': 26
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_fireball, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(26), 15, 12, "fireball", "!Fireball!", ""))
Exemple #17
0
import const
import fight
import game_utils
import handler_magic
import merc


def spell_flamestrike(sn, level, ch, victim, target):
    dam = game_utils.dice(6 + level // 2, 8)
    if handler_magic.saves_spell(level, victim, merc.DAM_FIRE):
        dam = dam // 2
    fight.damage(ch, victim, dam, sn, merc.DAM_FIRE, True)


const.register_spell(
    const.skill_type("flamestrike", {
        'mage': 53,
        'cleric': 20,
        'thief': 53,
        'warrior': 27
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_flamestrike, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(65), 20, 12, "flamestrike", "!Flamestrike!",
                     ""))
Exemple #18
0
        if vch.in_room == None:
            continue
        if vch.in_room == ch.in_room:
            if vch is not ch and (not vch.is_npc()
                                  if ch.is_npc() else vch.is_npc()):
                fight.damage(
                    ch, vch, dam // 2 if handler_magic.saves_spell(
                        level, vch, merc.DAM_LIGHTNING) else dam, sn,
                    merc.DAM_LIGHTNING, True)
            continue

        if vch.in_room.area == ch.in_room.area and state_checks.IS_OUTSIDE(
                vch) and vch.is_awake():
            vch.send("Lightning flashes in the sky.\n")


const.register_spell(
    const.skill_type("call lightning", {
        'mage': 26,
        'cleric': 18,
        'thief': 31,
        'warrior': 22
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_call_lightning, merc.TAR_IGNORE, merc.POS_FIGHTING, None,
                     const.SLOT(6), 15, 12, "lightning bolt",
                     "!Call Lightning!", ""))
Exemple #19
0
def spell_burning_hands(sn, level, ch, victim, target):
    dam_each = [
        0, 0, 0, 0, 0, 14, 17, 20, 23, 26, 29, 29, 29, 30, 30, 31, 31, 32, 32,
        33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41,
        42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48
    ]

    level = min(level, len(dam_each) - 1)
    level = max(0, level)
    dam = random.randint(dam_each[level] // 2, dam_each[level] * 2)
    if handler_magic.saves_spell(level, victim, merc.DAM_FIRE):
        dam = dam // 2
    fight.damage(ch, victim, dam, sn, merc.DAM_FIRE, True)


const.register_spell(
    const.skill_type("burning hands", {
        'mage': 7,
        'cleric': 53,
        'thief': 10,
        'warrior': 9
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_burning_hands, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(5), 15, 12, "burning hands", "!Burning Hands!",
                     ""))
Exemple #20
0
    af = handler_game.AFFECT_DATA()
    af.where = merc.TO_AFFECTS
    af.type = sn
    af.level = level * 3 // 4
    af.duration = level
    af.location = merc.APPLY_STR
    af.modifier = -5
    af.bitvector = merc.AFF_PLAGUE
    victim.affect_join(af)

    victim.send("You scream in agony as plague sores erupt from your skin.\n")
    handler_game.act("$n screams in agony as plague sores erupt from $s skin.",
                     victim, None, None, merc.TO_ROOM)


const.register_spell(
    const.skill_type("plague", {
        'mage': 23,
        'cleric': 17,
        'thief': 36,
        'warrior': 26
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_plague, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(503), 20, 12, "sickness", "Your sores vanish.",
                     ""))
import random
import const
import fight
import handler_magic
import merc


def spell_high_explosive(sn, level, ch, victim, target):
    dam = random.randint(30, 120)
    if handler_magic.saves_spell(level, victim, merc.DAM_PIERCE):
        dam = dam // 2
    fight.damage(ch, victim, dam, sn, merc.DAM_PIERCE, True)


const.register_spell(const.skill_type("high explosive",
                          {'mage': 53, 'cleric': 53, 'thief': 53, 'warrior': 53},
                          {'mage': 0, 'cleric': 0, 'thief': 0, 'warrior': 0},
                          spell_high_explosive, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING,
                          None, const.SLOT(402), 0, 12, "high explosive ammo", "!High Explosive Ammo!",
                          ""))  # combat and weapons skills */)
Exemple #22
0
import const
import handler_game
import merc
import object_creator


def spell_create_food(sn, level, ch, victim, target):
    mushroom = object_creator.create_item(
        instance.item_templates[merc.OBJ_VNUM_MUSHROOM], 0)
    mushroom.value[0] = level // 2
    mushroom.value[1] = level
    ch.in_room.put(mushroom)
    handler_game.act("$p suddenly appears.", ch, mushroom, None, merc.TO_ROOM)
    handler_game.act("$p suddenly appears.", ch, mushroom, None, merc.TO_CHAR)
    return


const.register_spell(
    const.skill_type("create food", {
        'mage': 10,
        'cleric': 5,
        'thief': 11,
        'warrior': 12
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_create_food, merc.TAR_IGNORE, merc.POS_STANDING, None,
                     const.SLOT(12), 5, 12, "", "!Create Food!", ""))
Exemple #23
0
        return

    af = handler_game.AFFECT_DATA()
    af.where = merc.TO_AFFECTS
    af.type = sn
    af.level = level
    af.duration = level // 6
    af.location = merc.APPLY_NONE
    af.modifier = 0
    af.bitvector = merc.AFF_SANCTUARY
    victim.affect_add(af)
    handler_game.act("$n is surrounded by a white aura.", victim, None, None,
                     merc.TO_ROOM)
    victim.send("You are surrounded by a white aura.\n")


const.register_spell(
    const.skill_type("sanctuary", {
        'mage': 36,
        'cleric': 20,
        'thief': 42,
        'warrior': 30
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_sanctuary, merc.TAR_CHAR_DEFENSIVE, merc.POS_STANDING, None,
                     const.SLOT(36), 75, 12, "",
                     "The white aura around your body fades.", ""))
Exemple #24
0
        ich = instance.characters[ich_id]
        if ich.invis_level > 0:
            continue

        if ich == ch or handler_magic.saves_spell(level, ich, merc.DAM_OTHER):
            continue

        ich.affect_strip('invis')
        ich.affect_strip('mass_invis')
        ich.affect_strip('sneak')
        ich.affected_by.rem_bit(merc.AFF_HIDE)
        ich.affected_by.rem_bit(merc.AFF_INVISIBLE)
        ich.affected_by.rem_bit(merc.AFF_SNEAK)
        handler_game.act("$n is revealed! ", ich, None, None, merc.TO_ROOM)
        ich.send("You are revealed! \n")


const.register_spell(
    const.skill_type("faerie fog", {
        'mage': 14,
        'cleric': 21,
        'thief': 16,
        'warrior': 24
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_faerie_fog, merc.TAR_IGNORE, merc.POS_STANDING, None,
                     const.SLOT(73), 12, 12, "faerie fog", "!Faerie Fog!", ""))
Exemple #25
0
        victim.send("You feel momentarily ill, but it passes.\n")
        return

    af = handler_game.AFFECT_DATA()
    af.where = merc.TO_AFFECTS
    af.type = sn
    af.level = level
    af.duration = level
    af.location = merc.APPLY_STR
    af.modifier = -2
    af.bitvector = merc.AFF_POISON
    victim.affect_join(af)
    victim.send("You feel very sick.\n")
    handler_game.act("$n looks very ill.", victim, None, None, merc.TO_ROOM)


const.register_spell(
    const.skill_type("poison", {
        'mage': 17,
        'cleric': 12,
        'thief': 15,
        'warrior': 21
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_poison, merc.TAR_OBJ_CHAR_OFF, merc.POS_FIGHTING, None,
                     const.SLOT(33), 10, 12, "poison", "You feel less sick.",
                     "The poison on $p dries up."))
Exemple #26
0
            level, victim, merc.DAM_OTHER):
        return
    af = handler_game.AFFECT_DATA()
    af.where = merc.TO_AFFECTS
    af.type = sn
    af.level = level
    af.duration = level // 2
    af.location = merc.APPLY_STR
    af.modifier = -1 * (level // 5)
    af.bitvector = merc.AFF_WEAKEN
    victim.affect_add(af)
    victim.send("You feel your strength slip away.\n")
    handler_game.act("$n looks tired and weak.", victim, None, None,
                     merc.TO_ROOM)


const.register_spell(
    const.skill_type("weaken", {
        'mage': 11,
        'cleric': 14,
        'thief': 16,
        'warrior': 17
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_weaken, merc.TAR_CHAR_OFFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(68), 20, 12, "spell", "You feel stronger.",
                     ""))
import merc


def spell_protection_evil(sn, level, ch, victim, target):
    if victim.is_affected( merc.AFF_PROTECT_EVIL) or victim.is_affected(
                                                                                           merc.AFF_PROTECT_GOOD):
        if victim == ch:
            ch.send("You are already protected.\n")
        else:
            handler_game.act("$N is already protected.", ch, None, victim, merc.TO_CHAR)
        return
    af = handler_game.AFFECT_DATA()
    af.where = merc.TO_AFFECTS
    af.type = sn
    af.level = level
    af.duration = 24
    af.location = merc.APPLY_SAVING_SPELL
    af.modifier = -1
    af.bitvector = merc.AFF_PROTECT_EVIL
    victim.affect_add(af)
    victim.send("You feel holy and pure.\n")
    if ch != victim:
        handler_game.act("$N is protected from evil.", ch, None, victim, merc.TO_CHAR)


const.register_spell(const.skill_type("protection evil",
                          {'mage': 12, 'cleric': 9, 'thief': 17, 'warrior': 11},
                          {'mage': 1, 'cleric': 1, 'thief': 2, 'warrior': 2},
                          spell_protection_evil, merc.TAR_CHAR_SELF, merc.POS_STANDING,
                          None, const.SLOT(34), 5, 12, "", "You feel less protected.", ""))
Exemple #28
0
    af.level = level
    if victim == ch:
        af.duration = level // 2
    else:
        af.duration = level // 4
    af.location = merc.APPLY_DEX
    af.modifier = 1 + (level >= 18) + (level >= 25) + (level >= 32)
    af.bitvector = merc.AFF_HASTE
    victim.affect_add(af)
    victim.send("You feel yourself moving more quickly.\n")
    handler_game.act("$n is moving more quickly.", victim, None, None,
                     merc.TO_ROOM)
    if ch != victim:
        ch.send("Ok.\n")


const.register_spell(
    const.skill_type("haste", {
        'mage': 21,
        'cleric': 53,
        'thief': 26,
        'warrior': 29
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_haste, merc.TAR_CHAR_DEFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(502), 30, 12, "",
                     "You feel yourself slow down.", ""))
    elif ap > 350:
        msg = "$N is of excellent moral character."
    elif ap > 100:
        msg = "$N is often kind and thoughtful."
    elif ap > -100:
        msg = "$N doesn't have a firm moral commitment."
    elif ap > -350:
        msg = "$N lies to $S friends."
    elif ap > -700:
        msg = "$N is a black-hearted murderer."
    else:
        msg = "$N is the embodiment of pure evil! ."

    handler_game.act(msg, ch, None, victim, merc.TO_CHAR)
    return


const.register_spell(
    const.skill_type("know alignment", {
        'mage': 12,
        'cleric': 9,
        'thief': 20,
        'warrior': 53
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_know_alignment, merc.TAR_CHAR_DEFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(58), 9, 12, "", "!Know Alignment!", ""))
Exemple #30
0
import const
import fight
import game_utils
import merc


def spell_cure_serious(sn, level, ch, victim, target):
    heal = game_utils.dice(2, 8) + level // 2
    victim.hit = min(victim.hit + heal, victim.max_hit)
    fight.update_pos(victim)
    victim.send("You feel better! \n")
    if ch != victim:
        ch.send("Ok.\n")


const.register_spell(
    const.skill_type("cure serious", {
        'mage': 53,
        'cleric': 7,
        'thief': 53,
        'warrior': 10
    }, {
        'mage': 1,
        'cleric': 1,
        'thief': 2,
        'warrior': 2
    }, spell_cure_serious, merc.TAR_CHAR_DEFENSIVE, merc.POS_FIGHTING, None,
                     const.SLOT(61), 15, 12, "", "!Cure Serious!", ""))