break;
case PO_SCR_FIRE:
print_msg("The scroll explodes in flames!\n");
- if (u.ring != -1)
+ if (u.resistances[DT_FIRE])
{
if (objects[u.ring].obj_id == PO_RING_FIRE)
{
break;
}
}
- i = damage_u(dice(4, 10), DEATH_KILLED, "searing flames");
- if (!i)
+ else
{
- print_msg("That hurt!\n");
+ i = damage_u(dice(4, 10), DEATH_KILLED, "searing flames");
+ if (!i)
+ {
+ print_msg("That hurt!\n");
+ }
}
for (i = 0; i < MONSTERS_IN_PLAY; ++i)
{
if (mon_visible(i))
{
+ if (!pmon_resists_fire(monsters[i].mon_id))
+ {
+ print_mon_name(i, 3);
+ print_msg(" is burned.\n");
+ damage_mon(i, dice(4, 10), 1);
+ }
}
}
break;
print_msg("Error: attempt to eat non-food (%d)!\n", optr->obj_id);
return -1;
}
- if (u.food < 0)
+ if (optr->obj_id == PO_DEVIL_SPLEEN)
+ {
+ print_msg("Vile power suffuses your body as you devour the devil\nspleen.\n");
+ if (zero_die(2))
+ {
+ gain_body(1, 1);
+ }
+ else
+ {
+ gain_agility(1, 1);
+ }
+ }
+ else if (u.food < 0)
{
print_msg("You ravenously devour your food!\n");
}
gain_agility(1, 1);
break;
case PO_POT_HEAL:
- /* Heal player; if hit points brought to max, gain one
- * hit point. */
- heal_u(dice(3, 12), 1, 1);
+ {
+ int healpercent = inclusive_flat(30, 50);
+ int healamount = (healpercent * ((u.hpmax > 60) ? u.hpmax : 60)) / 100;
+ heal_u(healamount, 1, 1);
+ }
break;
case PO_POT_RESTORATION:
print_msg("This potion makes you feel warm all over.\n");
else
{
objects[obj].durability--;
+ if (objects[obj].durability == 0)
+ {
+ switch (objects[obj].obj_id)
+ {
+ case PO_RIBBONS:
+ if (u.food < 500)
+ {
+ int shortfall = (u.food < 0) ? 500 : 500 - u.food;
+ int damage = (shortfall + 24) / 25;
+ u.food = (u.food < 0) ? u.food : 0;
+ print_msg("Blood trickles from your nose as the ribbons drain your\nstrength repair themselves.\n");
+ damage_u(damage, DEATH_RIBBONS, "");
+ }
+ else
+ {
+ print_msg("You gasp as the ribbons drain your strength to repair\nthemselves.\n");
+ u.food -= 500;
+ }
+ break;
+
+ case PO_TORMENTORS_LASH:
+ if (u.food < 500)
+ {
+ int shortfall = (u.food < 0) ? 500 : 500 - u.food;
+ int damage = (shortfall + 24) / 25;
+ u.food = (u.food < 0) ? u.food : 0;
+ print_msg("Pain explodes through your arm as the lash resotres\nitself!\n");
+ damage_u(damage, DEATH_LASH, "");
+ }
+ else
+ {
+ print_msg("A pins-and-needles sensation washes over you as the lash\nrestores itself.\n");
+ u.food -= 500;
+ }
+ break;
+ }
+ }
}
}
case PO_LEATHER_ARMOUR:
case PO_DRAGON_ARMOUR:
+ case PO_BATTLE_BALLGOWN:
return 10;
case PO_CHAINMAIL:
return 0;
case PO_ROBE_SHADOWS:
+ case PO_RIBBONS:
return -15; /* This is a bonus. */
default:
}
}
+int magic_ring(void)
+{
+ struct obj *optr = objects + u.ring;
+ switch (optr->obj_id)
+ {
+ case PO_RING_TELEPORT:
+ if (u.food >= 50)
+ {
+ u.food -= 50;
+ print_msg("You activate your ring's power of teleportation.\n");
+ teleport_u();
+ return 1;
+ }
+ return 0;
+ default:
+ print_msg("Your current ring has no activatable power.\n");
+ return 0;
+ }
+}
+
+int emanate_armour(void)
+{
+ struct obj *optr = objects + u.armour;
+ switch (optr->obj_id)
+ {
+ case PO_RIBBONS:
+ if (optr->durability < OBJ_MAX_DUR)
+ {
+ if (u.food < 5 * (OBJ_MAX_DUR - optr->durability))
+ {
+ print_msg("You are too hungry to willingly let the ribbons draw on\nyour strength.\n");
+ return 0;
+ }
+ else
+ {
+ print_msg("You gasp as the ribbons draw on your strength to\nrepair themselves.\n");
+ u.food -= 5 * (OBJ_MAX_DUR - optr->durability);
+ optr->durability = OBJ_MAX_DUR;
+ return 1;
+ }
+ }
+ return 1;
+ default:
+ print_msg("Your current attire has no activatable powers.\n");
+ break;
+ }
+ return 0;
+}
+
+int zap_weapon(void)
+{
+ struct obj *optr = objects + u.weapon;
+ switch (optr->obj_id)
+ {
+ case PO_STAFF_OF_FIRE:
+ if (u.food > 150)
+ {
+ int y, x;
+ u.food -= 150;
+ print_msg("You unleash the fiery powers of your staff!\n");
+ for (y = u.y - 1; y <= u.y + 1; ++y)
+ {
+ if ((y < 0) || (y >= DUN_HEIGHT))
+ {
+ continue;
+ }
+ for (x = u.x - 1; x <= u.x + 1; ++x)
+ {
+ if ((x < 0) || (x >= DUN_WIDTH))
+ {
+ continue;
+ }
+ if (mapmonster[y][x] != -1)
+ {
+ struct mon *mptr = monsters + mapmonster[y][x];
+ if (!pmon_resists_fire(mptr->mon_id))
+ {
+ print_mon_name(mapmonster[y][x], 3);
+ print_msg(" is engulfed in roaring flames.\n");
+ damage_mon(mapmonster[y][x], dice(4, 10), 1);
+ }
+ }
+ }
+ }
+ damage_obj(u.weapon);
+ }
+ default:
+ print_msg("Your current weapon has no activatable powers.\n");
+ return 0;
+ }
+}
+
/* objects.c */
#include "cavechop.h"
struct permobj permobjs[NUM_OF_PERMOBJS] = {
- [PO_DAGGER] =
- {
- "dagger", "daggers", "A long knife, designed for stabbing.", POCLASS_WEAPON, 25, ')', 4, 1, 1
- },
- [PO_LONG_SWORD] =
- {
- "long sword", "long swords", "A steel sword of simple but sturdy construction; the\nblade is three feet long.", POCLASS_WEAPON, 30, ')', 10, 1, 4
- },
- [PO_MACE] =
- {
- "mace", "maces", "A flanged lump of iron on an iron haft.", POCLASS_WEAPON, 30, ')', 7, 1, 2
- },
- [PO_RUNESWORD] =
- {
- "runesword", "runeswords", "An eerily glowing sword engraved with many strange\nrunes.", POCLASS_WEAPON, 80, ')', 20, 1, 12
- },
- [PO_BOW] =
- {
- "bow", "bows", "A recurve composite bow.", POCLASS_WEAPON, 45, '(', 8, 1, 1
- },
- [PO_CROSSBOW] =
- {
- "crossbow", "crossbows", "A crossbow.", POCLASS_WEAPON, 70, '(', 16, 1, 6
- },
- [PO_POT_HEAL] =
- {
- "healing potion", "healing potions", "This magic elixir restores some lost hit points.", POCLASS_POTION, 10, '!', 0, 1, 1
- },
- [PO_POT_BODY] =
- {
- "body potion", "body potions", "This magic elixir will improve your physique.", POCLASS_POTION, 70, '!', 0, 1, 5
- },
- [PO_POT_AGILITY] =
- {
- "agility potion", "agility potions", "This magic elixir will sharpen your reflexes.", POCLASS_POTION, 70, '!', 0, 1, 5
- },
- [PO_POT_RESTORATION] =
- {
- "restoration potion", "restoration potions", "This magic elixir cures temporary damage to one's\nabilities.", POCLASS_POTION, 70, '!', 0, 1, 1
- },
- [PO_FLASK_POISON] =
- {
- "poison flask", "poison flask", "This fragile bottle is full of contact poison.", POCLASS_FLASK, 10, '~', 0, 1, 1
- },
- [PO_FLASK_FIRE] =
- {
- "fire flask", "fire flasks", "The volatile, phosphorus-laced liquid in this sealed\nflask will ignite spontaneously when exposed to the air.", POCLASS_FLASK, 40, '~', 0, 1, 20
- },
- [PO_FLASK_WEAKNESS] =
- {
- "weakness flask", "weakness flasks", "Dousing the living in this vile liquid causes immediate\nand severe physical degeneration.", POCLASS_FLASK, 40, '~', 0, 1, 20
- },
- [PO_SCR_TELEPORT] =
- {
- "teleport scroll", "teleport scrolls", "Reading this scroll will teleport you to a random\nlocation.", POCLASS_SCROLL, 40, '?', 0, 1, 1
- },
- [PO_SCR_FIRE] =
- {
- "fire scroll", "fire scrolls", "Reading this scroll will engulf all nearby creatures\n(including you) in flames.", POCLASS_SCROLL, 30, '?', 0, 1, 1
- },
- [PO_SCR_PROTECTION] =
- {
- "protection scroll", "protection scrolls", "Reading this scroll will dispel any curses afflicting\nyou and protect you from curses for a time.", POCLASS_SCROLL, 80, '?', 0, 1, 8
- },
- [PO_LEATHER_ARMOUR] =
- {
- "leather armour", "suits of leather armour", "A heavy leather jerkin and breeches, providing some\nprotection.", POCLASS_ARMOUR, 25, '[', 3, 1, 1
- },
- [PO_CHAINMAIL] =
- {
- "chainmail", "suits of chainmail", "A suit of interlocking metal rings, providing better\nprotection than leather.", POCLASS_ARMOUR, 30, '[', 6, 1, 3
- },
- [PO_PLATE_ARMOUR] =
- {
- "plate armour", "suits of plate armour", "A suit of steel plates, providing better protection than\nchainmail.", POCLASS_ARMOUR, 40, '[', 10, 1, 6
- },
- [PO_MAGE_ARMOUR] =
- {
- "mage armour", "suits of mage armour", "A suit of glowing steel plates bearing enchantments of\ndefence.", POCLASS_ARMOUR, 70, '[', 15, 1, 12
- },
- [PO_ROBE] =
- {
- "mundane robe", "mundane robes", "A simple woolen robe. It's better protection than your\nskin, but not by much.", POCLASS_ARMOUR, 50, '[', 2, 1, 1
- },
- [PO_ROBE_SWIFTNESS] =
- {
- "robe of swiftness", "robes of swiftness", "A simple woolen robe that bears a potent enchantment,\nprotecting the wearer and making him unnaturally swift.", POCLASS_ARMOUR, 70, '[', 8, 1, 8
- },
- [PO_ROBE_SHADOWS] =
- {
- "robe of shadows", "robes of shadows", "A simple woolen robe that bears an awesome enchantment,\nprotecting the wearer better than steel plate.", POCLASS_ARMOUR, 90, '[', 14, 1, 18
- },
- [PO_DRAGON_ARMOUR] =
- {
- "dragonhide armour", "suits of dragonhide armour", "The skin of a dragon, formed into a jerkin and breeches;\nit turns blows like steel plate and turns away\nflames.", POCLASS_ARMOUR, 90, '[', 12, 1, 21
- },
- [PO_METEOR_ARMOUR] =
- {
- "meteoric plate armour", "suits of meteoric plate armour", "This plate armour has been forged out of metal taken from\na fallen star.", POCLASS_ARMOUR, 90, '[', 18, 1, 27
- },
- [PO_SACRED_MAIL] =
- {
- "sacred chainmail", "suits of sacred chainmail", "This suit of interlocking rings has been consecrated to\nthe gods of the Light.", POCLASS_ARMOUR, 90, '[', 15, 1, 24
- },
- [PO_BATTLE_BALLGOWN] =
- {
- "battle ballgown", "battle ballgowns", "This armoured dress is a beloved heirloom of\nyour house.", POCLASS_ARMOUR, 100, '[', 3, 1, 1
- },
- [PO_RIBBONS] =
- {
- "set of ribbons", "sets of ribbons", "These ribbons, arranged as if to form an alleged\ngarment, make your fingers tingle with magic.", POCLASS_ARMOUR, 90, '[', 15, 1, 27
- },
- [PO_RING_REGEN] =
- {
- "regeneration ring", "regeneration rings", "This magical ring increases the wearer's healing rate,\nbut also increases the rate at which they must consume\nfood.", POCLASS_RING, 70, '=', 0, 1, 1
- },
- [PO_RING_FIRE] =
- {
- "fire ring", "fire rings", "This magical ring protects the wearer from mundane and\nmagical fire, and imbues their blows in combat with the\npower of fire.", POCLASS_RING, 50, '=', 0, 1, 1
- },
- [PO_RING_VAMPIRE] =
- {
- "vampire ring", "vampire rings", "This magical ring protects the wearer from necromantic\nenergies, and imbues their blows in combat with such\nenergies as well.", POCLASS_RING, 90, '=', 0, 1, 12
- },
- [PO_RING_FROST] =
- {
- "frost ring", "frost rings", "This magical ring protects the wearer from mundane and\nmagical cold, and imbues their blows in combat with the\npower of cold.", POCLASS_RING, 40, '=', 0, 1, 1
- },
- [PO_RING_TELEPORT] =
- {
- "teleport ring", "teleport rings", "This magical ring allows the wearer to teleport for a\nmodest cost in nutrition.", POCLASS_RING, 70, '=', 0, 1, 1
- },
- [PO_IRON_RATION] =
- {
- "iron ration", "iron rations", "A parcel of hardtack and beef jerky. Dull but nutritious.", POCLASS_FOOD, 75, '%', 0, 1, 1
- },
- [PO_DRIED_FRUIT] =
- {
- "parcel of dried fruit", "parcels of dried fruit", "A parcel of mixed dried fruit. It sure beats hardtack\nand beef jerky.", POCLASS_FOOD, 75, '%', 0, 1, 1
- },
- [PO_ELVEN_BREAD] =
- {
- "round of elven waybread", "rounds of elven waybread", "A tasty, filling, nutritious piece of elven waybread.", POCLASS_FOOD, 85, '%', 0, 1, 1
- }
+ [PO_DAGGER] =
+ {
+ "dagger", "daggers", "A long knife, designed for stabbing.", POCLASS_WEAPON, 25, ')', 4, 1, 1
+ },
+ [PO_LONG_SWORD] =
+ {
+ "long sword", "long swords", "A steel sword of simple but sturdy construction; the\nblade is three feet long.", POCLASS_WEAPON, 30, ')', 10, 1, 4
+ },
+ [PO_MACE] =
+ {
+ "mace", "maces", "A flanged lump of iron on an iron haft.", POCLASS_WEAPON, 30, ')', 7, 1, 2
+ },
+ [PO_RUNESWORD] =
+ {
+ "runesword", "runeswords", "An eerily glowing sword engraved with many strange\nrunes.", POCLASS_WEAPON, 80, ')', 20, 1, 12
+ },
+ [PO_BOW] =
+ {
+ "bow", "bows", "A recurve composite bow.", POCLASS_WEAPON, 45, '(', 8, 1, 1
+ },
+ [PO_CROSSBOW] =
+ {
+ "crossbow", "crossbows", "A crossbow.", POCLASS_WEAPON, 70, '(', 16, 1, 6
+ },
+ [PO_TORMENTORS_LASH] =
+ {
+ "tormentor's lash", "tormentor's lash", "A bone-handled whip that crackles with malefic energies.", POCLASS_WEAPON, 80, ')', 20, 1, 30
+ },
+ [PO_STAFF_OF_FIRE] =
+ {
+ "staff of fire", "staff of fire", "A jet-black staff with a glowing ruby in its headpiece.", POCLASS_WEAPON, 80, ')', 10, 1, 20
+ },
+ [PO_POT_HEAL] =
+ {
+ "healing potion", "healing potions", "This magic elixir restores some lost hit points.", POCLASS_POTION, 10, '!', 0, 1, 1
+ },
+ [PO_POT_BODY] =
+ {
+ "body potion", "body potions", "This magic elixir will improve your physique.", POCLASS_POTION, 70, '!', 0, 1, 5
+ },
+ [PO_POT_AGILITY] =
+ {
+ "agility potion", "agility potions", "This magic elixir will sharpen your reflexes.", POCLASS_POTION, 70, '!', 0, 1, 5
+ },
+ [PO_POT_RESTORATION] =
+ {
+ "restoration potion", "restoration potions", "This magic elixir cures temporary damage to one's\nabilities.", POCLASS_POTION, 70, '!', 0, 1, 1
+ },
+ [PO_FLASK_POISON] =
+ {
+ "poison flask", "poison flask", "This fragile bottle is full of contact poison.", POCLASS_FLASK, 10, '~', 0, 1, 1
+ },
+ [PO_FLASK_FIRE] =
+ {
+ "fire flask", "fire flasks", "The volatile, phosphorus-laced liquid in this sealed\nflask will ignite spontaneously when exposed to the air.", POCLASS_FLASK, 40, '~', 0, 1, 20
+ },
+ [PO_FLASK_WEAKNESS] =
+ {
+ "weakness flask", "weakness flasks", "Dousing the living in this vile liquid causes immediate\nand severe physical degeneration.", POCLASS_FLASK, 40, '~', 0, 1, 20
+ },
+ [PO_SCR_TELEPORT] =
+ {
+ "teleport scroll", "teleport scrolls", "Reading this scroll will teleport you to a random\nlocation.", POCLASS_SCROLL, 40, '?', 0, 1, 1
+ },
+ [PO_SCR_FIRE] =
+ {
+ "fire scroll", "fire scrolls", "Reading this scroll will engulf all nearby creatures\n(including you) in flames.", POCLASS_SCROLL, 30, '?', 0, 1, 1
+ },
+ [PO_SCR_PROTECTION] =
+ {
+ "protection scroll", "protection scrolls", "Reading this scroll will dispel any curses afflicting\nyou and protect you from curses for a time.", POCLASS_SCROLL, 80, '?', 0, 1, 8
+ },
+ [PO_LEATHER_ARMOUR] =
+ {
+ "leather armour", "suits of leather armour", "A heavy leather jerkin and breeches, providing some\nprotection.", POCLASS_ARMOUR, 25, '[', 3, 1, 1
+ },
+ [PO_CHAINMAIL] =
+ {
+ "chainmail", "suits of chainmail", "A suit of interlocking metal rings, providing better\nprotection than leather.", POCLASS_ARMOUR, 30, '[', 6, 1, 3
+ },
+ [PO_PLATE_ARMOUR] =
+ {
+ "plate armour", "suits of plate armour", "A suit of steel plates, providing better protection than\nchainmail.", POCLASS_ARMOUR, 40, '[', 10, 1, 6
+ },
+ [PO_MAGE_ARMOUR] =
+ {
+ "mage armour", "suits of mage armour", "A suit of glowing steel plates bearing enchantments of\ndefence.", POCLASS_ARMOUR, 70, '[', 15, 1, 12
+ },
+ [PO_ROBE] =
+ {
+ "mundane robe", "mundane robes", "A simple woolen robe. It's better protection than your\nskin, but not by much.", POCLASS_ARMOUR, 50, '[', 2, 1, 1
+ },
+ [PO_ROBE_SWIFTNESS] =
+ {
+ "robe of swiftness", "robes of swiftness", "A simple woolen robe that bears a potent enchantment,\nprotecting the wearer and making him unnaturally swift.", POCLASS_ARMOUR, 70, '[', 8, 1, 8
+ },
+ [PO_ROBE_SHADOWS] =
+ {
+ "robe of shadows", "robes of shadows", "A simple woolen robe that bears an awesome enchantment,\nprotecting the wearer better than steel plate.", POCLASS_ARMOUR, 90, '[', 14, 1, 18
+ },
+ [PO_DRAGON_ARMOUR] =
+ {
+ "dragonhide armour", "suits of dragonhide armour", "The skin of a dragon, formed into a jerkin and breeches;\nit turns blows like steel plate and turns away\nflames.", POCLASS_ARMOUR, 90, '[', 12, 1, 21
+ },
+ [PO_METEOR_ARMOUR] =
+ {
+ "meteoric plate armour", "suits of meteoric plate armour", "This plate armour has been forged out of metal taken from\na fallen star.", POCLASS_ARMOUR, 90, '[', 18, 1, 27
+ },
+ [PO_SACRED_MAIL] =
+ {
+ "sacred chainmail", "suits of sacred chainmail", "This suit of interlocking rings has been consecrated to\nthe gods of the Light.", POCLASS_ARMOUR, 90, '[', 15, 1, 24
+ },
+ [PO_BATTLE_BALLGOWN] =
+ {
+ "battle ballgown", "battle ballgowns", "This lightly armoured dress is a beloved heirloom of\nyour house.", POCLASS_ARMOUR, 100, '[', 3, 1, 1
+ },
+ [PO_RIBBONS] =
+ {
+ /* inspired by DoomRL's Necroarmor and my own creepiness. */
+ "set of ribbons", "sets of ribbons", "These ribbons, arranged as if to form an alleged\ngarment, make your fingers tingle with magic.", POCLASS_ARMOUR, 90, '[', 15, 1, 27
+ },
+ [PO_RING_REGEN] =
+ {
+ "regeneration ring", "regeneration rings", "This magical ring increases the wearer's healing rate,\nbut also increases the rate at which they must consume\nfood.", POCLASS_RING, 70, '=', 0, 1, 1
+ },
+ [PO_RING_FIRE] =
+ {
+ "fire ring", "fire rings", "This magical ring protects the wearer from mundane and\nmagical fire, and imbues their blows in combat with the\npower of fire.", POCLASS_RING, 50, '=', 0, 1, 1
+ },
+ [PO_RING_VAMPIRE] =
+ {
+ "vampire ring", "vampire rings", "This magical ring protects the wearer from necromantic\nenergies, and imbues their blows in combat with such\nenergies as well.", POCLASS_RING, 90, '=', 0, 1, 12
+ },
+ [PO_RING_FROST] =
+ {
+ "frost ring", "frost rings", "This magical ring protects the wearer from mundane and\nmagical cold, and imbues their blows in combat with the\npower of cold. Rumour suggests it might also allow walking\non water.\n", POCLASS_RING, 40, '=', 0, 1, 1
+ },
+ [PO_RING_TELEPORT] =
+ {
+ "teleport ring", "teleport rings", "This magical ring allows the wearer to teleport for a\nmodest cost in nutrition.", POCLASS_RING, 70, '=', 0, 1, 1
+ },
+ [PO_IRON_RATION] =
+ {
+ "iron ration", "iron rations", "A parcel of hardtack and beef jerky. Dull but nutritious.", POCLASS_FOOD, 75, '%', 0, 1, 1
+ },
+ [PO_DRIED_FRUIT] =
+ {
+ "parcel of dried fruit", "parcels of dried fruit", "A parcel of mixed dried fruit. It sure beats hardtack\nand beef jerky.", POCLASS_FOOD, 75, '%', 0, 1, 1
+ },
+ [PO_ELVEN_BREAD] =
+ {
+ "round of elven waybread", "rounds of elven waybread", "A tasty, filling, nutritious piece of elven waybread.", POCLASS_FOOD, 85, '%', 0, 1, 1
+ },
+ [PO_DEVIL_SPLEEN] =
+ {
+ "devil spleen", "devil spleens", "A weirdly pulsing organ ripped from the torso of a devil.", POCLASS_FOOD, 100, '%', 0, 1, 1
+ }
};
/* permobj.c */
switch (objects[u.ring].obj_id)
{
case PO_RING_FIRE:
+ print_msg("gaining fire resistance from ring\n");
u.resistances[DT_FIRE] |= RESIST_RING;
break;
case PO_RING_FROST:
if ((u.y + dy < 0) || (u.y + dy >= DUN_HEIGHT) ||
(u.x + dx < 0) || (u.x + dx >= DUN_WIDTH))
{
- print_msg("Attempted move out of bounds.\n");
- return 0; /* No movement. */
+ print_msg("Attempted move out of bounds.\n");
+ return 0; /* No movement. */
}
if (mapmonster[u.y + dy][u.x + dx] != -1)
{
- if (u.weapon != -1)
- {
- if ((objects[u.weapon].obj_id == PO_BOW) ||
- (objects[u.weapon].obj_id == PO_CROSSBOW))
- {
- print_msg("You can't use that weapon in melee!\n");
- return 0;
- }
- }
- return player_attack(dy, dx);
+ if (u.weapon != -1)
+ {
+ if ((objects[u.weapon].obj_id == PO_BOW) ||
+ (objects[u.weapon].obj_id == PO_CROSSBOW))
+ {
+ print_msg("You can't use that weapon in melee!\n");
+ return 0;
+ }
+ }
+ return player_attack(dy, dx);
}
switch (terrain[u.y + dy][u.x + dx])
{
case WALL:
- print_msg("You cannot go there.\n");
- return 0;
+ print_msg("You cannot go there.\n");
+ return 0;
case FLOOR:
case DOOR:
case STAIRS:
- reloc_player(u.y + dy, u.x + dx);
- return 1;
+ reloc_player(u.y + dy, u.x + dx);
+ return 1;
case LAVA:
if (u.resistances[DT_FIRE])
{
+ if (terrain[u.y][u.x] != LAVA)
+ {
+ print_msg("You walk on the lava.\n");
+ }
reloc_player(u.y + dy, u.x + dx);
return 1;
}
return 0;
}
case WATER:
- if (u.ring != -1)
+ if ((u.ring != -1) && (objects[u.ring].obj_id == PO_RING_FROST))
{
- if (objects[u.weapon].obj_id == PO_RING_FROST)
+ if (terrain[u.y][u.x] != WATER)
{
- if (terrain[u.y][u.x] != WATER)
- {
- print_msg("You walk on the water.\n");
- }
- return 1;
- }
- else
- {
- print_msg("The idiot who raised you never taught you to swim.\n");
+ print_msg("You walk on the water.\n");
}
+ reloc_player(u.y + dy, u.x + dx);
+ return 1;
+ }
+ else
+ {
+ print_msg("The idiot who raised you never taught you to swim.\n");
+ return 0;
}
}
return 0;
status_updated = 1;
if (loud)
{
- /* Tell the player how much better he feels. */
+ /* Tell the player how much better they feel. */
if (u.hpcur == u.hpmax)
{
print_msg("You feel great.\n");
{
fp = fopen("cavechop.log", "a");
}
- fprintf(fp, "%s, ", u.name);
print_msg("THOU ART SLAIN!\n");
game_finished = 1;
switch (d)
print_msg("You were killed by %s.\n", what);
if (!wizard_mode)
{
- fprintf(fp, "you were killed by %s.\n", what);
+ fprintf(fp, "%s was killed by %s.\n", u.name, what);
}
break;
case DEATH_KILLED_MON:
print_msg("You were killed by a nasty %s.\n", what);
if (!wizard_mode)
{
- fprintf(fp, "you were killed by a nasty %s.\n", what);
+ fprintf(fp, "%s was killed by a nasty %s.\n", u.name, what);
}
break;
case DEATH_BODY:
print_msg("Your heart was stopped by %s.\n", what);
if (!wizard_mode)
{
- fprintf(fp, "your heart was stopped by %s.\n", what);
+ fprintf(fp, "%s's heart was stopped by %s.\n", u.name, what);
}
break;
case DEATH_AGILITY:
print_msg("Your nerves were destroyed by %s.\n", what);
if (!wizard_mode)
{
- fprintf(fp, "your nerves were destroyed by %s.\n", what);
+ fprintf(fp, "%s's nerves were destroyed by %s.\n", u.name, what);
}
break;
+ case DEATH_LASH:
+ print_msg("You tasted the lash one time too many.\n");
+ if (!wizard_mode)
+ {
+ fprintf(fp, "%s tasted the lash one time too many.\n", u.name);
+ }
+ break;
+ case DEATH_RIBBONS:
+ print_msg("You looked good in ribbons.\n");
+ if (!wizard_mode)
+ {
+ fprintf(fp, "%s looked good in ribbons.\n", u.name);
+ }
+ break;
}
if (!wizard_mode)
{
- fprintf(fp, "You died after %d ticks, with %d XP, on dungeon level %d.\n\n", game_tick, u.experience, depth);
+ fprintf(fp, " %s died after %d ticks, with %d XP, on dungeon level %d.\n\n", u.name, game_tick, u.experience, depth);
fflush(fp);
fclose(fp);
}