function adr_attack_bare()
{
    global $monster, $bat, $adr_user, $opponent_element, $item, $db, $lang, $user_id, $power, $crit_result;
    global $challenger, $battle_message, $user_action, $monster_action, $attack_img, $attackwith_overlay;
    global $damage, $dice;
    $monster_def_dice = rand(1, 10);
    $monster_modifier = rand(1, 10);
    // this is temp. until proper monster characteristics are added to ADR
    // V: temporary modified to 10 -- see below
    $bare_dice = rand(1, 20);
    // Grab modifers
    $bare_power = adr_modifier_calc($challenger['character_might']);
    // weaprof (yes, even for bare hand)
    $attbonus = adr_weapon_skill_check($user_id);
    if ($bare_dice + $bare_power > $monster_def_dice + $monster_modifier && $bare_dice != '1' || $bare_dice == '20') {
        rabbit_pet_regen();
        adr_use_hp_amulet();
        adr_use_mp_ring();
        // Attack success , calculate the damage . Critical dice roll is still success
        $damage = $bare_dice == '20' && $crit_roll == '20' ? $bare_power * 2 : $bare_power;
        // weap prof
        $damage = ceil($damage * $attbonus);
        // V: sigh.
        $damage = $damage < 1 ? 1 : $damage;
        $damage = $damage > $bat['battle_opponent_hp'] ? $bat['battle_opponent_hp'] : $damage;
        $battle_message .= $crit_result ? $lang['Adr_battle_critical_hit'] . "<br>" : '';
        $battle_message .= sprintf($lang['Adr_battle_attack_bare'], $challenger['character_name'], floor($attbonus), $damage, $monster['monster_name']) . "<br>";
    } else {
        $battle_message .= sprintf($lang['Adr_battle_attack_bare_fail'], $challenger['character_name'], $monster['monster_name']) . "<br>";
    }
}
Beispiel #2
0
 $weap = intval($HTTP_POST_VARS['item_weapon']);
 $power = 1;
 $quality = 0;
 $dice = rand(0, 5);
 if ($weap && ($item = adr_get_item_in_battle($weap))) {
     if ($challenger['character_mp'] < $item['item_mp_use'] || $challenger['character_mp'] < 0 || $item['item_mp_use'] == '') {
         adr_previous(Adr_battle_check, 'adr_battle', '');
     }
     //$challenger['character_mp'] < $item['item_mp_use'] || $challenger['character_mp'] < 0 || $item['item_mp_use'] == ''
     adr_substract_mp($item['item_mp_use']);
     // Define theses values according to the item type ( enchanted weapon are better than normal weapons )
     $quality = $item['item_type_use'] == 6 ? $item['item_quality'] * 2 : $item['item_quality'];
     $dice = rand(0, 5);
     $power = $item['item_type_use'] == 6 ? $item['item_power'] * 3 + $dice + $char['might'] * 0.2 + $item['item_add_power'] : $item['item_power'] * 2 + $item['item_add_power'] + $dice + $char['might'] * 0.2;
     rabbit_pet_regen();
     adr_use_hp_amulet();
     adr_use_mp_ring();
     adr_use_item($weap, $user_id);
 }
 // end if weapon
 // Let's sort out the weapon animations...
 // Make table for start battle sequence...
 // 0 = Standing image , 1 = Attack image
 $damage = 0;
 $user_action = 1;
 $monster_action = 1;
 $attack_img = isset($item) ? $item['item_name'] : '';
 $attackwith_overlay = file_exists("adr/images/battle/spells/" . $attack_img . ".gif") ? '<img src="adr/images/battle/spells/' . $attack_img . '.gif" width="256" height="96" border="0">' : '';
 list($crit_result, $power) = adr_battle_make_crit_roll($bat['battle_challenger_att'], $challenger['character_level'], $bat['battle_opponent_def'], $item['item_type_use'], $power, $quality, 20);
 if ($item['item_name'] == '') {
     adr_attack_bare();