mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'prison-ufos' into 'master'
Prison UFOs See merge request KartKrew/Kart!1060
This commit is contained in:
commit
bfbbfc2842
9 changed files with 106 additions and 67 deletions
|
|
@ -1973,6 +1973,8 @@ void D_SRB2Main(void)
|
|||
grandprixinfo.eventmode = GPEVENT_SPECIAL;
|
||||
else if (gametype != GT_RACE)
|
||||
grandprixinfo.eventmode = GPEVENT_BONUS;
|
||||
|
||||
multiplayer = true;
|
||||
}
|
||||
|
||||
G_SetUsedCheats();
|
||||
|
|
|
|||
|
|
@ -26250,13 +26250,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL, // xdeathstate
|
||||
sfx_cdfm19, // deathsound
|
||||
0, // speed
|
||||
70*FRACUNIT, // radius
|
||||
70*FRACUNIT, // height
|
||||
55*FRACUNIT, // radius
|
||||
95*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_SPECIAL, // flags
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_SPECIAL|MF_SHOOTABLE, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -778,6 +778,8 @@ void K_BattleInit(boolean singleplayercontext)
|
|||
{
|
||||
if (mt->type == mobjinfo[MT_BATTLECAPSULE].doomednum)
|
||||
P_SpawnMapThing(mt);
|
||||
else if (mt->type == mobjinfo[MT_CDUFO].doomednum)
|
||||
maptargets++;
|
||||
}
|
||||
|
||||
battlecapsules = true;
|
||||
|
|
|
|||
13
src/k_hud.c
13
src/k_hud.c
|
|
@ -76,7 +76,7 @@ patch_t *kp_facehighlight[8];
|
|||
|
||||
static patch_t *kp_nocontestminimap;
|
||||
static patch_t *kp_spbminimap;
|
||||
static patch_t *kp_capsuleminimap[2];
|
||||
static patch_t *kp_capsuleminimap[3];
|
||||
|
||||
static patch_t *kp_ringsticker[2];
|
||||
static patch_t *kp_ringstickersplit[4];
|
||||
|
|
@ -350,6 +350,7 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_spbminimap, "SPBMMAP");
|
||||
HU_UpdatePatch(&kp_capsuleminimap[0], "MINICAP1");
|
||||
HU_UpdatePatch(&kp_capsuleminimap[1], "MINICAP2");
|
||||
HU_UpdatePatch(&kp_capsuleminimap[2], "MINICAP3");
|
||||
|
||||
// Rings & Lives
|
||||
HU_UpdatePatch(&kp_ringsticker[0], "RNGBACKA");
|
||||
|
|
@ -956,7 +957,7 @@ void K_ObjectTracking(trackingResult_t *result, const vector3_t *point, boolean
|
|||
|
||||
// Determine viewpoint factors.
|
||||
h = R_PointToDist2(point->x, point->y, viewx, viewy);
|
||||
da = AngleDeltaSigned(viewpointAngle, R_PointToAngle2(point->x, point->y, viewx, viewy));
|
||||
da = AngleDeltaSigned(viewpointAngle, R_PointToAngle2(viewx, viewy, point->x, point->y));
|
||||
dp = AngleDeltaSigned(viewpointAiming, R_PointToAngle2(0, 0, h, viewz));
|
||||
|
||||
if (reverse)
|
||||
|
|
@ -966,7 +967,7 @@ void K_ObjectTracking(trackingResult_t *result, const vector3_t *point, boolean
|
|||
|
||||
// Set results relative to top left!
|
||||
result->x = FixedMul(NEWTAN(da), fg);
|
||||
result->y = FixedMul((NEWTAN(viewpointAiming) - FixedDiv((viewz - point->z), 1 + FixedMul(NEWCOS(da), h))), fg);
|
||||
result->y = FixedMul((NEWTAN(viewpointAiming) - FixedDiv((point->z - viewz), 1 + FixedMul(NEWCOS(da), h))), fg);
|
||||
|
||||
result->angle = da;
|
||||
result->pitch = dp;
|
||||
|
|
@ -993,7 +994,7 @@ void K_ObjectTracking(trackingResult_t *result, const vector3_t *point, boolean
|
|||
|
||||
result->scale = FixedDiv(screenHalfW, h+1);
|
||||
|
||||
result->onScreen = ((abs(da) > ANG60) || (abs(AngleDeltaSigned(viewpointAiming, R_PointToAngle2(0, 0, h, (viewz - point->z)))) > ANGLE_45));
|
||||
result->onScreen = !((abs(da) > ANG60) || (abs(AngleDeltaSigned(viewpointAiming, R_PointToAngle2(0, 0, h, (viewz - point->z)))) > ANGLE_45));
|
||||
|
||||
// Cheap dirty hacks for some split-screen related cases
|
||||
if (result->x < 0 || result->x > (screenWidth << FRACBITS))
|
||||
|
|
@ -3744,6 +3745,10 @@ static void K_drawKartMinimap(void)
|
|||
case MT_BATTLECAPSULE:
|
||||
workingPic = kp_capsuleminimap[(mobj->extravalue1 != 0 ? 1 : 0)];
|
||||
break;
|
||||
case MT_CDUFO:
|
||||
if (battlecapsules) //!battleprisons
|
||||
workingPic = kp_capsuleminimap[2];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
|||
// Simply pointing towards the result doesn't work, so inaccurate hack...
|
||||
borderDir.x = FixedMul(
|
||||
FixedMul(
|
||||
FINESINE((-result.angle >> ANGLETOFINESHIFT) & FINEMASK),
|
||||
FINESINE((result.angle >> ANGLETOFINESHIFT) & FINEMASK),
|
||||
FINECOSINE((-result.pitch >> ANGLETOFINESHIFT) & FINEMASK)
|
||||
),
|
||||
result.fov
|
||||
|
|
@ -181,7 +181,8 @@ void K_DrawTargetTracking(const TargetTracking& target)
|
|||
borderDir.y = FRACUNIT;
|
||||
}
|
||||
|
||||
if (target.mobj->type == MT_BATTLECAPSULE)
|
||||
if (target.mobj->type == MT_BATTLECAPSULE
|
||||
|| target.mobj->type == MT_CDUFO)
|
||||
{
|
||||
targetPatch = kp_capsuletarget_icon[timer & 1];
|
||||
}
|
||||
|
|
@ -363,6 +364,9 @@ bool is_object_tracking_target(const mobj_t* mobj)
|
|||
switch (mobj->type)
|
||||
{
|
||||
case MT_BATTLECAPSULE:
|
||||
case MT_CDUFO:
|
||||
return battlecapsules; // battleprisons
|
||||
|
||||
case MT_SPECIAL_UFO:
|
||||
return true;
|
||||
|
||||
|
|
|
|||
|
|
@ -5891,7 +5891,8 @@ static void K_DoShrink(player_t *user)
|
|||
next = mobj->itnext;
|
||||
|
||||
if (mobj->type == MT_SPB
|
||||
|| mobj->type == MT_BATTLECAPSULE)
|
||||
|| mobj->type == MT_BATTLECAPSULE
|
||||
|| mobj->type == MT_CDUFO)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,8 @@ static void RankCapsules_LoadTextmap(void)
|
|||
{
|
||||
UINT16 type = atol(val);
|
||||
|
||||
if (type == mobjinfo[MT_BATTLECAPSULE].doomednum)
|
||||
if (type == mobjinfo[MT_BATTLECAPSULE].doomednum
|
||||
|| type == mobjinfo[MT_CDUFO].doomednum)
|
||||
{
|
||||
g_rankCapsules_count++;
|
||||
}
|
||||
|
|
@ -163,7 +164,8 @@ static void RankCapsules_LoadThingsLump(UINT8 *data)
|
|||
|
||||
data += 2; // options
|
||||
|
||||
if (type == mobjinfo[MT_BATTLECAPSULE].doomednum)
|
||||
if (type == mobjinfo[MT_BATTLECAPSULE].doomednum
|
||||
|| type == mobjinfo[MT_CDUFO].doomednum)
|
||||
{
|
||||
g_rankCapsules_count++;
|
||||
}
|
||||
|
|
|
|||
127
src/p_inter.c
127
src/p_inter.c
|
|
@ -201,7 +201,6 @@ boolean P_EmblemWasCollected(INT32 emblemID)
|
|||
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
{
|
||||
player_t *player;
|
||||
INT32 i;
|
||||
|
||||
if (objectplacing)
|
||||
return;
|
||||
|
|
@ -445,7 +444,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
K_StartItemRoulette(player);
|
||||
|
||||
// Karma fireworks
|
||||
for (i = 0; i < 5; i++)
|
||||
/*for (i = 0; i < 5; i++)
|
||||
{
|
||||
mobj_t *firework = P_SpawnMobj(special->x, special->y, special->z, MT_KARMAFIREWORK);
|
||||
firework->momx = toucher->momx;
|
||||
|
|
@ -454,14 +453,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
P_Thrust(firework, FixedAngle((72*i)<<FRACBITS), P_RandomRange(PR_ITEM_DEBRIS, 1,8)*special->scale);
|
||||
P_SetObjectMomZ(firework, P_RandomRange(PR_ITEM_DEBRIS, 1,8)*special->scale, false);
|
||||
firework->color = toucher->color;
|
||||
}
|
||||
}*/
|
||||
|
||||
S_StartSound(toucher, sfx_cdfm73); // they don't make this sound in the original game but it's nice to have a "reward" for good play
|
||||
K_SetHitLagForObjects(special, toucher, 2, true);
|
||||
|
||||
//special->momx = special->momy = special->momz = 0;
|
||||
special->momz = -(3*special->scale)/2;
|
||||
//P_SetTarget(&special->target, toucher);
|
||||
special->fuse = 2*TICRATE;
|
||||
break;
|
||||
|
||||
case MT_BALLOON: // SRB2kart
|
||||
|
|
@ -637,6 +632,61 @@ void P_TouchStarPost(mobj_t *post, player_t *player, boolean snaptopost)
|
|||
player->starpostnum = post->health;
|
||||
}
|
||||
|
||||
static void P_AddBrokenPrison(mobj_t *target, mobj_t *source)
|
||||
{
|
||||
(void)target;
|
||||
|
||||
if (!battlecapsules) // !battleprisons
|
||||
return;
|
||||
|
||||
if ((gametyperules & GTR_POINTLIMIT) && (source && source->player))
|
||||
{
|
||||
/*mobj_t * ring;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
dir += (ANGLE_MAX/3);
|
||||
ring = P_SpawnMobj(target->x, target->y, target->z, MT_RING);
|
||||
ring->angle = dir;
|
||||
P_InstaThrust(ring, dir, 16*ring->scale);
|
||||
ring->momz = 8 * target->scale * P_MobjFlip(target);
|
||||
P_SetTarget(&ring->tracer, source);
|
||||
source->player->pickuprings++;
|
||||
}*/
|
||||
|
||||
P_AddPlayerScore(source->player, 1);
|
||||
K_SpawnBattlePoints(source->player, NULL, 1);
|
||||
}
|
||||
|
||||
if (++numtargets >= maptargets)
|
||||
{
|
||||
UINT8 i;
|
||||
boolean givelife = false;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
P_DoPlayerExit(&players[i]);
|
||||
if (!G_GametypeUsesLives())
|
||||
continue;
|
||||
P_GivePlayerLives(&players[i], 1);
|
||||
givelife = true;
|
||||
}
|
||||
|
||||
if (givelife)
|
||||
S_StartSound(NULL, sfx_cdfm73);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_StartSound(NULL, sfx_s221);
|
||||
if (timelimitintics)
|
||||
{
|
||||
extratimeintics += 10*TICRATE;
|
||||
secretextratime = TICRATE/2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks if the level timer is over the timelimit and the round should end,
|
||||
* unless you are in overtime. In which case leveltime may stretch out beyond
|
||||
* timelimitintics and overtime's status will be checked here each tick.
|
||||
|
|
@ -1524,7 +1574,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
|
||||
case MT_BATTLECAPSULE:
|
||||
{
|
||||
UINT8 i;
|
||||
mobj_t *cur;
|
||||
angle_t dir = 0;
|
||||
|
||||
|
|
@ -1571,54 +1620,19 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
|
||||
S_StartSound(target, sfx_mbs60);
|
||||
|
||||
if ((gametyperules & GTR_POINTLIMIT) && (source && source->player))
|
||||
{
|
||||
/*mobj_t * ring;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
dir += (ANGLE_MAX/3);
|
||||
ring = P_SpawnMobj(target->x, target->y, target->z, MT_RING);
|
||||
ring->angle = dir;
|
||||
P_InstaThrust(ring, dir, 16*ring->scale);
|
||||
ring->momz = 8 * target->scale * P_MobjFlip(target);
|
||||
P_SetTarget(&ring->tracer, source);
|
||||
source->player->pickuprings++;
|
||||
}*/
|
||||
|
||||
P_AddPlayerScore(source->player, 1);
|
||||
K_SpawnBattlePoints(source->player, NULL, 1);
|
||||
}
|
||||
|
||||
// All targets busted!
|
||||
if (++numtargets >= maptargets)
|
||||
{
|
||||
boolean givelife = false;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
continue;
|
||||
P_DoPlayerExit(&players[i]);
|
||||
if (!grandprixinfo.gp)
|
||||
continue;
|
||||
P_GivePlayerLives(&players[i], 1);
|
||||
givelife = true;
|
||||
}
|
||||
|
||||
if (givelife)
|
||||
S_StartSound(NULL, sfx_cdfm73);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_StartSound(NULL, sfx_s221);
|
||||
if (timelimitintics)
|
||||
{
|
||||
extratimeintics += 10*TICRATE;
|
||||
secretextratime = TICRATE/2;
|
||||
}
|
||||
}
|
||||
P_AddBrokenPrison(target, source);
|
||||
}
|
||||
break;
|
||||
|
||||
case MT_CDUFO:
|
||||
S_StartSound(inflictor, sfx_mbs60);
|
||||
|
||||
target->momz = -(3*mapobjectscale)/2;
|
||||
target->fuse = 2*TICRATE;
|
||||
|
||||
P_AddBrokenPrison(target, source);
|
||||
break;
|
||||
|
||||
case MT_BATTLEBUMPER:
|
||||
{
|
||||
mobj_t *owner = target->target;
|
||||
|
|
@ -2100,6 +2114,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
damage = Obj_MonitorGetDamage(target, inflictor, damagetype);
|
||||
Obj_MonitorOnDamage(target, inflictor, damage);
|
||||
break;
|
||||
case MT_CDUFO:
|
||||
// Make it possible to pick them up during race
|
||||
if (inflictor->type == MT_ORBINAUT_SHIELD || inflictor->type == MT_JAWZ_SHIELD)
|
||||
return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -5264,6 +5264,7 @@ static boolean P_IsTrackerType(INT32 type)
|
|||
// Primarily for minimap data, handle with care
|
||||
case MT_SPB:
|
||||
case MT_BATTLECAPSULE:
|
||||
case MT_CDUFO:
|
||||
case MT_SPECIAL_UFO:
|
||||
return true;
|
||||
|
||||
|
|
@ -8581,7 +8582,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
mobj->movecount--;
|
||||
break;
|
||||
}
|
||||
else if (P_AproxDistance(mobj->x - (mobj->spawnpoint->x<<FRACBITS), mobj->y - (mobj->spawnpoint->y<<FRACBITS)) < (420<<FRACBITS))
|
||||
else if (P_AproxDistance(mobj->x - (mobj->spawnpoint->x<<FRACBITS), mobj->y - (mobj->spawnpoint->y<<FRACBITS)) < (840*mapobjectscale))
|
||||
break;
|
||||
|
||||
mobj->movecount = 3;
|
||||
|
|
@ -10753,6 +10754,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
case MT_BIGRING:
|
||||
P_SetScale(mobj, (mobj->destscale = 3*FRACUNIT));
|
||||
break;
|
||||
case MT_CDUFO:
|
||||
P_SetScale(mobj, (mobj->destscale = 3*FRACUNIT/2));
|
||||
break;
|
||||
case MT_RANDOMAUDIENCE:
|
||||
{
|
||||
fixed_t randu = P_RandomFixed(PR_UNDEFINED);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue