예제 #1
0
def cmd_inconnu(ch, argument):
    if ch.is_npc():
        return

    if not ch.is_vampire():
        ch.huh()
        return

    if ch.clan and ch.powers[merc.UNI_GEN] < 3:
        ch.send("You cannot abandon your clan!\n")
        return

    if ch.years_old() < 75 and ch.powers[merc.UNI_GEN] > 2:
        ch.send("You must be at least an Elder to become an Inconnu.\n")
        return

    if ch.special.is_set(merc.SPC_INCONNU):
        ch.send("But you are already an Inconnu!\n")
        return

    if ch.exp < 1000000:
        ch.send("It costs 1000000 exp to become an Inconnu.\n")
        return

    ch.special.rem_bit(merc.SPC_ANARCH)
    ch.clan = ""
    ch.exp -= 1000000
    ch.send("You are now an Inconnu.\n")
    comm.info("{} is now an Inconnu!".format(ch.name))
    ch.special.set_bit(merc.SPC_INCONNU)
예제 #2
0
def cmd_anarch(ch, argument):
    if ch.is_npc():
        return

    if not ch.is_vampire():
        ch.huh()
        return

    if ch.clan:
        ch.send("But you are already in a clan!\n")
        return

    if ch.special.is_set(merc.SPC_INCONNU):
        ch.send("But you are already an Inconnu!\n")
        return

    if ch.special.is_set(merc.SPC_ANARCH):
        ch.send("You are no longer an Anarch.\n")
        comm.info("{} is no longer an Anarch!".format(ch.name))
        ch.special.rem_bit(merc.SPC_ANARCH)
        return

    ch.send("You are now an Anarch.\n")
    comm.info("{} is now an Anarch!".format(ch.name))
    ch.special.set_bit(merc.SPC_ANARCH)
예제 #3
0
def cmd_tie(ch, argument):
    argument, arg = game_utils.read_word(argument)

    victim = ch.get_char_room(arg)
    if not victim:
        ch.not_here(arg)
        return

    if ch == victim:
        ch.not_self()
        return

    if victim.extra.is_set(merc.EXTRA_TIED_UP):
        ch.send("But they are already tied up!\n")
        return

    if victim.position > merc.POS_STUNNED or victim.hit > 0:
        ch.send("You can only tie up a defenceless person.\n")
        return

    handler_game.act("You quickly tie up $N.", ch, None, victim, merc.TO_CHAR)
    handler_game.act("$n quickly ties up $N.", ch, None, victim, merc.TO_ROOM)
    victim.send("You have been tied up!\n")
    victim.extra.set_bit(merc.EXTRA_TIED_UP)
    comm.info("{} has been tied up by {}.".format(victim.name, ch.name))
예제 #4
0
def cmd_godless(ch, argument):
    argument, arg = game_utils.read_word(argument)

    if ch.is_npc():
        return

    if not arg:
        ch.send("Do you wish to switch it ON or OFF?\n")
        return

    if ch.level != 3 and not ch.act.is_set(merc.PLR_GODLESS):
        ch.send("Sorry, you must be level 3.\n")
        return

    if ch.act.is_set(merc.PLR_GODLESS) and game_utils.str_cmp(arg, "off"):
        ch.act.rem_bit(merc.PLR_GODLESS)
        ch.send("You now obey the gods.\n")
        comm.info("{} now follows the whims of the gods.".format(ch.name))
    elif not ch.act.is_set(merc.PLR_GODLESS) and game_utils.str_cmp(
            arg, "off"):
        ch.send("But you already obey the gods!\n")
    elif not ch.act.is_set(merc.PLR_GODLESS) and game_utils.str_cmp(arg, "on"):
        ch.act.set_bit(merc.PLR_GODLESS)
        ch.send("You no longer obey the gods.\n")
        comm.info("{} has rejected the gods.".format(ch.name))
    elif ch.act.is_set(merc.PLR_GODLESS) and game_utils.str_cmp(arg, "on"):
        ch.send("But you have already rejected the gods!\n")
    else:
        ch.send("Do you wish to switch it ON or OFF?\n")
예제 #5
0
def cmd_quit(ch, argument):
    if ch.is_npc():
        return

    if ch.position == merc.POS_FIGHTING:
        ch.send("No way! You are fighting.\n")
        return

    if ch.position < merc.POS_SLEEPING:
        ch.send("You're not DEAD yet.\n")
        return

    mount = ch.mount
    if mount:
        ch.cmd_dismount("")

    # After extract_char the ch is no longer valid!
    for item_id in ch.equipped.values():
        if not item_id:
            continue

        item = instance.items[item_id]

        if not ch.is_npc() and (item.chobj and not item.chobj.is_npc() and item.chobj.obj_vnum != 0) or item.item_type == merc.ITEM_KEY:
            ch.unequip(item.equipped_to, silent=True, forced=True)

    ch.save(logout=True, force=True)

    if ch.obj_vnum != 0:
        handler_game.act("$n slowly fades out of existance.", ch, None, None, merc.TO_ROOM)
    else:
        handler_game.act("$n has left the game.", ch, None, None, merc.TO_ROOM)

    comm.notify("{} has quit.".format(ch.name), merc.CONSOLE_INFO)
    if ch.obj_vnum == 0:
        comm.info("{} has left the God Wars.".format(ch.name))

    if ch.chobj:
        ch.chobj.extract()

    ch.send("\n           I'm a lean dog, a keen dog, a wild dog, and lone;\n"
            "           I'm a rough dog, a tough dog, hunting on my own;\n"
            "           I'm a bad dog, a mad dog, teasing silly sheep;\n"
            "           I love to sit and bay the moon, to keep fat souls from sleep.\n\n")

    d = ch.desc
    pid = ch.id
    ch.extract(True)

    if d:
        comm.close_socket(d)

    # toast evil cheating bastards
    for d in instance.descriptor_list[:]:
        tch = handler_ch.ch_desc(d)
        if tch and tch.id == pid:
            tch.extract(True)
            comm.close_socket(d)
예제 #6
0
def cmd_accept(ch, argument):
    argument, arg = game_utils.read_word(argument)

    if ch.is_npc():
        return

    if ch.marriage:
        if ch.extra.is_set(merc.EXTRA_MARRIED):
            ch.send("But you are already married!\n")
        else:
            ch.send("But you are already engaged!\n")
        return

    if not arg:
        ch.send("Who's proposal of marriage do you wish to accept?\n")
        return

    victim = ch.get_char_room(arg)
    if not victim:
        ch.not_here(arg)
        return

    if victim.is_npc():
        ch.not_npc()
        return

    if victim.marriage:
        if victim.extra.is_set(merc.EXTRA_MARRIED):
            ch.send("But they are already married!\n")
        else:
            ch.send("But they are already engaged!\n")
        return

    if not victim.propose or victim.propose != ch:
        ch.send("But they haven't proposed to you!\n")
        return

    if (ch.sex == merc.SEX_MALE and victim.sex == merc.SEX_FEMALE) or (
            ch.sex == merc.SEX_FEMALE and victim.sex == merc.SEX_MALE):
        victim.propose = None
        ch.propose = None
        victim.marriage = ch.name
        ch.marriage = victim.name
        handler_game.act("You accept $S offer of marriage.", ch, None, victim,
                         merc.TO_CHAR)
        handler_game.act("$n accepts $N's offer of marriage.", ch, None,
                         victim, merc.TO_NOTVICT)
        handler_game.act("$n accepts your offer of marriage.", ch, None,
                         victim, merc.TO_VICT)
        ch.save(force=True)
        victim.save(force=True)
        comm.info("{} and {} are now engaged!".format(ch.name, victim.name))
        return

    ch.send("I don't think that would be a very good idea...\n")
예제 #7
0
def cmd_breakup(ch, argument):
    argument, arg = game_utils.read_word(argument)

    if ch.is_npc():
        return

    if ch.marriage:
        if ch.extra.is_set(merc.EXTRA_MARRIED):
            ch.send("You'll have to get divorced.\n")
            return
    else:
        ch.send("But you are not even engaged!\n")
        return

    if not arg:
        ch.send("Who do you wish to break up with?\n")
        return

    victim = ch.get_char_room(arg)
    if not victim:
        ch.not_here(arg)
        return

    if victim.is_npc():
        ch.not_npc()
        return

    if victim.marriage:
        if victim.extra.is_set(merc.EXTRA_MARRIED):
            ch.send("They'll have to get divorced.\n")
            return
    else:
        ch.send("But they are not even engaged!\n")
        return

    if game_utils.str_cmp(ch.name, victim.marriage) and game_utils.str_cmp(
            victim.name, ch.marriage):
        victim.marriage = ""
        ch.marriage = ""
        handler_game.act("You break off your engagement with $M.", ch, None,
                         victim, merc.TO_CHAR)
        handler_game.act("$n breaks off $n engagement with $N.", ch, None,
                         victim, merc.TO_NOTVICT)
        handler_game.act("$n breaks off $s engagement with you.", ch, None,
                         victim, merc.TO_VICT)
        ch.save(force=True)
        victim.save(force=True)
        comm.info("{} and {} have broken up!".format(ch.name, victim.name))

    ch.send("You are not engaged to them.\n")
예제 #8
0
def cmd_divorce(ch, argument):
    argument, arg1 = game_utils.read_word(argument)
    argument, arg2 = game_utils.read_word(argument)

    if not arg1 or not arg2:
        ch.send("Syntax: divorse <person> <person>\n")
        return

    victim1 = ch.get_char_room(arg1)
    if not victim1:
        ch.not_here(arg1)
        return

    victim2 = ch.get_char_room(arg2)
    if not victim2:
        ch.not_here(arg2)
        return

    if victim1.is_npc() or victim2.is_npc():
        ch.not_npc()
        return

    if victim1.act.is_set(merc.PLR_GODLESS) and ch.level < merc.NO_GODLESS:
        ch.send("You failed.\n")
        return

    if victim2.act.is_set(merc.PLR_GODLESS) and ch.level < merc.NO_GODLESS:
        ch.send("You failed.\n")
        return

    if game_utils.str_cmp(victim1.name,
                          victim2.marriage) and game_utils.str_cmp(
                              victim2.name, victim1.marriage):
        if not victim1.extra.is_set(
                merc.EXTRA_MARRIED) or not victim2.extra.is_set(
                    merc.EXTRA_MARRIED):
            ch.send("But they are not married!\n")
            return

        victim1.extra.rem_bit(merc.EXTRA_MARRIED)
        victim2.extra.rem_bit(merc.EXTRA_MARRIED)
        victim1.marriage = ""
        victim2.marriage = ""
        victim1.save(force=True)
        victim2.save(force=True)
        comm.info("{} and {} are now divorced!".format(victim1.name,
                                                       victim2.name))
        return

    ch.send("But they are not married!\n")
예제 #9
0
def cmd_escape(ch, argument):
    if ch.is_npc() or not ch.is_hero():
        return

    if ch.position >= merc.POS_SLEEPING:
        ch.send("You can only do this if you are dying.\n")
        return

    location = instance.rooms[merc.ROOM_VNUM_TEMPLE]
    if not location:
        ch.send("You are completely lost.\n")
        return

    if ch.in_room == location:
        return

    ch.move = 0
    ch.mana = 0
    handler_game.act("$n fades out of existance.", ch, None, None, merc.TO_ROOM)
    ch.in_room.get(ch)
    location.put(ch)
    handler_game.act("$n fades into existance.", ch, None, None, merc.TO_ROOM)
    ch.cmd_look("auto")
    comm.info("{} has escaped defenceless from a fight.".format(ch.name))
예제 #10
0
def cmd_recharge(ch, argument):
    argument, arg1 = game_utils.read_word(argument)
    argument, arg2 = game_utils.read_word(argument)

    if not arg1 or not arg2:
        ch.send("Syntax: recharge <quest card> <quest machine>\n")
        return

    card = ch.get_item_carry(arg1)
    if not card:
        ch.send("You are not carrying that object.\n")
        return

    if card.item_type != merc.ITEM_QUESTCARD:
        ch.send("That is not a quest card.\n")
        return

    machine = ch.get_item_here(arg2)
    if not machine:
        ch.send("There is nothing for you to recharge it with.\n")
        return

    if machine.item_type != merc.ITEM_QUESTMACHINE:
        ch.send("That is not a quest machine.\n")
        return

    count = 0
    for i in range(4):
        if card.value[i] == -1:
            count += 1

    if count == 4:
        card.quest_object()
    else:
        ch.send("You have not yet completed the current quest.\n")
        return

    handler_game.act("You place $p into a small slot in $P.", ch, card,
                     machine, merc.TO_CHAR)
    handler_game.act("$n places $p into a small slot in $P.", ch, card,
                     machine, merc.TO_ROOM)
    handler_game.act("$P makes a few clicks and returns $p.", ch, card,
                     machine, merc.TO_CHAR)
    handler_game.act("$P makes a few clicks and returns $p.", ch, card,
                     machine, merc.TO_ROOM)
    value = state_checks.urange(1, card.level, 50)

    item = object_creator.create_item(
        instance.item_templates[merc.OBJ_VNUM_PROTOPLASM], 0)
    item.name = "quest token"
    item.short_descr = "a {} point quest token".format(value)
    item.description = "A {} point quest token lies on the floor.".format(
        value)
    item.value[0] = value
    item.level = value
    item.cost = value * 1000
    item.item_type = merc.ITEM_QUEST
    item.questmaker = ch.name
    ch.put(item)
    handler_game.act("You take $p from $P.", ch, item, machine, merc.TO_CHAR)
    handler_game.act("$n takes $p from $P.", ch, item, machine, merc.TO_ROOM)

    if not ch.is_npc():
        ch.score[merc.SCORE_NUM_QUEST] += 1
        ch.score[merc.SCORE_QUEST] += value

    comm.info("{} has completed a quest!".format(
        ch.name if not ch.is_npc() else ch.short_descr))
    ch.save(force=True)
예제 #11
0
def cmd_train(ch, argument):
    argument, arg1 = game_utils.read_word(argument)
    argument, arg2 = game_utils.read_word(argument)

    if ch.is_npc():
        return

    last = True
    is_ok = False

    if not arg1:
        ch.send("You have {:,} experience points.\n".format(ch.exp))
        arg1 = "foo"

    isok_list = [
        "str", "int", "wis", "dex", "con", "hp", "mana", "move", "primal"
    ]
    for stat in isok_list:
        if game_utils.str_cmp(arg1, stat):
            is_ok = True
    else:
        if game_utils.str_cmp(arg1, "silver") and ch.is_werewolf():
            is_ok = True

    if arg2 and is_ok:
        if not arg2.isdigit():
            ch.send("Please enter a numeric value.\n")
            return

        amount = int(arg2)
        if arg2 not in merc.irange(1, 50):
            ch.send("Please enter a value between 1 and 50.\n")
            return

        if amount > 1:
            ch.cmd_train("{} {}".format(arg1, amount - 1))
            last = False

    cost = 200
    immcost = count_imms(ch)
    primal = (1 + ch.practice) * 500
    silver = (1 + ch.powers[merc.WPOWER_SILVER]) * 2500
    max_stat = 25 if ch.is_highlander() else 18

    if game_utils.str_cmp(arg1, "str"):
        pability = merc.STAT_STR
        poutput = "strength"
    elif game_utils.str_cmp(arg1, "int"):
        pability = merc.STAT_INT
        poutput = "intelligence"
    elif game_utils.str_cmp(arg1, "wis"):
        pability = merc.STAT_WIS
        poutput = "wisdom"
    elif game_utils.str_cmp(arg1, "dex"):
        pability = merc.STAT_DEX
        poutput = "dexterity"
    elif game_utils.str_cmp(arg1, "con"):
        pability = merc.STAT_CON
        poutput = "constitution"
    elif game_utils.str_cmp(arg1, "avatar") and ch.level == 2:
        cost = 1000
        pability = ch.level
        poutput = "level"
    elif game_utils.str_cmp(arg1, "hp") and ch.max_hit < 30000:
        cost = ch.max_hit - ch.perm_stat[merc.STAT_CON]
        pability = ch.max_hit
        poutput = "hp"
    elif game_utils.str_cmp(arg1, "mana") and ch.max_mana < 30000:
        cost = ch.max_mana - ch.perm_stat[merc.STAT_WIS]
        pability = ch.max_mana
        poutput = "mana"
    elif game_utils.str_cmp(arg1, "move") and ch.max_move < 30000:
        cost = ch.max_move - ch.perm_stat[merc.STAT_CON]
        pability = ch.max_move
        poutput = "move"
    elif game_utils.str_cmp(arg1, "primal") and ch.practice < 100:
        cost = primal
        pability = ch.practice
        poutput = "primal"
    elif game_utils.str_cmp(arg1, "silver") and ch.is_werewolf(
    ) and ch.powers[merc.WPOWER_SILVER] < 100:
        cost = silver
        pability = ch.powers[merc.WPOWER_SILVER]
        poutput = "tolerance to silver"
    else:
        imm_list = [
            ("slash", merc.IMM_SLASH,
             "resistant to slashing and slicing weapons"),
            ("stab", merc.IMM_STAB,
             "resistant to stabbing and piercing weapons"),
            ("smash", merc.IMM_SMASH,
             "resistant to blasting, pounding and crushing weapons"),
            ("beast", merc.IMM_ANIMAL, "resistant to claw and bite attacks"),
            ("grab", merc.IMM_MISC,
             "resistant to grepping, sucking and whipping weapons"),
            ("charm", merc.IMM_CHARM, "immune to charm spells"),
            ("heat", merc.IMM_HEAT, "immune to heat and fire spells"),
            ("cold", merc.IMM_COLD, "immune to cold spells"),
            ("lightning", merc.IMM_LIGHTNING,
             "immune to lightning and electrical spells"),
            ("acid", merc.IMM_ACID, "immune to acid spells"),
            ("sleep", merc.IMM_SLEEP, "immune to the sleep spell"),
            ("drain", merc.IMM_DRAIN, "immune to the energy drain spell"),
            ("voodoo", merc.IMM_VOODOO, "immune to voodoo magic"),
            ("hurl", merc.IMM_HURL, "immune to being hurled"),
            ("backstab", merc.IMM_BACKSTAB, "immune to being backstabbed"),
            ("kick", merc.IMM_KICK, "immune to being kicked"),
            ("disarm", merc.IMM_DISARM, "immune to being disarmed"),
            ("steal", merc.IMM_STEAL, "immune to being stolen from")
        ]
        for (aa, bb, cc) in imm_list:
            if game_utils.str_cmp(arg1, aa) and not ch.immune.is_set(bb):
                if ch.exp < immcost:
                    ch.send("You don't have enough exp.\n")
                    return

                ch.exp -= immcost
                ch.immune.set_bit(bb)
                ch.send("You are now {}.\n".format(cc))
                return
        else:
            buf = ["You can train the following:\n"]
            buf += "Stats:"

            if ch.perm_stat[merc.STAT_STR] < max_stat:
                buf += " Str"

            if ch.perm_stat[merc.STAT_INT] < max_stat:
                buf += " Int"

            if ch.perm_stat[merc.STAT_WIS] < max_stat:
                buf += " Wis"

            if ch.perm_stat[merc.STAT_DEX] < max_stat:
                buf += " Dex"

            if ch.perm_stat[merc.STAT_CON] < max_stat:
                buf += " Con"

            if ch.perm_stat[merc.STAT_STR] >= max_stat and ch.perm_stat[merc.STAT_INT] >= max_stat and ch.perm_stat[merc.STAT_WIS] >= max_stat and \
                    ch.perm_stat[merc.STAT_DEX] >= max_stat and ch.perm_stat[merc.STAT_CON] >= max_stat:
                buf += " None left to train"
            buf += ".\n"

            if ch.level == 2:
                buf += "Become an avatar - 1000 exp.\n"

            if ch.max_hit < 30000:
                buf += "Hp               - {} exp per point.\n".format(
                    ch.max_hit - ch.perm_stat[merc.STAT_CON])

            if ch.max_mana < 30000:
                buf += "Mana             - {} exp per point.\n".format(
                    ch.max_mana - ch.perm_stat[merc.STAT_WIS])

            if ch.max_move < 30000:
                buf += "Move             - {} exp per point.\n".format(
                    ch.max_move - ch.perm_stat[merc.STAT_CON])

            if ch.practice < 100:
                buf += "Primal           - {} exp per point of primal energy.\n".format(
                    primal)

            if ch.powers[merc.WPOWER_SILVER] < 100 and ch.is_werewolf():
                buf += "Silver tolerance - {} exp per point of tolerance.\n".format(
                    silver)

            buf += "Natural resistances and immunities - {} exp each.\n".format(
                immcost)

            # Weapon resistance affects
            buf += "Weapon resistances:"
            found = False
            imm_list = [(merc.IMM_SLASH, " Slash"), (merc.IMM_STAB, " Stab"),
                        (merc.IMM_SMASH, " Smash"),
                        (merc.IMM_ANIMAL, " Beast"), (merc.IMM_MISC, " Grab")]
            for (aa, bb) in imm_list:
                if not ch.immune.is_set(aa):
                    found = True
                    buf += bb
            else:
                if not found:
                    buf += " None left to learn.\n"
                else:
                    buf += ".\n"

            # Spell immunity affects
            buf += "Magical immunities:"
            found = False
            imm_list = [(merc.IMM_CHARM, " Charm"), (merc.IMM_HEAT, " Heat"),
                        (merc.IMM_COLD, " Cold"),
                        (merc.IMM_LIGHTNING, " Lightning"),
                        (merc.IMM_ACID, " Acid"), (merc.IMM_SLEEP, " Sleep"),
                        (merc.IMM_DRAIN, " Drain"),
                        (merc.IMM_VOODOO, " Voodoo")]
            for (aa, bb) in imm_list:
                if not ch.immune.is_set(aa):
                    found = True
                    buf += bb
            else:
                if not found:
                    buf += " None left to learn.\n"
                else:
                    buf += ".\n"

            # Skill immunity affects
            buf += "Skill immunities:"
            imm_list = [(merc.IMM_HURL, " Hurl"),
                        (merc.IMM_BACKSTAB, " Backstab"),
                        (merc.IMM_KICK, " Kick"), (merc.IMM_DISARM, " Disarm"),
                        (merc.IMM_STEAL, " Steal")]
            found = False
            for (aa, bb) in imm_list:
                if not ch.immune.is_set(aa):
                    found = True
                    buf += bb
            else:
                if not found:
                    buf += " None left to learn.\n"
                else:
                    buf += ".\n"

            ch.send("".join(buf))
            return

    if pability >= max_stat and game_utils.str_cmp(
            arg1, ["str", "int", "wis", "dex", "con"]):
        if last:
            handler_game.act("Your $T is already at maximum.", ch, None,
                             poutput, merc.TO_CHAR)
        return

    if pability >= 30000 and game_utils.str_cmp(arg1, ["hp", "mana", "move"]):
        if last:
            handler_game.act("Your $T is already at maximum.", ch, None,
                             poutput, merc.TO_CHAR)
        return

    if pability >= 100 and game_utils.str_cmp(arg1, ["primal", "silver"]):
        if last:
            handler_game.act("Your $T is already at maximum.", ch, None,
                             poutput, merc.TO_CHAR)
        return

    if cost < 1:
        cost = 1

    if cost > ch.exp:
        if last:
            ch.send("You don't have enough exp.\n")
        return

    ch.exp -= cost

    if game_utils.str_cmp(arg1, "avatar"):
        ch.level = merc.LEVEL_AVATAR
    elif game_utils.str_cmp(arg1, "hp"):
        ch.max_hit += 1
    elif game_utils.str_cmp(arg1, "mana"):
        ch.max_mana += 1
    elif game_utils.str_cmp(arg1, "move"):
        ch.max_move += 1
    elif game_utils.str_cmp(arg1, "silver"):
        ch.powers[merc.WPOWER_SILVER] += 1
    elif game_utils.str_cmp(arg1, "primal"):
        ch.practice += 1
    else:
        ch.perm_stat[pability] += 1

    if game_utils.str_cmp(arg1, "avatar"):
        handler_game.act("You become an avatar!", ch, None, None, merc.TO_CHAR)
        comm.info("{} has become an avatar!".format(ch.name))

        if ch.level < ch.trust:
            ch.level = ch.trust

        if not ch.is_npc() and ch.vampaff.is_set(merc.VAM_MORTAL):
            ch.mortalvamp("")
    elif last:
        handler_game.act("Your $T increases!", ch, None, poutput, merc.TO_CHAR)
예제 #12
0
def cmd_info(ch, argument):
    if not argument:
        return

    comm.info(argument)
예제 #13
0
def cmd_decapitate(ch, argument):
    argument, arg = game_utils.read_word(argument)

    if ch.is_npc():
        return

    item = ch.get_eq("right_hand")
    if not item or item.item_type != merc.ITEM_WEAPON:
        item = ch.get_eq("left_hand")
        if not item or item.item_type != merc.ITEM_WEAPON:
            ch.send("But you are not wielding any weapons!\n")
            return

    if item.value[3] not in [1, 3]:
        ch.send(
            "You need to wield a slashing or slicing weapon to decapitate.\n")
        return

    if not arg:
        ch.send("Decapitate whom?\n")
        return

    victim = ch.get_char_room(arg)
    if not victim:
        ch.not_here(arg)
        return

    if ch == victim:
        ch.not_self()
        return

    if victim.is_npc():
        ch.send("You can only decapitate other players.\n")
        return

    if not ch.can_pk():
        ch.send("You must be an avatar to decapitate someone.\n")
        return

    if not victim.can_pk():
        ch.send("You can only decapitate other avatars.\n")
        return

    if victim.position > merc.POS_MORTAL:
        ch.send("You can only do this to mortally wounded players.\n")
        return

    if fight.is_safe(ch, victim):
        return

    if ch.is_vampire() and ch.special.is_set(
            merc.SPC_INCONNU) and (victim.is_vampire()
                                   or victim.vampaff.is_set(merc.VAM_MORTAL)):
        ch.send("You cannot decapitate another vampire.\n")
        return

    if victim.is_vampire() and victim.special.is_set(
            merc.SPC_INCONNU) and (ch.is_vampire()
                                   or ch.vampaff.is_set(merc.VAM_MORTAL)):
        ch.send("You cannot decapitate an Inconnu vampire.\n")
        return

    if ch.is_vampire() and victim.is_vampire() and ch.clan and victim.clan:
        if game_utils.str_cmp(ch.clan, victim.clan):
            ch.send("You cannot decapitate someone of your own clan.\n")
            return

    handler_game.act("You bring your weapon down upon $N's neck!", ch, None,
                     victim, merc.TO_CHAR)
    victim.send("Your head is sliced from your shoulders!\n")
    handler_game.act("$n swings $s weapon down towards $N's neck!", ch, None,
                     victim, merc.TO_NOTVICT)
    handler_game.act("$n's head is sliced from $s shoulders!", victim, None,
                     None, merc.TO_ROOM)

    if ch.is_demon() or ch.special.is_set(
            merc.SPC_CHAMPION) and not victim.is_demon(
            ) and not victim.special.is_set(merc.SPC_CHAMPION):
        if ch.race == 0 and victim.race == 0:
            ch.powers[merc.DEMON_CURRENT] += 1000
            ch.powers[merc.DEMON_TOTAL] += 1000
        else:
            ch.powers[merc.DEMON_CURRENT] += victim.race * 1000
            ch.powers[merc.DEMON_TOTAL] += victim.race * 1000

    if victim.race < 1 and ch.race > 0:
        comm.info("{} has been decapitated by {} for no status.".format(
            victim.name, ch.name))
        comm.notify(
            "{} decapitated by {} at {} for no status.".format(
                victim.name, ch.name, victim.in_room.vnum), merc.CONSOLE_INFO)

        if victim.is_vampire():
            victim.mortalvamp()
        elif victim.special.is_set(merc.SPC_WOLFMAN):
            victim.unwerewolf()

        if victim.is_mage() and victim.is_affected(merc.AFF_POLYMORPH):
            victim.cmd_unpolymorph("")

        fight.behead(victim)
        ch.beastlike()
        ch.pkill += 1
        victim.pdeath += 1
        return

    ch.exp += 1000

    if ch.race - ((ch.race // 100) * 100) == 0:
        ch.race += 1
    elif ch.race - ((ch.race // 100) * 100) < 25:
        ch.race += 1

    if ch.race - ((ch.race // 100) * 100) == 0:
        victim.race = victim.race
    elif victim.race - ((victim.race // 100) * 100) > 0:
        victim.race += 1

    handler_game.act(
        "A misty white vapour pours from $N's corpse into your body.", ch,
        None, victim, merc.TO_CHAR)
    handler_game.act(
        "A misty white vapour pours from $N's corpse into $n's body.", ch,
        None, victim, merc.TO_NOTVICT)
    handler_game.act(
        "You double over in agony as raw energy pulses through your veins.",
        ch, None, None, merc.TO_CHAR)
    handler_game.act(
        "$n doubles over in agony as sparks of energy crackle around $m.", ch,
        None, None, merc.TO_NOTVICT)

    if victim.is_vampire():
        victim.mortalvamp()
    elif victim.special.is_set(merc.SPC_WOLFMAN):
        victim.unwerewolf()

    if victim.is_mage() and victim.is_affected(merc.AFF_POLYMORPH):
        victim.cmd_unpolymorph("")

    fight.behead(victim)
    ch.beastlike()
    ch.pkill += 1
    victim.pdeath += 1
    victim.powers[merc.UNI_RAGE] = 0
    victim.level = 2
    comm.info("{} has been decapitated by {}.".format(victim.name, ch.name))
    comm.notify(
        "{} decapitated by {} at {}.".format(victim.name, ch.name,
                                             victim.in_room.vnum),
        merc.CONSOLE_INFO)
예제 #14
0
def cmd_tear(ch, argument):
    argument, arg = game_utils.read_word(argument)

    if ch.is_npc():
        return

    if not ch.is_werewolf():
        ch.huh()
        return

    if not ch.special.is_set(merc.SPC_WOLFMAN):
        ch.send("You can only tear heads off while in Crinos form.\n")
        return

    if not ch.vampaff.is_set(merc.VAM_CLAWS):
        ch.send("You better get your claws out first.\n")
        return

    if not arg:
        ch.send("Who's head do you wish to tear off?\n")
        return

    victim = ch.get_char_room(arg)
    if not victim:
        ch.not_here(arg)
        return

    if ch == victim:
        ch.not_self()
        return

    if victim.is_npc():
        ch.send("You can only tear the heads off other players.\n")
        return

    if not ch.can_pk():
        ch.send("You must be an avatar to tear someone's head off.\n")
        return

    if not victim.can_pk():
        ch.send("You can only tear the head off another avatar.\n")
        return

    if victim.position > merc.POS_MORTAL:
        ch.send("You can only do this to mortally wounded players.\n")
        return

    if fight.is_safe(ch, victim):
        return

    handler_game.act("You tear $N's head from $S shoulders!", ch, None, victim,
                     merc.TO_CHAR)
    victim.send("Your head is torn from your shoulders!\n")
    handler_game.act("$n tears $N's head from $S shoulders!", ch, None, victim,
                     merc.TO_NOTVICT)

    if ch.is_demon() or ch.special.is_set(merc.SPC_CHAMPION):
        if ch.race == 0 and victim.race == 0:
            ch.powers[merc.DEMON_CURRENT] += 1000
            ch.powers[merc.DEMON_TOTAL] += 1000
        else:
            ch.powers[merc.DEMON_CURRENT] += victim.race * 1000
            ch.powers[merc.DEMON_TOTAL] += victim.race * 1000

    if victim.race < 1 and ch.race > 0:
        comm.info("{} has been decapitated by {}.".format(
            victim.name, ch.name))
        comm.notify(
            "{} decapitated by {} at {} for no status.".format(
                victim.name, ch.name, victim.in_room.vnum), merc.CONSOLE_INFO)

        if victim.is_vampire():
            victim.mortalvamp()
        elif victim.special.is_set(merc.SPC_WOLFMAN):
            victim.unwerewolf()

        if victim.is_mage() and victim.is_affected(merc.AFF_POLYMORPH):
            victim.cmd_unpolymorph("")

        fight.behead(victim)
        ch.beastlike()
        ch.pkill += 1
        victim.pdeath += 1
        return

    ch.exp += 1000
    if ch.race - ((ch.race // 100) * 100) == 0:
        ch.race = ch.race + 1
    elif ch.race - ((ch.race // 100) * 100) < 25:
        ch.race = ch.race + 1

    if ch.race - ((ch.race // 100) * 100) == 0:
        victim.race = victim.race
    elif victim.race - ((victim.race // 100) * 100) > 0:
        victim.race = victim.race - 1

    handler_game.act(
        "A misty white vapour pours from $N's corpse into your body.", ch,
        None, victim, merc.TO_CHAR)
    handler_game.act(
        "A misty white vapour pours from $N's corpse into $n's body.", ch,
        None, victim, merc.TO_NOTVICT)
    handler_game.act(
        "You double over in agony as raw energy pulses through your veins.",
        ch, None, None, merc.TO_CHAR)
    handler_game.act(
        "$n doubles over in agony as sparks of energy crackle around $m.", ch,
        None, None, merc.TO_NOTVICT)

    if victim.is_vampire():
        victim.mortalvamp()
    elif victim.special.is_set(merc.SPC_WOLFMAN):
        victim.unwerewol()

    if victim.is_mage() and victim.is_affected(merc.AFF_POLYMORPH):
        victim.cmd_unpolymorph("")

    fight.behead(victim)
    ch.beastlike()
    ch.pkill += 1
    victim.pdeath += 1
    victim.powers[merc.UNI_RAGE] = 0
    victim.level = 2
    comm.info("{} has been decapitated by {}.".format(victim.name, ch.name))
    comm.notify(
        "{} decapitated by {} at {}.".format(victim.name, ch.name,
                                             victim.in_room.vnum),
        merc.CONSOLE_INFO)