'Implements the stab'

def func(self):

    cmdstring = self.cmdstring
    if (cmdstring in ('attack', 'fight')):
        string = "How    do    you    want    to    fight?    Choose    one    of    'stab',    'slash'    or    'defend'."
        self.caller.msg(string)
        return
    if (cmdstring in ('parry', 'defend')):
        string = 'You    raise    your    weapon    in    a    defensive    pose,    ready    to    block    the    next    enemy    attack.'
        self.caller.msg(string)
        self.caller.db.combat_parry_mode = True
        self.caller.location.msg_contents(('%s    takes    a    defensive    stance' % self.caller), exclude=[self.caller])
        return
    if (not self.args):
        self.caller.msg('Who    do    you    attack?')
        return
    target = self.caller.search(self.args.strip())
    if (not target):
        return
    if (cmdstring in ('thrust', 'pierce', 'stab')):
        hit = (float(self.obj.db.hit) * 0.7)
        damage = (self.obj.db.damage * 2)
        string = ('You    stab    with    %s.    ' % self.obj.key)
        tstring = ('%s    stabs    at    you    with    %s.    ' % (self.caller.key, self.obj.key))
        ostring = ('%s    stabs    at    %s    with    %s.    ' % (self.caller.key, target.key, self.obj.key))
        self.caller.db.combat_parry_mode = False
    elif (cmdstring in ('slash', 'chop')):
        hit = float(self.obj.db.hit)
        damage = self.obj.db.damage
        string = ('You    slash    with    %s.    ' % self.obj.key)
        tstring = ('%s    slash    at    you    with    %s.    ' % (self.caller.key, self.obj.key))
        ostring = ('%s    slash    at    %s    with    %s.    ' % (self.caller.key, target.key, self.obj.key))
        self.caller.db.combat_parry_mode = False
    else:
        self.caller.msg('You    fumble    with    your    weapon,    unsure    of    whether    to    stab,    slash    or    parry    ...')
        self.caller.location.msg_contents(('%s    fumbles    with    their    weapon.' % self.caller), exclude=self.caller)
        self.caller.db.combat_parry_mode = False
        return
    if target.db.combat_parry_mode:
        target.msg('|GYou    defend,    trying    to    avoid    the    attack.|n')
        hit *= 0.5
    if (random.random() <= hit):
        self.caller.msg((string + "|gIt's    a    hit!|n"))
        target.msg((tstring + "|rIt's    a    hit!|n"))
        self.caller.location.msg_contents((ostring + "It's    a    hit!"), exclude=[target, self.caller])
        if hasattr(target, 'at_hit'):
            target.at_hit(self.obj, self.caller, damage)
            return
        elif target.db.health:
            target.db.health -= damage
        else:
            self.caller.msg('The    enemy    seems    unaffected.')
            return
    else:
        self.caller.msg((string + '|rYou    miss.|n'))
        target.msg((tstring + '|gThey    miss    you.|n'))
        self.caller.location.msg_contents((ostring + 'They    miss.'), exclude=[target, self.caller])
