Instead, the amount is 2 + random2(quantity - 1), so ranging anywhere from 2 to the entire stack.
Yes, I know this is probably highly controversial, but I've thought about it some, and I think that this will actually change little for most characters: You still won't take large stacks of valuable potions into the Tomb since even if only part of the stack is destroyed it's a huge loss. On the other hand, this is easier on newbies who had no idea this could happen, and makes it a bit more harder for Transmuters to turn their twenty-something potions of water into decay.
I also added a message ("Your potions of xyz decay.") if you know the decay type. Otherwise the message is suppressed, so as to replicate the current situation of "Hey, what's this? When did I pick up those? (q)uaff…" For consistency, I also added a message when stuff is cursed, or rather I merged all those "Your foo glows black" messages into do_curse_stuff() that now takes a parameter "quiet" to control whether it's printed ot not.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4438 c06c8d41-db1a-0410-9941-cceddc491573
5FBOE2QNRLKUNOP54CZD6LFAMM7LX6NNLHJRJHRDDIUTQ7J723DQC QYUAYEGK7WPBJLZRSWZVDWD5SMNAWWIJSQPWYA7BEYXMEBD2SDKAC SRQJVKQVUY7QGCEBA2VQTWEJ7ADIUSY7L46HJQSQNM5DXYRRH5KAC LCVUTR5N23C2AE3EXJUDTYQVURXN6XXGGOYR4ALIVRIUBTVLN5PAC Q3XHNSHW6FI4JCXSEABATRFBJPMCF7PXNG2K6ZQTRRPVMIZFHUBQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC EB33TUEEJFHMEO6YHEXSYX3MBXHNPEFNMZL2VA75GOGKY6POSF2AC CZCG4FOXPQXXUCGKK4W2IHUJK2PXUZJ22IAA6UIZ2EU7WX7VLOBQC U6OTXM3JN7SGPVIGQ5F6NR2I7J5V7KOWFQ7AVNNRQQDNLBEDMYFQC 5B5DP5S6A6LQMKZYVLQAEMHQZWFWYDHPCKQGRNSCNNYIBQYZ6BIQC XUCCWGMXKPIR34BBCCOI67YHI3RST4STDWSDUZTN4B2CJWXQLQ7AC M2HMYLYYXSP5XGX6MCI77IT6UW5K4YSEUJWHPQPYXVSW5L36BJ2AC 7MXX53FZ5VFNAFDQN5WPPYF2MPKL5B3H3TINRKCFV2P6QZ2APVGQC 5BJPWUPLJFS34FUTFJVKA4A52YMIGV6EWDXLNSDCWBJWBGVSQFGQC C5VA63WAQRWPENIMXRPUPZLZJMC77PL2B3A77HYFWDCZU5QDG7VQC QCUMH3C7GXV7ZW444WT5SFAXQOJKJSE2YCQCEHMRYXCWF4QI7UMAC NO2HRD7RZS42S55UG4FQ5EFQDY6WYWKGIXHUKYLWF36HHE3VZ7WAC 25CH7HH4LKXFIZ75YNMXS3TSXO6O27DYSOPLOD45K4OCNFWLS4LQC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC BDFIS53HAIHOCXQ5BE7WCO2MEOFCUQPFY4JGUWVLWY6JO3IFMEKQC 34RCM6RXIWHZMYXNGFQKLKQIAJ6QISIQ3D5HMK4HZNLVX66BSUBAC 4DEFHDNO2GUBYL4EGYEAR2IP3KBDXRU7UL7L4P7HEZY2UNR6IYJAC CIPVRZGLOZHCERK6YPOBV3P2E4IAB4H6D5EHLRQE2O5E4P4VCBUAC SHSIZVHSB4RPTLGMFJXUDVHF3FTEZZYCRIH4CBZP4MXOBR3HC4QAC 22RFWMSJGG26Z2MQEEXGKVTFSTLREHQIG46WYOTMDRKI5YVMRNVAC LKLHWERPXMDTRNYPEXVDVB6PE7CT5PZ6WMNJJDTBBE5FBHOCEK5AC O4DT3BQQ3XYPL6PQ72G6VPBAVHXZMEOLONFXNHXFMBXBVOYMB6VQC O6ZMFKDI3XO2SWPNEYHIPYFDWJR4TVDP5BAATK6LVCVETQID6E7AC NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC // Potions of blood are vital to vampires, so make an exception for// for them. (Come to think of it, this would work nicely for all// other potion types as well.)if (you.inv[item].sub_type == POT_BLOOD|| you.inv[item].sub_type == POT_BLOOD_COAGULATED){int amount = random2(you.inv[item].quantity) + 1;split_blood_potions_into_decay(item, amount);
int amount;// decay at least two of the stackif (you.inv[item].quantity <= 2)amount = you.inv[item].quantity;elseamount = 2 + random2(you.inv[item].quantity - 1);
// Xom is amused if this happens to thirsty vampiresif (you.species == SP_VAMPIRE && you.hunger_state <= HS_HUNGRY)xom_is_stimulated(32 * amount);}else{// Xom is amused by useful potions being ruined.if (item_value(you.inv[item], true) / you.inv[item].quantity > 2)xom_is_stimulated(32 * you.inv[item].quantity);
split_potions_into_decay(item, amount);
{if (curse_an_item(true))mpr("You feel nervous for a moment...", MSGCH_MONSTER_SPELL);}
curse_an_item(true);
static void _coagulating_blood_message(item_def &blood, int num_coagulated)
// Prints messages for blood potions coagulating in inventory (coagulate = true)// or whenever potions are cursed into potions of decay (coagulate = false).static void _potion_stack_changed_message(item_def &potion, int num_changed,bool coagulate = true)
// A variation of the mummy curse: for potions of blood (vital for Vampires!)// split the stack and only turn part of it into POT_DECAY.void split_blood_potions_into_decay( int obj, int amount )
// A variation of the mummy curse:// instead of trashing the entire stack, split the stack and only turn part// of it into POT_DECAY.void split_potions_into_decay( int obj, int amount, bool need_msg )
// We're being nice here, and only decay the *oldest* potions.for (int i = 0; i < amount; i++)remove_oldest_blood_potion(potion);
// just in caseyou.wield_change = true;you.redraw_quiver = true;if (potion.sub_type == POT_BLOOD || potion.sub_type == POT_BLOOD_COAGULATED){// We're being nice here, and only decay the *oldest* potions.for (int i = 0; i < amount; i++)remove_oldest_blood_potion(potion);}
switch (random2(4)){case 0:potion2.colour = RED;break;case 1:potion2.colour = BROWN;break;case 2:potion2.colour = GREEN;break;case 3:potion2.colour = LIGHTRED;break;}
potion2.colour = potion.colour;
if (notes_are_active() && !(item.flags & ISFLAG_NOTED_ID) &&fully_identified(item) && is_interesting_item(item))
if (notes_are_active() && !(item.flags & ISFLAG_NOTED_ID)&& fully_identified(item) && is_interesting_item(item))
item_def& item = you.inv[you.equip[affected]];mprf("%s glows black for a moment.",item.name(DESC_CAP_YOUR).c_str());do_curse_item( item );
do_curse_item( you.inv[you.equip[affected]], false );