mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'battle-rethink' of https://git.do.srb2.org/KartKrew/Kart into battle-rethink
This commit is contained in:
commit
0f492f4300
6 changed files with 38 additions and 59 deletions
|
|
@ -8226,7 +8226,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
16, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SPECIAL, // flags
|
||||
MF_SPECIAL|MF_PICKUPFROMBELOW, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
@ -22769,7 +22769,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SLIDEME|MF_DONTENCOREMAP, // flags
|
||||
MF_SLIDEME|MF_SPECIAL|MF_PICKUPFROMBELOW|MF_DONTENCOREMAP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -404,34 +404,3 @@ boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2)
|
|||
K_KartBouncing(t2, t1, false, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean K_FloatingItemCollide(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
player_t * player = t2->player;
|
||||
|
||||
if (t1->flags2 & MF2_NIGHTSPULL)
|
||||
return true;
|
||||
|
||||
if (! player)
|
||||
return true;
|
||||
|
||||
if (!P_CanPickupItem(player, 3) || (player->kartstuff[k_itemamount] && player->kartstuff[k_itemtype] != t1->threshold))
|
||||
return true;
|
||||
|
||||
if ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0)
|
||||
return true;
|
||||
|
||||
player->kartstuff[k_itemtype] = t1->threshold;
|
||||
player->kartstuff[k_itemamount] += t1->movecount;
|
||||
if (player->kartstuff[k_itemamount] > 255)
|
||||
player->kartstuff[k_itemamount] = 255;
|
||||
|
||||
S_StartSound(t1, t1->info->deathsound);
|
||||
|
||||
P_SetTarget(&t1->tracer, t2);
|
||||
t1->flags2 |= MF2_NIGHTSPULL;
|
||||
t1->destscale = mapobjectscale>>4;
|
||||
t1->scalespeed <<= 1;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,5 @@ boolean K_MineExplosionCollide(mobj_t *t1, mobj_t *t2);
|
|||
boolean K_KitchenSinkCollide(mobj_t *t1, mobj_t *t2);
|
||||
boolean K_FallingRockCollide(mobj_t *t1, mobj_t *t2);
|
||||
boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2);
|
||||
boolean K_FloatingItemCollide(mobj_t *t1, mobj_t *t2);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -184,15 +184,24 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
if (heightcheck)
|
||||
{
|
||||
fixed_t toucher_bottom = toucher->z;
|
||||
fixed_t special_bottom = special->z;
|
||||
|
||||
if (toucher->flags & MF_PICKUPFROMBELOW)
|
||||
toucher_bottom -= toucher->height;
|
||||
|
||||
if (special->flags & MF_PICKUPFROMBELOW)
|
||||
special_bottom -= special->height;
|
||||
|
||||
if (toucher->momz < 0) {
|
||||
if (toucher->z + toucher->momz > special->z + special->height)
|
||||
if (toucher_bottom + toucher->momz > special->z + special->height)
|
||||
return;
|
||||
} else if (toucher->z > special->z + special->height)
|
||||
} else if (toucher_bottom > special->z + special->height)
|
||||
return;
|
||||
if (toucher->momz > 0) {
|
||||
if (toucher->z + toucher->height + toucher->momz < special->z)
|
||||
if (toucher->z + toucher->height + toucher->momz < special_bottom)
|
||||
return;
|
||||
} else if (toucher->z + toucher->height < special->z)
|
||||
} else if (toucher->z + toucher->height < special_bottom)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -233,6 +242,27 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
P_SetObjectMomZ(player->mo, 12<<FRACBITS, false);
|
||||
P_InstaThrust(player->mo, player->mo->angle, 20<<FRACBITS);
|
||||
return;
|
||||
case MT_FLOATINGITEM: // SRB2Kart
|
||||
if (!P_CanPickupItem(player, 3) || (player->kartstuff[k_itemamount] && player->kartstuff[k_itemtype] != special->threshold))
|
||||
return;
|
||||
|
||||
if ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0)
|
||||
return;
|
||||
|
||||
player->kartstuff[k_itemtype] = special->threshold;
|
||||
player->kartstuff[k_itemamount] += special->movecount;
|
||||
if (player->kartstuff[k_itemamount] > 255)
|
||||
player->kartstuff[k_itemamount] = 255;
|
||||
|
||||
S_StartSound(special, special->info->deathsound);
|
||||
|
||||
P_SetTarget(&special->tracer, toucher);
|
||||
special->flags2 |= MF2_NIGHTSPULL;
|
||||
special->destscale = mapobjectscale>>4;
|
||||
special->scalespeed <<= 1;
|
||||
|
||||
special->flags &= ~MF_SPECIAL;
|
||||
return;
|
||||
case MT_RANDOMITEM:
|
||||
if (!P_CanPickupItem(player, 1))
|
||||
return;
|
||||
|
|
|
|||
21
src/p_map.c
21
src/p_map.c
|
|
@ -970,27 +970,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return K_FallingRockCollide(thing, tmthing);
|
||||
}
|
||||
|
||||
if (tmthing->type == MT_FLOATINGITEM)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z - tmthing->height > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z) // extended hitbox
|
||||
return true; // underneath
|
||||
|
||||
return K_FloatingItemCollide(tmthing, thing);
|
||||
}
|
||||
else if (thing->type == MT_FLOATINGITEM)
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
if (tmthing->z + tmthing->height < thing->z - thing->height) // extended hitbox
|
||||
return true; // underneath
|
||||
|
||||
return K_FloatingItemCollide(thing, tmthing);
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
if ((thing->type == MT_SPRINGSHELL || thing->type == MT_YELLOWSHELL) && thing->health > 0
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ typedef enum
|
|||
MF_RUNSPAWNFUNC = 1<<27,
|
||||
// Don't remap in Encore mode. (Not a drawflag so that it's settable by mobjinfo.)
|
||||
MF_DONTENCOREMAP = 1<<28,
|
||||
// Hitbox extends just as far below as above.
|
||||
MF_PICKUPFROMBELOW = 1<<29,
|
||||
// free: to and including 1<<31
|
||||
} mobjflag_t;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue