Пример #1
0
DEFINE_ACTION_FUNCTION(AActor, A_IceSetTics)
{
	int floor;

	self->tics = 70+(pr_icesettics()&63);
	floor = P_GetThingFloorType (self);
	if (Terrains[floor].DamageMOD == NAME_Fire)
	{
		self->tics >>= 2;
	}
Пример #2
0
void A_IceSetTics (AActor *actor)
{
	int floor;

	actor->tics = 70+(pr_icesettics()&63);
	floor = P_GetThingFloorType (actor);
	if (Terrains[floor].DamageMOD == MOD_FIRE)
	{
		actor->tics >>= 2;
	}
Пример #3
0
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHeadCheck)
{
	PARAM_ACTION_PROLOGUE;

	if (self->Z() <= self->floorz)
	{
		if (Terrains[P_GetThingFloorType(self)].IsLiquid)
		{
			P_HitFloor (self);
			self->SetState (NULL);
		}
		else
		{
			self->SetState (self->FindState(NAME_Death));
		}
	}
	return 0;
}
Пример #4
0
boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, angle_t angle,
				   boolean useFog)
{
	fixed_t oldx;
	fixed_t oldy;
	fixed_t oldz;
	fixed_t aboveFloor;
	fixed_t fogDelta;
	player_t *player;
	unsigned an;
	mobj_t *fog;

	oldx = thing->x;
	oldy = thing->y;
	oldz = thing->z;
	aboveFloor = thing->z - thing->floorz;
	if(!P_TeleportMove(thing, x, y))
	{
		return false;
	}
	if(thing->player)
	{
		player = thing->player;
		player->plr->flags |= DDPF_FIXANGLES | DDPF_FIXPOS | DDPF_FIXMOM;
		if(player->powers[pw_flight] && aboveFloor)
		{
			thing->z = thing->floorz + aboveFloor;
			if(thing->z + thing->height > thing->ceilingz)
			{
				thing->z = thing->ceilingz - thing->height;
			}
			player->plr->viewz = thing->z + player->plr->viewheight;
		}
		else
		{
			thing->z = thing->floorz;
			player->plr->viewz = thing->z + player->plr->viewheight;
			if(useFog)
			{
				player->plr->lookdir = 0;
			}
		}
	}
	else if(thing->flags & MF_MISSILE)
	{
		thing->z = thing->floorz + aboveFloor;
		if(thing->z + thing->height > thing->ceilingz)
		{
			thing->z = thing->ceilingz - thing->height;
		}
	}
	else
	{
		thing->z = thing->floorz;
	}
	// Spawn teleport fog at source and destination
	if(useFog)
	{
		fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT;
		fog = P_SpawnMobj(oldx, oldy, oldz + fogDelta, MT_TFOG);
		S_StartSound(SFX_TELEPORT, fog);
		an = angle >> ANGLETOFINESHIFT;
		fog =
			P_SpawnMobj(x + 20 * finecosine[an], y + 20 * finesine[an],
						thing->z + fogDelta, MT_TFOG);
		S_StartSound(SFX_TELEPORT, fog);
		if(thing->player && !thing->player->powers[pw_speed])
		{						// Freeze player for about .5 sec
			thing->reactiontime = 18;
		}
		thing->angle = angle;
	}
	if(thing->flags2 & MF2_FLOORCLIP)
	{
		if(thing->z == thing->subsector->sector->floorheight &&
		   P_GetThingFloorType(thing) > FLOOR_SOLID)
		{
			thing->floorclip = 10 * FRACUNIT;
		}
		else
		{
			thing->floorclip = 0;
		}
	}
	if(thing->flags & MF_MISSILE)
	{
		angle >>= ANGLETOFINESHIFT;
		thing->momx = FixedMul(thing->info->speed, finecosine[angle]);
		thing->momy = FixedMul(thing->info->speed, finesine[angle]);
	}