p_inter.c
/*
==================
=
= P_TouchSpecialThing2
=
= Everything didn't fit in one function on the dsp, so half were moved here
= Returns sound to play, or -1 if no sound
==================
*/
P_TouchSpecialThing2
Everything didn't fit in one function on the dsp, so half were moved here
Returns sound to play, or -1 if no sound
P_TouchSpecialThing2 Everything didn ' t fit in one function on the dsp so half were moved here Returns sound to play or - 1 if no sound
int P_TouchSpecialThing2 (mobj_t *special, mobj_t *toucher)
{
	player_t *player;
	player = toucher->player ? &players[toucher->player-1] : NULL;
	switch (special->sprite)
	{
	case SPR_ARM1:
		if (!P_GiveArmor (player, 1))
			return -1;
		player->message = "You pick up the armor.";
		break;
	case SPR_ARM2:
		if (!P_GiveArmor (player, 2))
			return -1;
		player->message = "You got the MegaArmor!";
		break;
	case SPR_BKEY:
		if (!player->cards[it_bluecard])
			player->message = "You pick up a blue keycard.";
		P_GiveCard (player, it_bluecard);
		if (!netgame)
			break;
		return -1;
	case SPR_YKEY:
		if (!player->cards[it_yellowcard])
			player->message = "You pick up a yellow keycard.";
		P_GiveCard (player, it_yellowcard);
		if (!netgame)
			break;
		return -1;
	case SPR_RKEY:
		if (!player->cards[it_redcard])
			player->message = "You pick up a red keycard.";
		P_GiveCard (player, it_redcard);
		if (!netgame)
			break;
		return -1;
	case SPR_BSKU:
		if (!player->cards[it_blueskull])
			player->message = "You pick up a blue skull key.";
		P_GiveCard (player, it_blueskull);
		if (!netgame)
			break;
		return -1;
	case SPR_YSKU:
		if (!player->cards[it_yellowskull])
			player->message = "You pick up a yellow skull key.";
		P_GiveCard (player, it_yellowskull);
		if (!netgame)
			break;
		return -1;
	case SPR_RSKU:
		if (!player->cards[it_redskull])
			player->message = "You pick up a red skull key.";
		P_GiveCard (player, it_redskull);
		if (!netgame)
			break;
		return -1;
	case SPR_STIM:
		if (!P_GiveBody (player, 10))
			return -1;
		player->message = "You pick up a stimpack.";
		break;
	case SPR_MEDI:
		if (!P_GiveBody (player, 25))
			return -1;
		if (player->health < 25)
			player->message = "You pick up a medikit that you REALLY need!";
		else
			player->message = "You pick up a medikit.";
		break;
	case SPR_PINV:
		if (!P_GivePower (player, pw_invulnerability))
			return -1;
		player->message = "Invulnerability!";
		break;
	case SPR_PSTR:
		if (!P_GivePower (player, pw_strength))
			return -1;
		player->message = "Berserk!";
		if (player->readyweapon != wp_fist)
			player->pendingweapon = wp_fist;
		break;
	case SPR_PINS:
		break;
	case SPR_SUIT:
		if (!P_GivePower (player, pw_ironfeet))
			return -1;
		player->message = "Radiation Shielding Suit";
		break;
	case SPR_PMAP:
		if (!P_GivePower (player, pw_allmap))
			return -1;
		player->message = "Computer Area Map";
		break;
	case SPR_PVIS:
		break;
	default:
		I_Error ("P_SpecialThing: Unknown gettable thing");
	}
	return sfx_itemup;
}
int P_TouchSpecialThing2 ( mobj_t * special , mobj_t * toucher ) { player_t * player ; player = toucher -> player ? & players [ toucher -> player - 1 ] : NULL ; switch ( special -> sprite ) { case SPR_ARM1 : if ( ! P_GiveArmor ( player , 1 ) ) return -1 ; player -> message = " " ; break ; case SPR_ARM2 : if ( ! P_GiveArmor ( player , 2 ) ) return -1 ; player -> message = " " ; break ; case SPR_BKEY : if ( ! player -> cards [ it_bluecard ] ) player -> message = " " ; P_GiveCard ( player , it_bluecard ) ; if ( ! netgame ) break ; return -1 ; case SPR_YKEY : if ( ! player -> cards [ it_yellowcard ] ) player -> message = " " ; P_GiveCard ( player , it_yellowcard ) ; if ( ! netgame ) break ; return -1 ; case SPR_RKEY : if ( ! player -> cards [ it_redcard ] ) player -> message = " " ; P_GiveCard ( player , it_redcard ) ; if ( ! netgame ) break ; return -1 ; case SPR_BSKU : if ( ! player -> cards [ it_blueskull ] ) player -> message = " " ; P_GiveCard ( player , it_blueskull ) ; if ( ! netgame ) break ; return -1 ; case SPR_YSKU : if ( ! player -> cards [ it_yellowskull ] ) player -> message = " " ; P_GiveCard ( player , it_yellowskull ) ; if ( ! netgame ) break ; return -1 ; case SPR_RSKU : if ( ! player -> cards [ it_redskull ] ) player -> message = " " ; P_GiveCard ( player , it_redskull ) ; if ( ! netgame ) break ; return -1 ; case SPR_STIM : if ( ! P_GiveBody ( player , 10 ) ) return -1 ; player -> message = " " ; break ; case SPR_MEDI : if ( ! P_GiveBody ( player , 25 ) ) return -1 ; if ( player -> health < 25 ) player -> message = " " ; else player -> message = " " ; break ; case SPR_PINV : if ( ! P_GivePower ( player , pw_invulnerability ) ) return -1 ; player -> message = " " ; break ; case SPR_PSTR : if ( ! P_GivePower ( player , pw_strength ) ) return -1 ; player -> message = " " ; if ( player -> readyweapon != wp_fist ) player -> pendingweapon = wp_fist ; break ; case SPR_PINS : break ; case SPR_SUIT : if ( ! P_GivePower ( player , pw_ironfeet ) ) return -1 ; player -> message = " " ; break ; case SPR_PMAP : if ( ! P_GivePower ( player , pw_allmap ) ) return -1 ; player -> message = " " ; break ; case SPR_PVIS : break ; default : I_Error ( " " ) ; } return sfx_itemup ; }
P_TouchSpecialThing2
Everything didn't fit in one function on the dsp, so half were moved here
Returns sound to play, or -1 if no sound
P_TouchSpecialThing2 Everything didn ' t fit in one function on the dsp so half were moved here Returns sound to play or - 1 if no sound
/* */ /* armor */ /* */ /* */ /* cards */ /* leave cards for everyone */ /* */ /* heals */ /* */ /* */ /* power ups */ /* */