/
area/city/
area/crypts/
area/guilds/
area/psuedowild/
area/religion/
data/documents/MPDocs/
data/html/
data/mobprogs/
data/quest/
data/world/
data/world/_utilities/
data/world/images/
design/html/
notes/
player/
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "merc.h"
#include "interp.h"

/*
 * bow_and_arrow()
 * 
 * A replacement for one_hit if the player is using a bow
 */
void bow_and_arrow(CHAR_DATA * ch, CHAR_DATA * victim)
{
    OBJ_DATA * bow;
    OBJ_DATA * arrow;
    //int victim_ac;
    int dam_type;
    //int sn = -1;
    
    if (victim == ch || ch == NULL || victim == NULL)
        return;    
    
    /* Determine what were dealing with */
    bow         = get_eq_char (ch, WEAR_WIELD);
    arrow       = get_eq_char (ch, WEAR_HOLD);
    /* Find damage type */
    dam_type    = attack_table[arrow->value[2]].damage;


    /* Cant see, cant hit */
    if (!can_see (ch, victim))
        return;
    
}

/*
 * critical_hit()
 *
 * Calculates the exact damage increase for critical hits
 */
int critical_hit(CHAR_DATA * ch, CHAR_DATA * victim, int dam)
{
    int final = dam;
    int multi = (ch->level - 5) / 20;
    
    if (number_range(1, 100) >= 95)
    {
        final = final * multi;
        
        act("{5$n hits you with a critical hit!{x", ch,NULL,victim,TO_VICT);
        act("{5You hit $N with a critical hit!{x", ch,NULL,victim,TO_CHAR);
    }

    return final;
}

/*
 * vital_point()
 *
 * Finds a vital point of the victim and deals max damage
 *
 * TODO:Fix up message to show body hit
 */
int vital_point(CHAR_DATA * ch, CHAR_DATA * victim, int dam)
{
    int final = dam;
    bool do_it = FALSE;
    int multi = 0;
    int tmp;
    
    if (number_range(1, 100) >= 50)
    {
        switch(number_range(1, 100))
        {   default:
                break;
            case WEAR_FINGER_L:
                if ( (get_eq_char (ch, WEAR_FINGER_L) != NULL))
                {
                    multi = 3;
                    do_it = TRUE;
                }
                break;
            case WEAR_FINGER_R:
                if ( (get_eq_char (ch, WEAR_FINGER_R) != NULL))
                {
                    multi = 3;
                    do_it = TRUE;
                }
                break;
            case WEAR_HEAD:
                if ( (get_eq_char (ch, WEAR_HEAD) != NULL))
                {
                    multi = 5;
                    do_it = TRUE;
                }
                break;
            case WEAR_BODY:
                if ( (get_eq_char (ch, WEAR_BODY) != NULL))
                {
                    multi = 1.5;
                    do_it = TRUE;
                }
                break;
            case WEAR_LEGS:
                if ( (get_eq_char (ch, WEAR_LEGS) != NULL))
                {
                    multi = 1.33;
                    do_it = TRUE;
                }
                break;
            case WEAR_FEET_L:
                if ( (get_eq_char (ch, WEAR_FEET_L) != NULL))
                {
                    multi = 1.5;
                    do_it = TRUE;
                }
                break;
            case WEAR_FEET_R:
                if ( (get_eq_char (ch, WEAR_FEET_R) != NULL))
                {
                    multi = 1.5;
                    do_it = TRUE;
                }
                break;
            case WEAR_HANDS_L:
                if ( (get_eq_char (ch, WEAR_HANDS_L) != NULL))
                {
                    check_thief_disarm(ch, victim);
                    multi = 2;
                    do_it = TRUE;
                }
                break;
            case WEAR_HANDS_R:
                if ( (get_eq_char (ch, WEAR_HANDS_R) != NULL))
                {
                    check_thief_disarm(ch, victim);
                    multi = 2;
                    do_it = TRUE;
                }
                break;
            case WEAR_ARMS_L:
                if ( (get_eq_char (ch, WEAR_ARMS_L) != NULL))
                {
                    multi = 1.75;
                    do_it = TRUE;
                }
                break;
            case WEAR_ARMS_R:
                if ( (get_eq_char (ch, WEAR_ARMS_R) != NULL))
                {
                    multi = 1.75;
                    do_it = TRUE;
                }
                break;
            case WEAR_WAIST:
                if ( (get_eq_char (ch, WEAR_WAIST) != NULL))
                {
                    multi = 4;
                    do_it = TRUE;
                }
                break;
        }
            
        
        if (do_it)
        {
            tmp = final *= multi;
            final = tmp;
            act("{5$n finds one of your vital points!{x", ch,NULL,victim,TO_VICT);
            act("{5You find one of $N's vital points!{x", ch,NULL,victim,TO_CHAR);
        }
    }

    return final;
}


/*
 * check_thief_disarm()
 *
 * Chance to disarm opponent, disabled
 */
void check_thief_disarm(CHAR_DATA * ch, CHAR_DATA * victim)
{
    return;
}