if (object_is_cursed(o_ptr))
{
if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
+ have_flag(flgs, TR_ADD_L_CURSE) ||
+ have_flag(flgs, TR_ADD_H_CURSE) ||
(o_ptr->curse_flags & TRC_PERMA_CURSE))
{
#ifdef JP
int i, j;
int y, x;
int m[9];
- magic_type *s_ptr;
+ const magic_type *s_ptr;
char name[80];
char out_val[160];
s16b spell_chance(int spell, int use_realm)
{
int chance, minfail;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
int need_mana;
int penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
*/
bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
{
- magic_type *s_ptr;
+ const magic_type *s_ptr;
/* Access the spell */
if (!is_magic(use_realm))
void print_spells(int target_spell, byte *spells, int num, int y, int x, int use_realm)
{
int i, spell, exp_level, increment = 64;
- magic_type *s_ptr;
+ const magic_type *s_ptr;
cptr comment;
char info[80];
char out_val[160];
/*
* Hurt the player with Acid
*/
-int acid_dam(int dam, cptr kb_str, int monspell)
+int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_acid) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if (!CHECK_MULTISHADOW())
+ if (aura || !CHECK_MULTISHADOW())
{
if ((!(double_resist || p_ptr->resist_acid)) &&
one_in_(HURT_CHANCE))
}
/* Take damage */
- get_damage = take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_acid))
+ if (!aura && !(double_resist && p_ptr->resist_acid))
inven_damage(set_acid_destroy, inv);
return get_damage;
}
/*
* Hurt the player with electricity
*/
-int elec_dam(int dam, cptr kb_str, int monspell)
+int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_elec) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_elec)) &&
- one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
- (void)do_dec_stat(A_DEX);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_elec)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_DEX);
+ }
/* Take damage */
- get_damage = take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_elec))
+ if (!aura && !(double_resist && p_ptr->resist_elec))
inven_damage(set_elec_destroy, inv);
return get_damage;
/*
* Hurt the player with Fire
*/
-int fire_dam(int dam, cptr kb_str, int monspell)
+int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_fire) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_fire)) &&
- one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
- (void)do_dec_stat(A_STR);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_fire)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_STR);
+ }
/* Take damage */
- get_damage = take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_fire))
+ if (!aura && !(double_resist && p_ptr->resist_fire))
inven_damage(set_fire_destroy, inv);
return get_damage;
/*
* Hurt the player with Cold
*/
-int cold_dam(int dam, cptr kb_str, int monspell)
+int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
if (p_ptr->resist_cold) dam = (dam + 2) / 3;
if (double_resist) dam = (dam + 2) / 3;
- if ((!(double_resist || p_ptr->resist_cold)) &&
- one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
- (void)do_dec_stat(A_STR);
+ if (aura || !CHECK_MULTISHADOW())
+ {
+ if ((!(double_resist || p_ptr->resist_cold)) &&
+ one_in_(HURT_CHANCE))
+ (void)do_dec_stat(A_STR);
+ }
/* Take damage */
- get_damage = take_hit(DAMAGE_ATTACK, dam, kb_str, monspell);
+ get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
/* Inventory damage */
- if (!(double_resist && p_ptr->resist_cold))
+ if (!aura && !(double_resist && p_ptr->resist_cold))
inven_damage(set_cold_destroy, inv);
return get_damage;