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>";
    }
}
示例#2
0
         $battle_message .= '&nbsp;&nbsp;>&nbsp;' . sprintf($lang['Adr_battle_attack_dura'], $challenger['character_name'], adr_get_lang($item['item_name'])) . '<br>';
         $battle_message .= '</span><span class="genmed">';
         // reset span class to default
     }
     //($item['item_duration'] < '2') && ($item['item_name'] != '')
     // Update the database
     $sql = "UPDATE " . ADR_BATTLE_LIST_TABLE . "\r\n\t\t\tSET battle_opponent_hp = battle_opponent_hp - " . intval($damage) . ",\r\n\t\t\t\tbattle_turn = 2 , \r\n\t\t\t\tbattle_round = (battle_round + 1),\r\n\t\t\t\tbattle_challenger_dmg = {$damage}\r\n\t\t\tWHERE battle_challenger_id = {$user_id}\r\n\t\t\tAND battle_result = 0\r\n\t\t\tAND battle_type = 1 ";
     if (!($result = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update battle', '', __LINE__, __FILE__, $sql);
     }
     //!($result = $db->sql_query($sql))
 } else {
     if ($defend && $bat['battle_turn'] == BATTLE_TURN_PLAYER) {
         $def = TRUE;
         $power = floor($monster['monster_level'] * rand(1, 3) / 2);
         rabbit_pet_regen();
         $battle_message .= sprintf($lang['Adr_battle_defend'], $challenger['character_name'], $monster['monster_name']) . '<br>';
         if ($armour_info[3] != '0') {
             adr_shield_skill_check($user_id);
         }
         // Update the database
         $sql = "UPDATE " . ADR_BATTLE_LIST_TABLE . "\r\n\t\t\tSET battle_turn = 2,\r\n\t\t\t\t battle_round = (battle_round + 1)\r\n\t\t\tWHERE battle_challenger_id = {$user_id}\r\n\t\t\t\tAND battle_result = 0\r\n\t\t\t\tAND battle_type = 1 ";
         if (!($result = $db->sql_query($sql))) {
             message_die(GENERAL_ERROR, 'Could not update battle', '', __LINE__, __FILE__, $sql);
         }
         //!($result = $db->sql_query($sql))
         // Let's sort out the defend animations...
         // Make table for start battle sequence...
         // 0 = Standing image , 1 = Attack image
         $user_action = 0;
         $monster_action = 1;