mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
r_things.c, and connective stuff for face graphic loading. Cobbled a quick-fix together for the minimap icons, may or may not work.
This commit is contained in:
parent
84cbc2ce43
commit
d909f25cf6
5 changed files with 574 additions and 19 deletions
561
src/p_map.c
561
src/p_map.c
|
@ -123,7 +123,7 @@ void P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
return;
|
||||
}
|
||||
|
||||
spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify
|
||||
spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify // SRB2kart -- NOTE: Can this fix itemboxes?
|
||||
|
||||
if (horizspeed && vertispeed) // Mimic SA
|
||||
{
|
||||
|
@ -178,7 +178,7 @@ void P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
if (spring->flags & MF_ENEMY) // Spring shells
|
||||
P_SetTarget(&spring->target, object);
|
||||
|
||||
if (horizspeed && object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)
|
||||
if (horizspeed) // && object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0) // SRB2kart 16/04/24
|
||||
{
|
||||
object->angle = spring->angle;
|
||||
|
||||
|
@ -537,6 +537,527 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
}
|
||||
}
|
||||
|
||||
// SRB2kart 16/04/24
|
||||
if (tmthing->type == MT_SHELLITEM || tmthing->type == MT_REDSHELLITEM || tmthing->type == MT_REDSHELLITEM2
|
||||
|| tmthing->type == MT_SHELLSHIELD || tmthing->type == MT_REDSHELLSHIELD
|
||||
|| tmthing->type == MT_TSHELLSHIELD || tmthing->type == MT_TSHELLSHIELD2 || tmthing->type == MT_TSHELLSHIELD3
|
||||
|| tmthing->type == MT_TREDSHELLSHIELD || tmthing->type == MT_TREDSHELLSHIELD2 || tmthing->type == MT_TREDSHELLSHIELD3)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0)))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
if (((tmthing->type == MT_TSHELLSHIELD || tmthing->type == MT_TSHELLSHIELD2 || tmthing->type == MT_TSHELLSHIELD3
|
||||
|| tmthing->type == MT_TREDSHELLSHIELD || tmthing->type == MT_TREDSHELLSHIELD2 || tmthing->type == MT_TREDSHELLSHIELD3)
|
||||
&& (thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3
|
||||
|| thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3))
|
||||
&& (tmthing->target == thing->target)) // Don't hit each other if you have the same target
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
// Player Damage
|
||||
P_DamageMobj(thing, tmthing, tmthing->target, 1);
|
||||
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_SHELLITEM || thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2
|
||||
|| thing->type == MT_REDSHELLSHIELD || thing->type == MT_SHELLSHIELD
|
||||
|| thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3
|
||||
|| thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3
|
||||
|| thing->type == MT_BANANASHIELD || thing->type == MT_TBANANASHIELD || thing->type == MT_TBANANASHIELD2 || thing->type == MT_TBANANASHIELD3
|
||||
|| thing->type == MT_BANANAITEM)
|
||||
{
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD)
|
||||
{
|
||||
if (tmthing->type == MT_SHELLSHIELD || tmthing->type == MT_REDSHELLSHIELD
|
||||
|| tmthing->type == MT_TSHELLSHIELD || tmthing->type == MT_TSHELLSHIELD2 || tmthing->type == MT_TSHELLSHIELD3
|
||||
|| tmthing->type == MT_TREDSHELLSHIELD || tmthing->type == MT_TREDSHELLSHIELD2 || tmthing->type == MT_TREDSHELLSHIELD3)
|
||||
{
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_BOMBSHIELD || thing->type == MT_BOMBITEM)
|
||||
{
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
|
||||
|
||||
// Bomb death
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
}
|
||||
else if (thing->flags & MF_SPRING && (tmthing->type == MT_REDSHELLITEM || tmthing->type == MT_REDSHELLITEM2 || tmthing->type == MT_SHELLITEM))
|
||||
P_DoSpring(thing, tmthing);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (tmthing->flags & MF_SPRING && (thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2 || thing->type == MT_SHELLITEM))
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (thing->health <= 0)
|
||||
return true;
|
||||
|
||||
P_DoSpring(tmthing, thing);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (tmthing->type == MT_KITCHENSINK)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0)))
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
S_StartSound(NULL, sfx_cgot); //let all players hear it.
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
HU_DoCEcho(va("%s\\was hit by a kitchen sink.\\\\\\\\", player_names[thing->player-players]));
|
||||
I_OutputMsg("%s was hit by a kitchen sink.\n", player_names[thing->player-players]);
|
||||
P_DamageMobj(thing, tmthing, tmthing->target, 10000);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (tmthing->type == MT_EXPLOSION)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (!(thing->type == MT_PLAYER))
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
P_SpinPlayerMobj(thing, tmthing->target);
|
||||
}
|
||||
|
||||
return true; // This doesn't collide with anything, but we want it to effect the player anyway.
|
||||
}
|
||||
else if (tmthing->type == MT_BANANASHIELD || tmthing->type == MT_TBANANASHIELD || tmthing->type == MT_TBANANASHIELD2 || tmthing->type == MT_TBANANASHIELD3 || tmthing->type == MT_BANANAITEM)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0)))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
if (((tmthing->type == MT_BANANASHIELD || tmthing->type == MT_TBANANASHIELD || tmthing->type == MT_TBANANASHIELD2 || tmthing->type == MT_TBANANASHIELD3)
|
||||
&& (thing->type == MT_BANANASHIELD || thing->type == MT_TBANANASHIELD || thing->type == MT_TBANANASHIELD2 || thing->type == MT_TBANANASHIELD3))
|
||||
&& (tmthing->target == thing->target)) // Don't hit each other if you have the same target
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
// Player Damage
|
||||
P_SpinPlayerMobj(thing, tmthing->target);
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_BANANASHIELD || thing->type == MT_TBANANASHIELD || thing->type == MT_TBANANASHIELD2 || thing->type == MT_TBANANASHIELD3 || thing->type == MT_BANANAITEM
|
||||
|| thing->type == MT_SHELLITEM || thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2
|
||||
|| thing->type == MT_SHELLSHIELD || thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3
|
||||
|| thing->type == MT_REDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3)
|
||||
{
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD)
|
||||
{
|
||||
if (tmthing->type == MT_BANANASHIELD || tmthing->type == MT_TBANANASHIELD || tmthing->type == MT_TBANANASHIELD2 || tmthing->type == MT_TBANANASHIELD3)
|
||||
{
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (tmthing->type == MT_FAKESHIELD || tmthing->type == MT_FAKEITEM)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0)))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_SHELLITEM // When these items collide with the fake item, just the fake item is destroyed
|
||||
|| thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2
|
||||
|| thing->type == MT_BOMBITEM
|
||||
|| thing->type == MT_BANANAITEM)
|
||||
{
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_SHELLSHIELD || thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3 // When these items collide with the fake item, both of them are destroyed
|
||||
|| thing->type == MT_REDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3
|
||||
|| thing->type == MT_BOMBSHIELD
|
||||
|| thing->type == MT_BANANASHIELD || thing->type == MT_TBANANASHIELD || thing->type == MT_TBANANASHIELD2 || thing->type == MT_TBANANASHIELD3
|
||||
|| thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD)
|
||||
{
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_PLAYER)
|
||||
{
|
||||
// Player Damage
|
||||
P_DamageMobj(thing, tmthing, tmthing->target, 1);
|
||||
|
||||
// This Item Damage
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
tmthing->z -= tmthing->height;
|
||||
else
|
||||
tmthing->z += tmthing->height;
|
||||
|
||||
S_StartSound(tmthing, tmthing->info->deathsound);
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
P_SetObjectMomZ(tmthing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (tmthing->type == MT_BOMBSHIELD || tmthing->type == MT_BOMBITEM)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0)))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_PLAYER)
|
||||
{
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
}
|
||||
else if (thing->type == MT_SHELLITEM || thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2
|
||||
|| thing->type == MT_SHELLSHIELD || thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3
|
||||
|| thing->type == MT_REDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3)
|
||||
{
|
||||
P_KillMobj(tmthing, thing, thing);
|
||||
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (tmthing->type == MT_PLAYER && (thing->type == MT_SHELLSHIELD || thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3
|
||||
|| thing->type == MT_REDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3
|
||||
|| thing->type == MT_SHELLITEM || thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2
|
||||
|| thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM
|
||||
|| thing->type == MT_BANANASHIELD || thing->type == MT_TBANANASHIELD || thing->type == MT_TBANANASHIELD2 || thing->type == MT_TBANANASHIELD3 || thing->type == MT_BANANAITEM
|
||||
|| thing->type == MT_BOMBSHIELD || thing->type == MT_BOMBITEM
|
||||
|| thing->type == MT_EXPLOSION
|
||||
|| thing->type == MT_KITCHENSINK))
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (thing->type == MT_SHELLSHIELD || thing->type == MT_TSHELLSHIELD || thing->type == MT_TSHELLSHIELD2 || thing->type == MT_TSHELLSHIELD3
|
||||
|| thing->type == MT_REDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD || thing->type == MT_TREDSHELLSHIELD2 || thing->type == MT_TREDSHELLSHIELD3
|
||||
|| thing->type == MT_SHELLITEM || thing->type == MT_REDSHELLITEM || thing->type == MT_REDSHELLITEM2
|
||||
|| thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM)
|
||||
{
|
||||
if ((thing->target == tmthing) && (thing->threshold > 0))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
// Player Damage
|
||||
P_DamageMobj(tmthing, thing, thing->target, 1);
|
||||
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_BANANASHIELD || thing->type == MT_TBANANASHIELD || thing->type == MT_TBANANASHIELD2 || thing->type == MT_TBANANASHIELD3 || thing->type == MT_BANANAITEM)
|
||||
{
|
||||
if ((thing->target == tmthing) && (thing->threshold > 0))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
// Player Damage
|
||||
P_SpinPlayerMobj(tmthing, thing->target);
|
||||
|
||||
// Other Item Damage
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z -= thing->height;
|
||||
else
|
||||
thing->z += thing->height;
|
||||
|
||||
S_StartSound(thing, thing->info->deathsound);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
|
||||
P_SetObjectMomZ(thing, 8*FRACUNIT, false);
|
||||
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT);
|
||||
}
|
||||
else if (thing->type == MT_BOMBSHIELD || thing->type == MT_BOMBITEM)
|
||||
{
|
||||
if ((thing->target == tmthing) && (thing->threshold > 0))
|
||||
return true;
|
||||
|
||||
if (tmthing->health <= 0 || thing->health <= 0)
|
||||
return true;
|
||||
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
}
|
||||
else if (thing->type == MT_EXPLOSION)
|
||||
{
|
||||
// Player Damage
|
||||
P_SpinPlayerMobj(tmthing, thing->target);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (thing->type == MT_KITCHENSINK)
|
||||
{
|
||||
if ((thing->target == tmthing) && (thing->threshold > 0))
|
||||
return true;
|
||||
|
||||
S_StartSound(NULL, sfx_cgot); //let all players hear it.
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
HU_DoCEcho(va("%s\\was hit by a kitchen sink.\\\\\\\\", player_names[tmthing->player-players]));
|
||||
I_OutputMsg("%s was hit by a kitchen sink.\n", player_names[tmthing->player-players]);
|
||||
P_DamageMobj(tmthing, thing, thing->target, 10000);
|
||||
P_KillMobj(thing, tmthing, tmthing);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (thing->type == MT_POKEY)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (tmthing->type == MT_ENEMYFLIP)
|
||||
{
|
||||
if (tmthing->angle)
|
||||
P_SetMobjState(thing, S_POKEY5);
|
||||
else
|
||||
P_SetMobjState(thing, S_POKEY1);
|
||||
}
|
||||
if (tmthing->type == MT_PLAYER && !thing->threshold)
|
||||
P_DamageMobj(tmthing, thing, thing->target, 1);
|
||||
}
|
||||
//
|
||||
|
||||
if ((thing->type == MT_SPRINGSHELL || thing->type == MT_YELLOWSHELL) && thing->health > 0
|
||||
&& (tmthing->player || (tmthing->flags & MF_PUSHABLE)) && tmthing->health > 0)
|
||||
{
|
||||
|
@ -769,13 +1290,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
}
|
||||
|
||||
// check for special pickup
|
||||
if (thing->flags & MF_SPECIAL && tmthing->player)
|
||||
if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY) // SRB2kart 16/04/24
|
||||
{
|
||||
P_TouchSpecialThing(thing, tmthing, true); // can remove thing
|
||||
return true;
|
||||
}
|
||||
// check again for special pickup
|
||||
if (tmthing->flags & MF_SPECIAL && thing->player)
|
||||
if (tmthing->flags & MF_SPECIAL && thing->player && thing->type != MT_POKEY) // SRB2kart 16/04/24
|
||||
{
|
||||
P_TouchSpecialThing(tmthing, thing, true); // can remove thing
|
||||
return true;
|
||||
|
@ -837,6 +1358,24 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
{
|
||||
if (G_RingSlingerGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
|
||||
{
|
||||
// SRB2kart 16/04/24
|
||||
if (tmthing->player->powers[pw_boost] > 71)
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1);
|
||||
else if (thing->player->powers[pw_boost] > 71)
|
||||
P_DamageMobj(tmthing, thing, thing, 1);
|
||||
|
||||
if ((tmthing->player->powers[pw_shrink] < 0 && thing->player->powers[pw_shrink] >= 0)
|
||||
|| (tmthing->player->powers[pw_shrink] == 0 && thing->player->powers[pw_shrink] > 0))
|
||||
{
|
||||
P_SquishPlayerMobj(thing, tmthing);
|
||||
}
|
||||
else if ((thing->player->powers[pw_shrink] < 0 && tmthing->player->powers[pw_shrink] >= 0)
|
||||
|| (thing->player->powers[pw_shrink] == 0 && tmthing->player->powers[pw_shrink] > 0))
|
||||
{
|
||||
P_SquishPlayerMobj(tmthing, thing);
|
||||
}
|
||||
//
|
||||
|
||||
if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super])
|
||||
&& !thing->player->powers[pw_super])
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1);
|
||||
|
@ -925,11 +1464,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed.
|
||||
fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;;
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1); // break the monitor
|
||||
|
||||
// SRB2kart 16/04/24
|
||||
// Going down? Then bounce back up.
|
||||
if ((P_MobjWasRemoved(thing) // Monitor was removed
|
||||
|| !thing->health) // or otherwise popped
|
||||
&& (flipval*(*momz) < 0)) // monitor is on the floor and you're going down, or on the ceiling and you're going up
|
||||
*momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
|
||||
//if ((P_MobjWasRemoved(thing) // Monitor was removed
|
||||
// || !thing->health) // or otherwise popped
|
||||
//&& (flipval*(*momz) < 0)) // monitor is on the floor and you're going down, or on the ceiling and you're going up
|
||||
// *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
|
@ -3152,6 +3693,10 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
|
|||
// Crush the object
|
||||
if (netgame && thing->player && thing->player->spectator)
|
||||
P_DamageMobj(thing, NULL, NULL, 42000); // Respawn crushed spectators
|
||||
else if (thing->player) // SRB2kart 16/04/24
|
||||
{
|
||||
P_SquishPlayerMobj(thing, crumbler->player->mo);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!killer)
|
||||
|
|
|
@ -70,7 +70,7 @@ INT16 screenheightarray[MAXVIDWIDTH];
|
|||
spritedef_t *sprites;
|
||||
size_t numsprites;
|
||||
|
||||
static spriteframe_t sprtemp[64];
|
||||
static spriteframe_t sprtemp[84]; // SRB2kart 16/04/24
|
||||
static size_t maxframe;
|
||||
static const char *spritename;
|
||||
|
||||
|
@ -99,7 +99,7 @@ static void R_InstallSpriteLump(UINT16 wad, // graphics patch
|
|||
lumppat <<= 16;
|
||||
lumppat += lump;
|
||||
|
||||
if (frame >= 64 || rotation > 8)
|
||||
if (frame >= 84 || rotation > 8) // SRB2kart 16/04/24
|
||||
I_Error("R_InstallSpriteLump: Bad frame characters in lump %s", W_CheckNameForNum(lumppat));
|
||||
|
||||
if (maxframe ==(size_t)-1 || frame > maxframe)
|
||||
|
@ -194,7 +194,7 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef,
|
|||
frame = R_Char2Frame(lumpinfo[l].name[4]);
|
||||
rotation = (UINT8)(lumpinfo[l].name[5] - '0');
|
||||
|
||||
if (frame >= 64 || rotation > 8) // Give an actual NAME error -_-...
|
||||
if (frame >= 84 || rotation > 8) // Give an actual NAME error -_-... // SRB2kart 16/04/24
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Bad sprite name: %s\n"), W_CheckNameForNumPwad(wadnum,l));
|
||||
continue;
|
||||
|
@ -2234,6 +2234,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
|
|||
strncpy(skin->charsel, "CHRSONIC", 8);
|
||||
strncpy(skin->face, "MISSING", 8);
|
||||
strncpy(skin->superface, "MISSING", 8);
|
||||
strncpy(skin->mapface, "MISSING", 8);
|
||||
|
||||
skin->starttranscolor = 160;
|
||||
skin->prefcolor = SKINCOLOR_GREEN;
|
||||
|
@ -2295,6 +2296,7 @@ void R_InitSkins(void)
|
|||
strncpy(skin->charsel, "CHRSONIC", 8);
|
||||
strncpy(skin->face, "LIVSONIC", 8);
|
||||
strncpy(skin->superface, "LIVSUPER", 8);
|
||||
strncpy(skin->mapface, "MAPSONIC", 8);
|
||||
skin->prefcolor = SKINCOLOR_BLUE;
|
||||
|
||||
skin->ability = CA_THOK;
|
||||
|
@ -2308,7 +2310,7 @@ void R_InitSkins(void)
|
|||
|
||||
skin->spritedef.numframes = sprites[SPR_PLAY].numframes;
|
||||
skin->spritedef.spriteframes = sprites[SPR_PLAY].spriteframes;
|
||||
ST_LoadFaceGraphics(skin->face, skin->superface, 0);
|
||||
ST_LoadFaceGraphics(skin->face, skin->superface, skin->mapface, 0);
|
||||
|
||||
//MD2 for sonic doesn't want to load in Linux.
|
||||
#ifdef HWRENDER
|
||||
|
@ -2449,7 +2451,7 @@ void R_AddSkins(UINT16 wadnum)
|
|||
char *value;
|
||||
size_t size;
|
||||
skin_t *skin;
|
||||
boolean hudname, realname, superface;
|
||||
boolean hudname, realname, superface, mapface;
|
||||
|
||||
//
|
||||
// search for all skin markers in pwad
|
||||
|
@ -2479,7 +2481,7 @@ void R_AddSkins(UINT16 wadnum)
|
|||
skin = &skins[numskins];
|
||||
Sk_SetDefaultValue(skin);
|
||||
skin->wadnum = wadnum;
|
||||
hudname = realname = superface = false;
|
||||
hudname = realname = superface = mapface = false;
|
||||
// parse
|
||||
stoken = strtok (buf2, "\r\n= ");
|
||||
while (stoken)
|
||||
|
@ -2582,6 +2584,11 @@ void R_AddSkins(UINT16 wadnum)
|
|||
strupr(value);
|
||||
strncpy(skin->superface, value, sizeof skin->superface);
|
||||
}
|
||||
else if (!stricmp(stoken, "mapface"))
|
||||
{
|
||||
strupr(value);
|
||||
strncpy(skin->mapface, value, sizeof skin->mapface);
|
||||
}
|
||||
|
||||
#define FULLPROCESS(field) else if (!stricmp(stoken, #field)) skin->field = get_number(value);
|
||||
// character type identification
|
||||
|
@ -2721,7 +2728,7 @@ next_token:
|
|||
#endif
|
||||
|
||||
// add face graphics
|
||||
ST_LoadFaceGraphics(skin->face, skin->superface, numskins);
|
||||
ST_LoadFaceGraphics(skin->face, skin->superface, skin->mapface, numskins);
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
|
|
|
@ -75,7 +75,7 @@ typedef struct
|
|||
|
||||
char realname[SKINNAMESIZE+1]; // Display name for level completion.
|
||||
char hudname[SKINNAMESIZE+1]; // HUD name to display (officially exactly 5 characters long)
|
||||
char charsel[8], face[8], superface[8]; // Arbitrarily named patch lumps
|
||||
char charsel[8], face[8], superface[8], iconprefix[8]; // Arbitrarily named patch lumps
|
||||
|
||||
UINT8 ability; // ability definition
|
||||
UINT8 ability2; // secondary ability definition
|
||||
|
|
|
@ -51,6 +51,7 @@ UINT16 objectsdrawn = 0;
|
|||
|
||||
patch_t *faceprefix[MAXSKINS]; // face status patches
|
||||
patch_t *superprefix[MAXSKINS]; // super face status patches
|
||||
patch_t *mapprefix[MAXSKINS]; // super face status patches
|
||||
|
||||
// ------------------------------------------
|
||||
// status bar overlay
|
||||
|
@ -340,10 +341,11 @@ void ST_LoadGraphics(void)
|
|||
}
|
||||
|
||||
// made separate so that skins code can reload custom face graphics
|
||||
void ST_LoadFaceGraphics(char *facestr, char *superstr, INT32 skinnum)
|
||||
void ST_LoadFaceGraphics(char *facestr, char *superstr, char *mapstr, INT32 skinnum)
|
||||
{
|
||||
faceprefix[skinnum] = W_CachePatchName(facestr, PU_HUDGFX);
|
||||
superprefix[skinnum] = W_CachePatchName(superstr, PU_HUDGFX);
|
||||
mapprefix[skinnum] = W_CachePatchName(mapstr, PU_HUDGFX);
|
||||
facefreed[skinnum] = false;
|
||||
}
|
||||
|
||||
|
@ -352,6 +354,7 @@ void ST_UnLoadFaceGraphics(INT32 skinnum)
|
|||
{
|
||||
Z_Free(faceprefix[skinnum]);
|
||||
Z_Free(superprefix[skinnum]);
|
||||
Z_Free(mapprefix[skinnum]);
|
||||
facefreed[skinnum] = true;
|
||||
}
|
||||
#endif
|
||||
|
@ -361,7 +364,7 @@ void ST_ReloadSkinFaceGraphics(void)
|
|||
INT32 i;
|
||||
|
||||
for (i = 0; i < numskins; i++)
|
||||
ST_LoadFaceGraphics(skins[i].face, skins[i].superface, i);
|
||||
ST_LoadFaceGraphics(skins[i].face, skins[i].superface, skins[i].mapface, i);
|
||||
}
|
||||
|
||||
static inline void ST_InitData(void)
|
||||
|
|
|
@ -42,7 +42,7 @@ void ST_UnloadGraphics(void);
|
|||
void ST_LoadGraphics(void);
|
||||
|
||||
// face load graphics, called when skin changes
|
||||
void ST_LoadFaceGraphics(char *facestr, char *superstr, INT32 playernum);
|
||||
void ST_LoadFaceGraphics(char *facestr, char *superstr, char *mapstr, INT32 playernum);
|
||||
void ST_ReloadSkinFaceGraphics(void);
|
||||
#ifdef DELFILE
|
||||
void ST_UnLoadFaceGraphics(INT32 skinnum);
|
||||
|
|
Loading…
Reference in a new issue