What does orc/elf/human skeleton do?
Beside being creepy, does this thing have any real use?
Beside being creepy, does this thing have any real use?
/* * Acid has hit the player, attempt to affect some armor. */ static int damage_armour(void) { object_type *o_ptr = NULL; u32b f1, f2, f3; char o_name[80]; int item = INVEN_BODY; // a default value to soothe compilation warnings /* Pick a (possibly empty) inventory slot */ switch (dieroll(6)) { case 1: item = INVEN_BODY; break; case 2: item = INVEN_ARM; break; case 3: item = INVEN_OUTER; break; case 4: item = INVEN_HANDS; break; case 5: item = INVEN_HEAD; break; case 6: item = INVEN_FEET; break; } o_ptr = &inventory[item]; [COLOR="Red"] /* Nothing to damage */ if (!o_ptr->k_idx || ((item == INVEN_ARM) && (o_ptr->tval != TV_SHIELD))) return (FALSE); [/COLOR] /* Extract the flags */ object_flags(o_ptr, &f1, &f2, &f3); /* Describe */ object_desc(o_name, sizeof(o_name), o_ptr, FALSE, 0); /* Object resists */ if (f3 & (TR3_IGNORE_ACID)) { msg_format("Your %s is unaffected!", o_name); return (TRUE); } /* No damage left to be done */ if ((o_ptr->ps <= 0) && (o_ptr->evn <= 0)) { /* Destroy the item */ inven_item_increase(item, -1); inven_item_optimize(item); /* Message */ msg_format("Your %s is destroyed!", o_name); } else if (o_ptr->evn >= 0) { /* Damage the item */ o_ptr->evn--; /* Message */ msg_format("Your %s is damaged!", o_name); } else { /* Damage the item */ o_ptr->ps--; /* Message */ msg_format("Your %s is damaged!", o_name); } /* Calculate bonuses */ p_ptr->update |= (PU_BONUS); /* Window stuff */ p_ptr->window |= (PW_EQUIP | PW_PLAYER_0); /* Item was damaged */ return (TRUE); } /* * Hurt the player with Acid */ void acid_dam(int dam, cptr kb_str) { int inv = (dam < 10) ? 1 : (dam < 20) ? 2 : 3; /* Abort if no damage to receive */ if (dam <= 0) return; [COLOR="Red"] /* Damage armour */ damage_armour(); /* Take damage */ take_hit(dam, kb_str); [/COLOR] /* Inventory damage */ inven_damage(set_acid_destroy, inv, 1); }
Comment