mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Item Capsules use args
This commit is contained in:
parent
c1581d0f75
commit
77ec64497c
3 changed files with 32 additions and 10 deletions
16
src/p_mobj.c
16
src/p_mobj.c
|
|
@ -11666,7 +11666,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
|
||||||
{
|
{
|
||||||
case MT_ITEMCAPSULE:
|
case MT_ITEMCAPSULE:
|
||||||
{
|
{
|
||||||
boolean isRingCapsule = (mthing->angle < 1 || mthing->angle == KITEM_SUPERRING || mthing->angle >= NUMKARTITEMS);
|
boolean isRingCapsule = (mthing->args[0] < 1 || mthing->args[0] == KITEM_SUPERRING || mthing->args[0] >= NUMKARTITEMS);
|
||||||
|
|
||||||
// don't spawn ring capsules in GTR_SPHERES gametypes
|
// don't spawn ring capsules in GTR_SPHERES gametypes
|
||||||
if (isRingCapsule && (gametyperules & GTR_SPHERES))
|
if (isRingCapsule && (gametyperules & GTR_SPHERES))
|
||||||
|
|
@ -11675,7 +11675,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
|
||||||
// in record attack, only spawn ring capsules
|
// in record attack, only spawn ring capsules
|
||||||
// (behavior can be inverted with the Extra flag, i.e. item capsule spawns and ring capsule does not)
|
// (behavior can be inverted with the Extra flag, i.e. item capsule spawns and ring capsule does not)
|
||||||
if (modeattacking
|
if (modeattacking
|
||||||
&& (!(mthing->options & MTF_EXTRA) == !isRingCapsule))
|
&& (!(mthing->args[2] & TMICF_INVERTTIMEATTACK) == !isRingCapsule))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -12624,18 +12624,14 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
|
||||||
mobj->flags |= MF_NOGRAVITY;
|
mobj->flags |= MF_NOGRAVITY;
|
||||||
|
|
||||||
// Angle = item type
|
// Angle = item type
|
||||||
if (mthing->angle > 0 && mthing->angle < NUMKARTITEMS)
|
if (mthing->args[0] > 0 && mthing->args[0] < NUMKARTITEMS)
|
||||||
mobj->threshold = mthing->angle;
|
mobj->threshold = mthing->args[0];
|
||||||
|
|
||||||
// Parameter = extra items (x5 for rings)
|
// Parameter = extra items (x5 for rings)
|
||||||
mobj->movecount += mthing->extrainfo;
|
mobj->movecount += mthing->args[1];
|
||||||
|
|
||||||
// Special = +16 items (+80 for rings)
|
|
||||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
|
||||||
mobj->movecount += 16;
|
|
||||||
|
|
||||||
// Ambush = double size (grounded) / half size (aerial)
|
// Ambush = double size (grounded) / half size (aerial)
|
||||||
if (!(mthing->options & MTF_AMBUSH) == !P_IsObjectOnGround(mobj))
|
if (!(mthing->args[2] & TMICF_INVERTSIZE) == !P_IsObjectOnGround(mobj))
|
||||||
{
|
{
|
||||||
mobj->extravalue1 = min(mobj->extravalue1 << 1, FixedDiv(64*FRACUNIT, mobj->info->radius)); // don't make them larger than the blockmap can handle
|
mobj->extravalue1 = min(mobj->extravalue1 << 1, FixedDiv(64*FRACUNIT, mobj->info->radius)); // don't make them larger than the blockmap can handle
|
||||||
mobj->scalespeed <<= 1;
|
mobj->scalespeed <<= 1;
|
||||||
|
|
|
||||||
|
|
@ -6497,6 +6497,26 @@ static void P_ConvertBinaryThingTypes(void)
|
||||||
mapthings[i].args[0] = mapthings[i].angle;
|
mapthings[i].args[0] = mapthings[i].angle;
|
||||||
mapthings[i].args[1] = mapthings[i].extrainfo;
|
mapthings[i].args[1] = mapthings[i].extrainfo;
|
||||||
break;
|
break;
|
||||||
|
case 2010: // MT_ITEMCAPSULE
|
||||||
|
mapthings[i].args[0] = mapthings[i].angle;
|
||||||
|
mapthings[i].args[1] = mapthings[i].extrainfo;
|
||||||
|
|
||||||
|
if (mapthings[i].options & MTF_OBJECTSPECIAL)
|
||||||
|
{
|
||||||
|
// Special = +16 items (+80 for rings)
|
||||||
|
mapthings[i].args[1] += 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapthings[i].options & MTF_EXTRA)
|
||||||
|
{
|
||||||
|
mapthings[i].args[2] |= TMICF_INVERTTIMEATTACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mapthings[i].options & MTF_AMBUSH)
|
||||||
|
{
|
||||||
|
mapthings[i].args[2] |= TMICF_INVERTSIZE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 2333: // MT_BATTLECAPSULE
|
case 2333: // MT_BATTLECAPSULE
|
||||||
mapthings[i].args[0] = mapthings[i].extrainfo;
|
mapthings[i].args[0] = mapthings[i].extrainfo;
|
||||||
mapthings[i].args[1] = mapthings[i].angle;
|
mapthings[i].args[1] = mapthings[i].angle;
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,12 @@ typedef enum
|
||||||
TMBCF_REVERSE = 1<<1,
|
TMBCF_REVERSE = 1<<1,
|
||||||
} textmapbattlecapsuleflags_t;
|
} textmapbattlecapsuleflags_t;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
TMICF_INVERTTIMEATTACK = 1,
|
||||||
|
TMICF_INVERTSIZE = 1<<1,
|
||||||
|
} textmapitemcapsuleflags_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
TMFF_AIMLESS = 1,
|
TMFF_AIMLESS = 1,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue