Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > ToME

Reply
 
Thread Tools Display Modes
Old March 23, 2021, 06:44   #1
KesTheHammer
Apprentice
 
Join Date: Feb 2021
Posts: 50
KesTheHammer is on a distinguished road
Beastmaster Quests - Can I hack up the corpse?

Do the beastmaster want the entire 500lbs corpse or is he happy if I (h)ack up the corpse and take him some meat?
KesTheHammer is offline   Reply With Quote
Old March 23, 2021, 12:05   #2
Yottle
Apprentice
 
Join Date: Dec 2008
Location: West Virginia
Posts: 51
Yottle is on a distinguished road
A piece of meat is fine. Be careful hacking up corpses, though. Some of them may have bad effects.
Yottle is offline   Reply With Quote
Old March 23, 2021, 21:02   #3
fiery_mews
Scout
 
fiery_mews's Avatar
 
Join Date: Sep 2020
Location: Suburbia :(
Posts: 26
fiery_mews is on a distinguished road
It's usually recommended to eat from the corpse before hacking (since that will provide the necessary resists right off the bat). Though the damage is based on the weight of the corpse, and the cap is very high if there's a cap at all; even with double resist, a Great Hell Wyrm might do a lot of damage.

... I should check this in debug mode.

Edit: yeah okay, double resist is enough, you'll take < 50 HP damage from a Great Hell Wyrm corpse. Single resist OTOH is definitely not enough, my test character took over 600.

Interestingly, eating from the corpse works even for a Great Wyrm of Power corpse, which will otherwise kill you instantly with a blast of (unresistable) raw mana. Funny, I don't remember seeing anything like that in the code...

Last edited by fiery_mews; March 23, 2021 at 21:16.
fiery_mews is offline   Reply With Quote
Old March 24, 2021, 10:18   #4
KesTheHammer
Apprentice
 
Join Date: Feb 2021
Posts: 50
KesTheHammer is on a distinguished road
Thanks for the responses!

I did not even know that eating the meat will do something!

I just wanted to get the corpse preservation and monster lore skills!
KesTheHammer is offline   Reply With Quote
Old March 24, 2021, 12:32   #5
Yottle
Apprentice
 
Join Date: Dec 2008
Location: West Virginia
Posts: 51
Yottle is on a distinguished road
Eating a piece of meat, hacking a corpse, and eating a corpse can all have different effects. Usually eating meat doesn't have the bad effects and can be quite useful.
Yottle is offline   Reply With Quote
Old March 24, 2021, 13:49   #6
fiery_mews
Scout
 
fiery_mews's Avatar
 
Join Date: Sep 2020
Location: Suburbia :(
Posts: 26
fiery_mews is on a distinguished road
Eating a monster's meat has no effects, good or bad. Eating corpses can have good effects, bad effects, or both. In general IIRC it is unwise to eat the remains of anything with necromantic powers, but I'd have to check the code for other stuff.
fiery_mews is offline   Reply With Quote
Old March 24, 2021, 14:17   #7
fiery_mews
Scout
 
fiery_mews's Avatar
 
Join Date: Sep 2020
Location: Suburbia :(
Posts: 26
fiery_mews is on a distinguished road
So... extensive spoilers follow...

I think the main function we want is this

Code:
/*
 * Determine the effects of eating a corpse. A corpse can be
 * eaten whole or cut into pieces for later.
 */
static void corpse_effect(object_type *o_ptr, bool cutting)
in cmd6.cc (for ToME 2.4, the C++ port).

Code:
	/* Immediate effects - poison, acid, fire, etc. */
	if (!cutting)
	{
		for (i = 0; i < 4; i++)
		{
			/* skip empty blow slot */
			if (!r_ptr->blow[i].method) continue;

			method = r_ptr->blow[i].method;
			effect = r_ptr->blow[i].effect;
			d_dice = r_ptr->blow[i].d_dice;
			d_side = r_ptr->blow[i].d_side;
			dam = damroll(d_dice, d_side) * o_ptr->pval / o_ptr->weight / 2;
			idam = damroll(d_dice, d_side) *
			       ((o_ptr->weight / o_ptr->pval > 2) ?
			        o_ptr->weight / o_ptr->pval : 2);
			mdam = maxroll(d_dice, d_side) * 2;
So this is for elemental and poison damage based on monster's melee attacks. IDK what determines pval in this case, or what it indicates. Dam dice and sides are gotten from the monster's physical attack power when it was alive. Weight seems to reduce the damage, which uh might be a bug? IDK my brain isn't fully working right now.

The TL;DR though is that monsters with elemental melee attacks will damage you with those elements when eaten; ones that cause confusion or hallucination on hit, will cause those statuses when eaten; ones that paralyze or reduce stats, likewise, etc.

Code:
				/* Don't eat Morgoth's corpse :) */
			case RBE_LOSE_ALL:
				{
					do_dec_stat(A_STR, STAT_DEC_NORMAL);
					do_dec_stat(A_INT, STAT_DEC_NORMAL);
					do_dec_stat(A_WIS, STAT_DEC_NORMAL);
					do_dec_stat(A_DEX, STAT_DEC_NORMAL);
					do_dec_stat(A_CON, STAT_DEC_NORMAL);
					do_dec_stat(A_CHR, STAT_DEC_NORMAL);
					o_ptr->pval = 1;

					break;
				}

			case RBE_SANITY:
				{
					msg_print("You feel your sanity slipping away!");
					take_sanity_hit(dam, "eating an insane monster");

					break;
				}
Nice. And anything that drains experience in melee will drain it when eaten too.

Code:
	/*
	 * The organ that supplies breath attacks is not
	 * immediately emptied upon death, although some types
	 * of breath have no effect.
	 * AMHD's make rather risky meals, and deadly snacks.
	 */

	/* Acid */
	if ((r_ptr->spells & SF_BR_ACID) && brpow > 0)
	{
		brdam = ((brpow / 3) > 1600 ? 1600 : (brpow / 3));

		msg_print("You are hit by a gush of acid!");

		/* Total Immunity */
		if (!(p_ptr->immune_acid || (brdam <= 0)))
		{
			/* Take damage */
			acid_dam(brdam, "a gush of acid");
			harmful = true;
		}
		o_ptr->pval = 1;
	}
	else if (r_ptr->spells & SF_BR_ACID)
	{
		set_oppose_acid(p_ptr->oppose_acid + rand_int(10) + 10);
	}
For elemental breathers, hacking hits you with the given element, capped at max elemental breath damage. But eating the corpse directly makes you resistant, and doesn't hit you for damage.

Nether and confusion breathers OTOH don't offer resistance if eaten directly, they just hit you with damage and status effects. Chaos breathers likewise.

Code:
	/* Disenchantment */
	if ((r_ptr->spells & SF_BR_DISE) && brpow > 0)
	{
		brdam = ((brpow / 6) > 500 ? 500 : (brpow / 6));

		msg_print("You are blasted by raw mana!");

		if (p_ptr->resist_disen)
		{
			brdam *= 6;
			brdam /= (randint(6) + 6);
		}
		else
		{
			apply_disenchant(0);
		}

		/* Take damage */
		take_hit(brdam, "raw mana");
		o_ptr->pval = 1;
	}
So that "raw mana" is from disenchantment breathers, and it's not actually raw mana - it's disenchantment damage, and resistance to that will protect you. Plasma breathers will also hit you up for damage and stunning, as in life.

Code:
	/*
	 * Hack -- Jellies, kobolds, spiders, icky things, molds, and mushrooms
	 * are immune to poison because their body already contains
	 * poisonous chemicals.
	 */
	if (strchr("ijkmS,", r_ptr->d_char) && (r_ptr->flags & RF_IM_POIS))
	{
		if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
		{
			set_poisoned(p_ptr->poisoned + rand_int(15) + 10);
		}
		harmful = true;
	}
Kobolds: not edible unless you're also a kobold.

Code:
	/*
	 * Bad effects override good effects
	 * and hacked-up corpses lose intrinsics.
	 */
	if (!harmful && !cutting && (o_ptr->sval != SV_CORPSE_MEAT))
	{
		if (r_ptr->flags & RF_IM_ACID)
		{
			set_oppose_acid(p_ptr->oppose_acid + rand_int(10) + 10);
		}
		if (r_ptr->flags & RF_IM_ELEC)
		{
			set_oppose_elec(p_ptr->oppose_elec + rand_int(10) + 10);
		}
		if (r_ptr->flags & RF_IM_FIRE)
		{
			set_oppose_fire(p_ptr->oppose_fire + rand_int(10) + 10);
		}
		if (r_ptr->flags & RF_IM_COLD)
		{
			set_oppose_cold(p_ptr->oppose_cold + rand_int(10) + 10);
		}
		if (r_ptr->flags & RF_IM_POIS)
		{
			set_oppose_pois(p_ptr->oppose_pois + rand_int(10) + 10);
		}
		if (r_ptr->flags & RF_RES_NETH)
		{
			set_protevil(p_ptr->protevil + rand_int(25) + 3 * r_ptr->level);
		}
		if (r_ptr->flags & RF_RES_PLAS)
		{
			set_oppose_fire(p_ptr->oppose_fire + rand_int(20) + 20);
		}
		if (r_ptr->flags & RF_SHAPECHANGER)
		{
			/* DGDGDG			set_mimic(20 , rand_int(MIMIC_VALAR)); */
		}

		if (r_ptr->flags & RF_DEMON)
		{
			/* DGDGDG			set_mimic(30 , MIMIC_DEMON); */
		}

		if (r_ptr->flags & RF_UNDEAD)
		{
			/* DGDGDG			set_mimic(30 , MIMIC_VAMPIRE); */
		}

		if (r_ptr->flags & RF_NO_FEAR)
		{
			set_afraid(0);
		}
		if (r_ptr->flags & RF_NO_STUN)
		{
			set_stun(0);
		}
		if (r_ptr->flags & RF_NO_CONF)
		{
			set_confused(0);
		}
		if (r_ptr->spells & SF_S_THUNDERLORD)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_THUNDERLORD, false);
		}
		if (r_ptr->spells & SF_S_DEMON)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DEMON, false);
		}
		if (r_ptr->spells & SF_S_KIN)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_KIN, false);
		}
		if (r_ptr->spells & SF_S_HI_DEMON)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_DEMON, false);
		}
		if (r_ptr->spells & SF_S_MONSTER)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, 0, false);
		}
		if (r_ptr->spells & SF_S_MONSTERS)
		{
			int k;
			for (k = 0; k < 8; k++)
			{
				summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, 0, false);
			}
		}
		if (r_ptr->spells & SF_S_UNDEAD)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_UNDEAD, false);
		}
		if (r_ptr->spells & SF_S_DRAGON)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_DRAGON, false);
		}
		if (r_ptr->spells & SF_S_ANT)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_ANT, false);
		}
		if (r_ptr->spells & SF_S_SPIDER)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_SPIDER, false);
		}
		if (r_ptr->spells & SF_S_HOUND)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HOUND, false);
		}
		if (r_ptr->spells & SF_S_HYDRA)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HYDRA, false);
		}
		if (r_ptr->spells & SF_S_ANGEL)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_ANGEL, false);
		}
		if (r_ptr->spells & SF_S_HI_DRAGON)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_DRAGON, false);
		}
		if (r_ptr->spells & SF_S_HI_UNDEAD)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_HI_UNDEAD, false);
		}
		if (r_ptr->spells & SF_S_WRAITH)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_WRAITH, false);
		}
		if (r_ptr->spells & SF_S_UNIQUE)
		{
			summon_specific_friendly(p_ptr->py, p_ptr->px, dun_level, SUMMON_UNIQUE, false);
		}
	}
Ah so it's not breath attacks that have positive effects, it's resistances and elemental immunities! And summoning spells. Mind, these are only for corpses that are not flagged "harmful" earlier in the code, and definitely not if you're hacking them or eating their meat; only if eating from them directly.
fiery_mews is offline   Reply With Quote
Old March 24, 2021, 14:34   #8
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,726
Donated: $40
Pete Mack will become famous soon enough
This kind of thing:
Code:
         brdam *= 6;
         brdam /= (randint(6) + 6);
Is a microcosm of the Poschengband code in general. I mean, it is obviously much worse to write:
Code:
        brdam = (brdam * 6) / (randint(6) + 6);
Than to miss a chance to use the rare assignment operator /=

It is also magnificent to nest a block of 31 non-exclusive if statements in still another conditional.
Pete Mack is offline   Reply With Quote
Old March 25, 2021, 11:35   #9
Yottle
Apprentice
 
Join Date: Dec 2008
Location: West Virginia
Posts: 51
Yottle is on a distinguished road
I thought the summoning effect was still there for meat. I could be wrong.
Yottle is offline   Reply With Quote
Old March 25, 2021, 14:16   #10
fiery_mews
Scout
 
fiery_mews's Avatar
 
Join Date: Sep 2020
Location: Suburbia :(
Posts: 26
fiery_mews is on a distinguished road
@Pete Mack

The original T2 codebase is even more horrifying; I'm still in awe of AnonymousHero, TBH. (My own contributions to the C++ port were pretty minimal.)

@Yottle

Nope, hacked meat still doesn't work. Note

Code:
if (!harmful && !cutting && (o_ptr->sval != SV_CORPSE_MEAT))
I actually can't get the summoning to work in debug mode with a bunch of summoner corpses, maybe most of them will get their corpses flagged harmful by other stuff? Though I do remember summoning a mob one time by accident from eating of a unique summoner's corpse.
fiery_mews is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tome 2.3.5 - no side quests KesTheHammer ToME 4 February 5, 2021 13:06
Best code examples for terrain generation, AI and quests? droof Development 20 February 16, 2018 05:00
Chengband # of random quests prompt ekolis Variants 9 June 18, 2012 00:17
real time roguelike/hack'n'slash bebo Idle chatter 0 February 8, 2009 15:57
[Z] Completing quests Parcae Variants 2 October 14, 2007 19:41


All times are GMT +1. The time now is 20:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.