/*
* Regenerate mana points
*/
-static void regenmana(int percent)
+static void regenmana(int upkeep_factor, int regen_amount)
{
s32b old_csp = p_ptr->csp;
+ s32b regen_rate = regen_amount * 100 - upkeep_factor * PY_REGEN_NORMAL;
/*
* Excess mana will decay 32 times faster than normal
}
/* Regenerating mana (unless the player has excess mana) */
- else if (percent > 0)
+ else if (regen_rate > 0)
{
/* (percent/100) is the Regen factor in unit (1/2^16) */
s32b new_mana = 0;
- u32b new_mana_frac = (p_ptr->msp * percent / 100 + PY_REGEN_MNBASE);
+ u32b new_mana_frac = (p_ptr->msp * regen_rate / 100 + PY_REGEN_MNBASE);
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(new_mana, new_mana_frac, 16);
/* Reduce mana (even when the player has excess mana) */
- if (percent < 0)
+ if (regen_rate < 0)
{
/* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
s32b reduce_mana = 0;
- u32b reduce_mana_frac = (p_ptr->msp * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
+ u32b reduce_mana_frac = (p_ptr->msp * (-1) * regen_rate / 100 + PY_REGEN_MNBASE);
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(reduce_mana, reduce_mana_frac, 16);
/*
* Regenerate magic
+ * regen_amount: PY_REGEN_NORMAL * 2 (if resting) * 2 (if having regenarate)
*/
-static void regenmagic(int percent)
+static void regenmagic(int regen_amount)
{
- s32b new_mana;
+ s32b new_mana;
int i;
+ int dev = 30;
+ int mult = (dev + adj_mag_mana[p_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */
for (i = 0; i < EATER_EXT*2; i++)
{
if (!p_ptr->magic_num2[i]) continue;
if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
- new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
+
+ /* Increase remaining charge number like float value */
+ new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 13)) / (dev * 8);
p_ptr->magic_num1[i] += new_mana;
/* Check maximum charge */
{
if (!p_ptr->magic_num1[i]) continue;
if (!p_ptr->magic_num2[i]) continue;
- p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * EATER_ROD_CHARGE/16;
+
+ /* Decrease remaining period for charging */
+ new_mana = (regen_amount * mult * ((long)p_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE)
+ / (dev * 16 * PY_REGEN_NORMAL);
+ p_ptr->magic_num1[i] -= new_mana;
+
+ /* Check minimum remaining period for charging */
if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
wild_regen = 20;
}
feature_type *f_ptr = &f_info[cave[py][px].feat];
bool cave_no_regen = FALSE;
int upkeep_factor = 0;
- int upkeep_regen;
/* Default regeneration */
int regen_amount = PY_REGEN_NORMAL;
}
/* Regenerate the mana */
- upkeep_regen = (100 - upkeep_factor) * regen_amount;
- regenmana(upkeep_regen);
+ regenmana(upkeep_factor, regen_amount);
/* Recharge magic eater's power */
disturb(0, 0);
/* Determine the level */
- if (dun_level || p_ptr->inside_quest)
+ if (dun_level || p_ptr->inside_quest || p_ptr->enter_dungeon)
{
-#ifdef JP
-msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
-#else
- msg_print("You feel yourself yanked upwards!");
-#endif
+ msg_print(_("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª",
+ "You feel yourself yanked upwards!"));
if (dungeon_type) p_ptr->recall_dungeon = dungeon_type;
if (record_stair)
}
else
{
-#ifdef JP
-msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
-#else
- msg_print("You feel yourself yanked downwards!");
-#endif
+ msg_print(_("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª",
+ "You feel yourself yanked downwards!"));
dungeon_type = p_ptr->recall_dungeon;
else if (p_ptr->pclass == CLASS_SMITH)
do_cmd_kaji(TRUE);
else if (p_ptr->pclass == CLASS_MAGIC_EATER)
- do_cmd_magic_eater(TRUE);
+ do_cmd_magic_eater(TRUE, FALSE);
else if (p_ptr->pclass == CLASS_SNIPER)
do_cmd_snipe_browse();
else do_cmd_browse();
else if (p_ptr->pclass == CLASS_IMITATOR)
do_cmd_mane(FALSE);
else if (p_ptr->pclass == CLASS_MAGIC_EATER)
- do_cmd_magic_eater(FALSE);
+ do_cmd_magic_eater(FALSE, FALSE);
else if (p_ptr->pclass == CLASS_SAMURAI)
do_cmd_hissatsu();
else if (p_ptr->pclass == CLASS_BLUE_MAGE)