• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision8adc3c1ff6ee9b5881e6ed449c330c4ebed6d185 (tree)
Time2019-07-13 13:02:23
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 calc_bonuses() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/player-status.c
+++ b/src/player-status.c
@@ -1340,6 +1340,7 @@ int spell_exp_level(int spell_exp)
13401340 else return EXP_LEVEL_MASTER;
13411341 }
13421342
1343+
13431344 /*!
13441345 * @brief プレイヤーの全ステータスを更新する /
13451346 * Calculate the players current "state", taking into account
@@ -1364,12 +1365,12 @@ int spell_exp_level(int spell_exp)
13641365 * This function induces various "status" messages.
13651366 * </pre>
13661367 */
1367-void calc_bonuses(void)
1368+void calc_bonuses(player_type *creature_ptr)
13681369 {
13691370 int i, j, hold;
13701371 int new_speed;
13711372 int default_hand = 0;
1372- int empty_hands_status = empty_hands(p_ptr, TRUE);
1373+ int empty_hands_status = empty_hands(creature_ptr, TRUE);
13731374 int extra_blows[2];
13741375 object_type *o_ptr;
13751376 BIT_FLAGS flgs[TR_FLAG_SIZE];
@@ -1387,428 +1388,428 @@ void calc_bonuses(void)
13871388 const player_race *tmp_rp_ptr;
13881389
13891390 /* Save the old vision stuff */
1390- bool old_telepathy = p_ptr->telepathy;
1391- bool old_esp_animal = p_ptr->esp_animal;
1392- bool old_esp_undead = p_ptr->esp_undead;
1393- bool old_esp_demon = p_ptr->esp_demon;
1394- bool old_esp_orc = p_ptr->esp_orc;
1395- bool old_esp_troll = p_ptr->esp_troll;
1396- bool old_esp_giant = p_ptr->esp_giant;
1397- bool old_esp_dragon = p_ptr->esp_dragon;
1398- bool old_esp_human = p_ptr->esp_human;
1399- bool old_esp_evil = p_ptr->esp_evil;
1400- bool old_esp_good = p_ptr->esp_good;
1401- bool old_esp_nonliving = p_ptr->esp_nonliving;
1402- bool old_esp_unique = p_ptr->esp_unique;
1403- bool old_see_inv = p_ptr->see_inv;
1404- bool old_mighty_throw = p_ptr->mighty_throw;
1391+ bool old_telepathy = creature_ptr->telepathy;
1392+ bool old_esp_animal = creature_ptr->esp_animal;
1393+ bool old_esp_undead = creature_ptr->esp_undead;
1394+ bool old_esp_demon = creature_ptr->esp_demon;
1395+ bool old_esp_orc = creature_ptr->esp_orc;
1396+ bool old_esp_troll = creature_ptr->esp_troll;
1397+ bool old_esp_giant = creature_ptr->esp_giant;
1398+ bool old_esp_dragon = creature_ptr->esp_dragon;
1399+ bool old_esp_human = creature_ptr->esp_human;
1400+ bool old_esp_evil = creature_ptr->esp_evil;
1401+ bool old_esp_good = creature_ptr->esp_good;
1402+ bool old_esp_nonliving = creature_ptr->esp_nonliving;
1403+ bool old_esp_unique = creature_ptr->esp_unique;
1404+ bool old_see_inv = creature_ptr->see_inv;
1405+ bool old_mighty_throw = creature_ptr->mighty_throw;
14051406
14061407 /* Current feature under player. */
1407- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
1408+ feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
14081409
14091410 /* Save the old armor class */
1410- ARMOUR_CLASS old_dis_ac = p_ptr->dis_ac;
1411- ARMOUR_CLASS old_dis_to_a = p_ptr->dis_to_a;
1411+ ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
1412+ ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a;
14121413
14131414
14141415 /* Clear extra blows/shots */
14151416 extra_blows[0] = extra_blows[1] = 0;
14161417
14171418 /* Clear the stat modifiers */
1418- for (i = 0; i < A_MAX; i++) p_ptr->stat_add[i] = 0;
1419+ for (i = 0; i < A_MAX; i++) creature_ptr->stat_add[i] = 0;
14191420
14201421
14211422 /* Clear the Displayed/Real armor class */
1422- p_ptr->dis_ac = p_ptr->ac = 0;
1423+ creature_ptr->dis_ac = creature_ptr->ac = 0;
14231424
14241425 /* Clear the Displayed/Real Bonuses */
1425- p_ptr->dis_to_h[0] = p_ptr->to_h[0] = 0;
1426- p_ptr->dis_to_h[1] = p_ptr->to_h[1] = 0;
1427- p_ptr->dis_to_d[0] = p_ptr->to_d[0] = 0;
1428- p_ptr->dis_to_d[1] = p_ptr->to_d[1] = 0;
1429- p_ptr->dis_to_h_b = p_ptr->to_h_b = 0;
1430- p_ptr->dis_to_a = p_ptr->to_a = 0;
1431- p_ptr->to_h_m = 0;
1432- p_ptr->to_d_m = 0;
1426+ creature_ptr->dis_to_h[0] = creature_ptr->to_h[0] = 0;
1427+ creature_ptr->dis_to_h[1] = creature_ptr->to_h[1] = 0;
1428+ creature_ptr->dis_to_d[0] = creature_ptr->to_d[0] = 0;
1429+ creature_ptr->dis_to_d[1] = creature_ptr->to_d[1] = 0;
1430+ creature_ptr->dis_to_h_b = creature_ptr->to_h_b = 0;
1431+ creature_ptr->dis_to_a = creature_ptr->to_a = 0;
1432+ creature_ptr->to_h_m = 0;
1433+ creature_ptr->to_d_m = 0;
14331434
1434- p_ptr->to_m_chance = 0;
1435+ creature_ptr->to_m_chance = 0;
14351436
14361437 /* Clear the Extra Dice Bonuses */
1437- p_ptr->to_dd[0] = p_ptr->to_ds[0] = 0;
1438- p_ptr->to_dd[1] = p_ptr->to_ds[1] = 0;
1438+ creature_ptr->to_dd[0] = creature_ptr->to_ds[0] = 0;
1439+ creature_ptr->to_dd[1] = creature_ptr->to_ds[1] = 0;
14391440
14401441 /* Start with "normal" speed */
14411442 new_speed = 110;
14421443
14431444 /* Start with a single blow per current_world_ptr->game_turn */
1444- p_ptr->num_blow[0] = 1;
1445- p_ptr->num_blow[1] = 1;
1445+ creature_ptr->num_blow[0] = 1;
1446+ creature_ptr->num_blow[1] = 1;
14461447
14471448 /* Start with a single shot per current_world_ptr->game_turn */
1448- p_ptr->num_fire = 100;
1449+ creature_ptr->num_fire = 100;
14491450
14501451 /* Reset the "xtra" tval */
1451- p_ptr->tval_xtra = 0;
1452+ creature_ptr->tval_xtra = 0;
14521453
14531454 /* Reset the "ammo" tval */
1454- p_ptr->tval_ammo = 0;
1455+ creature_ptr->tval_ammo = 0;
14551456
14561457 /* Clear all the flags */
1457- p_ptr->cursed = 0L;
1458- p_ptr->bless_blade = FALSE;
1459- p_ptr->xtra_might = FALSE;
1460- p_ptr->impact[0] = FALSE;
1461- p_ptr->impact[1] = FALSE;
1462- p_ptr->pass_wall = FALSE;
1463- p_ptr->kill_wall = FALSE;
1464- p_ptr->dec_mana = FALSE;
1465- p_ptr->easy_spell = FALSE;
1466- p_ptr->heavy_spell = FALSE;
1467- p_ptr->see_inv = FALSE;
1468- p_ptr->free_act = FALSE;
1469- p_ptr->slow_digest = FALSE;
1470- p_ptr->regenerate = FALSE;
1471- p_ptr->can_swim = FALSE;
1472- p_ptr->levitation = FALSE;
1473- p_ptr->hold_exp = FALSE;
1474- p_ptr->telepathy = FALSE;
1475- p_ptr->esp_animal = FALSE;
1476- p_ptr->esp_undead = FALSE;
1477- p_ptr->esp_demon = FALSE;
1478- p_ptr->esp_orc = FALSE;
1479- p_ptr->esp_troll = FALSE;
1480- p_ptr->esp_giant = FALSE;
1481- p_ptr->esp_dragon = FALSE;
1482- p_ptr->esp_human = FALSE;
1483- p_ptr->esp_evil = FALSE;
1484- p_ptr->esp_good = FALSE;
1485- p_ptr->esp_nonliving = FALSE;
1486- p_ptr->esp_unique = FALSE;
1487- p_ptr->lite = FALSE;
1488- p_ptr->sustain_str = FALSE;
1489- p_ptr->sustain_int = FALSE;
1490- p_ptr->sustain_wis = FALSE;
1491- p_ptr->sustain_con = FALSE;
1492- p_ptr->sustain_dex = FALSE;
1493- p_ptr->sustain_chr = FALSE;
1494- p_ptr->resist_acid = FALSE;
1495- p_ptr->resist_elec = FALSE;
1496- p_ptr->resist_fire = FALSE;
1497- p_ptr->resist_cold = FALSE;
1498- p_ptr->resist_pois = FALSE;
1499- p_ptr->resist_conf = FALSE;
1500- p_ptr->resist_sound = FALSE;
1501- p_ptr->resist_lite = FALSE;
1502- p_ptr->resist_dark = FALSE;
1503- p_ptr->resist_chaos = FALSE;
1504- p_ptr->resist_disen = FALSE;
1505- p_ptr->resist_shard = FALSE;
1506- p_ptr->resist_nexus = FALSE;
1507- p_ptr->resist_blind = FALSE;
1508- p_ptr->resist_neth = FALSE;
1509- p_ptr->resist_time = FALSE;
1510- p_ptr->resist_water = FALSE;
1511- p_ptr->resist_fear = FALSE;
1512- p_ptr->reflect = FALSE;
1513- p_ptr->sh_fire = FALSE;
1514- p_ptr->sh_elec = FALSE;
1515- p_ptr->sh_cold = FALSE;
1516- p_ptr->anti_magic = FALSE;
1517- p_ptr->anti_tele = FALSE;
1518- p_ptr->warning = FALSE;
1519- p_ptr->mighty_throw = FALSE;
1520- p_ptr->see_nocto = FALSE;
1521-
1522- p_ptr->immune_acid = FALSE;
1523- p_ptr->immune_elec = FALSE;
1524- p_ptr->immune_fire = FALSE;
1525- p_ptr->immune_cold = FALSE;
1526-
1527- p_ptr->ryoute = FALSE;
1528- p_ptr->migite = FALSE;
1529- p_ptr->hidarite = FALSE;
1530- p_ptr->no_flowed = FALSE;
1531-
1532- if (p_ptr->mimic_form) tmp_rp_ptr = &mimic_info[p_ptr->mimic_form];
1533- else tmp_rp_ptr = &race_info[p_ptr->prace];
1458+ creature_ptr->cursed = 0L;
1459+ creature_ptr->bless_blade = FALSE;
1460+ creature_ptr->xtra_might = FALSE;
1461+ creature_ptr->impact[0] = FALSE;
1462+ creature_ptr->impact[1] = FALSE;
1463+ creature_ptr->pass_wall = FALSE;
1464+ creature_ptr->kill_wall = FALSE;
1465+ creature_ptr->dec_mana = FALSE;
1466+ creature_ptr->easy_spell = FALSE;
1467+ creature_ptr->heavy_spell = FALSE;
1468+ creature_ptr->see_inv = FALSE;
1469+ creature_ptr->free_act = FALSE;
1470+ creature_ptr->slow_digest = FALSE;
1471+ creature_ptr->regenerate = FALSE;
1472+ creature_ptr->can_swim = FALSE;
1473+ creature_ptr->levitation = FALSE;
1474+ creature_ptr->hold_exp = FALSE;
1475+ creature_ptr->telepathy = FALSE;
1476+ creature_ptr->esp_animal = FALSE;
1477+ creature_ptr->esp_undead = FALSE;
1478+ creature_ptr->esp_demon = FALSE;
1479+ creature_ptr->esp_orc = FALSE;
1480+ creature_ptr->esp_troll = FALSE;
1481+ creature_ptr->esp_giant = FALSE;
1482+ creature_ptr->esp_dragon = FALSE;
1483+ creature_ptr->esp_human = FALSE;
1484+ creature_ptr->esp_evil = FALSE;
1485+ creature_ptr->esp_good = FALSE;
1486+ creature_ptr->esp_nonliving = FALSE;
1487+ creature_ptr->esp_unique = FALSE;
1488+ creature_ptr->lite = FALSE;
1489+ creature_ptr->sustain_str = FALSE;
1490+ creature_ptr->sustain_int = FALSE;
1491+ creature_ptr->sustain_wis = FALSE;
1492+ creature_ptr->sustain_con = FALSE;
1493+ creature_ptr->sustain_dex = FALSE;
1494+ creature_ptr->sustain_chr = FALSE;
1495+ creature_ptr->resist_acid = FALSE;
1496+ creature_ptr->resist_elec = FALSE;
1497+ creature_ptr->resist_fire = FALSE;
1498+ creature_ptr->resist_cold = FALSE;
1499+ creature_ptr->resist_pois = FALSE;
1500+ creature_ptr->resist_conf = FALSE;
1501+ creature_ptr->resist_sound = FALSE;
1502+ creature_ptr->resist_lite = FALSE;
1503+ creature_ptr->resist_dark = FALSE;
1504+ creature_ptr->resist_chaos = FALSE;
1505+ creature_ptr->resist_disen = FALSE;
1506+ creature_ptr->resist_shard = FALSE;
1507+ creature_ptr->resist_nexus = FALSE;
1508+ creature_ptr->resist_blind = FALSE;
1509+ creature_ptr->resist_neth = FALSE;
1510+ creature_ptr->resist_time = FALSE;
1511+ creature_ptr->resist_water = FALSE;
1512+ creature_ptr->resist_fear = FALSE;
1513+ creature_ptr->reflect = FALSE;
1514+ creature_ptr->sh_fire = FALSE;
1515+ creature_ptr->sh_elec = FALSE;
1516+ creature_ptr->sh_cold = FALSE;
1517+ creature_ptr->anti_magic = FALSE;
1518+ creature_ptr->anti_tele = FALSE;
1519+ creature_ptr->warning = FALSE;
1520+ creature_ptr->mighty_throw = FALSE;
1521+ creature_ptr->see_nocto = FALSE;
1522+
1523+ creature_ptr->immune_acid = FALSE;
1524+ creature_ptr->immune_elec = FALSE;
1525+ creature_ptr->immune_fire = FALSE;
1526+ creature_ptr->immune_cold = FALSE;
1527+
1528+ creature_ptr->ryoute = FALSE;
1529+ creature_ptr->migite = FALSE;
1530+ creature_ptr->hidarite = FALSE;
1531+ creature_ptr->no_flowed = FALSE;
1532+
1533+ if (creature_ptr->mimic_form) tmp_rp_ptr = &mimic_info[creature_ptr->mimic_form];
1534+ else tmp_rp_ptr = &race_info[creature_ptr->prace];
15341535
15351536 /* Base infravision (purely racial) */
1536- p_ptr->see_infra = tmp_rp_ptr->infra;
1537+ creature_ptr->see_infra = tmp_rp_ptr->infra;
15371538
15381539 /* Base skill -- disarming */
1539- p_ptr->skill_dis = tmp_rp_ptr->r_dis + cp_ptr->c_dis + ap_ptr->a_dis;
1540+ creature_ptr->skill_dis = tmp_rp_ptr->r_dis + cp_ptr->c_dis + ap_ptr->a_dis;
15401541
15411542 /* Base skill -- magic devices */
1542- p_ptr->skill_dev = tmp_rp_ptr->r_dev + cp_ptr->c_dev + ap_ptr->a_dev;
1543+ creature_ptr->skill_dev = tmp_rp_ptr->r_dev + cp_ptr->c_dev + ap_ptr->a_dev;
15431544
15441545 /* Base skill -- saving throw */
1545- p_ptr->skill_sav = tmp_rp_ptr->r_sav + cp_ptr->c_sav + ap_ptr->a_sav;
1546+ creature_ptr->skill_sav = tmp_rp_ptr->r_sav + cp_ptr->c_sav + ap_ptr->a_sav;
15461547
15471548 /* Base skill -- stealth */
1548- p_ptr->skill_stl = tmp_rp_ptr->r_stl + cp_ptr->c_stl + ap_ptr->a_stl;
1549+ creature_ptr->skill_stl = tmp_rp_ptr->r_stl + cp_ptr->c_stl + ap_ptr->a_stl;
15491550
15501551 /* Base skill -- searching ability */
1551- p_ptr->skill_srh = tmp_rp_ptr->r_srh + cp_ptr->c_srh + ap_ptr->a_srh;
1552+ creature_ptr->skill_srh = tmp_rp_ptr->r_srh + cp_ptr->c_srh + ap_ptr->a_srh;
15521553
15531554 /* Base skill -- searching frequency */
1554- p_ptr->skill_fos = tmp_rp_ptr->r_fos + cp_ptr->c_fos + ap_ptr->a_fos;
1555+ creature_ptr->skill_fos = tmp_rp_ptr->r_fos + cp_ptr->c_fos + ap_ptr->a_fos;
15551556
15561557 /* Base skill -- combat (normal) */
1557- p_ptr->skill_thn = tmp_rp_ptr->r_thn + cp_ptr->c_thn + ap_ptr->a_thn;
1558+ creature_ptr->skill_thn = tmp_rp_ptr->r_thn + cp_ptr->c_thn + ap_ptr->a_thn;
15581559
15591560 /* Base skill -- combat (shooting) */
1560- p_ptr->skill_thb = tmp_rp_ptr->r_thb + cp_ptr->c_thb + ap_ptr->a_thb;
1561+ creature_ptr->skill_thb = tmp_rp_ptr->r_thb + cp_ptr->c_thb + ap_ptr->a_thb;
15611562
15621563 /* Base skill -- combat (throwing) */
1563- p_ptr->skill_tht = tmp_rp_ptr->r_thb + cp_ptr->c_thb + ap_ptr->a_thb;
1564+ creature_ptr->skill_tht = tmp_rp_ptr->r_thb + cp_ptr->c_thb + ap_ptr->a_thb;
15641565
15651566 /* Base skill -- digging */
1566- p_ptr->skill_dig = 0;
1567+ creature_ptr->skill_dig = 0;
15671568
1568- if (has_melee_weapon(p_ptr, INVEN_RARM)) p_ptr->migite = TRUE;
1569- if (has_melee_weapon(p_ptr, INVEN_LARM))
1569+ if (has_melee_weapon(creature_ptr, INVEN_RARM)) creature_ptr->migite = TRUE;
1570+ if (has_melee_weapon(creature_ptr, INVEN_LARM))
15701571 {
1571- p_ptr->hidarite = TRUE;
1572- if (!p_ptr->migite) default_hand = 1;
1572+ creature_ptr->hidarite = TRUE;
1573+ if (!creature_ptr->migite) default_hand = 1;
15731574 }
15741575
15751576 if (CAN_TWO_HANDS_WIELDING())
15761577 {
1577- if (p_ptr->migite && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_LARM) &&
1578- object_allow_two_hands_wielding(&p_ptr->inventory_list[INVEN_RARM]))
1578+ if (creature_ptr->migite && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) &&
1579+ object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_RARM]))
15791580 {
1580- p_ptr->ryoute = TRUE;
1581+ creature_ptr->ryoute = TRUE;
15811582 }
1582- else if (p_ptr->hidarite && (empty_hands(p_ptr, FALSE) == EMPTY_HAND_RARM) &&
1583- object_allow_two_hands_wielding(&p_ptr->inventory_list[INVEN_LARM]))
1583+ else if (creature_ptr->hidarite && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) &&
1584+ object_allow_two_hands_wielding(&creature_ptr->inventory_list[INVEN_LARM]))
15841585 {
1585- p_ptr->ryoute = TRUE;
1586+ creature_ptr->ryoute = TRUE;
15861587 }
15871588 else
15881589 {
1589- switch (p_ptr->pclass)
1590+ switch (creature_ptr->pclass)
15901591 {
15911592 case CLASS_MONK:
15921593 case CLASS_FORCETRAINER:
15931594 case CLASS_BERSERKER:
1594- if (empty_hands(p_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
1595+ if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))
15951596 {
1596- p_ptr->migite = TRUE;
1597- p_ptr->ryoute = TRUE;
1597+ creature_ptr->migite = TRUE;
1598+ creature_ptr->ryoute = TRUE;
15981599 }
15991600 break;
16001601 }
16011602 }
16021603 }
16031604
1604- if (!p_ptr->migite && !p_ptr->hidarite)
1605+ if (!creature_ptr->migite && !creature_ptr->hidarite)
16051606 {
1606- if (empty_hands_status & EMPTY_HAND_RARM) p_ptr->migite = TRUE;
1607+ if (empty_hands_status & EMPTY_HAND_RARM) creature_ptr->migite = TRUE;
16071608 else if (empty_hands_status == EMPTY_HAND_LARM)
16081609 {
1609- p_ptr->hidarite = TRUE;
1610+ creature_ptr->hidarite = TRUE;
16101611 default_hand = 1;
16111612 }
16121613 }
16131614
1614- if (p_ptr->special_defense & KAMAE_MASK)
1615+ if (creature_ptr->special_defense & KAMAE_MASK)
16151616 {
16161617 if (!(empty_hands_status & EMPTY_HAND_RARM))
16171618 {
1618- set_action(p_ptr, ACTION_NONE);
1619+ set_action(creature_ptr, ACTION_NONE);
16191620 }
16201621 }
16211622
1622- switch (p_ptr->pclass)
1623+ switch (creature_ptr->pclass)
16231624 {
16241625 case CLASS_WARRIOR:
1625- if (p_ptr->lev > 29) p_ptr->resist_fear = TRUE;
1626- if (p_ptr->lev > 44) p_ptr->regenerate = TRUE;
1626+ if (creature_ptr->lev > 29) creature_ptr->resist_fear = TRUE;
1627+ if (creature_ptr->lev > 44) creature_ptr->regenerate = TRUE;
16271628 break;
16281629 case CLASS_PALADIN:
1629- if (p_ptr->lev > 39) p_ptr->resist_fear = TRUE;
1630+ if (creature_ptr->lev > 39) creature_ptr->resist_fear = TRUE;
16301631 break;
16311632 case CLASS_CHAOS_WARRIOR:
1632- if (p_ptr->lev > 29) p_ptr->resist_chaos = TRUE;
1633- if (p_ptr->lev > 39) p_ptr->resist_fear = TRUE;
1633+ if (creature_ptr->lev > 29) creature_ptr->resist_chaos = TRUE;
1634+ if (creature_ptr->lev > 39) creature_ptr->resist_fear = TRUE;
16341635 break;
16351636 case CLASS_MINDCRAFTER:
1636- if (p_ptr->lev > 9) p_ptr->resist_fear = TRUE;
1637- if (p_ptr->lev > 19) p_ptr->sustain_wis = TRUE;
1638- if (p_ptr->lev > 29) p_ptr->resist_conf = TRUE;
1639- if (p_ptr->lev > 39) p_ptr->telepathy = TRUE;
1637+ if (creature_ptr->lev > 9) creature_ptr->resist_fear = TRUE;
1638+ if (creature_ptr->lev > 19) creature_ptr->sustain_wis = TRUE;
1639+ if (creature_ptr->lev > 29) creature_ptr->resist_conf = TRUE;
1640+ if (creature_ptr->lev > 39) creature_ptr->telepathy = TRUE;
16401641 break;
16411642 case CLASS_MONK:
16421643 case CLASS_FORCETRAINER:
16431644 /* Unencumbered Monks become faster every 10 levels */
1644- if (!(heavy_armor(p_ptr)))
1645+ if (!(heavy_armor(creature_ptr)))
16451646 {
1646- if (!(PRACE_IS_(p_ptr, RACE_KLACKON) ||
1647- PRACE_IS_(p_ptr, RACE_SPRITE) ||
1648- (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
1649- new_speed += (p_ptr->lev) / 10;
1647+ if (!(PRACE_IS_(creature_ptr, RACE_KLACKON) ||
1648+ PRACE_IS_(creature_ptr, RACE_SPRITE) ||
1649+ (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
1650+ new_speed += (creature_ptr->lev) / 10;
16501651
16511652 /* Free action if unencumbered at level 25 */
1652- if (p_ptr->lev > 24)
1653- p_ptr->free_act = TRUE;
1653+ if (creature_ptr->lev > 24)
1654+ creature_ptr->free_act = TRUE;
16541655 }
16551656 break;
16561657 case CLASS_SORCERER:
1657- p_ptr->to_a -= 50;
1658- p_ptr->dis_to_a -= 50;
1658+ creature_ptr->to_a -= 50;
1659+ creature_ptr->dis_to_a -= 50;
16591660 break;
16601661 case CLASS_BARD:
1661- p_ptr->resist_sound = TRUE;
1662+ creature_ptr->resist_sound = TRUE;
16621663 break;
16631664 case CLASS_SAMURAI:
1664- if (p_ptr->lev > 29) p_ptr->resist_fear = TRUE;
1665+ if (creature_ptr->lev > 29) creature_ptr->resist_fear = TRUE;
16651666 break;
16661667 case CLASS_BERSERKER:
1667- p_ptr->shero = 1;
1668- p_ptr->sustain_str = TRUE;
1669- p_ptr->sustain_dex = TRUE;
1670- p_ptr->sustain_con = TRUE;
1671- p_ptr->regenerate = TRUE;
1672- p_ptr->free_act = TRUE;
1668+ creature_ptr->shero = 1;
1669+ creature_ptr->sustain_str = TRUE;
1670+ creature_ptr->sustain_dex = TRUE;
1671+ creature_ptr->sustain_con = TRUE;
1672+ creature_ptr->regenerate = TRUE;
1673+ creature_ptr->free_act = TRUE;
16731674 new_speed += 2;
1674- if (p_ptr->lev > 29) new_speed++;
1675- if (p_ptr->lev > 39) new_speed++;
1676- if (p_ptr->lev > 44) new_speed++;
1677- if (p_ptr->lev > 49) new_speed++;
1678- p_ptr->to_a += 10 + p_ptr->lev / 2;
1679- p_ptr->dis_to_a += 10 + p_ptr->lev / 2;
1680- p_ptr->skill_dig += (100 + p_ptr->lev * 8);
1681- if (p_ptr->lev > 39) p_ptr->reflect = TRUE;
1682- p_ptr->redraw |= PR_STATUS;
1675+ if (creature_ptr->lev > 29) new_speed++;
1676+ if (creature_ptr->lev > 39) new_speed++;
1677+ if (creature_ptr->lev > 44) new_speed++;
1678+ if (creature_ptr->lev > 49) new_speed++;
1679+ creature_ptr->to_a += 10 + creature_ptr->lev / 2;
1680+ creature_ptr->dis_to_a += 10 + creature_ptr->lev / 2;
1681+ creature_ptr->skill_dig += (100 + creature_ptr->lev * 8);
1682+ if (creature_ptr->lev > 39) creature_ptr->reflect = TRUE;
1683+ creature_ptr->redraw |= PR_STATUS;
16831684 break;
16841685 case CLASS_MIRROR_MASTER:
1685- if (p_ptr->lev > 39) p_ptr->reflect = TRUE;
1686+ if (creature_ptr->lev > 39) creature_ptr->reflect = TRUE;
16861687 break;
16871688 case CLASS_NINJA:
16881689 /* Unencumbered Ninjas become faster every 10 levels */
1689- if (heavy_armor(p_ptr))
1690+ if (heavy_armor(creature_ptr))
16901691 {
1691- new_speed -= (p_ptr->lev) / 10;
1692- p_ptr->skill_stl -= (p_ptr->lev) / 10;
1692+ new_speed -= (creature_ptr->lev) / 10;
1693+ creature_ptr->skill_stl -= (creature_ptr->lev) / 10;
16931694 }
1694- else if ((!p_ptr->inventory_list[INVEN_RARM].k_idx || p_ptr->migite) &&
1695- (!p_ptr->inventory_list[INVEN_LARM].k_idx || p_ptr->hidarite))
1695+ else if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || creature_ptr->migite) &&
1696+ (!creature_ptr->inventory_list[INVEN_LARM].k_idx || creature_ptr->hidarite))
16961697 {
16971698 new_speed += 3;
1698- if (!(PRACE_IS_(p_ptr, RACE_KLACKON) ||
1699- PRACE_IS_(p_ptr, RACE_SPRITE) ||
1700- (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
1701- new_speed += (p_ptr->lev) / 10;
1702- p_ptr->skill_stl += (p_ptr->lev) / 10;
1699+ if (!(PRACE_IS_(creature_ptr, RACE_KLACKON) ||
1700+ PRACE_IS_(creature_ptr, RACE_SPRITE) ||
1701+ (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN)))
1702+ new_speed += (creature_ptr->lev) / 10;
1703+ creature_ptr->skill_stl += (creature_ptr->lev) / 10;
17031704
17041705 /* Free action if unencumbered at level 25 */
1705- if (p_ptr->lev > 24)
1706- p_ptr->free_act = TRUE;
1706+ if (creature_ptr->lev > 24)
1707+ creature_ptr->free_act = TRUE;
17071708 }
1708- if ((!p_ptr->inventory_list[INVEN_RARM].k_idx || p_ptr->migite) &&
1709- (!p_ptr->inventory_list[INVEN_LARM].k_idx || p_ptr->hidarite))
1709+ if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || creature_ptr->migite) &&
1710+ (!creature_ptr->inventory_list[INVEN_LARM].k_idx || creature_ptr->hidarite))
17101711 {
1711- p_ptr->to_a += p_ptr->lev / 2 + 5;
1712- p_ptr->dis_to_a += p_ptr->lev / 2 + 5;
1712+ creature_ptr->to_a += creature_ptr->lev / 2 + 5;
1713+ creature_ptr->dis_to_a += creature_ptr->lev / 2 + 5;
17131714 }
1714- p_ptr->slow_digest = TRUE;
1715- p_ptr->resist_fear = TRUE;
1716- if (p_ptr->lev > 19) p_ptr->resist_pois = TRUE;
1717- if (p_ptr->lev > 24) p_ptr->sustain_dex = TRUE;
1718- if (p_ptr->lev > 29) p_ptr->see_inv = TRUE;
1719- if (p_ptr->lev > 44)
1715+ creature_ptr->slow_digest = TRUE;
1716+ creature_ptr->resist_fear = TRUE;
1717+ if (creature_ptr->lev > 19) creature_ptr->resist_pois = TRUE;
1718+ if (creature_ptr->lev > 24) creature_ptr->sustain_dex = TRUE;
1719+ if (creature_ptr->lev > 29) creature_ptr->see_inv = TRUE;
1720+ if (creature_ptr->lev > 44)
17201721 {
1721- p_ptr->oppose_pois = 1;
1722- p_ptr->redraw |= PR_STATUS;
1722+ creature_ptr->oppose_pois = 1;
1723+ creature_ptr->redraw |= PR_STATUS;
17231724 }
1724- p_ptr->see_nocto = TRUE;
1725+ creature_ptr->see_nocto = TRUE;
17251726 break;
17261727 }
17271728
17281729 /***** Races ****/
1729- if (p_ptr->mimic_form)
1730+ if (creature_ptr->mimic_form)
17301731 {
1731- switch (p_ptr->mimic_form)
1732+ switch (creature_ptr->mimic_form)
17321733 {
17331734 case MIMIC_DEMON:
1734- p_ptr->hold_exp = TRUE;
1735- p_ptr->resist_chaos = TRUE;
1736- p_ptr->resist_neth = TRUE;
1737- p_ptr->resist_fire = TRUE;
1738- p_ptr->oppose_fire = 1;
1739- p_ptr->see_inv = TRUE;
1735+ creature_ptr->hold_exp = TRUE;
1736+ creature_ptr->resist_chaos = TRUE;
1737+ creature_ptr->resist_neth = TRUE;
1738+ creature_ptr->resist_fire = TRUE;
1739+ creature_ptr->oppose_fire = 1;
1740+ creature_ptr->see_inv = TRUE;
17401741 new_speed += 3;
1741- p_ptr->redraw |= PR_STATUS;
1742- p_ptr->to_a += 10;
1743- p_ptr->dis_to_a += 10;
1742+ creature_ptr->redraw |= PR_STATUS;
1743+ creature_ptr->to_a += 10;
1744+ creature_ptr->dis_to_a += 10;
17441745 break;
17451746 case MIMIC_DEMON_LORD:
1746- p_ptr->hold_exp = TRUE;
1747- p_ptr->resist_chaos = TRUE;
1748- p_ptr->resist_neth = TRUE;
1749- p_ptr->immune_fire = TRUE;
1750- p_ptr->resist_acid = TRUE;
1751- p_ptr->resist_fire = TRUE;
1752- p_ptr->resist_cold = TRUE;
1753- p_ptr->resist_elec = TRUE;
1754- p_ptr->resist_pois = TRUE;
1755- p_ptr->resist_conf = TRUE;
1756- p_ptr->resist_disen = TRUE;
1757- p_ptr->resist_nexus = TRUE;
1758- p_ptr->resist_fear = TRUE;
1759- p_ptr->sh_fire = TRUE;
1760- p_ptr->see_inv = TRUE;
1761- p_ptr->telepathy = TRUE;
1762- p_ptr->levitation = TRUE;
1763- p_ptr->kill_wall = TRUE;
1747+ creature_ptr->hold_exp = TRUE;
1748+ creature_ptr->resist_chaos = TRUE;
1749+ creature_ptr->resist_neth = TRUE;
1750+ creature_ptr->immune_fire = TRUE;
1751+ creature_ptr->resist_acid = TRUE;
1752+ creature_ptr->resist_fire = TRUE;
1753+ creature_ptr->resist_cold = TRUE;
1754+ creature_ptr->resist_elec = TRUE;
1755+ creature_ptr->resist_pois = TRUE;
1756+ creature_ptr->resist_conf = TRUE;
1757+ creature_ptr->resist_disen = TRUE;
1758+ creature_ptr->resist_nexus = TRUE;
1759+ creature_ptr->resist_fear = TRUE;
1760+ creature_ptr->sh_fire = TRUE;
1761+ creature_ptr->see_inv = TRUE;
1762+ creature_ptr->telepathy = TRUE;
1763+ creature_ptr->levitation = TRUE;
1764+ creature_ptr->kill_wall = TRUE;
17641765 new_speed += 5;
1765- p_ptr->to_a += 20;
1766- p_ptr->dis_to_a += 20;
1766+ creature_ptr->to_a += 20;
1767+ creature_ptr->dis_to_a += 20;
17671768 break;
17681769 case MIMIC_VAMPIRE:
1769- p_ptr->resist_dark = TRUE;
1770- p_ptr->hold_exp = TRUE;
1771- p_ptr->resist_neth = TRUE;
1772- p_ptr->resist_cold = TRUE;
1773- p_ptr->resist_pois = TRUE;
1774- p_ptr->see_inv = TRUE;
1770+ creature_ptr->resist_dark = TRUE;
1771+ creature_ptr->hold_exp = TRUE;
1772+ creature_ptr->resist_neth = TRUE;
1773+ creature_ptr->resist_cold = TRUE;
1774+ creature_ptr->resist_pois = TRUE;
1775+ creature_ptr->see_inv = TRUE;
17751776 new_speed += 3;
1776- p_ptr->to_a += 10;
1777- p_ptr->dis_to_a += 10;
1778- if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
1777+ creature_ptr->to_a += 10;
1778+ creature_ptr->dis_to_a += 10;
1779+ if (creature_ptr->pclass != CLASS_NINJA) creature_ptr->lite = TRUE;
17791780 break;
17801781 }
17811782 }
17821783 else
17831784 {
1784- switch (p_ptr->prace)
1785+ switch (creature_ptr->prace)
17851786 {
17861787 case RACE_ELF:
1787- p_ptr->resist_lite = TRUE;
1788+ creature_ptr->resist_lite = TRUE;
17881789 break;
17891790 case RACE_HOBBIT:
1790- p_ptr->hold_exp = TRUE;
1791+ creature_ptr->hold_exp = TRUE;
17911792 break;
17921793 case RACE_GNOME:
1793- p_ptr->free_act = TRUE;
1794+ creature_ptr->free_act = TRUE;
17941795 break;
17951796 case RACE_DWARF:
1796- p_ptr->resist_blind = TRUE;
1797+ creature_ptr->resist_blind = TRUE;
17971798 break;
17981799 case RACE_HALF_ORC:
1799- p_ptr->resist_dark = TRUE;
1800+ creature_ptr->resist_dark = TRUE;
18001801 break;
18011802 case RACE_HALF_TROLL:
1802- p_ptr->sustain_str = TRUE;
1803+ creature_ptr->sustain_str = TRUE;
18031804
1804- if (p_ptr->lev > 14)
1805+ if (creature_ptr->lev > 14)
18051806 {
18061807 /* High level trolls heal fast... */
1807- p_ptr->regenerate = TRUE;
1808+ creature_ptr->regenerate = TRUE;
18081809
1809- if (p_ptr->pclass == CLASS_WARRIOR || p_ptr->pclass == CLASS_BERSERKER)
1810+ if (creature_ptr->pclass == CLASS_WARRIOR || creature_ptr->pclass == CLASS_BERSERKER)
18101811 {
1811- p_ptr->slow_digest = TRUE;
1812+ creature_ptr->slow_digest = TRUE;
18121813 /* Let's not make Regeneration
18131814 * a disadvantage for the poor warriors who can
18141815 * never learn a spell that satisfies hunger (actually
@@ -1818,172 +1819,172 @@ void calc_bonuses(void)
18181819 }
18191820 break;
18201821 case RACE_AMBERITE:
1821- p_ptr->sustain_con = TRUE;
1822- p_ptr->regenerate = TRUE; /* Amberites heal fast... */
1822+ creature_ptr->sustain_con = TRUE;
1823+ creature_ptr->regenerate = TRUE; /* Amberites heal fast... */
18231824 break;
18241825 case RACE_HIGH_ELF:
1825- p_ptr->resist_lite = TRUE;
1826- p_ptr->see_inv = TRUE;
1826+ creature_ptr->resist_lite = TRUE;
1827+ creature_ptr->see_inv = TRUE;
18271828 break;
18281829 case RACE_BARBARIAN:
1829- p_ptr->resist_fear = TRUE;
1830+ creature_ptr->resist_fear = TRUE;
18301831 break;
18311832 case RACE_HALF_OGRE:
1832- p_ptr->resist_dark = TRUE;
1833- p_ptr->sustain_str = TRUE;
1833+ creature_ptr->resist_dark = TRUE;
1834+ creature_ptr->sustain_str = TRUE;
18341835 break;
18351836 case RACE_HALF_GIANT:
1836- p_ptr->sustain_str = TRUE;
1837- p_ptr->resist_shard = TRUE;
1837+ creature_ptr->sustain_str = TRUE;
1838+ creature_ptr->resist_shard = TRUE;
18381839 break;
18391840 case RACE_HALF_TITAN:
1840- p_ptr->resist_chaos = TRUE;
1841+ creature_ptr->resist_chaos = TRUE;
18411842 break;
18421843 case RACE_CYCLOPS:
1843- p_ptr->resist_sound = TRUE;
1844+ creature_ptr->resist_sound = TRUE;
18441845 break;
18451846 case RACE_YEEK:
1846- p_ptr->resist_acid = TRUE;
1847- if (p_ptr->lev > 19) p_ptr->immune_acid = TRUE;
1847+ creature_ptr->resist_acid = TRUE;
1848+ if (creature_ptr->lev > 19) creature_ptr->immune_acid = TRUE;
18481849 break;
18491850 case RACE_KLACKON:
1850- p_ptr->resist_conf = TRUE;
1851- p_ptr->resist_acid = TRUE;
1851+ creature_ptr->resist_conf = TRUE;
1852+ creature_ptr->resist_acid = TRUE;
18521853
18531854 /* Klackons become faster */
1854- new_speed += (p_ptr->lev) / 10;
1855+ new_speed += (creature_ptr->lev) / 10;
18551856 break;
18561857 case RACE_KOBOLD:
1857- p_ptr->resist_pois = TRUE;
1858+ creature_ptr->resist_pois = TRUE;
18581859 break;
18591860 case RACE_NIBELUNG:
1860- p_ptr->resist_disen = TRUE;
1861- p_ptr->resist_dark = TRUE;
1861+ creature_ptr->resist_disen = TRUE;
1862+ creature_ptr->resist_dark = TRUE;
18621863 break;
18631864 case RACE_DARK_ELF:
1864- p_ptr->resist_dark = TRUE;
1865- if (p_ptr->lev > 19) p_ptr->see_inv = TRUE;
1865+ creature_ptr->resist_dark = TRUE;
1866+ if (creature_ptr->lev > 19) creature_ptr->see_inv = TRUE;
18661867 break;
18671868 case RACE_DRACONIAN:
1868- p_ptr->levitation = TRUE;
1869- if (p_ptr->lev > 4) p_ptr->resist_fire = TRUE;
1870- if (p_ptr->lev > 9) p_ptr->resist_cold = TRUE;
1871- if (p_ptr->lev > 14) p_ptr->resist_acid = TRUE;
1872- if (p_ptr->lev > 19) p_ptr->resist_elec = TRUE;
1873- if (p_ptr->lev > 34) p_ptr->resist_pois = TRUE;
1869+ creature_ptr->levitation = TRUE;
1870+ if (creature_ptr->lev > 4) creature_ptr->resist_fire = TRUE;
1871+ if (creature_ptr->lev > 9) creature_ptr->resist_cold = TRUE;
1872+ if (creature_ptr->lev > 14) creature_ptr->resist_acid = TRUE;
1873+ if (creature_ptr->lev > 19) creature_ptr->resist_elec = TRUE;
1874+ if (creature_ptr->lev > 34) creature_ptr->resist_pois = TRUE;
18741875 break;
18751876 case RACE_MIND_FLAYER:
1876- p_ptr->sustain_int = TRUE;
1877- p_ptr->sustain_wis = TRUE;
1878- if (p_ptr->lev > 14) p_ptr->see_inv = TRUE;
1879- if (p_ptr->lev > 29) p_ptr->telepathy = TRUE;
1877+ creature_ptr->sustain_int = TRUE;
1878+ creature_ptr->sustain_wis = TRUE;
1879+ if (creature_ptr->lev > 14) creature_ptr->see_inv = TRUE;
1880+ if (creature_ptr->lev > 29) creature_ptr->telepathy = TRUE;
18801881 break;
18811882 case RACE_IMP:
1882- p_ptr->resist_fire = TRUE;
1883- if (p_ptr->lev > 9) p_ptr->see_inv = TRUE;
1883+ creature_ptr->resist_fire = TRUE;
1884+ if (creature_ptr->lev > 9) creature_ptr->see_inv = TRUE;
18841885 break;
18851886 case RACE_GOLEM:
1886- p_ptr->slow_digest = TRUE;
1887- p_ptr->free_act = TRUE;
1888- p_ptr->see_inv = TRUE;
1889- p_ptr->resist_pois = TRUE;
1890- if (p_ptr->lev > 34) p_ptr->hold_exp = TRUE;
1887+ creature_ptr->slow_digest = TRUE;
1888+ creature_ptr->free_act = TRUE;
1889+ creature_ptr->see_inv = TRUE;
1890+ creature_ptr->resist_pois = TRUE;
1891+ if (creature_ptr->lev > 34) creature_ptr->hold_exp = TRUE;
18911892 break;
18921893 case RACE_SKELETON:
1893- p_ptr->resist_shard = TRUE;
1894- p_ptr->hold_exp = TRUE;
1895- p_ptr->see_inv = TRUE;
1896- p_ptr->resist_pois = TRUE;
1897- if (p_ptr->lev > 9) p_ptr->resist_cold = TRUE;
1894+ creature_ptr->resist_shard = TRUE;
1895+ creature_ptr->hold_exp = TRUE;
1896+ creature_ptr->see_inv = TRUE;
1897+ creature_ptr->resist_pois = TRUE;
1898+ if (creature_ptr->lev > 9) creature_ptr->resist_cold = TRUE;
18981899 break;
18991900 case RACE_ZOMBIE:
1900- p_ptr->resist_neth = TRUE;
1901- p_ptr->hold_exp = TRUE;
1902- p_ptr->see_inv = TRUE;
1903- p_ptr->resist_pois = TRUE;
1904- p_ptr->slow_digest = TRUE;
1905- if (p_ptr->lev > 4) p_ptr->resist_cold = TRUE;
1901+ creature_ptr->resist_neth = TRUE;
1902+ creature_ptr->hold_exp = TRUE;
1903+ creature_ptr->see_inv = TRUE;
1904+ creature_ptr->resist_pois = TRUE;
1905+ creature_ptr->slow_digest = TRUE;
1906+ if (creature_ptr->lev > 4) creature_ptr->resist_cold = TRUE;
19061907 break;
19071908 case RACE_VAMPIRE:
1908- p_ptr->resist_dark = TRUE;
1909- p_ptr->hold_exp = TRUE;
1910- p_ptr->resist_neth = TRUE;
1911- p_ptr->resist_cold = TRUE;
1912- p_ptr->resist_pois = TRUE;
1913- if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
1909+ creature_ptr->resist_dark = TRUE;
1910+ creature_ptr->hold_exp = TRUE;
1911+ creature_ptr->resist_neth = TRUE;
1912+ creature_ptr->resist_cold = TRUE;
1913+ creature_ptr->resist_pois = TRUE;
1914+ if (creature_ptr->pclass != CLASS_NINJA) creature_ptr->lite = TRUE;
19141915 break;
19151916 case RACE_SPECTRE:
1916- p_ptr->levitation = TRUE;
1917- p_ptr->free_act = TRUE;
1918- p_ptr->resist_neth = TRUE;
1919- p_ptr->hold_exp = TRUE;
1920- p_ptr->see_inv = TRUE;
1921- p_ptr->resist_pois = TRUE;
1922- p_ptr->slow_digest = TRUE;
1923- p_ptr->resist_cold = TRUE;
1924- p_ptr->pass_wall = TRUE;
1925- if (p_ptr->lev > 34) p_ptr->telepathy = TRUE;
1917+ creature_ptr->levitation = TRUE;
1918+ creature_ptr->free_act = TRUE;
1919+ creature_ptr->resist_neth = TRUE;
1920+ creature_ptr->hold_exp = TRUE;
1921+ creature_ptr->see_inv = TRUE;
1922+ creature_ptr->resist_pois = TRUE;
1923+ creature_ptr->slow_digest = TRUE;
1924+ creature_ptr->resist_cold = TRUE;
1925+ creature_ptr->pass_wall = TRUE;
1926+ if (creature_ptr->lev > 34) creature_ptr->telepathy = TRUE;
19261927 break;
19271928 case RACE_SPRITE:
1928- p_ptr->levitation = TRUE;
1929- p_ptr->resist_lite = TRUE;
1929+ creature_ptr->levitation = TRUE;
1930+ creature_ptr->resist_lite = TRUE;
19301931
19311932 /* Sprites become faster */
1932- new_speed += (p_ptr->lev) / 10;
1933+ new_speed += (creature_ptr->lev) / 10;
19331934 break;
19341935 case RACE_BEASTMAN:
1935- p_ptr->resist_conf = TRUE;
1936- p_ptr->resist_sound = TRUE;
1936+ creature_ptr->resist_conf = TRUE;
1937+ creature_ptr->resist_sound = TRUE;
19371938 break;
19381939 case RACE_ENT:
19391940 /* Ents dig like maniacs, but only with their hands. */
1940- if (!p_ptr->inventory_list[INVEN_RARM].k_idx)
1941- p_ptr->skill_dig += p_ptr->lev * 10;
1941+ if (!creature_ptr->inventory_list[INVEN_RARM].k_idx)
1942+ creature_ptr->skill_dig += creature_ptr->lev * 10;
19421943 /* Ents get tougher and stronger as they age, but lose dexterity. */
1943- if (p_ptr->lev > 25) p_ptr->stat_add[A_STR]++;
1944- if (p_ptr->lev > 40) p_ptr->stat_add[A_STR]++;
1945- if (p_ptr->lev > 45) p_ptr->stat_add[A_STR]++;
1944+ if (creature_ptr->lev > 25) creature_ptr->stat_add[A_STR]++;
1945+ if (creature_ptr->lev > 40) creature_ptr->stat_add[A_STR]++;
1946+ if (creature_ptr->lev > 45) creature_ptr->stat_add[A_STR]++;
19461947
1947- if (p_ptr->lev > 25) p_ptr->stat_add[A_DEX]--;
1948- if (p_ptr->lev > 40) p_ptr->stat_add[A_DEX]--;
1949- if (p_ptr->lev > 45) p_ptr->stat_add[A_DEX]--;
1948+ if (creature_ptr->lev > 25) creature_ptr->stat_add[A_DEX]--;
1949+ if (creature_ptr->lev > 40) creature_ptr->stat_add[A_DEX]--;
1950+ if (creature_ptr->lev > 45) creature_ptr->stat_add[A_DEX]--;
19501951
1951- if (p_ptr->lev > 25) p_ptr->stat_add[A_CON]++;
1952- if (p_ptr->lev > 40) p_ptr->stat_add[A_CON]++;
1953- if (p_ptr->lev > 45) p_ptr->stat_add[A_CON]++;
1952+ if (creature_ptr->lev > 25) creature_ptr->stat_add[A_CON]++;
1953+ if (creature_ptr->lev > 40) creature_ptr->stat_add[A_CON]++;
1954+ if (creature_ptr->lev > 45) creature_ptr->stat_add[A_CON]++;
19541955 break;
19551956 case RACE_ANGEL:
1956- p_ptr->levitation = TRUE;
1957- p_ptr->see_inv = TRUE;
1957+ creature_ptr->levitation = TRUE;
1958+ creature_ptr->see_inv = TRUE;
19581959 break;
19591960 case RACE_DEMON:
1960- p_ptr->resist_fire = TRUE;
1961- p_ptr->resist_neth = TRUE;
1962- p_ptr->hold_exp = TRUE;
1963- if (p_ptr->lev > 9) p_ptr->see_inv = TRUE;
1964- if (p_ptr->lev > 44)
1961+ creature_ptr->resist_fire = TRUE;
1962+ creature_ptr->resist_neth = TRUE;
1963+ creature_ptr->hold_exp = TRUE;
1964+ if (creature_ptr->lev > 9) creature_ptr->see_inv = TRUE;
1965+ if (creature_ptr->lev > 44)
19651966 {
1966- p_ptr->oppose_fire = 1;
1967- p_ptr->redraw |= PR_STATUS;
1967+ creature_ptr->oppose_fire = 1;
1968+ creature_ptr->redraw |= PR_STATUS;
19681969 }
19691970 break;
19701971 case RACE_DUNADAN:
1971- p_ptr->sustain_con = TRUE;
1972+ creature_ptr->sustain_con = TRUE;
19721973 break;
19731974 case RACE_S_FAIRY:
1974- p_ptr->levitation = TRUE;
1975+ creature_ptr->levitation = TRUE;
19751976 break;
19761977 case RACE_KUTAR:
1977- p_ptr->resist_conf = TRUE;
1978+ creature_ptr->resist_conf = TRUE;
19781979 break;
19791980 case RACE_ANDROID:
1980- p_ptr->slow_digest = TRUE;
1981- p_ptr->free_act = TRUE;
1982- p_ptr->resist_pois = TRUE;
1983- p_ptr->hold_exp = TRUE;
1981+ creature_ptr->slow_digest = TRUE;
1982+ creature_ptr->free_act = TRUE;
1983+ creature_ptr->resist_pois = TRUE;
1984+ creature_ptr->hold_exp = TRUE;
19841985 break;
19851986 case RACE_MERFOLK:
1986- p_ptr->resist_water = TRUE;
1987+ creature_ptr->resist_water = TRUE;
19871988 break;
19881989 default:
19891990 /* Do nothing */
@@ -1991,96 +1992,96 @@ void calc_bonuses(void)
19911992 }
19921993 }
19931994
1994- if (p_ptr->ult_res || (p_ptr->special_defense & KATA_MUSOU))
1995- {
1996- p_ptr->see_inv = TRUE;
1997- p_ptr->free_act = TRUE;
1998- p_ptr->slow_digest = TRUE;
1999- p_ptr->regenerate = TRUE;
2000- p_ptr->levitation = TRUE;
2001- p_ptr->hold_exp = TRUE;
2002- p_ptr->telepathy = TRUE;
2003- p_ptr->lite = TRUE;
2004- p_ptr->sustain_str = TRUE;
2005- p_ptr->sustain_int = TRUE;
2006- p_ptr->sustain_wis = TRUE;
2007- p_ptr->sustain_con = TRUE;
2008- p_ptr->sustain_dex = TRUE;
2009- p_ptr->sustain_chr = TRUE;
2010- p_ptr->resist_acid = TRUE;
2011- p_ptr->resist_elec = TRUE;
2012- p_ptr->resist_fire = TRUE;
2013- p_ptr->resist_cold = TRUE;
2014- p_ptr->resist_pois = TRUE;
2015- p_ptr->resist_conf = TRUE;
2016- p_ptr->resist_sound = TRUE;
2017- p_ptr->resist_lite = TRUE;
2018- p_ptr->resist_dark = TRUE;
2019- p_ptr->resist_chaos = TRUE;
2020- p_ptr->resist_disen = TRUE;
2021- p_ptr->resist_shard = TRUE;
2022- p_ptr->resist_nexus = TRUE;
2023- p_ptr->resist_blind = TRUE;
2024- p_ptr->resist_neth = TRUE;
2025- p_ptr->resist_fear = TRUE;
2026- p_ptr->reflect = TRUE;
2027- p_ptr->sh_fire = TRUE;
2028- p_ptr->sh_elec = TRUE;
2029- p_ptr->sh_cold = TRUE;
2030- p_ptr->to_a += 100;
2031- p_ptr->dis_to_a += 100;
1995+ if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU))
1996+ {
1997+ creature_ptr->see_inv = TRUE;
1998+ creature_ptr->free_act = TRUE;
1999+ creature_ptr->slow_digest = TRUE;
2000+ creature_ptr->regenerate = TRUE;
2001+ creature_ptr->levitation = TRUE;
2002+ creature_ptr->hold_exp = TRUE;
2003+ creature_ptr->telepathy = TRUE;
2004+ creature_ptr->lite = TRUE;
2005+ creature_ptr->sustain_str = TRUE;
2006+ creature_ptr->sustain_int = TRUE;
2007+ creature_ptr->sustain_wis = TRUE;
2008+ creature_ptr->sustain_con = TRUE;
2009+ creature_ptr->sustain_dex = TRUE;
2010+ creature_ptr->sustain_chr = TRUE;
2011+ creature_ptr->resist_acid = TRUE;
2012+ creature_ptr->resist_elec = TRUE;
2013+ creature_ptr->resist_fire = TRUE;
2014+ creature_ptr->resist_cold = TRUE;
2015+ creature_ptr->resist_pois = TRUE;
2016+ creature_ptr->resist_conf = TRUE;
2017+ creature_ptr->resist_sound = TRUE;
2018+ creature_ptr->resist_lite = TRUE;
2019+ creature_ptr->resist_dark = TRUE;
2020+ creature_ptr->resist_chaos = TRUE;
2021+ creature_ptr->resist_disen = TRUE;
2022+ creature_ptr->resist_shard = TRUE;
2023+ creature_ptr->resist_nexus = TRUE;
2024+ creature_ptr->resist_blind = TRUE;
2025+ creature_ptr->resist_neth = TRUE;
2026+ creature_ptr->resist_fear = TRUE;
2027+ creature_ptr->reflect = TRUE;
2028+ creature_ptr->sh_fire = TRUE;
2029+ creature_ptr->sh_elec = TRUE;
2030+ creature_ptr->sh_cold = TRUE;
2031+ creature_ptr->to_a += 100;
2032+ creature_ptr->dis_to_a += 100;
20322033 }
20332034 /* Temporary shield */
2034- else if (p_ptr->tsubureru || p_ptr->shield || p_ptr->magicdef)
2035+ else if (creature_ptr->tsubureru || creature_ptr->shield || creature_ptr->magicdef)
20352036 {
2036- p_ptr->to_a += 50;
2037- p_ptr->dis_to_a += 50;
2037+ creature_ptr->to_a += 50;
2038+ creature_ptr->dis_to_a += 50;
20382039 }
20392040
2040- if (p_ptr->tim_res_nether)
2041+ if (creature_ptr->tim_res_nether)
20412042 {
2042- p_ptr->resist_neth = TRUE;
2043+ creature_ptr->resist_neth = TRUE;
20432044 }
2044- if (p_ptr->tim_sh_fire)
2045+ if (creature_ptr->tim_sh_fire)
20452046 {
2046- p_ptr->sh_fire = TRUE;
2047+ creature_ptr->sh_fire = TRUE;
20472048 }
2048- if (p_ptr->tim_res_time)
2049+ if (creature_ptr->tim_res_time)
20492050 {
2050- p_ptr->resist_time = TRUE;
2051+ creature_ptr->resist_time = TRUE;
20512052 }
20522053
20532054 /* Sexy Gal */
2054- if (p_ptr->pseikaku == SEIKAKU_SEXY) p_ptr->cursed |= (TRC_AGGRAVATE);
2055+ if (creature_ptr->pseikaku == SEIKAKU_SEXY) creature_ptr->cursed |= (TRC_AGGRAVATE);
20552056
2056- if (p_ptr->pseikaku == SEIKAKU_NAMAKE) p_ptr->to_m_chance += 10;
2057- if (p_ptr->pseikaku == SEIKAKU_KIREMONO) p_ptr->to_m_chance -= 3;
2058- if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) p_ptr->to_m_chance++;
2057+ if (creature_ptr->pseikaku == SEIKAKU_NAMAKE) creature_ptr->to_m_chance += 10;
2058+ if (creature_ptr->pseikaku == SEIKAKU_KIREMONO) creature_ptr->to_m_chance -= 3;
2059+ if ((creature_ptr->pseikaku == SEIKAKU_GAMAN) || (creature_ptr->pseikaku == SEIKAKU_CHIKARA)) creature_ptr->to_m_chance++;
20592060
2060- if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN)
2061+ if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN)
20612062 {
2062- p_ptr->to_m_chance += 5;
2063- p_ptr->resist_conf = TRUE;
2063+ creature_ptr->to_m_chance += 5;
2064+ creature_ptr->resist_conf = TRUE;
20642065 }
20652066
20662067 /* Lucky man */
2067- if (p_ptr->pseikaku == SEIKAKU_LUCKY) p_ptr->muta3 |= MUT3_GOOD_LUCK;
2068+ if (creature_ptr->pseikaku == SEIKAKU_LUCKY) creature_ptr->muta3 |= MUT3_GOOD_LUCK;
20682069
2069- if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
2070+ if (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN)
20702071 {
2071- p_ptr->resist_blind = TRUE;
2072- p_ptr->resist_conf = TRUE;
2073- p_ptr->hold_exp = TRUE;
2074- if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE;
2072+ creature_ptr->resist_blind = TRUE;
2073+ creature_ptr->resist_conf = TRUE;
2074+ creature_ptr->hold_exp = TRUE;
2075+ if (creature_ptr->pclass != CLASS_NINJA) creature_ptr->lite = TRUE;
20752076
2076- if ((p_ptr->prace != RACE_KLACKON) && (p_ptr->prace != RACE_SPRITE))
2077+ if ((creature_ptr->prace != RACE_KLACKON) && (creature_ptr->prace != RACE_SPRITE))
20772078 /* Munchkin become faster */
2078- new_speed += (p_ptr->lev) / 10 + 5;
2079+ new_speed += (creature_ptr->lev) / 10 + 5;
20792080 }
20802081
20812082 if (music_singing(MUSIC_WALL))
20822083 {
2083- p_ptr->kill_wall = TRUE;
2084+ creature_ptr->kill_wall = TRUE;
20842085 }
20852086
20862087 /* Hack -- apply racial/class stat maxes */
@@ -2088,220 +2089,220 @@ void calc_bonuses(void)
20882089 for (i = 0; i < A_MAX; i++)
20892090 {
20902091 /* Modify the stats for "race" */
2091- p_ptr->stat_add[i] += (tmp_rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i]);
2092+ creature_ptr->stat_add[i] += (tmp_rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i]);
20922093 }
20932094
20942095
20952096 /* I'm adding the mutations here for the lack of a better place... */
2096- if (p_ptr->muta3)
2097+ if (creature_ptr->muta3)
20972098 {
20982099 /* Hyper Strength */
2099- if (p_ptr->muta3 & MUT3_HYPER_STR)
2100+ if (creature_ptr->muta3 & MUT3_HYPER_STR)
21002101 {
2101- p_ptr->stat_add[A_STR] += 4;
2102+ creature_ptr->stat_add[A_STR] += 4;
21022103 }
21032104
21042105 /* Puny */
2105- if (p_ptr->muta3 & MUT3_PUNY)
2106+ if (creature_ptr->muta3 & MUT3_PUNY)
21062107 {
2107- p_ptr->stat_add[A_STR] -= 4;
2108+ creature_ptr->stat_add[A_STR] -= 4;
21082109 }
21092110
21102111 /* Living computer */
2111- if (p_ptr->muta3 & MUT3_HYPER_INT)
2112+ if (creature_ptr->muta3 & MUT3_HYPER_INT)
21122113 {
2113- p_ptr->stat_add[A_INT] += 4;
2114- p_ptr->stat_add[A_WIS] += 4;
2114+ creature_ptr->stat_add[A_INT] += 4;
2115+ creature_ptr->stat_add[A_WIS] += 4;
21152116 }
21162117
21172118 /* Moronic */
2118- if (p_ptr->muta3 & MUT3_MORONIC)
2119+ if (creature_ptr->muta3 & MUT3_MORONIC)
21192120 {
2120- p_ptr->stat_add[A_INT] -= 4;
2121- p_ptr->stat_add[A_WIS] -= 4;
2121+ creature_ptr->stat_add[A_INT] -= 4;
2122+ creature_ptr->stat_add[A_WIS] -= 4;
21222123 }
21232124
2124- if (p_ptr->muta3 & MUT3_RESILIENT)
2125+ if (creature_ptr->muta3 & MUT3_RESILIENT)
21252126 {
2126- p_ptr->stat_add[A_CON] += 4;
2127+ creature_ptr->stat_add[A_CON] += 4;
21272128 }
21282129
2129- if (p_ptr->muta3 & MUT3_XTRA_FAT)
2130+ if (creature_ptr->muta3 & MUT3_XTRA_FAT)
21302131 {
2131- p_ptr->stat_add[A_CON] += 2;
2132+ creature_ptr->stat_add[A_CON] += 2;
21322133 new_speed -= 2;
21332134 }
21342135
2135- if (p_ptr->muta3 & MUT3_ALBINO)
2136+ if (creature_ptr->muta3 & MUT3_ALBINO)
21362137 {
2137- p_ptr->stat_add[A_CON] -= 4;
2138+ creature_ptr->stat_add[A_CON] -= 4;
21382139 }
21392140
2140- if (p_ptr->muta3 & MUT3_FLESH_ROT)
2141+ if (creature_ptr->muta3 & MUT3_FLESH_ROT)
21412142 {
2142- p_ptr->stat_add[A_CON] -= 2;
2143- p_ptr->stat_add[A_CHR] -= 1;
2144- p_ptr->regenerate = FALSE;
2143+ creature_ptr->stat_add[A_CON] -= 2;
2144+ creature_ptr->stat_add[A_CHR] -= 1;
2145+ creature_ptr->regenerate = FALSE;
21452146 /* Cancel innate regeneration */
21462147 }
21472148
2148- if (p_ptr->muta3 & MUT3_SILLY_VOI)
2149+ if (creature_ptr->muta3 & MUT3_SILLY_VOI)
21492150 {
2150- p_ptr->stat_add[A_CHR] -= 4;
2151+ creature_ptr->stat_add[A_CHR] -= 4;
21512152 }
21522153
2153- if (p_ptr->muta3 & MUT3_BLANK_FAC)
2154+ if (creature_ptr->muta3 & MUT3_BLANK_FAC)
21542155 {
2155- p_ptr->stat_add[A_CHR] -= 1;
2156+ creature_ptr->stat_add[A_CHR] -= 1;
21562157 }
21572158
2158- if (p_ptr->muta3 & MUT3_XTRA_EYES)
2159+ if (creature_ptr->muta3 & MUT3_XTRA_EYES)
21592160 {
2160- p_ptr->skill_fos += 15;
2161- p_ptr->skill_srh += 15;
2161+ creature_ptr->skill_fos += 15;
2162+ creature_ptr->skill_srh += 15;
21622163 }
21632164
2164- if (p_ptr->muta3 & MUT3_MAGIC_RES)
2165+ if (creature_ptr->muta3 & MUT3_MAGIC_RES)
21652166 {
2166- p_ptr->skill_sav += (15 + (p_ptr->lev / 5));
2167+ creature_ptr->skill_sav += (15 + (creature_ptr->lev / 5));
21672168 }
21682169
2169- if (p_ptr->muta3 & MUT3_XTRA_NOIS)
2170+ if (creature_ptr->muta3 & MUT3_XTRA_NOIS)
21702171 {
2171- p_ptr->skill_stl -= 3;
2172+ creature_ptr->skill_stl -= 3;
21722173 }
21732174
2174- if (p_ptr->muta3 & MUT3_INFRAVIS)
2175+ if (creature_ptr->muta3 & MUT3_INFRAVIS)
21752176 {
2176- p_ptr->see_infra += 3;
2177+ creature_ptr->see_infra += 3;
21772178 }
21782179
2179- if (p_ptr->muta3 & MUT3_XTRA_LEGS)
2180+ if (creature_ptr->muta3 & MUT3_XTRA_LEGS)
21802181 {
21812182 new_speed += 3;
21822183 }
21832184
2184- if (p_ptr->muta3 & MUT3_SHORT_LEG)
2185+ if (creature_ptr->muta3 & MUT3_SHORT_LEG)
21852186 {
21862187 new_speed -= 3;
21872188 }
21882189
2189- if (p_ptr->muta3 & MUT3_ELEC_TOUC)
2190+ if (creature_ptr->muta3 & MUT3_ELEC_TOUC)
21902191 {
2191- p_ptr->sh_elec = TRUE;
2192+ creature_ptr->sh_elec = TRUE;
21922193 }
21932194
2194- if (p_ptr->muta3 & MUT3_FIRE_BODY)
2195+ if (creature_ptr->muta3 & MUT3_FIRE_BODY)
21952196 {
2196- p_ptr->sh_fire = TRUE;
2197- p_ptr->lite = TRUE;
2197+ creature_ptr->sh_fire = TRUE;
2198+ creature_ptr->lite = TRUE;
21982199 }
21992200
2200- if (p_ptr->muta3 & MUT3_WART_SKIN)
2201+ if (creature_ptr->muta3 & MUT3_WART_SKIN)
22012202 {
2202- p_ptr->stat_add[A_CHR] -= 2;
2203- p_ptr->to_a += 5;
2204- p_ptr->dis_to_a += 5;
2203+ creature_ptr->stat_add[A_CHR] -= 2;
2204+ creature_ptr->to_a += 5;
2205+ creature_ptr->dis_to_a += 5;
22052206 }
22062207
2207- if (p_ptr->muta3 & MUT3_SCALES)
2208+ if (creature_ptr->muta3 & MUT3_SCALES)
22082209 {
2209- p_ptr->stat_add[A_CHR] -= 1;
2210- p_ptr->to_a += 10;
2211- p_ptr->dis_to_a += 10;
2210+ creature_ptr->stat_add[A_CHR] -= 1;
2211+ creature_ptr->to_a += 10;
2212+ creature_ptr->dis_to_a += 10;
22122213 }
22132214
2214- if (p_ptr->muta3 & MUT3_IRON_SKIN)
2215+ if (creature_ptr->muta3 & MUT3_IRON_SKIN)
22152216 {
2216- p_ptr->stat_add[A_DEX] -= 1;
2217- p_ptr->to_a += 25;
2218- p_ptr->dis_to_a += 25;
2217+ creature_ptr->stat_add[A_DEX] -= 1;
2218+ creature_ptr->to_a += 25;
2219+ creature_ptr->dis_to_a += 25;
22192220 }
22202221
2221- if (p_ptr->muta3 & MUT3_WINGS)
2222+ if (creature_ptr->muta3 & MUT3_WINGS)
22222223 {
2223- p_ptr->levitation = TRUE;
2224+ creature_ptr->levitation = TRUE;
22242225 }
22252226
2226- if (p_ptr->muta3 & MUT3_FEARLESS)
2227+ if (creature_ptr->muta3 & MUT3_FEARLESS)
22272228 {
2228- p_ptr->resist_fear = TRUE;
2229+ creature_ptr->resist_fear = TRUE;
22292230 }
22302231
2231- if (p_ptr->muta3 & MUT3_REGEN)
2232+ if (creature_ptr->muta3 & MUT3_REGEN)
22322233 {
2233- p_ptr->regenerate = TRUE;
2234+ creature_ptr->regenerate = TRUE;
22342235 }
22352236
2236- if (p_ptr->muta3 & MUT3_ESP)
2237+ if (creature_ptr->muta3 & MUT3_ESP)
22372238 {
2238- p_ptr->telepathy = TRUE;
2239+ creature_ptr->telepathy = TRUE;
22392240 }
22402241
2241- if (p_ptr->muta3 & MUT3_LIMBER)
2242+ if (creature_ptr->muta3 & MUT3_LIMBER)
22422243 {
2243- p_ptr->stat_add[A_DEX] += 3;
2244+ creature_ptr->stat_add[A_DEX] += 3;
22442245 }
22452246
2246- if (p_ptr->muta3 & MUT3_ARTHRITIS)
2247+ if (creature_ptr->muta3 & MUT3_ARTHRITIS)
22472248 {
2248- p_ptr->stat_add[A_DEX] -= 3;
2249+ creature_ptr->stat_add[A_DEX] -= 3;
22492250 }
22502251
2251- if (p_ptr->muta3 & MUT3_MOTION)
2252+ if (creature_ptr->muta3 & MUT3_MOTION)
22522253 {
2253- p_ptr->free_act = TRUE;
2254- p_ptr->skill_stl += 1;
2254+ creature_ptr->free_act = TRUE;
2255+ creature_ptr->skill_stl += 1;
22552256 }
22562257
2257- if (p_ptr->muta3 & MUT3_ILL_NORM)
2258+ if (creature_ptr->muta3 & MUT3_ILL_NORM)
22582259 {
2259- p_ptr->stat_add[A_CHR] = 0;
2260+ creature_ptr->stat_add[A_CHR] = 0;
22602261 }
22612262 }
22622263
2263- if (p_ptr->tsuyoshi)
2264+ if (creature_ptr->tsuyoshi)
22642265 {
2265- p_ptr->stat_add[A_STR] += 4;
2266- p_ptr->stat_add[A_CON] += 4;
2266+ creature_ptr->stat_add[A_STR] += 4;
2267+ creature_ptr->stat_add[A_CON] += 4;
22672268 }
22682269
2269- /* Scan the usable p_ptr->inventory_list */
2270+ /* Scan the usable creature_ptr->inventory_list */
22702271 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
22712272 {
22722273 int bonus_to_h, bonus_to_d;
2273- o_ptr = &p_ptr->inventory_list[i];
2274+ o_ptr = &creature_ptr->inventory_list[i];
22742275 if (!o_ptr->k_idx) continue;
22752276
22762277 object_flags(o_ptr, flgs);
22772278
2278- p_ptr->cursed |= (o_ptr->curse_flags & (0xFFFFFFF0L));
2279- if (o_ptr->name1 == ART_CHAINSWORD) p_ptr->cursed |= TRC_CHAINSWORD;
2279+ creature_ptr->cursed |= (o_ptr->curse_flags & (0xFFFFFFF0L));
2280+ if (o_ptr->name1 == ART_CHAINSWORD) creature_ptr->cursed |= TRC_CHAINSWORD;
22802281
22812282 /* Affect stats */
2282- if (have_flag(flgs, TR_STR)) p_ptr->stat_add[A_STR] += o_ptr->pval;
2283- if (have_flag(flgs, TR_INT)) p_ptr->stat_add[A_INT] += o_ptr->pval;
2284- if (have_flag(flgs, TR_WIS)) p_ptr->stat_add[A_WIS] += o_ptr->pval;
2285- if (have_flag(flgs, TR_DEX)) p_ptr->stat_add[A_DEX] += o_ptr->pval;
2286- if (have_flag(flgs, TR_CON)) p_ptr->stat_add[A_CON] += o_ptr->pval;
2287- if (have_flag(flgs, TR_CHR)) p_ptr->stat_add[A_CHR] += o_ptr->pval;
2283+ if (have_flag(flgs, TR_STR)) creature_ptr->stat_add[A_STR] += o_ptr->pval;
2284+ if (have_flag(flgs, TR_INT)) creature_ptr->stat_add[A_INT] += o_ptr->pval;
2285+ if (have_flag(flgs, TR_WIS)) creature_ptr->stat_add[A_WIS] += o_ptr->pval;
2286+ if (have_flag(flgs, TR_DEX)) creature_ptr->stat_add[A_DEX] += o_ptr->pval;
2287+ if (have_flag(flgs, TR_CON)) creature_ptr->stat_add[A_CON] += o_ptr->pval;
2288+ if (have_flag(flgs, TR_CHR)) creature_ptr->stat_add[A_CHR] += o_ptr->pval;
22882289
2289- if (have_flag(flgs, TR_MAGIC_MASTERY)) p_ptr->skill_dev += 8 * o_ptr->pval;
2290+ if (have_flag(flgs, TR_MAGIC_MASTERY)) creature_ptr->skill_dev += 8 * o_ptr->pval;
22902291
22912292 /* Affect stealth */
2292- if (have_flag(flgs, TR_STEALTH)) p_ptr->skill_stl += o_ptr->pval;
2293+ if (have_flag(flgs, TR_STEALTH)) creature_ptr->skill_stl += o_ptr->pval;
22932294
22942295 /* Affect searching ability (factor of five) */
2295- if (have_flag(flgs, TR_SEARCH)) p_ptr->skill_srh += (o_ptr->pval * 5);
2296+ if (have_flag(flgs, TR_SEARCH)) creature_ptr->skill_srh += (o_ptr->pval * 5);
22962297
22972298 /* Affect searching frequency (factor of five) */
2298- if (have_flag(flgs, TR_SEARCH)) p_ptr->skill_fos += (o_ptr->pval * 5);
2299+ if (have_flag(flgs, TR_SEARCH)) creature_ptr->skill_fos += (o_ptr->pval * 5);
22992300
23002301 /* Affect infravision */
2301- if (have_flag(flgs, TR_INFRA)) p_ptr->see_infra += o_ptr->pval;
2302+ if (have_flag(flgs, TR_INFRA)) creature_ptr->see_infra += o_ptr->pval;
23022303
23032304 /* Affect digging (factor of 20) */
2304- if (have_flag(flgs, TR_TUNNEL)) p_ptr->skill_dig += (o_ptr->pval * 20);
2305+ if (have_flag(flgs, TR_TUNNEL)) creature_ptr->skill_dig += (o_ptr->pval * 20);
23052306
23062307 /* Affect speed */
23072308 if (have_flag(flgs, TR_SPEED)) new_speed += o_ptr->pval;
@@ -2309,63 +2310,63 @@ void calc_bonuses(void)
23092310 /* Affect blows */
23102311 if (have_flag(flgs, TR_BLOWS))
23112312 {
2312- if ((i == INVEN_RARM || i == INVEN_RIGHT) && !p_ptr->ryoute) extra_blows[0] += o_ptr->pval;
2313- else if ((i == INVEN_LARM || i == INVEN_LEFT) && !p_ptr->ryoute) extra_blows[1] += o_ptr->pval;
2313+ if ((i == INVEN_RARM || i == INVEN_RIGHT) && !creature_ptr->ryoute) extra_blows[0] += o_ptr->pval;
2314+ else if ((i == INVEN_LARM || i == INVEN_LEFT) && !creature_ptr->ryoute) extra_blows[1] += o_ptr->pval;
23142315 else { extra_blows[0] += o_ptr->pval; extra_blows[1] += o_ptr->pval; }
23152316 }
23162317
23172318 /* Hack -- cause earthquakes */
2318- if (have_flag(flgs, TR_IMPACT)) p_ptr->impact[(i == INVEN_RARM) ? 0 : 1] = TRUE;
2319+ if (have_flag(flgs, TR_IMPACT)) creature_ptr->impact[(i == INVEN_RARM) ? 0 : 1] = TRUE;
23192320
23202321 /* Various flags */
2321- if (have_flag(flgs, TR_AGGRAVATE)) p_ptr->cursed |= TRC_AGGRAVATE;
2322- if (have_flag(flgs, TR_DRAIN_EXP)) p_ptr->cursed |= TRC_DRAIN_EXP;
2323- if (have_flag(flgs, TR_TY_CURSE)) p_ptr->cursed |= TRC_TY_CURSE;
2324- if (have_flag(flgs, TR_ADD_L_CURSE)) p_ptr->cursed |= TRC_ADD_L_CURSE;
2325- if (have_flag(flgs, TR_ADD_H_CURSE)) p_ptr->cursed |= TRC_ADD_H_CURSE;
2326- if (have_flag(flgs, TR_DRAIN_HP)) p_ptr->cursed |= TRC_DRAIN_HP;
2327- if (have_flag(flgs, TR_DRAIN_MANA)) p_ptr->cursed |= TRC_DRAIN_MANA;
2328- if (have_flag(flgs, TR_CALL_ANIMAL)) p_ptr->cursed |= TRC_CALL_ANIMAL;
2329- if (have_flag(flgs, TR_CALL_DEMON)) p_ptr->cursed |= TRC_CALL_DEMON;
2330- if (have_flag(flgs, TR_CALL_DRAGON)) p_ptr->cursed |= TRC_CALL_DRAGON;
2331- if (have_flag(flgs, TR_CALL_UNDEAD)) p_ptr->cursed |= TRC_CALL_UNDEAD;
2332- if (have_flag(flgs, TR_COWARDICE)) p_ptr->cursed |= TRC_COWARDICE;
2333- if (have_flag(flgs, TR_LOW_MELEE)) p_ptr->cursed |= TRC_LOW_MELEE;
2334- if (have_flag(flgs, TR_LOW_AC)) p_ptr->cursed |= TRC_LOW_AC;
2335- if (have_flag(flgs, TR_LOW_MAGIC)) p_ptr->cursed |= TRC_LOW_MAGIC;
2336- if (have_flag(flgs, TR_FAST_DIGEST)) p_ptr->cursed |= TRC_FAST_DIGEST;
2337- if (have_flag(flgs, TR_SLOW_REGEN)) p_ptr->cursed |= TRC_SLOW_REGEN;
2338- if (have_flag(flgs, TR_DEC_MANA)) p_ptr->dec_mana = TRUE;
2339- if (have_flag(flgs, TR_BLESSED)) p_ptr->bless_blade = TRUE;
2340- if (have_flag(flgs, TR_XTRA_MIGHT)) p_ptr->xtra_might = TRUE;
2341- if (have_flag(flgs, TR_SLOW_DIGEST)) p_ptr->slow_digest = TRUE;
2342- if (have_flag(flgs, TR_REGEN)) p_ptr->regenerate = TRUE;
2343- if (have_flag(flgs, TR_TELEPATHY)) p_ptr->telepathy = TRUE;
2344- if (have_flag(flgs, TR_ESP_ANIMAL)) p_ptr->esp_animal = TRUE;
2345- if (have_flag(flgs, TR_ESP_UNDEAD)) p_ptr->esp_undead = TRUE;
2346- if (have_flag(flgs, TR_ESP_DEMON)) p_ptr->esp_demon = TRUE;
2347- if (have_flag(flgs, TR_ESP_ORC)) p_ptr->esp_orc = TRUE;
2348- if (have_flag(flgs, TR_ESP_TROLL)) p_ptr->esp_troll = TRUE;
2349- if (have_flag(flgs, TR_ESP_GIANT)) p_ptr->esp_giant = TRUE;
2350- if (have_flag(flgs, TR_ESP_DRAGON)) p_ptr->esp_dragon = TRUE;
2351- if (have_flag(flgs, TR_ESP_HUMAN)) p_ptr->esp_human = TRUE;
2352- if (have_flag(flgs, TR_ESP_EVIL)) p_ptr->esp_evil = TRUE;
2353- if (have_flag(flgs, TR_ESP_GOOD)) p_ptr->esp_good = TRUE;
2354- if (have_flag(flgs, TR_ESP_NONLIVING)) p_ptr->esp_nonliving = TRUE;
2355- if (have_flag(flgs, TR_ESP_UNIQUE)) p_ptr->esp_unique = TRUE;
2356-
2357- if (have_flag(flgs, TR_SEE_INVIS)) p_ptr->see_inv = TRUE;
2358- if (have_flag(flgs, TR_LEVITATION)) p_ptr->levitation = TRUE;
2359- if (have_flag(flgs, TR_FREE_ACT)) p_ptr->free_act = TRUE;
2360- if (have_flag(flgs, TR_HOLD_EXP)) p_ptr->hold_exp = TRUE;
2322+ if (have_flag(flgs, TR_AGGRAVATE)) creature_ptr->cursed |= TRC_AGGRAVATE;
2323+ if (have_flag(flgs, TR_DRAIN_EXP)) creature_ptr->cursed |= TRC_DRAIN_EXP;
2324+ if (have_flag(flgs, TR_TY_CURSE)) creature_ptr->cursed |= TRC_TY_CURSE;
2325+ if (have_flag(flgs, TR_ADD_L_CURSE)) creature_ptr->cursed |= TRC_ADD_L_CURSE;
2326+ if (have_flag(flgs, TR_ADD_H_CURSE)) creature_ptr->cursed |= TRC_ADD_H_CURSE;
2327+ if (have_flag(flgs, TR_DRAIN_HP)) creature_ptr->cursed |= TRC_DRAIN_HP;
2328+ if (have_flag(flgs, TR_DRAIN_MANA)) creature_ptr->cursed |= TRC_DRAIN_MANA;
2329+ if (have_flag(flgs, TR_CALL_ANIMAL)) creature_ptr->cursed |= TRC_CALL_ANIMAL;
2330+ if (have_flag(flgs, TR_CALL_DEMON)) creature_ptr->cursed |= TRC_CALL_DEMON;
2331+ if (have_flag(flgs, TR_CALL_DRAGON)) creature_ptr->cursed |= TRC_CALL_DRAGON;
2332+ if (have_flag(flgs, TR_CALL_UNDEAD)) creature_ptr->cursed |= TRC_CALL_UNDEAD;
2333+ if (have_flag(flgs, TR_COWARDICE)) creature_ptr->cursed |= TRC_COWARDICE;
2334+ if (have_flag(flgs, TR_LOW_MELEE)) creature_ptr->cursed |= TRC_LOW_MELEE;
2335+ if (have_flag(flgs, TR_LOW_AC)) creature_ptr->cursed |= TRC_LOW_AC;
2336+ if (have_flag(flgs, TR_LOW_MAGIC)) creature_ptr->cursed |= TRC_LOW_MAGIC;
2337+ if (have_flag(flgs, TR_FAST_DIGEST)) creature_ptr->cursed |= TRC_FAST_DIGEST;
2338+ if (have_flag(flgs, TR_SLOW_REGEN)) creature_ptr->cursed |= TRC_SLOW_REGEN;
2339+ if (have_flag(flgs, TR_DEC_MANA)) creature_ptr->dec_mana = TRUE;
2340+ if (have_flag(flgs, TR_BLESSED)) creature_ptr->bless_blade = TRUE;
2341+ if (have_flag(flgs, TR_XTRA_MIGHT)) creature_ptr->xtra_might = TRUE;
2342+ if (have_flag(flgs, TR_SLOW_DIGEST)) creature_ptr->slow_digest = TRUE;
2343+ if (have_flag(flgs, TR_REGEN)) creature_ptr->regenerate = TRUE;
2344+ if (have_flag(flgs, TR_TELEPATHY)) creature_ptr->telepathy = TRUE;
2345+ if (have_flag(flgs, TR_ESP_ANIMAL)) creature_ptr->esp_animal = TRUE;
2346+ if (have_flag(flgs, TR_ESP_UNDEAD)) creature_ptr->esp_undead = TRUE;
2347+ if (have_flag(flgs, TR_ESP_DEMON)) creature_ptr->esp_demon = TRUE;
2348+ if (have_flag(flgs, TR_ESP_ORC)) creature_ptr->esp_orc = TRUE;
2349+ if (have_flag(flgs, TR_ESP_TROLL)) creature_ptr->esp_troll = TRUE;
2350+ if (have_flag(flgs, TR_ESP_GIANT)) creature_ptr->esp_giant = TRUE;
2351+ if (have_flag(flgs, TR_ESP_DRAGON)) creature_ptr->esp_dragon = TRUE;
2352+ if (have_flag(flgs, TR_ESP_HUMAN)) creature_ptr->esp_human = TRUE;
2353+ if (have_flag(flgs, TR_ESP_EVIL)) creature_ptr->esp_evil = TRUE;
2354+ if (have_flag(flgs, TR_ESP_GOOD)) creature_ptr->esp_good = TRUE;
2355+ if (have_flag(flgs, TR_ESP_NONLIVING)) creature_ptr->esp_nonliving = TRUE;
2356+ if (have_flag(flgs, TR_ESP_UNIQUE)) creature_ptr->esp_unique = TRUE;
2357+
2358+ if (have_flag(flgs, TR_SEE_INVIS)) creature_ptr->see_inv = TRUE;
2359+ if (have_flag(flgs, TR_LEVITATION)) creature_ptr->levitation = TRUE;
2360+ if (have_flag(flgs, TR_FREE_ACT)) creature_ptr->free_act = TRUE;
2361+ if (have_flag(flgs, TR_HOLD_EXP)) creature_ptr->hold_exp = TRUE;
23612362 if (have_flag(flgs, TR_WARNING)) {
23622363 if (!o_ptr->inscription || !(my_strchr(quark_str(o_ptr->inscription), '$')))
2363- p_ptr->warning = TRUE;
2364+ creature_ptr->warning = TRUE;
23642365 }
23652366
23662367 if (have_flag(flgs, TR_TELEPORT))
23672368 {
2368- if (object_is_cursed(o_ptr)) p_ptr->cursed |= TRC_TELEPORT;
2369+ if (object_is_cursed(o_ptr)) creature_ptr->cursed |= TRC_TELEPORT;
23692370 else
23702371 {
23712372 concptr insc = quark_str(o_ptr->inscription);
@@ -2379,83 +2380,83 @@ void calc_bonuses(void)
23792380 else
23802381 {
23812382 /* Controlled random teleportation */
2382- p_ptr->cursed |= TRC_TELEPORT_SELF;
2383+ creature_ptr->cursed |= TRC_TELEPORT_SELF;
23832384 }
23842385 }
23852386 }
23862387
23872388 /* Immunity flags */
2388- if (have_flag(flgs, TR_IM_FIRE)) p_ptr->immune_fire = TRUE;
2389- if (have_flag(flgs, TR_IM_ACID)) p_ptr->immune_acid = TRUE;
2390- if (have_flag(flgs, TR_IM_COLD)) p_ptr->immune_cold = TRUE;
2391- if (have_flag(flgs, TR_IM_ELEC)) p_ptr->immune_elec = TRUE;
2389+ if (have_flag(flgs, TR_IM_FIRE)) creature_ptr->immune_fire = TRUE;
2390+ if (have_flag(flgs, TR_IM_ACID)) creature_ptr->immune_acid = TRUE;
2391+ if (have_flag(flgs, TR_IM_COLD)) creature_ptr->immune_cold = TRUE;
2392+ if (have_flag(flgs, TR_IM_ELEC)) creature_ptr->immune_elec = TRUE;
23922393
23932394 /* Resistance flags */
2394- if (have_flag(flgs, TR_RES_ACID)) p_ptr->resist_acid = TRUE;
2395- if (have_flag(flgs, TR_RES_ELEC)) p_ptr->resist_elec = TRUE;
2396- if (have_flag(flgs, TR_RES_FIRE)) p_ptr->resist_fire = TRUE;
2397- if (have_flag(flgs, TR_RES_COLD)) p_ptr->resist_cold = TRUE;
2398- if (have_flag(flgs, TR_RES_POIS)) p_ptr->resist_pois = TRUE;
2399- if (have_flag(flgs, TR_RES_FEAR)) p_ptr->resist_fear = TRUE;
2400- if (have_flag(flgs, TR_RES_CONF)) p_ptr->resist_conf = TRUE;
2401- if (have_flag(flgs, TR_RES_SOUND)) p_ptr->resist_sound = TRUE;
2402- if (have_flag(flgs, TR_RES_LITE)) p_ptr->resist_lite = TRUE;
2403- if (have_flag(flgs, TR_RES_DARK)) p_ptr->resist_dark = TRUE;
2404- if (have_flag(flgs, TR_RES_CHAOS)) p_ptr->resist_chaos = TRUE;
2405- if (have_flag(flgs, TR_RES_DISEN)) p_ptr->resist_disen = TRUE;
2406- if (have_flag(flgs, TR_RES_SHARDS)) p_ptr->resist_shard = TRUE;
2407- if (have_flag(flgs, TR_RES_NEXUS)) p_ptr->resist_nexus = TRUE;
2408- if (have_flag(flgs, TR_RES_BLIND)) p_ptr->resist_blind = TRUE;
2409- if (have_flag(flgs, TR_RES_NETHER)) p_ptr->resist_neth = TRUE;
2410-
2411- if (have_flag(flgs, TR_REFLECT)) p_ptr->reflect = TRUE;
2412- if (have_flag(flgs, TR_SH_FIRE)) p_ptr->sh_fire = TRUE;
2413- if (have_flag(flgs, TR_SH_ELEC)) p_ptr->sh_elec = TRUE;
2414- if (have_flag(flgs, TR_SH_COLD)) p_ptr->sh_cold = TRUE;
2415- if (have_flag(flgs, TR_NO_MAGIC)) p_ptr->anti_magic = TRUE;
2416- if (have_flag(flgs, TR_NO_TELE)) p_ptr->anti_tele = TRUE;
2395+ if (have_flag(flgs, TR_RES_ACID)) creature_ptr->resist_acid = TRUE;
2396+ if (have_flag(flgs, TR_RES_ELEC)) creature_ptr->resist_elec = TRUE;
2397+ if (have_flag(flgs, TR_RES_FIRE)) creature_ptr->resist_fire = TRUE;
2398+ if (have_flag(flgs, TR_RES_COLD)) creature_ptr->resist_cold = TRUE;
2399+ if (have_flag(flgs, TR_RES_POIS)) creature_ptr->resist_pois = TRUE;
2400+ if (have_flag(flgs, TR_RES_FEAR)) creature_ptr->resist_fear = TRUE;
2401+ if (have_flag(flgs, TR_RES_CONF)) creature_ptr->resist_conf = TRUE;
2402+ if (have_flag(flgs, TR_RES_SOUND)) creature_ptr->resist_sound = TRUE;
2403+ if (have_flag(flgs, TR_RES_LITE)) creature_ptr->resist_lite = TRUE;
2404+ if (have_flag(flgs, TR_RES_DARK)) creature_ptr->resist_dark = TRUE;
2405+ if (have_flag(flgs, TR_RES_CHAOS)) creature_ptr->resist_chaos = TRUE;
2406+ if (have_flag(flgs, TR_RES_DISEN)) creature_ptr->resist_disen = TRUE;
2407+ if (have_flag(flgs, TR_RES_SHARDS)) creature_ptr->resist_shard = TRUE;
2408+ if (have_flag(flgs, TR_RES_NEXUS)) creature_ptr->resist_nexus = TRUE;
2409+ if (have_flag(flgs, TR_RES_BLIND)) creature_ptr->resist_blind = TRUE;
2410+ if (have_flag(flgs, TR_RES_NETHER)) creature_ptr->resist_neth = TRUE;
2411+
2412+ if (have_flag(flgs, TR_REFLECT)) creature_ptr->reflect = TRUE;
2413+ if (have_flag(flgs, TR_SH_FIRE)) creature_ptr->sh_fire = TRUE;
2414+ if (have_flag(flgs, TR_SH_ELEC)) creature_ptr->sh_elec = TRUE;
2415+ if (have_flag(flgs, TR_SH_COLD)) creature_ptr->sh_cold = TRUE;
2416+ if (have_flag(flgs, TR_NO_MAGIC)) creature_ptr->anti_magic = TRUE;
2417+ if (have_flag(flgs, TR_NO_TELE)) creature_ptr->anti_tele = TRUE;
24172418
24182419 /* Sustain flags */
2419- if (have_flag(flgs, TR_SUST_STR)) p_ptr->sustain_str = TRUE;
2420- if (have_flag(flgs, TR_SUST_INT)) p_ptr->sustain_int = TRUE;
2421- if (have_flag(flgs, TR_SUST_WIS)) p_ptr->sustain_wis = TRUE;
2422- if (have_flag(flgs, TR_SUST_DEX)) p_ptr->sustain_dex = TRUE;
2423- if (have_flag(flgs, TR_SUST_CON)) p_ptr->sustain_con = TRUE;
2424- if (have_flag(flgs, TR_SUST_CHR)) p_ptr->sustain_chr = TRUE;
2420+ if (have_flag(flgs, TR_SUST_STR)) creature_ptr->sustain_str = TRUE;
2421+ if (have_flag(flgs, TR_SUST_INT)) creature_ptr->sustain_int = TRUE;
2422+ if (have_flag(flgs, TR_SUST_WIS)) creature_ptr->sustain_wis = TRUE;
2423+ if (have_flag(flgs, TR_SUST_DEX)) creature_ptr->sustain_dex = TRUE;
2424+ if (have_flag(flgs, TR_SUST_CON)) creature_ptr->sustain_con = TRUE;
2425+ if (have_flag(flgs, TR_SUST_CHR)) creature_ptr->sustain_chr = TRUE;
24252426
24262427 if (o_ptr->name2 == EGO_YOIYAMI) yoiyami = TRUE;
24272428 if (o_ptr->name2 == EGO_2WEAPON) easy_2weapon = TRUE;
2428- if (o_ptr->name2 == EGO_RING_RES_TIME) p_ptr->resist_time = TRUE;
2429- if (o_ptr->name2 == EGO_RING_THROW) p_ptr->mighty_throw = TRUE;
2430- if (have_flag(flgs, TR_EASY_SPELL)) p_ptr->easy_spell = TRUE;
2431- if (o_ptr->name2 == EGO_AMU_FOOL) p_ptr->heavy_spell = TRUE;
2429+ if (o_ptr->name2 == EGO_RING_RES_TIME) creature_ptr->resist_time = TRUE;
2430+ if (o_ptr->name2 == EGO_RING_THROW) creature_ptr->mighty_throw = TRUE;
2431+ if (have_flag(flgs, TR_EASY_SPELL)) creature_ptr->easy_spell = TRUE;
2432+ if (o_ptr->name2 == EGO_AMU_FOOL) creature_ptr->heavy_spell = TRUE;
24322433 if (o_ptr->name2 == EGO_AMU_NAIVETY) down_saving = TRUE;
24332434
24342435 if (o_ptr->curse_flags & TRC_LOW_MAGIC)
24352436 {
24362437 if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
24372438 {
2438- p_ptr->to_m_chance += 10;
2439+ creature_ptr->to_m_chance += 10;
24392440 }
24402441 else
24412442 {
2442- p_ptr->to_m_chance += 3;
2443+ creature_ptr->to_m_chance += 3;
24432444 }
24442445 }
24452446
24462447 if (o_ptr->tval == TV_CAPTURE) continue;
24472448
24482449 /* Modify the base armor class */
2449- p_ptr->ac += o_ptr->ac;
2450+ creature_ptr->ac += o_ptr->ac;
24502451
24512452 /* The base armor class is always known */
2452- p_ptr->dis_ac += o_ptr->ac;
2453+ creature_ptr->dis_ac += o_ptr->ac;
24532454
24542455 /* Apply the bonuses to armor class */
2455- p_ptr->to_a += o_ptr->to_a;
2456+ creature_ptr->to_a += o_ptr->to_a;
24562457
24572458 /* Apply the mental bonuses to armor class, if known */
2458- if (object_is_known(o_ptr)) p_ptr->dis_to_a += o_ptr->to_a;
2459+ if (object_is_known(o_ptr)) creature_ptr->dis_to_a += o_ptr->to_a;
24592460
24602461 if (o_ptr->curse_flags & TRC_LOW_MELEE)
24612462 {
@@ -2464,26 +2465,26 @@ void calc_bonuses(void)
24642465 {
24652466 if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
24662467 {
2467- p_ptr->to_h[slot] -= 15;
2468- if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h[slot] -= 15;
2468+ creature_ptr->to_h[slot] -= 15;
2469+ if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h[slot] -= 15;
24692470 }
24702471 else
24712472 {
2472- p_ptr->to_h[slot] -= 5;
2473- if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h[slot] -= 5;
2473+ creature_ptr->to_h[slot] -= 5;
2474+ if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h[slot] -= 5;
24742475 }
24752476 }
24762477 else
24772478 {
24782479 if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
24792480 {
2480- p_ptr->to_h_b -= 15;
2481- if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h_b -= 15;
2481+ creature_ptr->to_h_b -= 15;
2482+ if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h_b -= 15;
24822483 }
24832484 else
24842485 {
2485- p_ptr->to_h_b -= 5;
2486- if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_h_b -= 5;
2486+ creature_ptr->to_h_b -= 5;
2487+ if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_h_b -= 5;
24872488 }
24882489 }
24892490 }
@@ -2492,19 +2493,19 @@ void calc_bonuses(void)
24922493 {
24932494 if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
24942495 {
2495- p_ptr->to_a -= 30;
2496- if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_a -= 30;
2496+ creature_ptr->to_a -= 30;
2497+ if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_a -= 30;
24972498 }
24982499 else
24992500 {
2500- p_ptr->to_a -= 10;
2501- if (o_ptr->ident & IDENT_MENTAL) p_ptr->dis_to_a -= 10;
2501+ creature_ptr->to_a -= 10;
2502+ if (o_ptr->ident & IDENT_MENTAL) creature_ptr->dis_to_a -= 10;
25022503 }
25032504 }
25042505
25052506 /* Hack -- do not apply "weapon" bonuses */
2506- if (i == INVEN_RARM && has_melee_weapon(p_ptr, i)) continue;
2507- if (i == INVEN_LARM && has_melee_weapon(p_ptr, i)) continue;
2507+ if (i == INVEN_RARM && has_melee_weapon(creature_ptr, i)) continue;
2508+ if (i == INVEN_LARM && has_melee_weapon(creature_ptr, i)) continue;
25082509
25092510 /* Hack -- do not apply "bow" bonuses */
25102511 if (i == INVEN_BOW) continue;
@@ -2512,7 +2513,7 @@ void calc_bonuses(void)
25122513 bonus_to_h = o_ptr->to_h;
25132514 bonus_to_d = o_ptr->to_d;
25142515
2515- if (p_ptr->pclass == CLASS_NINJA)
2516+ if (creature_ptr->pclass == CLASS_NINJA)
25162517 {
25172518 if (o_ptr->to_h > 0) bonus_to_h = (o_ptr->to_h + 1) / 2;
25182519 if (o_ptr->to_d > 0) bonus_to_d = (o_ptr->to_d + 1) / 2;
@@ -2521,191 +2522,191 @@ void calc_bonuses(void)
25212522 /* To Bow and Natural attack */
25222523
25232524 /* Apply the bonuses to hit/damage */
2524- p_ptr->to_h_b += (s16b)bonus_to_h;
2525- p_ptr->to_h_m += (s16b)bonus_to_h;
2526- p_ptr->to_d_m += (s16b)bonus_to_d;
2525+ creature_ptr->to_h_b += (s16b)bonus_to_h;
2526+ creature_ptr->to_h_m += (s16b)bonus_to_h;
2527+ creature_ptr->to_d_m += (s16b)bonus_to_d;
25272528
25282529 /* Apply the mental bonuses tp hit/damage, if known */
2529- if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += (s16b)bonus_to_h;
2530+ if (object_is_known(o_ptr)) creature_ptr->dis_to_h_b += (s16b)bonus_to_h;
25302531
25312532 /* To Melee */
2532- if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !p_ptr->ryoute)
2533+ if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !creature_ptr->ryoute)
25332534 {
25342535 /* Apply the bonuses to hit/damage */
2535- p_ptr->to_h[i - INVEN_RIGHT] += (s16b)bonus_to_h;
2536- p_ptr->to_d[i - INVEN_RIGHT] += (s16b)bonus_to_d;
2536+ creature_ptr->to_h[i - INVEN_RIGHT] += (s16b)bonus_to_h;
2537+ creature_ptr->to_d[i - INVEN_RIGHT] += (s16b)bonus_to_d;
25372538
25382539 /* Apply the mental bonuses tp hit/damage, if known */
25392540 if (object_is_known(o_ptr))
25402541 {
2541- p_ptr->dis_to_h[i - INVEN_RIGHT] += (s16b)bonus_to_h;
2542- p_ptr->dis_to_d[i - INVEN_RIGHT] += (s16b)bonus_to_d;
2542+ creature_ptr->dis_to_h[i - INVEN_RIGHT] += (s16b)bonus_to_h;
2543+ creature_ptr->dis_to_d[i - INVEN_RIGHT] += (s16b)bonus_to_d;
25432544 }
25442545 }
2545- else if (p_ptr->migite && p_ptr->hidarite)
2546+ else if (creature_ptr->migite && creature_ptr->hidarite)
25462547 {
25472548 /* Apply the bonuses to hit/damage */
2548- p_ptr->to_h[0] += (bonus_to_h > 0) ? (bonus_to_h + 1) / 2 : bonus_to_h;
2549- p_ptr->to_h[1] += (bonus_to_h > 0) ? bonus_to_h / 2 : bonus_to_h;
2550- p_ptr->to_d[0] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
2551- p_ptr->to_d[1] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
2549+ creature_ptr->to_h[0] += (bonus_to_h > 0) ? (bonus_to_h + 1) / 2 : bonus_to_h;
2550+ creature_ptr->to_h[1] += (bonus_to_h > 0) ? bonus_to_h / 2 : bonus_to_h;
2551+ creature_ptr->to_d[0] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
2552+ creature_ptr->to_d[1] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
25522553
25532554 /* Apply the mental bonuses tp hit/damage, if known */
25542555 if (object_is_known(o_ptr))
25552556 {
2556- p_ptr->dis_to_h[0] += (bonus_to_h > 0) ? (bonus_to_h + 1) / 2 : bonus_to_h;
2557- p_ptr->dis_to_h[1] += (bonus_to_h > 0) ? bonus_to_h / 2 : bonus_to_h;
2558- p_ptr->dis_to_d[0] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
2559- p_ptr->dis_to_d[1] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
2557+ creature_ptr->dis_to_h[0] += (bonus_to_h > 0) ? (bonus_to_h + 1) / 2 : bonus_to_h;
2558+ creature_ptr->dis_to_h[1] += (bonus_to_h > 0) ? bonus_to_h / 2 : bonus_to_h;
2559+ creature_ptr->dis_to_d[0] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
2560+ creature_ptr->dis_to_d[1] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
25602561 }
25612562 }
25622563 else
25632564 {
25642565 /* Apply the bonuses to hit/damage */
2565- p_ptr->to_h[default_hand] += (s16b)bonus_to_h;
2566- p_ptr->to_d[default_hand] += (s16b)bonus_to_d;
2566+ creature_ptr->to_h[default_hand] += (s16b)bonus_to_h;
2567+ creature_ptr->to_d[default_hand] += (s16b)bonus_to_d;
25672568
25682569 /* Apply the mental bonuses to hit/damage, if known */
25692570 if (object_is_known(o_ptr))
25702571 {
2571- p_ptr->dis_to_h[default_hand] += (s16b)bonus_to_h;
2572- p_ptr->dis_to_d[default_hand] += (s16b)bonus_to_d;
2572+ creature_ptr->dis_to_h[default_hand] += (s16b)bonus_to_h;
2573+ creature_ptr->dis_to_d[default_hand] += (s16b)bonus_to_d;
25732574 }
25742575 }
25752576 }
25762577
25772578 /* Shield skill bonus */
2578- if (object_is_armour(&p_ptr->inventory_list[INVEN_RARM]) || object_is_armour(&p_ptr->inventory_list[INVEN_LARM]))
2579+ if (object_is_armour(&creature_ptr->inventory_list[INVEN_RARM]) || object_is_armour(&creature_ptr->inventory_list[INVEN_LARM]))
25792580 {
2580- p_ptr->ac += p_ptr->skill_exp[GINOU_SHIELD] * (1 + p_ptr->lev / 22) / 2000;
2581- p_ptr->dis_ac += p_ptr->skill_exp[GINOU_SHIELD] * (1 + p_ptr->lev / 22) / 2000;
2581+ creature_ptr->ac += creature_ptr->skill_exp[GINOU_SHIELD] * (1 + creature_ptr->lev / 22) / 2000;
2582+ creature_ptr->dis_ac += creature_ptr->skill_exp[GINOU_SHIELD] * (1 + creature_ptr->lev / 22) / 2000;
25822583 }
25832584
2584- if (old_mighty_throw != p_ptr->mighty_throw)
2585+ if (old_mighty_throw != creature_ptr->mighty_throw)
25852586 {
25862587 /* Redraw average damege display of Shuriken */
2587- p_ptr->window |= PW_INVEN;
2588+ creature_ptr->window |= PW_INVEN;
25882589 }
25892590
2590- if (p_ptr->cursed & TRC_TELEPORT) p_ptr->cursed &= ~(TRC_TELEPORT_SELF);
2591+ if (creature_ptr->cursed & TRC_TELEPORT) creature_ptr->cursed &= ~(TRC_TELEPORT_SELF);
25912592
25922593 /* Monks get extra ac for armour _not worn_ */
2593- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && !heavy_armor(p_ptr))
2594+ if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER)) && !heavy_armor(creature_ptr))
25942595 {
2595- if (!(p_ptr->inventory_list[INVEN_BODY].k_idx))
2596+ if (!(creature_ptr->inventory_list[INVEN_BODY].k_idx))
25962597 {
2597- p_ptr->to_a += (p_ptr->lev * 3) / 2;
2598- p_ptr->dis_to_a += (p_ptr->lev * 3) / 2;
2598+ creature_ptr->to_a += (creature_ptr->lev * 3) / 2;
2599+ creature_ptr->dis_to_a += (creature_ptr->lev * 3) / 2;
25992600 }
2600- if (!(p_ptr->inventory_list[INVEN_OUTER].k_idx) && (p_ptr->lev > 15))
2601+ if (!(creature_ptr->inventory_list[INVEN_OUTER].k_idx) && (creature_ptr->lev > 15))
26012602 {
2602- p_ptr->to_a += ((p_ptr->lev - 13) / 3);
2603- p_ptr->dis_to_a += ((p_ptr->lev - 13) / 3);
2603+ creature_ptr->to_a += ((creature_ptr->lev - 13) / 3);
2604+ creature_ptr->dis_to_a += ((creature_ptr->lev - 13) / 3);
26042605 }
2605- if (!(p_ptr->inventory_list[INVEN_LARM].k_idx) && (p_ptr->lev > 10))
2606+ if (!(creature_ptr->inventory_list[INVEN_LARM].k_idx) && (creature_ptr->lev > 10))
26062607 {
2607- p_ptr->to_a += ((p_ptr->lev - 8) / 3);
2608- p_ptr->dis_to_a += ((p_ptr->lev - 8) / 3);
2608+ creature_ptr->to_a += ((creature_ptr->lev - 8) / 3);
2609+ creature_ptr->dis_to_a += ((creature_ptr->lev - 8) / 3);
26092610 }
2610- if (!(p_ptr->inventory_list[INVEN_HEAD].k_idx) && (p_ptr->lev > 4))
2611+ if (!(creature_ptr->inventory_list[INVEN_HEAD].k_idx) && (creature_ptr->lev > 4))
26112612 {
2612- p_ptr->to_a += (p_ptr->lev - 2) / 3;
2613- p_ptr->dis_to_a += (p_ptr->lev - 2) / 3;
2613+ creature_ptr->to_a += (creature_ptr->lev - 2) / 3;
2614+ creature_ptr->dis_to_a += (creature_ptr->lev - 2) / 3;
26142615 }
2615- if (!(p_ptr->inventory_list[INVEN_HANDS].k_idx))
2616+ if (!(creature_ptr->inventory_list[INVEN_HANDS].k_idx))
26162617 {
2617- p_ptr->to_a += (p_ptr->lev / 2);
2618- p_ptr->dis_to_a += (p_ptr->lev / 2);
2618+ creature_ptr->to_a += (creature_ptr->lev / 2);
2619+ creature_ptr->dis_to_a += (creature_ptr->lev / 2);
26192620 }
2620- if (!(p_ptr->inventory_list[INVEN_FEET].k_idx))
2621+ if (!(creature_ptr->inventory_list[INVEN_FEET].k_idx))
26212622 {
2622- p_ptr->to_a += (p_ptr->lev / 3);
2623- p_ptr->dis_to_a += (p_ptr->lev / 3);
2623+ creature_ptr->to_a += (creature_ptr->lev / 3);
2624+ creature_ptr->dis_to_a += (creature_ptr->lev / 3);
26242625 }
2625- if (p_ptr->special_defense & KAMAE_BYAKKO)
2626+ if (creature_ptr->special_defense & KAMAE_BYAKKO)
26262627 {
2627- p_ptr->stat_add[A_STR] += 2;
2628- p_ptr->stat_add[A_DEX] += 2;
2629- p_ptr->stat_add[A_CON] -= 3;
2628+ creature_ptr->stat_add[A_STR] += 2;
2629+ creature_ptr->stat_add[A_DEX] += 2;
2630+ creature_ptr->stat_add[A_CON] -= 3;
26302631 }
2631- else if (p_ptr->special_defense & KAMAE_SEIRYU)
2632+ else if (creature_ptr->special_defense & KAMAE_SEIRYU)
26322633 {
26332634 }
2634- else if (p_ptr->special_defense & KAMAE_GENBU)
2635+ else if (creature_ptr->special_defense & KAMAE_GENBU)
26352636 {
2636- p_ptr->stat_add[A_INT] -= 1;
2637- p_ptr->stat_add[A_WIS] -= 1;
2638- p_ptr->stat_add[A_DEX] -= 2;
2639- p_ptr->stat_add[A_CON] += 3;
2637+ creature_ptr->stat_add[A_INT] -= 1;
2638+ creature_ptr->stat_add[A_WIS] -= 1;
2639+ creature_ptr->stat_add[A_DEX] -= 2;
2640+ creature_ptr->stat_add[A_CON] += 3;
26402641 }
2641- else if (p_ptr->special_defense & KAMAE_SUZAKU)
2642+ else if (creature_ptr->special_defense & KAMAE_SUZAKU)
26422643 {
2643- p_ptr->stat_add[A_STR] -= 2;
2644- p_ptr->stat_add[A_INT] += 1;
2645- p_ptr->stat_add[A_WIS] += 1;
2646- p_ptr->stat_add[A_DEX] += 2;
2647- p_ptr->stat_add[A_CON] -= 2;
2644+ creature_ptr->stat_add[A_STR] -= 2;
2645+ creature_ptr->stat_add[A_INT] += 1;
2646+ creature_ptr->stat_add[A_WIS] += 1;
2647+ creature_ptr->stat_add[A_DEX] += 2;
2648+ creature_ptr->stat_add[A_CON] -= 2;
26482649 }
26492650 }
26502651
2651- if (p_ptr->special_defense & KATA_KOUKIJIN)
2652+ if (creature_ptr->special_defense & KATA_KOUKIJIN)
26522653 {
26532654 for (i = 0; i < A_MAX; i++)
2654- p_ptr->stat_add[i] += 5;
2655- p_ptr->to_a -= 50;
2656- p_ptr->dis_to_a -= 50;
2655+ creature_ptr->stat_add[i] += 5;
2656+ creature_ptr->to_a -= 50;
2657+ creature_ptr->dis_to_a -= 50;
26572658 }
26582659
26592660 /* Hack -- aura of fire also provides light */
2660- if (p_ptr->sh_fire) p_ptr->lite = TRUE;
2661+ if (creature_ptr->sh_fire) creature_ptr->lite = TRUE;
26612662
26622663 /* Golems also get an intrinsic AC bonus */
2663- if (PRACE_IS_(p_ptr, RACE_GOLEM) || PRACE_IS_(p_ptr, RACE_ANDROID))
2664+ if (PRACE_IS_(creature_ptr, RACE_GOLEM) || PRACE_IS_(creature_ptr, RACE_ANDROID))
26642665 {
2665- p_ptr->to_a += 10 + (p_ptr->lev * 2 / 5);
2666- p_ptr->dis_to_a += 10 + (p_ptr->lev * 2 / 5);
2666+ creature_ptr->to_a += 10 + (creature_ptr->lev * 2 / 5);
2667+ creature_ptr->dis_to_a += 10 + (creature_ptr->lev * 2 / 5);
26672668 }
26682669
26692670 /* Hex bonuses */
2670- if (p_ptr->realm1 == REALM_HEX)
2671+ if (creature_ptr->realm1 == REALM_HEX)
26712672 {
2672- if (hex_spelling_any()) p_ptr->skill_stl -= (1 + CASTING_HEX_NUM(p_ptr));
2673- if (hex_spelling(HEX_DETECT_EVIL)) p_ptr->esp_evil = TRUE;
2674- if (hex_spelling(HEX_XTRA_MIGHT)) p_ptr->stat_add[A_STR] += 4;
2673+ if (hex_spelling_any()) creature_ptr->skill_stl -= (1 + CASTING_HEX_NUM(creature_ptr));
2674+ if (hex_spelling(HEX_DETECT_EVIL)) creature_ptr->esp_evil = TRUE;
2675+ if (hex_spelling(HEX_XTRA_MIGHT)) creature_ptr->stat_add[A_STR] += 4;
26752676 if (hex_spelling(HEX_BUILDING))
26762677 {
2677- p_ptr->stat_add[A_STR] += 4;
2678- p_ptr->stat_add[A_DEX] += 4;
2679- p_ptr->stat_add[A_CON] += 4;
2678+ creature_ptr->stat_add[A_STR] += 4;
2679+ creature_ptr->stat_add[A_DEX] += 4;
2680+ creature_ptr->stat_add[A_CON] += 4;
26802681 }
26812682 if (hex_spelling(HEX_DEMON_AURA))
26822683 {
2683- p_ptr->sh_fire = TRUE;
2684- p_ptr->regenerate = TRUE;
2684+ creature_ptr->sh_fire = TRUE;
2685+ creature_ptr->regenerate = TRUE;
26852686 }
26862687 if (hex_spelling(HEX_ICE_ARMOR))
26872688 {
2688- p_ptr->sh_cold = TRUE;
2689- p_ptr->to_a += 30;
2690- p_ptr->dis_to_a += 30;
2689+ creature_ptr->sh_cold = TRUE;
2690+ creature_ptr->to_a += 30;
2691+ creature_ptr->dis_to_a += 30;
26912692 }
26922693 if (hex_spelling(HEX_SHOCK_CLOAK))
26932694 {
2694- p_ptr->sh_elec = TRUE;
2695+ creature_ptr->sh_elec = TRUE;
26952696 new_speed += 3;
26962697 }
26972698 for (i = INVEN_RARM; i <= INVEN_FEET; i++)
26982699 {
26992700 ARMOUR_CLASS ac = 0;
2700- o_ptr = &p_ptr->inventory_list[i];
2701+ o_ptr = &creature_ptr->inventory_list[i];
27012702 if (!o_ptr->k_idx) continue;
27022703 if (!object_is_armour(o_ptr)) continue;
27032704 if (!object_is_cursed(o_ptr)) continue;
27042705 ac += 5;
27052706 if (o_ptr->curse_flags & TRC_HEAVY_CURSE) ac += 7;
27062707 if (o_ptr->curse_flags & TRC_PERMA_CURSE) ac += 13;
2707- p_ptr->to_a += (s16b)ac;
2708- p_ptr->dis_to_a += (s16b)ac;
2708+ creature_ptr->to_a += (s16b)ac;
2709+ creature_ptr->dis_to_a += (s16b)ac;
27092710 }
27102711 }
27112712
@@ -2715,37 +2716,37 @@ void calc_bonuses(void)
27152716 int top, use, ind;
27162717
27172718 /* Extract the new "stat_use" value for the stat */
2718- top = modify_stat_value(p_ptr->stat_max[i], p_ptr->stat_add[i]);
2719+ top = modify_stat_value(creature_ptr->stat_max[i], creature_ptr->stat_add[i]);
27192720
27202721 /* Notice changes */
2721- if (p_ptr->stat_top[i] != top)
2722+ if (creature_ptr->stat_top[i] != top)
27222723 {
27232724 /* Save the new value */
2724- p_ptr->stat_top[i] = (s16b)top;
2725- p_ptr->redraw |= (PR_STATS);
2726- p_ptr->window |= (PW_PLAYER);
2725+ creature_ptr->stat_top[i] = (s16b)top;
2726+ creature_ptr->redraw |= (PR_STATS);
2727+ creature_ptr->window |= (PW_PLAYER);
27272728 }
27282729
27292730
27302731 /* Extract the new "stat_use" value for the stat */
2731- use = modify_stat_value(p_ptr->stat_cur[i], p_ptr->stat_add[i]);
2732+ use = modify_stat_value(creature_ptr->stat_cur[i], creature_ptr->stat_add[i]);
27322733
2733- if ((i == A_CHR) && (p_ptr->muta3 & MUT3_ILL_NORM))
2734+ if ((i == A_CHR) && (creature_ptr->muta3 & MUT3_ILL_NORM))
27342735 {
27352736 /* 10 to 18/90 charisma, guaranteed, based on level */
2736- if (use < 8 + 2 * p_ptr->lev)
2737+ if (use < 8 + 2 * creature_ptr->lev)
27372738 {
2738- use = 8 + 2 * p_ptr->lev;
2739+ use = 8 + 2 * creature_ptr->lev;
27392740 }
27402741 }
27412742
27422743 /* Notice changes */
2743- if (p_ptr->stat_use[i] != use)
2744+ if (creature_ptr->stat_use[i] != use)
27442745 {
27452746 /* Save the new value */
2746- p_ptr->stat_use[i] = (s16b)use;
2747- p_ptr->redraw |= (PR_STATS);
2748- p_ptr->window |= (PW_PLAYER);
2747+ creature_ptr->stat_use[i] = (s16b)use;
2748+ creature_ptr->redraw |= (PR_STATS);
2749+ creature_ptr->window |= (PW_PLAYER);
27492750 }
27502751
27512752
@@ -2759,15 +2760,15 @@ void calc_bonuses(void)
27592760 else ind = (37);
27602761
27612762 /* Notice changes */
2762- if (p_ptr->stat_ind[i] != ind)
2763+ if (creature_ptr->stat_ind[i] != ind)
27632764 {
27642765 /* Save the new index */
2765- p_ptr->stat_ind[i] = (s16b)ind;
2766+ creature_ptr->stat_ind[i] = (s16b)ind;
27662767
27672768 /* Change in CON affects Hitpoints */
27682769 if (i == A_CON)
27692770 {
2770- p_ptr->update |= (PU_HP);
2771+ creature_ptr->update |= (PU_HP);
27712772 }
27722773
27732774 /* Change in INT may affect Mana/Spells */
@@ -2775,7 +2776,7 @@ void calc_bonuses(void)
27752776 {
27762777 if (mp_ptr->spell_stat == A_INT)
27772778 {
2778- p_ptr->update |= (PU_MANA | PU_SPELLS);
2779+ creature_ptr->update |= (PU_MANA | PU_SPELLS);
27792780 }
27802781 }
27812782
@@ -2784,7 +2785,7 @@ void calc_bonuses(void)
27842785 {
27852786 if (mp_ptr->spell_stat == A_WIS)
27862787 {
2787- p_ptr->update |= (PU_MANA | PU_SPELLS);
2788+ creature_ptr->update |= (PU_MANA | PU_SPELLS);
27882789 }
27892790 }
27902791
@@ -2793,118 +2794,118 @@ void calc_bonuses(void)
27932794 {
27942795 if (mp_ptr->spell_stat == A_CHR)
27952796 {
2796- p_ptr->update |= (PU_MANA | PU_SPELLS);
2797+ creature_ptr->update |= (PU_MANA | PU_SPELLS);
27972798 }
27982799 }
27992800
2800- p_ptr->window |= (PW_PLAYER);
2801+ creature_ptr->window |= (PW_PLAYER);
28012802 }
28022803 }
28032804
28042805
28052806 /* Apply temporary "stun" */
2806- if (p_ptr->stun > 50)
2807- {
2808- p_ptr->to_h[0] -= 20;
2809- p_ptr->to_h[1] -= 20;
2810- p_ptr->to_h_b -= 20;
2811- p_ptr->to_h_m -= 20;
2812- p_ptr->dis_to_h[0] -= 20;
2813- p_ptr->dis_to_h[1] -= 20;
2814- p_ptr->dis_to_h_b -= 20;
2815- p_ptr->to_d[0] -= 20;
2816- p_ptr->to_d[1] -= 20;
2817- p_ptr->to_d_m -= 20;
2818- p_ptr->dis_to_d[0] -= 20;
2819- p_ptr->dis_to_d[1] -= 20;
2820- }
2821- else if (p_ptr->stun)
2822- {
2823- p_ptr->to_h[0] -= 5;
2824- p_ptr->to_h[1] -= 5;
2825- p_ptr->to_h_b -= 5;
2826- p_ptr->to_h_m -= 5;
2827- p_ptr->dis_to_h[0] -= 5;
2828- p_ptr->dis_to_h[1] -= 5;
2829- p_ptr->dis_to_h_b -= 5;
2830- p_ptr->to_d[0] -= 5;
2831- p_ptr->to_d[1] -= 5;
2832- p_ptr->to_d_m -= 5;
2833- p_ptr->dis_to_d[0] -= 5;
2834- p_ptr->dis_to_d[1] -= 5;
2807+ if (creature_ptr->stun > 50)
2808+ {
2809+ creature_ptr->to_h[0] -= 20;
2810+ creature_ptr->to_h[1] -= 20;
2811+ creature_ptr->to_h_b -= 20;
2812+ creature_ptr->to_h_m -= 20;
2813+ creature_ptr->dis_to_h[0] -= 20;
2814+ creature_ptr->dis_to_h[1] -= 20;
2815+ creature_ptr->dis_to_h_b -= 20;
2816+ creature_ptr->to_d[0] -= 20;
2817+ creature_ptr->to_d[1] -= 20;
2818+ creature_ptr->to_d_m -= 20;
2819+ creature_ptr->dis_to_d[0] -= 20;
2820+ creature_ptr->dis_to_d[1] -= 20;
2821+ }
2822+ else if (creature_ptr->stun)
2823+ {
2824+ creature_ptr->to_h[0] -= 5;
2825+ creature_ptr->to_h[1] -= 5;
2826+ creature_ptr->to_h_b -= 5;
2827+ creature_ptr->to_h_m -= 5;
2828+ creature_ptr->dis_to_h[0] -= 5;
2829+ creature_ptr->dis_to_h[1] -= 5;
2830+ creature_ptr->dis_to_h_b -= 5;
2831+ creature_ptr->to_d[0] -= 5;
2832+ creature_ptr->to_d[1] -= 5;
2833+ creature_ptr->to_d_m -= 5;
2834+ creature_ptr->dis_to_d[0] -= 5;
2835+ creature_ptr->dis_to_d[1] -= 5;
28352836 }
28362837
28372838 /* Wraith form */
2838- if (p_ptr->wraith_form)
2839+ if (creature_ptr->wraith_form)
28392840 {
2840- p_ptr->reflect = TRUE;
2841- p_ptr->pass_wall = TRUE;
2841+ creature_ptr->reflect = TRUE;
2842+ creature_ptr->pass_wall = TRUE;
28422843 }
28432844
2844- if (p_ptr->kabenuke)
2845+ if (creature_ptr->kabenuke)
28452846 {
2846- p_ptr->pass_wall = TRUE;
2847+ creature_ptr->pass_wall = TRUE;
28472848 }
28482849
28492850 /* Temporary blessing */
28502851 if (IS_BLESSED())
28512852 {
2852- p_ptr->to_a += 5;
2853- p_ptr->dis_to_a += 5;
2854- p_ptr->to_h[0] += 10;
2855- p_ptr->to_h[1] += 10;
2856- p_ptr->to_h_b += 10;
2857- p_ptr->to_h_m += 10;
2858- p_ptr->dis_to_h[0] += 10;
2859- p_ptr->dis_to_h[1] += 10;
2860- p_ptr->dis_to_h_b += 10;
2853+ creature_ptr->to_a += 5;
2854+ creature_ptr->dis_to_a += 5;
2855+ creature_ptr->to_h[0] += 10;
2856+ creature_ptr->to_h[1] += 10;
2857+ creature_ptr->to_h_b += 10;
2858+ creature_ptr->to_h_m += 10;
2859+ creature_ptr->dis_to_h[0] += 10;
2860+ creature_ptr->dis_to_h[1] += 10;
2861+ creature_ptr->dis_to_h_b += 10;
28612862 }
28622863
2863- if (p_ptr->magicdef)
2864+ if (creature_ptr->magicdef)
28642865 {
2865- p_ptr->resist_blind = TRUE;
2866- p_ptr->resist_conf = TRUE;
2867- p_ptr->reflect = TRUE;
2868- p_ptr->free_act = TRUE;
2869- p_ptr->levitation = TRUE;
2866+ creature_ptr->resist_blind = TRUE;
2867+ creature_ptr->resist_conf = TRUE;
2868+ creature_ptr->reflect = TRUE;
2869+ creature_ptr->free_act = TRUE;
2870+ creature_ptr->levitation = TRUE;
28702871 }
28712872
28722873 /* Temporary "Hero" */
28732874 if (IS_HERO())
28742875 {
2875- p_ptr->to_h[0] += 12;
2876- p_ptr->to_h[1] += 12;
2877- p_ptr->to_h_b += 12;
2878- p_ptr->to_h_m += 12;
2879- p_ptr->dis_to_h[0] += 12;
2880- p_ptr->dis_to_h[1] += 12;
2881- p_ptr->dis_to_h_b += 12;
2876+ creature_ptr->to_h[0] += 12;
2877+ creature_ptr->to_h[1] += 12;
2878+ creature_ptr->to_h_b += 12;
2879+ creature_ptr->to_h_m += 12;
2880+ creature_ptr->dis_to_h[0] += 12;
2881+ creature_ptr->dis_to_h[1] += 12;
2882+ creature_ptr->dis_to_h_b += 12;
28822883 }
28832884
28842885 /* Temporary "Beserk" */
2885- if (p_ptr->shero)
2886- {
2887- p_ptr->to_h[0] += 12;
2888- p_ptr->to_h[1] += 12;
2889- p_ptr->to_h_b -= 12;
2890- p_ptr->to_h_m += 12;
2891- p_ptr->to_d[0] += 3 + (p_ptr->lev / 5);
2892- p_ptr->to_d[1] += 3 + (p_ptr->lev / 5);
2893- p_ptr->to_d_m += 3 + (p_ptr->lev / 5);
2894- p_ptr->dis_to_h[0] += 12;
2895- p_ptr->dis_to_h[1] += 12;
2896- p_ptr->dis_to_h_b -= 12;
2897- p_ptr->dis_to_d[0] += 3 + (p_ptr->lev / 5);
2898- p_ptr->dis_to_d[1] += 3 + (p_ptr->lev / 5);
2899- p_ptr->to_a -= 10;
2900- p_ptr->dis_to_a -= 10;
2901- p_ptr->skill_stl -= 7;
2902- p_ptr->skill_dev -= 20;
2903- p_ptr->skill_sav -= 30;
2904- p_ptr->skill_srh -= 15;
2905- p_ptr->skill_fos -= 15;
2906- p_ptr->skill_tht -= 20;
2907- p_ptr->skill_dig += 30;
2886+ if (creature_ptr->shero)
2887+ {
2888+ creature_ptr->to_h[0] += 12;
2889+ creature_ptr->to_h[1] += 12;
2890+ creature_ptr->to_h_b -= 12;
2891+ creature_ptr->to_h_m += 12;
2892+ creature_ptr->to_d[0] += 3 + (creature_ptr->lev / 5);
2893+ creature_ptr->to_d[1] += 3 + (creature_ptr->lev / 5);
2894+ creature_ptr->to_d_m += 3 + (creature_ptr->lev / 5);
2895+ creature_ptr->dis_to_h[0] += 12;
2896+ creature_ptr->dis_to_h[1] += 12;
2897+ creature_ptr->dis_to_h_b -= 12;
2898+ creature_ptr->dis_to_d[0] += 3 + (creature_ptr->lev / 5);
2899+ creature_ptr->dis_to_d[1] += 3 + (creature_ptr->lev / 5);
2900+ creature_ptr->to_a -= 10;
2901+ creature_ptr->dis_to_a -= 10;
2902+ creature_ptr->skill_stl -= 7;
2903+ creature_ptr->skill_dev -= 20;
2904+ creature_ptr->skill_sav -= 30;
2905+ creature_ptr->skill_srh -= 15;
2906+ creature_ptr->skill_fos -= 15;
2907+ creature_ptr->skill_tht -= 20;
2908+ creature_ptr->skill_dig += 30;
29082909 }
29092910
29102911 /* Temporary "fast" */
@@ -2914,7 +2915,7 @@ void calc_bonuses(void)
29142915 }
29152916
29162917 /* Temporary "slow" */
2917- if (p_ptr->slow)
2918+ if (creature_ptr->slow)
29182919 {
29192920 new_speed -= 10;
29202921 }
@@ -2922,176 +2923,176 @@ void calc_bonuses(void)
29222923 /* Temporary "telepathy" */
29232924 if (IS_TIM_ESP())
29242925 {
2925- p_ptr->telepathy = TRUE;
2926+ creature_ptr->telepathy = TRUE;
29262927 }
29272928
2928- if (p_ptr->ele_immune)
2929+ if (creature_ptr->ele_immune)
29292930 {
2930- if (p_ptr->special_defense & DEFENSE_ACID)
2931- p_ptr->immune_acid = TRUE;
2932- else if (p_ptr->special_defense & DEFENSE_ELEC)
2933- p_ptr->immune_elec = TRUE;
2934- else if (p_ptr->special_defense & DEFENSE_FIRE)
2935- p_ptr->immune_fire = TRUE;
2936- else if (p_ptr->special_defense & DEFENSE_COLD)
2937- p_ptr->immune_cold = TRUE;
2931+ if (creature_ptr->special_defense & DEFENSE_ACID)
2932+ creature_ptr->immune_acid = TRUE;
2933+ else if (creature_ptr->special_defense & DEFENSE_ELEC)
2934+ creature_ptr->immune_elec = TRUE;
2935+ else if (creature_ptr->special_defense & DEFENSE_FIRE)
2936+ creature_ptr->immune_fire = TRUE;
2937+ else if (creature_ptr->special_defense & DEFENSE_COLD)
2938+ creature_ptr->immune_cold = TRUE;
29382939 }
29392940
29402941 /* Temporary see invisible */
2941- if (p_ptr->tim_invis)
2942+ if (creature_ptr->tim_invis)
29422943 {
2943- p_ptr->see_inv = TRUE;
2944+ creature_ptr->see_inv = TRUE;
29442945 }
29452946
29462947 /* Temporary infravision boost */
2947- if (p_ptr->tim_infra)
2948+ if (creature_ptr->tim_infra)
29482949 {
2949- p_ptr->see_infra += 3;
2950+ creature_ptr->see_infra += 3;
29502951 }
29512952
29522953 /* Temporary regeneration boost */
2953- if (p_ptr->tim_regen)
2954+ if (creature_ptr->tim_regen)
29542955 {
2955- p_ptr->regenerate = TRUE;
2956+ creature_ptr->regenerate = TRUE;
29562957 }
29572958
29582959 /* Temporary levitation */
2959- if (p_ptr->tim_levitation)
2960+ if (creature_ptr->tim_levitation)
29602961 {
2961- p_ptr->levitation = TRUE;
2962+ creature_ptr->levitation = TRUE;
29622963 }
29632964
29642965 /* Temporary reflection */
2965- if (p_ptr->tim_reflect)
2966+ if (creature_ptr->tim_reflect)
29662967 {
2967- p_ptr->reflect = TRUE;
2968+ creature_ptr->reflect = TRUE;
29682969 }
29692970
29702971 /* Hack -- Hero/Shero -> Res fear */
2971- if (IS_HERO() || p_ptr->shero)
2972+ if (IS_HERO() || creature_ptr->shero)
29722973 {
2973- p_ptr->resist_fear = TRUE;
2974+ creature_ptr->resist_fear = TRUE;
29742975 }
29752976
29762977
29772978 /* Hack -- Telepathy Change */
2978- if (p_ptr->telepathy != old_telepathy)
2979+ if (creature_ptr->telepathy != old_telepathy)
29792980 {
2980- p_ptr->update |= (PU_MONSTERS);
2981+ creature_ptr->update |= (PU_MONSTERS);
29812982 }
29822983
2983- if ((p_ptr->esp_animal != old_esp_animal) ||
2984- (p_ptr->esp_undead != old_esp_undead) ||
2985- (p_ptr->esp_demon != old_esp_demon) ||
2986- (p_ptr->esp_orc != old_esp_orc) ||
2987- (p_ptr->esp_troll != old_esp_troll) ||
2988- (p_ptr->esp_giant != old_esp_giant) ||
2989- (p_ptr->esp_dragon != old_esp_dragon) ||
2990- (p_ptr->esp_human != old_esp_human) ||
2991- (p_ptr->esp_evil != old_esp_evil) ||
2992- (p_ptr->esp_good != old_esp_good) ||
2993- (p_ptr->esp_nonliving != old_esp_nonliving) ||
2994- (p_ptr->esp_unique != old_esp_unique))
2984+ if ((creature_ptr->esp_animal != old_esp_animal) ||
2985+ (creature_ptr->esp_undead != old_esp_undead) ||
2986+ (creature_ptr->esp_demon != old_esp_demon) ||
2987+ (creature_ptr->esp_orc != old_esp_orc) ||
2988+ (creature_ptr->esp_troll != old_esp_troll) ||
2989+ (creature_ptr->esp_giant != old_esp_giant) ||
2990+ (creature_ptr->esp_dragon != old_esp_dragon) ||
2991+ (creature_ptr->esp_human != old_esp_human) ||
2992+ (creature_ptr->esp_evil != old_esp_evil) ||
2993+ (creature_ptr->esp_good != old_esp_good) ||
2994+ (creature_ptr->esp_nonliving != old_esp_nonliving) ||
2995+ (creature_ptr->esp_unique != old_esp_unique))
29952996 {
2996- p_ptr->update |= (PU_MONSTERS);
2997+ creature_ptr->update |= (PU_MONSTERS);
29972998 }
29982999
29993000 /* Hack -- See Invis Change */
3000- if (p_ptr->see_inv != old_see_inv)
3001+ if (creature_ptr->see_inv != old_see_inv)
30013002 {
3002- p_ptr->update |= (PU_MONSTERS);
3003+ creature_ptr->update |= (PU_MONSTERS);
30033004 }
30043005
30053006 /* Bloating slows the player down (a little) */
3006- if (p_ptr->food >= PY_FOOD_MAX) new_speed -= 10;
3007+ if (creature_ptr->food >= PY_FOOD_MAX) new_speed -= 10;
30073008
3008- if (p_ptr->special_defense & KAMAE_SUZAKU) new_speed += 10;
3009+ if (creature_ptr->special_defense & KAMAE_SUZAKU) new_speed += 10;
30093010
3010- if ((p_ptr->migite && (empty_hands_status & EMPTY_HAND_RARM)) ||
3011- (p_ptr->hidarite && (empty_hands_status & EMPTY_HAND_LARM)))
3011+ if ((creature_ptr->migite && (empty_hands_status & EMPTY_HAND_RARM)) ||
3012+ (creature_ptr->hidarite && (empty_hands_status & EMPTY_HAND_LARM)))
30123013 {
3013- p_ptr->to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
3014- p_ptr->dis_to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
3014+ creature_ptr->to_h[default_hand] += (creature_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
3015+ creature_ptr->dis_to_h[default_hand] += (creature_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
30153016 }
30163017
3017- if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
3018+ if (has_melee_weapon(creature_ptr, INVEN_RARM) && has_melee_weapon(creature_ptr, INVEN_LARM))
30183019 {
30193020 int penalty1, penalty2;
3020- penalty1 = ((100 - p_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - p_ptr->inventory_list[INVEN_RARM].weight) / 8);
3021- penalty2 = ((100 - p_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - p_ptr->inventory_list[INVEN_LARM].weight) / 8);
3022- if ((p_ptr->inventory_list[INVEN_RARM].name1 == ART_QUICKTHORN) && (p_ptr->inventory_list[INVEN_LARM].name1 == ART_TINYTHORN))
3021+ penalty1 = ((100 - creature_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - creature_ptr->inventory_list[INVEN_RARM].weight) / 8);
3022+ penalty2 = ((100 - creature_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - creature_ptr->inventory_list[INVEN_LARM].weight) / 8);
3023+ if ((creature_ptr->inventory_list[INVEN_RARM].name1 == ART_QUICKTHORN) && (creature_ptr->inventory_list[INVEN_LARM].name1 == ART_TINYTHORN))
30233024 {
30243025 penalty1 = penalty1 / 2 - 5;
30253026 penalty2 = penalty2 / 2 - 5;
30263027 new_speed += 7;
3027- p_ptr->to_a += 10;
3028- p_ptr->dis_to_a += 10;
3028+ creature_ptr->to_a += 10;
3029+ creature_ptr->dis_to_a += 10;
30293030 }
30303031 if (easy_2weapon)
30313032 {
30323033 if (penalty1 > 0) penalty1 /= 2;
30333034 if (penalty2 > 0) penalty2 /= 2;
30343035 }
3035- else if ((p_ptr->inventory_list[INVEN_LARM].tval == TV_SWORD) && ((p_ptr->inventory_list[INVEN_LARM].sval == SV_MAIN_GAUCHE) || (p_ptr->inventory_list[INVEN_LARM].sval == SV_WAKIZASHI)))
3036+ else if ((creature_ptr->inventory_list[INVEN_LARM].tval == TV_SWORD) && ((creature_ptr->inventory_list[INVEN_LARM].sval == SV_MAIN_GAUCHE) || (creature_ptr->inventory_list[INVEN_LARM].sval == SV_WAKIZASHI)))
30363037 {
30373038 penalty1 = MAX(0, penalty1 - 10);
30383039 penalty2 = MAX(0, penalty2 - 10);
30393040 }
3040- if ((p_ptr->inventory_list[INVEN_RARM].name1 == ART_MUSASI_KATANA) && (p_ptr->inventory_list[INVEN_LARM].name1 == ART_MUSASI_WAKIZASI))
3041+ if ((creature_ptr->inventory_list[INVEN_RARM].name1 == ART_MUSASI_KATANA) && (creature_ptr->inventory_list[INVEN_LARM].name1 == ART_MUSASI_WAKIZASI))
30413042 {
30423043 penalty1 = MIN(0, penalty1);
30433044 penalty2 = MIN(0, penalty2);
3044- p_ptr->to_a += 10;
3045- p_ptr->dis_to_a += 10;
3045+ creature_ptr->to_a += 10;
3046+ creature_ptr->dis_to_a += 10;
30463047 }
30473048 else
30483049 {
3049- if ((p_ptr->inventory_list[INVEN_RARM].name1 == ART_MUSASI_KATANA) && (penalty1 > 0))
3050+ if ((creature_ptr->inventory_list[INVEN_RARM].name1 == ART_MUSASI_KATANA) && (penalty1 > 0))
30503051 penalty1 /= 2;
3051- if ((p_ptr->inventory_list[INVEN_LARM].name1 == ART_MUSASI_WAKIZASI) && (penalty2 > 0))
3052+ if ((creature_ptr->inventory_list[INVEN_LARM].name1 == ART_MUSASI_WAKIZASI) && (penalty2 > 0))
30523053 penalty2 /= 2;
30533054 }
3054- if (p_ptr->inventory_list[INVEN_RARM].tval == TV_POLEARM) penalty1 += 10;
3055- if (p_ptr->inventory_list[INVEN_LARM].tval == TV_POLEARM) penalty2 += 10;
3056- p_ptr->to_h[0] -= (s16b)penalty1;
3057- p_ptr->to_h[1] -= (s16b)penalty2;
3058- p_ptr->dis_to_h[0] -= (s16b)penalty1;
3059- p_ptr->dis_to_h[1] -= (s16b)penalty2;
3055+ if (creature_ptr->inventory_list[INVEN_RARM].tval == TV_POLEARM) penalty1 += 10;
3056+ if (creature_ptr->inventory_list[INVEN_LARM].tval == TV_POLEARM) penalty2 += 10;
3057+ creature_ptr->to_h[0] -= (s16b)penalty1;
3058+ creature_ptr->to_h[1] -= (s16b)penalty2;
3059+ creature_ptr->dis_to_h[0] -= (s16b)penalty1;
3060+ creature_ptr->dis_to_h[1] -= (s16b)penalty2;
30603061 }
30613062
30623063 /* Extract the current weight (in tenth pounds) */
3063- j = p_ptr->total_weight;
3064+ j = creature_ptr->total_weight;
30643065
3065- if (!p_ptr->riding)
3066+ if (!creature_ptr->riding)
30663067 {
30673068 /* Extract the "weight limit" (in tenth pounds) */
3068- i = (int)weight_limit(p_ptr);
3069+ i = (int)weight_limit(creature_ptr);
30693070 }
30703071 else
30713072 {
3072- monster_type *riding_m_ptr = &current_floor_ptr->m_list[p_ptr->riding];
3073+ monster_type *riding_m_ptr = &current_floor_ptr->m_list[creature_ptr->riding];
30733074 monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
30743075 SPEED speed = riding_m_ptr->mspeed;
30753076
30763077 if (riding_m_ptr->mspeed > 110)
30773078 {
3078- new_speed = 110 + (s16b)((speed - 110) * (p_ptr->skill_exp[GINOU_RIDING] * 3 + p_ptr->lev * 160L - 10000L) / (22000L));
3079+ new_speed = 110 + (s16b)((speed - 110) * (creature_ptr->skill_exp[GINOU_RIDING] * 3 + creature_ptr->lev * 160L - 10000L) / (22000L));
30793080 if (new_speed < 110) new_speed = 110;
30803081 }
30813082 else
30823083 {
30833084 new_speed = speed;
30843085 }
3085- new_speed += (p_ptr->skill_exp[GINOU_RIDING] + p_ptr->lev * 160L) / 3200;
3086+ new_speed += (creature_ptr->skill_exp[GINOU_RIDING] + creature_ptr->lev * 160L) / 3200;
30863087 if (MON_FAST(riding_m_ptr)) new_speed += 10;
30873088 if (MON_SLOW(riding_m_ptr)) new_speed -= 10;
30883089 riding_levitation = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? TRUE : FALSE;
3089- if (riding_r_ptr->flags7 & (RF7_CAN_SWIM | RF7_AQUATIC)) p_ptr->can_swim = TRUE;
3090+ if (riding_r_ptr->flags7 & (RF7_CAN_SWIM | RF7_AQUATIC)) creature_ptr->can_swim = TRUE;
30903091
3091- if (!(riding_r_ptr->flags2 & RF2_PASS_WALL)) p_ptr->pass_wall = FALSE;
3092- if (riding_r_ptr->flags2 & RF2_KILL_WALL) p_ptr->kill_wall = TRUE;
3092+ if (!(riding_r_ptr->flags2 & RF2_PASS_WALL)) creature_ptr->pass_wall = FALSE;
3093+ if (riding_r_ptr->flags2 & RF2_KILL_WALL) creature_ptr->kill_wall = TRUE;
30933094
3094- if (p_ptr->skill_exp[GINOU_RIDING] < RIDING_EXP_SKILLED) j += (p_ptr->wt * 3 * (RIDING_EXP_SKILLED - p_ptr->skill_exp[GINOU_RIDING])) / RIDING_EXP_SKILLED;
3095+ if (creature_ptr->skill_exp[GINOU_RIDING] < RIDING_EXP_SKILLED) j += (creature_ptr->wt * 3 * (RIDING_EXP_SKILLED - creature_ptr->skill_exp[GINOU_RIDING])) / RIDING_EXP_SKILLED;
30953096
30963097 /* Extract the "weight limit" */
30973098 i = 1500 + riding_r_ptr->level * 25;
@@ -3101,16 +3102,16 @@ void calc_bonuses(void)
31013102 if (j > i) new_speed -= ((j - i) / (i / 5));
31023103
31033104 /* Searching slows the player down */
3104- if (p_ptr->action == ACTION_SEARCH) new_speed -= 10;
3105+ if (creature_ptr->action == ACTION_SEARCH) new_speed -= 10;
31053106
31063107 /* Feature bonus */
3107- if (p_ptr->prace == RACE_MERFOLK)
3108+ if (creature_ptr->prace == RACE_MERFOLK)
31083109 {
31093110 if (have_flag(f_ptr->flags, FF_WATER))
31103111 {
3111- new_speed += (2 + p_ptr->lev / 10);
3112+ new_speed += (2 + creature_ptr->lev / 10);
31123113 }
3113- else if (!p_ptr->levitation)
3114+ else if (!creature_ptr->levitation)
31143115 {
31153116 new_speed -= 2;
31163117 }
@@ -3118,114 +3119,114 @@ void calc_bonuses(void)
31183119
31193120
31203121 /* Actual Modifier Bonuses (Un-inflate stat bonuses) */
3121- p_ptr->to_a += ((int)(adj_dex_ta[p_ptr->stat_ind[A_DEX]]) - 128);
3122- p_ptr->to_d[0] += ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
3123- p_ptr->to_d[1] += ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
3124- p_ptr->to_d_m += ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
3125- p_ptr->to_h[0] += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3126- p_ptr->to_h[1] += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3127- p_ptr->to_h_b += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3128- p_ptr->to_h_m += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3129- p_ptr->to_h[0] += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3130- p_ptr->to_h[1] += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3131- p_ptr->to_h_b += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3132- p_ptr->to_h_m += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3122+ creature_ptr->to_a += ((int)(adj_dex_ta[creature_ptr->stat_ind[A_DEX]]) - 128);
3123+ creature_ptr->to_d[0] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
3124+ creature_ptr->to_d[1] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
3125+ creature_ptr->to_d_m += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
3126+ creature_ptr->to_h[0] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3127+ creature_ptr->to_h[1] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3128+ creature_ptr->to_h_b += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3129+ creature_ptr->to_h_m += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3130+ creature_ptr->to_h[0] += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
3131+ creature_ptr->to_h[1] += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
3132+ creature_ptr->to_h_b += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
3133+ creature_ptr->to_h_m += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
31333134
31343135 /* Displayed Modifier Bonuses (Un-inflate stat bonuses) */
3135- p_ptr->dis_to_a += ((int)(adj_dex_ta[p_ptr->stat_ind[A_DEX]]) - 128);
3136- p_ptr->dis_to_d[0] += ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
3137- p_ptr->dis_to_d[1] += ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128);
3138- p_ptr->dis_to_h[0] += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3139- p_ptr->dis_to_h[1] += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3140- p_ptr->dis_to_h_b += ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3141- p_ptr->dis_to_h[0] += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3142- p_ptr->dis_to_h[1] += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3143- p_ptr->dis_to_h_b += ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128);
3136+ creature_ptr->dis_to_a += ((int)(adj_dex_ta[creature_ptr->stat_ind[A_DEX]]) - 128);
3137+ creature_ptr->dis_to_d[0] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
3138+ creature_ptr->dis_to_d[1] += ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128);
3139+ creature_ptr->dis_to_h[0] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3140+ creature_ptr->dis_to_h[1] += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3141+ creature_ptr->dis_to_h_b += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
3142+ creature_ptr->dis_to_h[0] += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
3143+ creature_ptr->dis_to_h[1] += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
3144+ creature_ptr->dis_to_h_b += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128);
31443145
31453146
31463147 /* Obtain the "hold" value */
3147- hold = adj_str_hold[p_ptr->stat_ind[A_STR]];
3148+ hold = adj_str_hold[creature_ptr->stat_ind[A_STR]];
31483149
31493150
31503151 /* Examine the "current bow" */
3151- o_ptr = &p_ptr->inventory_list[INVEN_BOW];
3152+ o_ptr = &creature_ptr->inventory_list[INVEN_BOW];
31523153
31533154 /* It is hard to carholdry a heavy bow */
3154- p_ptr->heavy_shoot = is_heavy_shoot(p_ptr, o_ptr);
3155- if (p_ptr->heavy_shoot)
3155+ creature_ptr->heavy_shoot = is_heavy_shoot(creature_ptr, o_ptr);
3156+ if (creature_ptr->heavy_shoot)
31563157 {
31573158 /* Hard to wield a heavy bow */
3158- p_ptr->to_h_b += 2 * (hold - o_ptr->weight / 10);
3159- p_ptr->dis_to_h_b += 2 * (hold - o_ptr->weight / 10);
3159+ creature_ptr->to_h_b += 2 * (hold - o_ptr->weight / 10);
3160+ creature_ptr->dis_to_h_b += 2 * (hold - o_ptr->weight / 10);
31603161 }
31613162
31623163 /* Compute "extra shots" if needed */
31633164 if (o_ptr->k_idx)
31643165 {
3165- p_ptr->tval_ammo = (byte_hack)bow_tval_ammo(o_ptr);
3166+ creature_ptr->tval_ammo = (byte_hack)bow_tval_ammo(o_ptr);
31663167
31673168 /* Apply special flags */
3168- if (o_ptr->k_idx && !p_ptr->heavy_shoot)
3169+ if (o_ptr->k_idx && !creature_ptr->heavy_shoot)
31693170 {
31703171 /* Extra shots */
3171- p_ptr->num_fire = calc_num_fire(p_ptr, o_ptr);
3172+ creature_ptr->num_fire = calc_num_fire(creature_ptr, o_ptr);
31723173
31733174 /* Snipers love Cross bows */
3174- if ((p_ptr->pclass == CLASS_SNIPER) &&
3175- (p_ptr->tval_ammo == TV_BOLT))
3175+ if ((creature_ptr->pclass == CLASS_SNIPER) &&
3176+ (creature_ptr->tval_ammo == TV_BOLT))
31763177 {
3177- p_ptr->to_h_b += (10 + (p_ptr->lev / 5));
3178- p_ptr->dis_to_h_b += (10 + (p_ptr->lev / 5));
3178+ creature_ptr->to_h_b += (10 + (creature_ptr->lev / 5));
3179+ creature_ptr->dis_to_h_b += (10 + (creature_ptr->lev / 5));
31793180 }
31803181 }
31813182 }
31823183
3183- if (p_ptr->ryoute) hold *= 2;
3184+ if (creature_ptr->ryoute) hold *= 2;
31843185
31853186 for (i = 0; i < 2; i++)
31863187 {
31873188 /* Examine the "main weapon" */
3188- o_ptr = &p_ptr->inventory_list[INVEN_RARM + i];
3189+ o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
31893190
31903191 object_flags(o_ptr, flgs);
31913192
31923193 /* Assume not heavy */
3193- p_ptr->heavy_wield[i] = FALSE;
3194- p_ptr->icky_wield[i] = FALSE;
3195- p_ptr->riding_wield[i] = FALSE;
3194+ creature_ptr->heavy_wield[i] = FALSE;
3195+ creature_ptr->icky_wield[i] = FALSE;
3196+ creature_ptr->riding_wield[i] = FALSE;
31963197
3197- if (!has_melee_weapon(p_ptr, INVEN_RARM + i))
3198+ if (!has_melee_weapon(creature_ptr, INVEN_RARM + i))
31983199 {
3199- p_ptr->num_blow[i] = 1;
3200+ creature_ptr->num_blow[i] = 1;
32003201 continue;
32013202 }
32023203 /* It is hard to hold a heavy weapon */
32033204 if (hold < o_ptr->weight / 10)
32043205 {
32053206 /* Hard to wield a heavy weapon */
3206- p_ptr->to_h[i] += 2 * (hold - o_ptr->weight / 10);
3207- p_ptr->dis_to_h[i] += 2 * (hold - o_ptr->weight / 10);
3207+ creature_ptr->to_h[i] += 2 * (hold - o_ptr->weight / 10);
3208+ creature_ptr->dis_to_h[i] += 2 * (hold - o_ptr->weight / 10);
32083209
32093210 /* Heavy weapon */
3210- p_ptr->heavy_wield[i] = TRUE;
3211+ creature_ptr->heavy_wield[i] = TRUE;
32113212 }
3212- else if (p_ptr->ryoute && (hold < o_ptr->weight / 5)) omoi = TRUE;
3213+ else if (creature_ptr->ryoute && (hold < o_ptr->weight / 5)) omoi = TRUE;
32133214
32143215 if ((i == 1) && (o_ptr->tval == TV_SWORD) && ((o_ptr->sval == SV_MAIN_GAUCHE) || (o_ptr->sval == SV_WAKIZASHI)))
32153216 {
3216- p_ptr->to_a += 5;
3217- p_ptr->dis_to_a += 5;
3217+ creature_ptr->to_a += 5;
3218+ creature_ptr->dis_to_a += 5;
32183219 }
32193220
32203221 /* Normal weapons */
3221- if (o_ptr->k_idx && !p_ptr->heavy_wield[i])
3222+ if (o_ptr->k_idx && !creature_ptr->heavy_wield[i])
32223223 {
32233224 int str_index, dex_index;
32243225
32253226 int num = 0, wgt = 0, mul = 0, div = 0;
32263227
32273228 /* Analyze the class */
3228- switch (p_ptr->pclass)
3229+ switch (creature_ptr->pclass)
32293230 {
32303231 case CLASS_WARRIOR:
32313232 num = 6; wgt = 70; mul = 5; break;
@@ -3276,7 +3277,7 @@ void calc_bonuses(void)
32763277 num = 5; wgt = 70; mul = 3; break;
32773278
32783279 case CLASS_CAVALRY:
3279- if ((p_ptr->riding) && (have_flag(flgs, TR_RIDING))) { num = 5; wgt = 70; mul = 4; }
3280+ if ((creature_ptr->riding) && (have_flag(flgs, TR_RIDING))) { num = 5; wgt = 70; mul = 4; }
32803281 else { num = 5; wgt = 100; mul = 3; }
32813282 break;
32823283
@@ -3305,307 +3306,307 @@ void calc_bonuses(void)
33053306 div = ((o_ptr->weight < wgt) ? wgt : o_ptr->weight);
33063307
33073308 /* Access the strength vs weight */
3308- str_index = (adj_str_blow[p_ptr->stat_ind[A_STR]] * mul / div);
3309+ str_index = (adj_str_blow[creature_ptr->stat_ind[A_STR]] * mul / div);
33093310
3310- if (p_ptr->ryoute && !omoi) str_index++;
3311- if (p_ptr->pclass == CLASS_NINJA) str_index = MAX(0, str_index - 1);
3311+ if (creature_ptr->ryoute && !omoi) str_index++;
3312+ if (creature_ptr->pclass == CLASS_NINJA) str_index = MAX(0, str_index - 1);
33123313
33133314 /* Maximal value */
33143315 if (str_index > 11) str_index = 11;
33153316
33163317 /* Index by dexterity */
3317- dex_index = (adj_dex_blow[p_ptr->stat_ind[A_DEX]]);
3318+ dex_index = (adj_dex_blow[creature_ptr->stat_ind[A_DEX]]);
33183319
33193320 /* Maximal value */
33203321 if (dex_index > 11) dex_index = 11;
33213322
33223323 /* Use the blows table */
3323- p_ptr->num_blow[i] = blows_table[str_index][dex_index];
3324+ creature_ptr->num_blow[i] = blows_table[str_index][dex_index];
33243325
33253326 /* Maximal value */
3326- if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = (s16b)num;
3327+ if (creature_ptr->num_blow[i] > num) creature_ptr->num_blow[i] = (s16b)num;
33273328
33283329 /* Add in the "bonus blows" */
3329- p_ptr->num_blow[i] += (s16b)extra_blows[i];
3330+ creature_ptr->num_blow[i] += (s16b)extra_blows[i];
33303331
33313332
3332- if (p_ptr->pclass == CLASS_WARRIOR) p_ptr->num_blow[i] += (p_ptr->lev / 40);
3333- else if (p_ptr->pclass == CLASS_BERSERKER)
3333+ if (creature_ptr->pclass == CLASS_WARRIOR) creature_ptr->num_blow[i] += (creature_ptr->lev / 40);
3334+ else if (creature_ptr->pclass == CLASS_BERSERKER)
33343335 {
3335- p_ptr->num_blow[i] += (p_ptr->lev / 23);
3336+ creature_ptr->num_blow[i] += (creature_ptr->lev / 23);
33363337 }
3337- else if ((p_ptr->pclass == CLASS_ROGUE) && (o_ptr->weight < 50) && (p_ptr->stat_ind[A_DEX] >= 30)) p_ptr->num_blow[i] ++;
3338+ else if ((creature_ptr->pclass == CLASS_ROGUE) && (o_ptr->weight < 50) && (creature_ptr->stat_ind[A_DEX] >= 30)) creature_ptr->num_blow[i] ++;
33383339
3339- if (p_ptr->special_defense & KATA_FUUJIN) p_ptr->num_blow[i] -= 1;
3340+ if (creature_ptr->special_defense & KATA_FUUJIN) creature_ptr->num_blow[i] -= 1;
33403341
3341- if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) p_ptr->num_blow[i] = 1;
3342+ if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) creature_ptr->num_blow[i] = 1;
33423343
33433344
33443345 /* Require at least one blow */
3345- if (p_ptr->num_blow[i] < 1) p_ptr->num_blow[i] = 1;
3346+ if (creature_ptr->num_blow[i] < 1) creature_ptr->num_blow[i] = 1;
33463347
33473348 /* Boost digging skill by weapon weight */
3348- p_ptr->skill_dig += (o_ptr->weight / 10);
3349+ creature_ptr->skill_dig += (o_ptr->weight / 10);
33493350 }
33503351
33513352 /* Assume okay */
33523353 /* Priest weapon penalty for non-blessed edged weapons */
3353- if ((p_ptr->pclass == CLASS_PRIEST) && (!(have_flag(flgs, TR_BLESSED))) &&
3354+ if ((creature_ptr->pclass == CLASS_PRIEST) && (!(have_flag(flgs, TR_BLESSED))) &&
33543355 ((o_ptr->tval == TV_SWORD) || (o_ptr->tval == TV_POLEARM)))
33553356 {
33563357 /* Reduce the real bonuses */
3357- p_ptr->to_h[i] -= 2;
3358- p_ptr->to_d[i] -= 2;
3358+ creature_ptr->to_h[i] -= 2;
3359+ creature_ptr->to_d[i] -= 2;
33593360
33603361 /* Reduce the mental bonuses */
3361- p_ptr->dis_to_h[i] -= 2;
3362- p_ptr->dis_to_d[i] -= 2;
3362+ creature_ptr->dis_to_h[i] -= 2;
3363+ creature_ptr->dis_to_d[i] -= 2;
33633364
33643365 /* Icky weapon */
3365- p_ptr->icky_wield[i] = TRUE;
3366+ creature_ptr->icky_wield[i] = TRUE;
33663367 }
3367- else if (p_ptr->pclass == CLASS_BERSERKER)
3368+ else if (creature_ptr->pclass == CLASS_BERSERKER)
33683369 {
3369- p_ptr->to_h[i] += p_ptr->lev / 5;
3370- p_ptr->to_d[i] += p_ptr->lev / 6;
3371- p_ptr->dis_to_h[i] += p_ptr->lev / 5;
3372- p_ptr->dis_to_d[i] += p_ptr->lev / 6;
3373- if (((i == 0) && !p_ptr->hidarite) || p_ptr->ryoute)
3370+ creature_ptr->to_h[i] += creature_ptr->lev / 5;
3371+ creature_ptr->to_d[i] += creature_ptr->lev / 6;
3372+ creature_ptr->dis_to_h[i] += creature_ptr->lev / 5;
3373+ creature_ptr->dis_to_d[i] += creature_ptr->lev / 6;
3374+ if (((i == 0) && !creature_ptr->hidarite) || creature_ptr->ryoute)
33743375 {
3375- p_ptr->to_h[i] += p_ptr->lev / 5;
3376- p_ptr->to_d[i] += p_ptr->lev / 6;
3377- p_ptr->dis_to_h[i] += p_ptr->lev / 5;
3378- p_ptr->dis_to_d[i] += p_ptr->lev / 6;
3376+ creature_ptr->to_h[i] += creature_ptr->lev / 5;
3377+ creature_ptr->to_d[i] += creature_ptr->lev / 6;
3378+ creature_ptr->dis_to_h[i] += creature_ptr->lev / 5;
3379+ creature_ptr->dis_to_d[i] += creature_ptr->lev / 6;
33793380 }
33803381 }
3381- else if (p_ptr->pclass == CLASS_SORCERER)
3382+ else if (creature_ptr->pclass == CLASS_SORCERER)
33823383 {
33833384 if (!((o_ptr->tval == TV_HAFTED) && ((o_ptr->sval == SV_WIZSTAFF) || (o_ptr->sval == SV_NAMAKE_HAMMER))))
33843385 {
33853386 /* Reduce the real bonuses */
3386- p_ptr->to_h[i] -= 200;
3387- p_ptr->to_d[i] -= 200;
3387+ creature_ptr->to_h[i] -= 200;
3388+ creature_ptr->to_d[i] -= 200;
33883389
33893390 /* Reduce the mental bonuses */
3390- p_ptr->dis_to_h[i] -= 200;
3391- p_ptr->dis_to_d[i] -= 200;
3391+ creature_ptr->dis_to_h[i] -= 200;
3392+ creature_ptr->dis_to_d[i] -= 200;
33923393
33933394 /* Icky weapon */
3394- p_ptr->icky_wield[i] = TRUE;
3395+ creature_ptr->icky_wield[i] = TRUE;
33953396 }
33963397 else
33973398 {
33983399 /* Reduce the real bonuses */
3399- p_ptr->to_h[i] -= 30;
3400- p_ptr->to_d[i] -= 10;
3400+ creature_ptr->to_h[i] -= 30;
3401+ creature_ptr->to_d[i] -= 10;
34013402
34023403 /* Reduce the mental bonuses */
3403- p_ptr->dis_to_h[i] -= 30;
3404- p_ptr->dis_to_d[i] -= 10;
3404+ creature_ptr->dis_to_h[i] -= 30;
3405+ creature_ptr->dis_to_d[i] -= 10;
34053406 }
34063407 }
34073408 /* Hex bonuses */
3408- if (p_ptr->realm1 == REALM_HEX)
3409+ if (creature_ptr->realm1 == REALM_HEX)
34093410 {
34103411 if (object_is_cursed(o_ptr))
34113412 {
3412- if (o_ptr->curse_flags & (TRC_CURSED)) { p_ptr->to_h[i] += 5; p_ptr->dis_to_h[i] += 5; }
3413- if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { p_ptr->to_h[i] += 7; p_ptr->dis_to_h[i] += 7; }
3414- if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { p_ptr->to_h[i] += 13; p_ptr->dis_to_h[i] += 13; }
3415- if (o_ptr->curse_flags & (TRC_TY_CURSE)) { p_ptr->to_h[i] += 5; p_ptr->dis_to_h[i] += 5; }
3413+ if (o_ptr->curse_flags & (TRC_CURSED)) { creature_ptr->to_h[i] += 5; creature_ptr->dis_to_h[i] += 5; }
3414+ if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { creature_ptr->to_h[i] += 7; creature_ptr->dis_to_h[i] += 7; }
3415+ if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { creature_ptr->to_h[i] += 13; creature_ptr->dis_to_h[i] += 13; }
3416+ if (o_ptr->curse_flags & (TRC_TY_CURSE)) { creature_ptr->to_h[i] += 5; creature_ptr->dis_to_h[i] += 5; }
34163417 if (hex_spelling(HEX_RUNESWORD))
34173418 {
3418- if (o_ptr->curse_flags & (TRC_CURSED)) { p_ptr->to_d[i] += 5; p_ptr->dis_to_d[i] += 5; }
3419- if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { p_ptr->to_d[i] += 7; p_ptr->dis_to_d[i] += 7; }
3420- if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { p_ptr->to_d[i] += 13; p_ptr->dis_to_d[i] += 13; }
3419+ if (o_ptr->curse_flags & (TRC_CURSED)) { creature_ptr->to_d[i] += 5; creature_ptr->dis_to_d[i] += 5; }
3420+ if (o_ptr->curse_flags & (TRC_HEAVY_CURSE)) { creature_ptr->to_d[i] += 7; creature_ptr->dis_to_d[i] += 7; }
3421+ if (o_ptr->curse_flags & (TRC_PERMA_CURSE)) { creature_ptr->to_d[i] += 13; creature_ptr->dis_to_d[i] += 13; }
34213422 }
34223423 }
34233424 }
3424- if (p_ptr->riding)
3425+ if (creature_ptr->riding)
34253426 {
34263427 if ((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
34273428 {
3428- p_ptr->to_h[i] += 15;
3429- p_ptr->dis_to_h[i] += 15;
3430- p_ptr->to_dd[i] += 2;
3429+ creature_ptr->to_h[i] += 15;
3430+ creature_ptr->dis_to_h[i] += 15;
3431+ creature_ptr->to_dd[i] += 2;
34313432 }
34323433 else if (!(have_flag(flgs, TR_RIDING)))
34333434 {
34343435 int penalty;
3435- if ((p_ptr->pclass == CLASS_BEASTMASTER) || (p_ptr->pclass == CLASS_CAVALRY))
3436+ if ((creature_ptr->pclass == CLASS_BEASTMASTER) || (creature_ptr->pclass == CLASS_CAVALRY))
34363437 {
34373438 penalty = 5;
34383439 }
34393440 else
34403441 {
3441- penalty = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 80;
3442+ penalty = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
34423443 penalty += 30;
34433444 if (penalty < 30) penalty = 30;
34443445 }
3445- p_ptr->to_h[i] -= (s16b)penalty;
3446- p_ptr->dis_to_h[i] -= (s16b)penalty;
3446+ creature_ptr->to_h[i] -= (s16b)penalty;
3447+ creature_ptr->dis_to_h[i] -= (s16b)penalty;
34473448
34483449 /* Riding weapon */
3449- p_ptr->riding_wield[i] = TRUE;
3450+ creature_ptr->riding_wield[i] = TRUE;
34503451 }
34513452 }
34523453 }
34533454
3454- if (p_ptr->riding)
3455+ if (creature_ptr->riding)
34553456 {
34563457 int penalty = 0;
34573458
3458- p_ptr->riding_ryoute = FALSE;
3459+ creature_ptr->riding_ryoute = FALSE;
34593460
3460- if (p_ptr->ryoute || (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE)) p_ptr->riding_ryoute = TRUE;
3461- else if (p_ptr->pet_extra_flags & PF_RYOUTE)
3461+ if (creature_ptr->ryoute || (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_NONE)) creature_ptr->riding_ryoute = TRUE;
3462+ else if (creature_ptr->pet_extra_flags & PF_RYOUTE)
34623463 {
3463- switch (p_ptr->pclass)
3464+ switch (creature_ptr->pclass)
34643465 {
34653466 case CLASS_MONK:
34663467 case CLASS_FORCETRAINER:
34673468 case CLASS_BERSERKER:
3468- if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
3469- p_ptr->riding_ryoute = TRUE;
3469+ if ((empty_hands(creature_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
3470+ creature_ptr->riding_ryoute = TRUE;
34703471 break;
34713472 }
34723473 }
34733474
3474- if ((p_ptr->pclass == CLASS_BEASTMASTER) || (p_ptr->pclass == CLASS_CAVALRY))
3475+ if ((creature_ptr->pclass == CLASS_BEASTMASTER) || (creature_ptr->pclass == CLASS_CAVALRY))
34753476 {
3476- if (p_ptr->tval_ammo != TV_ARROW) penalty = 5;
3477+ if (creature_ptr->tval_ammo != TV_ARROW) penalty = 5;
34773478 }
34783479 else
34793480 {
3480- penalty = r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 80;
3481+ penalty = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
34813482 penalty += 30;
34823483 if (penalty < 30) penalty = 30;
34833484 }
3484- if (p_ptr->tval_ammo == TV_BOLT) penalty *= 2;
3485- p_ptr->to_h_b -= (s16b)penalty;
3486- p_ptr->dis_to_h_b -= (s16b)penalty;
3485+ if (creature_ptr->tval_ammo == TV_BOLT) penalty *= 2;
3486+ creature_ptr->to_h_b -= (s16b)penalty;
3487+ creature_ptr->dis_to_h_b -= (s16b)penalty;
34873488 }
34883489
34893490 /* Different calculation for monks with empty hands */
3490- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) &&
3491- (empty_hands_status & EMPTY_HAND_RARM) && !p_ptr->hidarite)
3491+ if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_BERSERKER)) &&
3492+ (empty_hands_status & EMPTY_HAND_RARM) && !creature_ptr->hidarite)
34923493 {
3493- int blow_base = p_ptr->lev + adj_dex_blow[p_ptr->stat_ind[A_DEX]];
3494- p_ptr->num_blow[0] = 0;
3494+ int blow_base = creature_ptr->lev + adj_dex_blow[creature_ptr->stat_ind[A_DEX]];
3495+ creature_ptr->num_blow[0] = 0;
34953496
3496- if (p_ptr->pclass == CLASS_FORCETRAINER)
3497+ if (creature_ptr->pclass == CLASS_FORCETRAINER)
34973498 {
3498- if (blow_base > 18) p_ptr->num_blow[0]++;
3499- if (blow_base > 31) p_ptr->num_blow[0]++;
3500- if (blow_base > 44) p_ptr->num_blow[0]++;
3501- if (blow_base > 58) p_ptr->num_blow[0]++;
3499+ if (blow_base > 18) creature_ptr->num_blow[0]++;
3500+ if (blow_base > 31) creature_ptr->num_blow[0]++;
3501+ if (blow_base > 44) creature_ptr->num_blow[0]++;
3502+ if (blow_base > 58) creature_ptr->num_blow[0]++;
35023503 if (P_PTR_KI)
35033504 {
3504- p_ptr->to_d[0] += P_PTR_KI / 5;
3505- p_ptr->dis_to_d[0] += P_PTR_KI / 5;
3505+ creature_ptr->to_d[0] += P_PTR_KI / 5;
3506+ creature_ptr->dis_to_d[0] += P_PTR_KI / 5;
35063507 }
35073508 }
35083509 else
35093510 {
3510- if (blow_base > 12) p_ptr->num_blow[0]++;
3511- if (blow_base > 22) p_ptr->num_blow[0]++;
3512- if (blow_base > 31) p_ptr->num_blow[0]++;
3513- if (blow_base > 39) p_ptr->num_blow[0]++;
3514- if (blow_base > 46) p_ptr->num_blow[0]++;
3515- if (blow_base > 53) p_ptr->num_blow[0]++;
3516- if (blow_base > 59) p_ptr->num_blow[0]++;
3511+ if (blow_base > 12) creature_ptr->num_blow[0]++;
3512+ if (blow_base > 22) creature_ptr->num_blow[0]++;
3513+ if (blow_base > 31) creature_ptr->num_blow[0]++;
3514+ if (blow_base > 39) creature_ptr->num_blow[0]++;
3515+ if (blow_base > 46) creature_ptr->num_blow[0]++;
3516+ if (blow_base > 53) creature_ptr->num_blow[0]++;
3517+ if (blow_base > 59) creature_ptr->num_blow[0]++;
35173518 }
35183519
3519- if (heavy_armor(p_ptr) && (p_ptr->pclass != CLASS_BERSERKER))
3520- p_ptr->num_blow[0] /= 2;
3520+ if (heavy_armor(creature_ptr) && (creature_ptr->pclass != CLASS_BERSERKER))
3521+ creature_ptr->num_blow[0] /= 2;
35213522 else
35223523 {
3523- p_ptr->to_h[0] += (p_ptr->lev / 3);
3524- p_ptr->dis_to_h[0] += (p_ptr->lev / 3);
3524+ creature_ptr->to_h[0] += (creature_ptr->lev / 3);
3525+ creature_ptr->dis_to_h[0] += (creature_ptr->lev / 3);
35253526
3526- p_ptr->to_d[0] += (p_ptr->lev / 6);
3527- p_ptr->dis_to_d[0] += (p_ptr->lev / 6);
3527+ creature_ptr->to_d[0] += (creature_ptr->lev / 6);
3528+ creature_ptr->dis_to_d[0] += (creature_ptr->lev / 6);
35283529 }
35293530
3530- if (p_ptr->special_defense & KAMAE_BYAKKO)
3531+ if (creature_ptr->special_defense & KAMAE_BYAKKO)
35313532 {
3532- p_ptr->to_a -= 40;
3533- p_ptr->dis_to_a -= 40;
3533+ creature_ptr->to_a -= 40;
3534+ creature_ptr->dis_to_a -= 40;
35343535
35353536 }
3536- else if (p_ptr->special_defense & KAMAE_SEIRYU)
3537+ else if (creature_ptr->special_defense & KAMAE_SEIRYU)
35373538 {
3538- p_ptr->to_a -= 50;
3539- p_ptr->dis_to_a -= 50;
3540- p_ptr->resist_acid = TRUE;
3541- p_ptr->resist_fire = TRUE;
3542- p_ptr->resist_elec = TRUE;
3543- p_ptr->resist_cold = TRUE;
3544- p_ptr->resist_pois = TRUE;
3545- p_ptr->sh_fire = TRUE;
3546- p_ptr->sh_elec = TRUE;
3547- p_ptr->sh_cold = TRUE;
3548- p_ptr->levitation = TRUE;
3539+ creature_ptr->to_a -= 50;
3540+ creature_ptr->dis_to_a -= 50;
3541+ creature_ptr->resist_acid = TRUE;
3542+ creature_ptr->resist_fire = TRUE;
3543+ creature_ptr->resist_elec = TRUE;
3544+ creature_ptr->resist_cold = TRUE;
3545+ creature_ptr->resist_pois = TRUE;
3546+ creature_ptr->sh_fire = TRUE;
3547+ creature_ptr->sh_elec = TRUE;
3548+ creature_ptr->sh_cold = TRUE;
3549+ creature_ptr->levitation = TRUE;
35493550 }
3550- else if (p_ptr->special_defense & KAMAE_GENBU)
3551+ else if (creature_ptr->special_defense & KAMAE_GENBU)
35513552 {
3552- p_ptr->to_a += (p_ptr->lev*p_ptr->lev) / 50;
3553- p_ptr->dis_to_a += (p_ptr->lev*p_ptr->lev) / 50;
3554- p_ptr->reflect = TRUE;
3555- p_ptr->num_blow[0] -= 2;
3556- if ((p_ptr->pclass == CLASS_MONK) && (p_ptr->lev > 42)) p_ptr->num_blow[0]--;
3557- if (p_ptr->num_blow[0] < 0) p_ptr->num_blow[0] = 0;
3553+ creature_ptr->to_a += (creature_ptr->lev*creature_ptr->lev) / 50;
3554+ creature_ptr->dis_to_a += (creature_ptr->lev*creature_ptr->lev) / 50;
3555+ creature_ptr->reflect = TRUE;
3556+ creature_ptr->num_blow[0] -= 2;
3557+ if ((creature_ptr->pclass == CLASS_MONK) && (creature_ptr->lev > 42)) creature_ptr->num_blow[0]--;
3558+ if (creature_ptr->num_blow[0] < 0) creature_ptr->num_blow[0] = 0;
35583559 }
3559- else if (p_ptr->special_defense & KAMAE_SUZAKU)
3560+ else if (creature_ptr->special_defense & KAMAE_SUZAKU)
35603561 {
3561- p_ptr->to_h[0] -= (p_ptr->lev / 3);
3562- p_ptr->to_d[0] -= (p_ptr->lev / 6);
3562+ creature_ptr->to_h[0] -= (creature_ptr->lev / 3);
3563+ creature_ptr->to_d[0] -= (creature_ptr->lev / 6);
35633564
3564- p_ptr->dis_to_h[0] -= (p_ptr->lev / 3);
3565- p_ptr->dis_to_d[0] -= (p_ptr->lev / 6);
3566- p_ptr->num_blow[0] /= 2;
3567- p_ptr->levitation = TRUE;
3565+ creature_ptr->dis_to_h[0] -= (creature_ptr->lev / 3);
3566+ creature_ptr->dis_to_d[0] -= (creature_ptr->lev / 6);
3567+ creature_ptr->num_blow[0] /= 2;
3568+ creature_ptr->levitation = TRUE;
35683569 }
35693570
3570- p_ptr->num_blow[0] += 1 + extra_blows[0];
3571+ creature_ptr->num_blow[0] += 1 + extra_blows[0];
35713572 }
35723573
3573- if (p_ptr->riding) p_ptr->levitation = riding_levitation;
3574+ if (creature_ptr->riding) creature_ptr->levitation = riding_levitation;
35743575
3575- p_ptr->monk_armour_aux = FALSE;
3576+ creature_ptr->monk_armour_aux = FALSE;
35763577
3577- if (heavy_armor(p_ptr))
3578+ if (heavy_armor(creature_ptr))
35783579 {
3579- p_ptr->monk_armour_aux = TRUE;
3580+ creature_ptr->monk_armour_aux = TRUE;
35803581 }
35813582
35823583 for (i = 0; i < 2; i++)
35833584 {
3584- if (has_melee_weapon(p_ptr, INVEN_RARM + i))
3585+ if (has_melee_weapon(creature_ptr, INVEN_RARM + i))
35853586 {
3586- OBJECT_TYPE_VALUE tval = p_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
3587- OBJECT_SUBTYPE_VALUE sval = p_ptr->inventory_list[INVEN_RARM + i].sval;
3587+ OBJECT_TYPE_VALUE tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
3588+ OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval;
35883589
3589- p_ptr->to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
3590- p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
3591- if ((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER))
3590+ creature_ptr->to_h[i] += (creature_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
3591+ creature_ptr->dis_to_h[i] += (creature_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
3592+ if ((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER))
35923593 {
3593- if (!s_info[p_ptr->pclass].w_max[tval][sval])
3594+ if (!s_info[creature_ptr->pclass].w_max[tval][sval])
35943595 {
3595- p_ptr->to_h[i] -= 40;
3596- p_ptr->dis_to_h[i] -= 40;
3597- p_ptr->icky_wield[i] = TRUE;
3596+ creature_ptr->to_h[i] -= 40;
3597+ creature_ptr->dis_to_h[i] -= 40;
3598+ creature_ptr->icky_wield[i] = TRUE;
35983599 }
35993600 }
3600- else if (p_ptr->pclass == CLASS_NINJA)
3601+ else if (creature_ptr->pclass == CLASS_NINJA)
36013602 {
3602- if ((s_info[CLASS_NINJA].w_max[tval][sval] <= WEAPON_EXP_BEGINNER) || (p_ptr->inventory_list[INVEN_LARM - i].tval == TV_SHIELD))
3603+ if ((s_info[CLASS_NINJA].w_max[tval][sval] <= WEAPON_EXP_BEGINNER) || (creature_ptr->inventory_list[INVEN_LARM - i].tval == TV_SHIELD))
36033604 {
3604- p_ptr->to_h[i] -= 40;
3605- p_ptr->dis_to_h[i] -= 40;
3606- p_ptr->icky_wield[i] = TRUE;
3607- p_ptr->num_blow[i] /= 2;
3608- if (p_ptr->num_blow[i] < 1) p_ptr->num_blow[i] = 1;
3605+ creature_ptr->to_h[i] -= 40;
3606+ creature_ptr->dis_to_h[i] -= 40;
3607+ creature_ptr->icky_wield[i] = TRUE;
3608+ creature_ptr->num_blow[i] /= 2;
3609+ if (creature_ptr->num_blow[i] < 1) creature_ptr->num_blow[i] = 1;
36093610 }
36103611 }
36113612 }
@@ -3613,7 +3614,7 @@ void calc_bonuses(void)
36133614
36143615 /* Maximum speed is (+99). (internally it's 110 + 99) */
36153616 /* Temporary lightspeed forces to be maximum speed */
3616- if ((p_ptr->lightspeed && !p_ptr->riding) || (new_speed > 209))
3617+ if ((creature_ptr->lightspeed && !creature_ptr->riding) || (new_speed > 209))
36173618 {
36183619 new_speed = 209;
36193620 }
@@ -3622,126 +3623,126 @@ void calc_bonuses(void)
36223623 if (new_speed < 11) new_speed = 11;
36233624
36243625 /* Display the speed (if needed) */
3625- if (p_ptr->pspeed != (byte)new_speed)
3626+ if (creature_ptr->pspeed != (byte)new_speed)
36263627 {
3627- p_ptr->pspeed = (byte)new_speed;
3628- p_ptr->redraw |= (PR_SPEED);
3628+ creature_ptr->pspeed = (byte)new_speed;
3629+ creature_ptr->redraw |= (PR_SPEED);
36293630 }
36303631
36313632 if (yoiyami)
36323633 {
3633- if (p_ptr->to_a > (0 - p_ptr->ac))
3634- p_ptr->to_a = 0 - p_ptr->ac;
3635- if (p_ptr->dis_to_a > (0 - p_ptr->dis_ac))
3636- p_ptr->dis_to_a = 0 - p_ptr->dis_ac;
3634+ if (creature_ptr->to_a > (0 - creature_ptr->ac))
3635+ creature_ptr->to_a = 0 - creature_ptr->ac;
3636+ if (creature_ptr->dis_to_a > (0 - creature_ptr->dis_ac))
3637+ creature_ptr->dis_to_a = 0 - creature_ptr->dis_ac;
36373638 }
36383639
36393640 /* Redraw armor (if needed) */
3640- if ((p_ptr->dis_ac != old_dis_ac) || (p_ptr->dis_to_a != old_dis_to_a))
3641+ if ((creature_ptr->dis_ac != old_dis_ac) || (creature_ptr->dis_to_a != old_dis_to_a))
36413642 {
3642- p_ptr->redraw |= (PR_ARMOR);
3643- p_ptr->window |= (PW_PLAYER);
3643+ creature_ptr->redraw |= (PR_ARMOR);
3644+ creature_ptr->window |= (PW_PLAYER);
36443645 }
36453646
3646- if (p_ptr->ryoute && !omoi)
3647+ if (creature_ptr->ryoute && !omoi)
36473648 {
36483649 int bonus_to_h = 0, bonus_to_d = 0;
3649- bonus_to_d = ((int)(adj_str_td[p_ptr->stat_ind[A_STR]]) - 128) / 2;
3650- bonus_to_h = ((int)(adj_str_th[p_ptr->stat_ind[A_STR]]) - 128) + ((int)(adj_dex_th[p_ptr->stat_ind[A_DEX]]) - 128);
3650+ bonus_to_d = ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128) / 2;
3651+ bonus_to_h = ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128) + ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128);
36513652
3652- p_ptr->to_h[default_hand] += MAX(bonus_to_h, 1);
3653- p_ptr->dis_to_h[default_hand] += MAX(bonus_to_h, 1);
3654- p_ptr->to_d[default_hand] += MAX(bonus_to_d, 1);
3655- p_ptr->dis_to_d[default_hand] += MAX(bonus_to_d, 1);
3653+ creature_ptr->to_h[default_hand] += MAX(bonus_to_h, 1);
3654+ creature_ptr->dis_to_h[default_hand] += MAX(bonus_to_h, 1);
3655+ creature_ptr->to_d[default_hand] += MAX(bonus_to_d, 1);
3656+ creature_ptr->dis_to_d[default_hand] += MAX(bonus_to_d, 1);
36563657 }
36573658
3658- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(p_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) p_ptr->ryoute = FALSE;
3659+ if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM))) creature_ptr->ryoute = FALSE;
36593660
36603661 /* Affect Skill -- stealth (bonus one) */
3661- p_ptr->skill_stl += 1;
3662+ creature_ptr->skill_stl += 1;
36623663
3663- if (IS_TIM_STEALTH()) p_ptr->skill_stl += 99;
3664+ if (IS_TIM_STEALTH()) creature_ptr->skill_stl += 99;
36643665
36653666 /* Affect Skill -- disarming (DEX and INT) */
3666- p_ptr->skill_dis += adj_dex_dis[p_ptr->stat_ind[A_DEX]];
3667- p_ptr->skill_dis += adj_int_dis[p_ptr->stat_ind[A_INT]];
3667+ creature_ptr->skill_dis += adj_dex_dis[creature_ptr->stat_ind[A_DEX]];
3668+ creature_ptr->skill_dis += adj_int_dis[creature_ptr->stat_ind[A_INT]];
36683669
36693670 /* Affect Skill -- magic devices (INT) */
3670- p_ptr->skill_dev += adj_int_dev[p_ptr->stat_ind[A_INT]];
3671+ creature_ptr->skill_dev += adj_int_dev[creature_ptr->stat_ind[A_INT]];
36713672
36723673 /* Affect Skill -- saving throw (WIS) */
3673- p_ptr->skill_sav += adj_wis_sav[p_ptr->stat_ind[A_WIS]];
3674+ creature_ptr->skill_sav += adj_wis_sav[creature_ptr->stat_ind[A_WIS]];
36743675
36753676 /* Affect Skill -- digging (STR) */
3676- p_ptr->skill_dig += adj_str_dig[p_ptr->stat_ind[A_STR]];
3677+ creature_ptr->skill_dig += adj_str_dig[creature_ptr->stat_ind[A_STR]];
36773678
36783679 /* Affect Skill -- disarming (Level, by Class) */
3679- p_ptr->skill_dis += ((cp_ptr->x_dis * p_ptr->lev / 10) + (ap_ptr->a_dis * p_ptr->lev / 50));
3680+ creature_ptr->skill_dis += ((cp_ptr->x_dis * creature_ptr->lev / 10) + (ap_ptr->a_dis * creature_ptr->lev / 50));
36803681
36813682 /* Affect Skill -- magic devices (Level, by Class) */
3682- p_ptr->skill_dev += ((cp_ptr->x_dev * p_ptr->lev / 10) + (ap_ptr->a_dev * p_ptr->lev / 50));
3683+ creature_ptr->skill_dev += ((cp_ptr->x_dev * creature_ptr->lev / 10) + (ap_ptr->a_dev * creature_ptr->lev / 50));
36833684
36843685 /* Affect Skill -- saving throw (Level, by Class) */
3685- p_ptr->skill_sav += ((cp_ptr->x_sav * p_ptr->lev / 10) + (ap_ptr->a_sav * p_ptr->lev / 50));
3686+ creature_ptr->skill_sav += ((cp_ptr->x_sav * creature_ptr->lev / 10) + (ap_ptr->a_sav * creature_ptr->lev / 50));
36863687
36873688 /* Affect Skill -- stealth (Level, by Class) */
3688- p_ptr->skill_stl += (cp_ptr->x_stl * p_ptr->lev / 10);
3689+ creature_ptr->skill_stl += (cp_ptr->x_stl * creature_ptr->lev / 10);
36893690
36903691 /* Affect Skill -- search ability (Level, by Class) */
3691- p_ptr->skill_srh += (cp_ptr->x_srh * p_ptr->lev / 10);
3692+ creature_ptr->skill_srh += (cp_ptr->x_srh * creature_ptr->lev / 10);
36923693
36933694 /* Affect Skill -- search frequency (Level, by Class) */
3694- p_ptr->skill_fos += (cp_ptr->x_fos * p_ptr->lev / 10);
3695+ creature_ptr->skill_fos += (cp_ptr->x_fos * creature_ptr->lev / 10);
36953696
36963697 /* Affect Skill -- combat (normal) (Level, by Class) */
3697- p_ptr->skill_thn += ((cp_ptr->x_thn * p_ptr->lev / 10) + (ap_ptr->a_thn * p_ptr->lev / 50));
3698+ creature_ptr->skill_thn += ((cp_ptr->x_thn * creature_ptr->lev / 10) + (ap_ptr->a_thn * creature_ptr->lev / 50));
36983699
36993700 /* Affect Skill -- combat (shooting) (Level, by Class) */
3700- p_ptr->skill_thb += ((cp_ptr->x_thb * p_ptr->lev / 10) + (ap_ptr->a_thb * p_ptr->lev / 50));
3701+ creature_ptr->skill_thb += ((cp_ptr->x_thb * creature_ptr->lev / 10) + (ap_ptr->a_thb * creature_ptr->lev / 50));
37013702
37023703 /* Affect Skill -- combat (throwing) (Level, by Class) */
3703- p_ptr->skill_tht += ((cp_ptr->x_thb * p_ptr->lev / 10) + (ap_ptr->a_thb * p_ptr->lev / 50));
3704+ creature_ptr->skill_tht += ((cp_ptr->x_thb * creature_ptr->lev / 10) + (ap_ptr->a_thb * creature_ptr->lev / 50));
37043705
37053706
3706- if ((PRACE_IS_(p_ptr, RACE_S_FAIRY)) && (p_ptr->pseikaku != SEIKAKU_SEXY) && (p_ptr->cursed & TRC_AGGRAVATE))
3707+ if ((PRACE_IS_(creature_ptr, RACE_S_FAIRY)) && (creature_ptr->pseikaku != SEIKAKU_SEXY) && (creature_ptr->cursed & TRC_AGGRAVATE))
37073708 {
3708- p_ptr->cursed &= ~(TRC_AGGRAVATE);
3709- p_ptr->skill_stl = MIN(p_ptr->skill_stl - 3, (p_ptr->skill_stl + 2) / 2);
3709+ creature_ptr->cursed &= ~(TRC_AGGRAVATE);
3710+ creature_ptr->skill_stl = MIN(creature_ptr->skill_stl - 3, (creature_ptr->skill_stl + 2) / 2);
37103711 }
37113712
37123713 /* Limit Skill -- stealth from 0 to 30 */
3713- if (p_ptr->skill_stl > 30) p_ptr->skill_stl = 30;
3714- if (p_ptr->skill_stl < 0) p_ptr->skill_stl = 0;
3714+ if (creature_ptr->skill_stl > 30) creature_ptr->skill_stl = 30;
3715+ if (creature_ptr->skill_stl < 0) creature_ptr->skill_stl = 0;
37153716
37163717 /* Limit Skill -- digging from 1 up */
3717- if (p_ptr->skill_dig < 1) p_ptr->skill_dig = 1;
3718+ if (creature_ptr->skill_dig < 1) creature_ptr->skill_dig = 1;
37183719
3719- if (p_ptr->anti_magic && (p_ptr->skill_sav < (90 + p_ptr->lev))) p_ptr->skill_sav = 90 + p_ptr->lev;
3720+ if (creature_ptr->anti_magic && (creature_ptr->skill_sav < (90 + creature_ptr->lev))) creature_ptr->skill_sav = 90 + creature_ptr->lev;
37203721
3721- if (p_ptr->tsubureru) p_ptr->skill_sav = 10;
3722+ if (creature_ptr->tsubureru) creature_ptr->skill_sav = 10;
37223723
3723- if ((p_ptr->ult_res || p_ptr->resist_magic || p_ptr->magicdef) && (p_ptr->skill_sav < (95 + p_ptr->lev))) p_ptr->skill_sav = 95 + p_ptr->lev;
3724+ if ((creature_ptr->ult_res || creature_ptr->resist_magic || creature_ptr->magicdef) && (creature_ptr->skill_sav < (95 + creature_ptr->lev))) creature_ptr->skill_sav = 95 + creature_ptr->lev;
37243725
3725- if (down_saving) p_ptr->skill_sav /= 2;
3726+ if (down_saving) creature_ptr->skill_sav /= 2;
37263727
37273728 /* Hack -- Each elemental immunity includes resistance */
3728- if (p_ptr->immune_acid) p_ptr->resist_acid = TRUE;
3729- if (p_ptr->immune_elec) p_ptr->resist_elec = TRUE;
3730- if (p_ptr->immune_fire) p_ptr->resist_fire = TRUE;
3731- if (p_ptr->immune_cold) p_ptr->resist_cold = TRUE;
3729+ if (creature_ptr->immune_acid) creature_ptr->resist_acid = TRUE;
3730+ if (creature_ptr->immune_elec) creature_ptr->resist_elec = TRUE;
3731+ if (creature_ptr->immune_fire) creature_ptr->resist_fire = TRUE;
3732+ if (creature_ptr->immune_cold) creature_ptr->resist_cold = TRUE;
37323733
37333734
37343735 /* Hack -- handle "xtra" mode */
37353736 if (current_world_ptr->character_xtra) return;
37363737
37373738 /* Take note when "heavy bow" changes */
3738- if (p_ptr->old_heavy_shoot != p_ptr->heavy_shoot)
3739+ if (creature_ptr->old_heavy_shoot != creature_ptr->heavy_shoot)
37393740 {
3740- if (p_ptr->heavy_shoot)
3741+ if (creature_ptr->heavy_shoot)
37413742 {
37423743 msg_print(_("こんな重い弓を装備しているのは大変だ。", "You have trouble wielding such a heavy bow."));
37433744 }
3744- else if (p_ptr->inventory_list[INVEN_BOW].k_idx)
3745+ else if (creature_ptr->inventory_list[INVEN_BOW].k_idx)
37453746 {
37463747 msg_print(_("この弓なら装備していても辛くない。", "You have no trouble wielding your bow."));
37473748 }
@@ -3751,23 +3752,23 @@ void calc_bonuses(void)
37513752 }
37523753
37533754 /* Save it */
3754- p_ptr->old_heavy_shoot = p_ptr->heavy_shoot;
3755+ creature_ptr->old_heavy_shoot = creature_ptr->heavy_shoot;
37553756 }
37563757
37573758 for (i = 0; i < 2; i++)
37583759 {
37593760 /* Take note when "heavy weapon" changes */
3760- if (p_ptr->old_heavy_wield[i] != p_ptr->heavy_wield[i])
3761+ if (creature_ptr->old_heavy_wield[i] != creature_ptr->heavy_wield[i])
37613762 {
3762- if (p_ptr->heavy_wield[i])
3763+ if (creature_ptr->heavy_wield[i])
37633764 {
37643765 msg_print(_("こんな重い武器を装備しているのは大変だ。", "You have trouble wielding such a heavy weapon."));
37653766 }
3766- else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
3767+ else if (has_melee_weapon(creature_ptr, INVEN_RARM + i))
37673768 {
37683769 msg_print(_("これなら装備していても辛くない。", "You have no trouble wielding your weapon."));
37693770 }
3770- else if (p_ptr->heavy_wield[1 - i])
3771+ else if (creature_ptr->heavy_wield[1 - i])
37713772 {
37723773 msg_print(_("まだ武器が重い。", "You have still trouble wielding a heavy weapon."));
37733774 }
@@ -3777,40 +3778,40 @@ void calc_bonuses(void)
37773778 }
37783779
37793780 /* Save it */
3780- p_ptr->old_heavy_wield[i] = p_ptr->heavy_wield[i];
3781+ creature_ptr->old_heavy_wield[i] = creature_ptr->heavy_wield[i];
37813782 }
37823783
37833784 /* Take note when "heavy weapon" changes */
3784- if (p_ptr->old_riding_wield[i] != p_ptr->riding_wield[i])
3785+ if (creature_ptr->old_riding_wield[i] != creature_ptr->riding_wield[i])
37853786 {
3786- if (p_ptr->riding_wield[i])
3787+ if (creature_ptr->riding_wield[i])
37873788 {
37883789 msg_print(_("この武器は乗馬中に使うにはむかないようだ。", "This weapon is not suitable for use while riding."));
37893790 }
3790- else if (!p_ptr->riding)
3791+ else if (!creature_ptr->riding)
37913792 {
37923793 msg_print(_("この武器は徒歩で使いやすい。", "This weapon was not suitable for use while riding."));
37933794 }
3794- else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
3795+ else if (has_melee_weapon(creature_ptr, INVEN_RARM + i))
37953796 {
37963797 msg_print(_("これなら乗馬中にぴったりだ。", "This weapon is suitable for use while riding."));
37973798 }
37983799 /* Save it */
3799- p_ptr->old_riding_wield[i] = p_ptr->riding_wield[i];
3800+ creature_ptr->old_riding_wield[i] = creature_ptr->riding_wield[i];
38003801 }
38013802
38023803 /* Take note when "illegal weapon" changes */
3803- if (p_ptr->old_icky_wield[i] != p_ptr->icky_wield[i])
3804+ if (creature_ptr->old_icky_wield[i] != creature_ptr->icky_wield[i])
38043805 {
3805- if (p_ptr->icky_wield[i])
3806+ if (creature_ptr->icky_wield[i])
38063807 {
38073808 msg_print(_("今の装備はどうも自分にふさわしくない気がする。", "You do not feel comfortable with your weapon."));
38083809 if (current_world_ptr->is_loading_now)
38093810 {
3810- chg_virtue(p_ptr, V_FAITH, -1);
3811+ chg_virtue(creature_ptr, V_FAITH, -1);
38113812 }
38123813 }
3813- else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
3814+ else if (has_melee_weapon(creature_ptr, INVEN_RARM + i))
38143815 {
38153816 msg_print(_("今の装備は自分にふさわしい気がする。", "You feel comfortable with your weapon."));
38163817 }
@@ -3820,16 +3821,16 @@ void calc_bonuses(void)
38203821 }
38213822
38223823 /* Save it */
3823- p_ptr->old_icky_wield[i] = p_ptr->icky_wield[i];
3824+ creature_ptr->old_icky_wield[i] = creature_ptr->icky_wield[i];
38243825 }
38253826 }
38263827
3827- if (p_ptr->riding && (p_ptr->old_riding_ryoute != p_ptr->riding_ryoute))
3828+ if (creature_ptr->riding && (creature_ptr->old_riding_ryoute != creature_ptr->riding_ryoute))
38283829 {
3829- if (p_ptr->riding_ryoute)
3830+ if (creature_ptr->riding_ryoute)
38303831 {
38313832 #ifdef JP
3832- msg_format("%s馬を操れない。", (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE) ? "両手がふさがっていて" : "");
3833+ msg_format("%s馬を操れない。", (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_NONE) ? "両手がふさがっていて" : "");
38333834 #else
38343835 msg_print("You are using both hand for fighting, and you can't control a riding pet.");
38353836 #endif
@@ -3837,23 +3838,23 @@ void calc_bonuses(void)
38373838 else
38383839 {
38393840 #ifdef JP
3840- msg_format("%s馬を操れるようになった。", (empty_hands(p_ptr, FALSE) == EMPTY_HAND_NONE) ? "手が空いて" : "");
3841+ msg_format("%s馬を操れるようになった。", (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_NONE) ? "手が空いて" : "");
38413842 #else
38423843 msg_print("You began to control riding pet with one hand.");
38433844 #endif
38443845 }
38453846
3846- p_ptr->old_riding_ryoute = p_ptr->riding_ryoute;
3847+ creature_ptr->old_riding_ryoute = creature_ptr->riding_ryoute;
38473848 }
38483849
3849- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_NINJA)) && (p_ptr->monk_armour_aux != p_ptr->monk_notify_aux))
3850+ if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_NINJA)) && (creature_ptr->monk_armour_aux != creature_ptr->monk_notify_aux))
38503851 {
3851- if (heavy_armor(p_ptr))
3852+ if (heavy_armor(creature_ptr))
38523853 {
38533854 msg_print(_("装備が重くてバランスを取れない。", "The weight of your armor disrupts your balance."));
38543855 if (current_world_ptr->is_loading_now)
38553856 {
3856- chg_virtue(p_ptr, V_HARMONY, -1);
3857+ chg_virtue(creature_ptr, V_HARMONY, -1);
38573858 }
38583859 }
38593860 else
@@ -3861,20 +3862,20 @@ void calc_bonuses(void)
38613862 msg_print(_("バランスがとれるようになった。", "You regain your balance."));
38623863 }
38633864
3864- p_ptr->monk_notify_aux = p_ptr->monk_armour_aux;
3865+ creature_ptr->monk_notify_aux = creature_ptr->monk_armour_aux;
38653866 }
38663867
38673868 for (i = 0; i < INVEN_PACK; i++)
38683869 {
38693870 #if 0
3870- if ((p_ptr->inventory_list[i].tval == TV_SORCERY_BOOK) && (p_ptr->inventory_list[i].sval == 2)) have_dd_s = TRUE;
3871- if ((p_ptr->inventory_list[i].tval == TV_TRUMP_BOOK) && (p_ptr->inventory_list[i].sval == 1)) have_dd_t = TRUE;
3871+ if ((creature_ptr->inventory_list[i].tval == TV_SORCERY_BOOK) && (creature_ptr->inventory_list[i].sval == 2)) have_dd_s = TRUE;
3872+ if ((creature_ptr->inventory_list[i].tval == TV_TRUMP_BOOK) && (creature_ptr->inventory_list[i].sval == 1)) have_dd_t = TRUE;
38723873 #endif
3873- if ((p_ptr->inventory_list[i].tval == TV_NATURE_BOOK) && (p_ptr->inventory_list[i].sval == 2)) have_sw = TRUE;
3874- if ((p_ptr->inventory_list[i].tval == TV_CRAFT_BOOK) && (p_ptr->inventory_list[i].sval == 2)) have_kabe = TRUE;
3874+ if ((creature_ptr->inventory_list[i].tval == TV_NATURE_BOOK) && (creature_ptr->inventory_list[i].sval == 2)) have_sw = TRUE;
3875+ if ((creature_ptr->inventory_list[i].tval == TV_CRAFT_BOOK) && (creature_ptr->inventory_list[i].sval == 2)) have_kabe = TRUE;
38753876 }
38763877
3877- for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
3878+ for (this_o_idx = current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
38783879 {
38793880 o_ptr = &current_floor_ptr->o_list[this_o_idx];
38803881 next_o_idx = o_ptr->next_o_idx;
@@ -3887,30 +3888,30 @@ void calc_bonuses(void)
38873888 if ((o_ptr->tval == TV_CRAFT_BOOK) && (o_ptr->sval == 2)) have_kabe = TRUE;
38883889 }
38893890
3890- if (p_ptr->pass_wall && !p_ptr->kill_wall) p_ptr->no_flowed = TRUE;
3891+ if (creature_ptr->pass_wall && !creature_ptr->kill_wall) creature_ptr->no_flowed = TRUE;
38913892 #if 0
3892- if (have_dd_s && ((p_ptr->realm1 == REALM_SORCERY) || (p_ptr->realm2 == REALM_SORCERY) || (p_ptr->pclass == CLASS_SORCERER)))
3893+ if (have_dd_s && ((creature_ptr->realm1 == REALM_SORCERY) || (creature_ptr->realm2 == REALM_SORCERY) || (creature_ptr->pclass == CLASS_SORCERER)))
38933894 {
38943895 const magic_type *s_ptr = &mp_ptr->info[REALM_SORCERY - 1][SPELL_DD_S];
3895- if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
3896+ if (creature_ptr->lev >= s_ptr->slevel) creature_ptr->no_flowed = TRUE;
38963897 }
38973898
3898- if (have_dd_t && ((p_ptr->realm1 == REALM_TRUMP) || (p_ptr->realm2 == REALM_TRUMP) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE)))
3899+ if (have_dd_t && ((creature_ptr->realm1 == REALM_TRUMP) || (creature_ptr->realm2 == REALM_TRUMP) || (creature_ptr->pclass == CLASS_SORCERER) || (creature_ptr->pclass == CLASS_RED_MAGE)))
38993900 {
39003901 const magic_type *s_ptr = &mp_ptr->info[REALM_TRUMP - 1][SPELL_DD_T];
3901- if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
3902+ if (creature_ptr->lev >= s_ptr->slevel) creature_ptr->no_flowed = TRUE;
39023903 }
39033904 #endif
3904- if (have_sw && ((p_ptr->realm1 == REALM_NATURE) || (p_ptr->realm2 == REALM_NATURE) || (p_ptr->pclass == CLASS_SORCERER)))
3905+ if (have_sw && ((creature_ptr->realm1 == REALM_NATURE) || (creature_ptr->realm2 == REALM_NATURE) || (creature_ptr->pclass == CLASS_SORCERER)))
39053906 {
39063907 const magic_type *s_ptr = &mp_ptr->info[REALM_NATURE - 1][SPELL_SW];
3907- if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
3908+ if (creature_ptr->lev >= s_ptr->slevel) creature_ptr->no_flowed = TRUE;
39083909 }
39093910
3910- if (have_kabe && ((p_ptr->realm1 == REALM_CRAFT) || (p_ptr->realm2 == REALM_CRAFT) || (p_ptr->pclass == CLASS_SORCERER)))
3911+ if (have_kabe && ((creature_ptr->realm1 == REALM_CRAFT) || (creature_ptr->realm2 == REALM_CRAFT) || (creature_ptr->pclass == CLASS_SORCERER)))
39113912 {
39123913 const magic_type *s_ptr = &mp_ptr->info[REALM_CRAFT - 1][SPELL_KABE];
3913- if (p_ptr->lev >= s_ptr->slevel) p_ptr->no_flowed = TRUE;
3914+ if (creature_ptr->lev >= s_ptr->slevel) creature_ptr->no_flowed = TRUE;
39143915 }
39153916 }
39163917
@@ -5008,7 +5009,7 @@ void update_creature(player_type *creature_ptr)
50085009 {
50095010 creature_ptr->update &= ~(PU_BONUS);
50105011 calc_alignment();
5011- calc_bonuses();
5012+ calc_bonuses(creature_ptr);
50125013 }
50135014
50145015 if (creature_ptr->update & (PU_TORCH))
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -731,7 +731,7 @@ extern int riding_exp_level(int riding_exp);
731731 extern int spell_exp_level(int spell_exp);
732732
733733 extern s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
734-extern void calc_bonuses(void);
734+extern void calc_bonuses(player_type *creature_ptr);
735735 extern WEIGHT weight_limit(player_type *creature_ptr);
736736 extern bool has_melee_weapon(player_type *creature_ptr, int i);
737737 extern bool is_heavy_shoot(player_type *creature_ptr, object_type *o_ptr);
Show on old repository browser