Make anchoring non-specific to Ideya states (now anchor anything!)

# Conflicts:
#	src/p_inter.c
This commit is contained in:
mazmazz 2018-08-13 02:19:53 -04:00
parent 06bbafec2f
commit bec3a6884c
3 changed files with 21 additions and 24 deletions

View File

@ -811,38 +811,32 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
mobj_t *orbittarget = special->target ? special->target : special;
mobj_t *hnext = orbittarget->hnext, *anchorpoint = NULL;
mobj_t *mo2;
thinker_t *th;
UINT16 ideyanum = toucher->tracer->health;
if (toucher->tracer->type == MT_GOTEMERALD
&& toucher->tracer->state-states >= S_ORBIDYA1
&& toucher->tracer->state-states <= S_ORBIDYA5)
// scan the thinkers to find the corresponding anchorpoint
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
mobj_t *mo2;
thinker_t *th;
UINT16 ideyanum = (toucher->tracer->state-states) - mobjinfo[MT_GOTEMERALD].missilestate;
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
// scan the thinkers to find the corresponding anchorpoint
for (th = thinkercap.next; th != &thinkercap; th = th->next)
mo2 = (mobj_t *)th;
if (mo2->type == MT_IDEYAANCHOR)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
continue;
mo2 = (mobj_t *)th;
if (mo2->type == MT_IDEYAANCHOR)
if(mo2->health == ideyanum)
{
if(mo2->health == ideyanum)
{
anchorpoint = mo2;
break;
}
anchorpoint = mo2;
break;
}
}
}
if (anchorpoint)
{
toucher->tracer->flags |= MF_GRENADEBOUNCE; // custom radius factors
toucher->tracer->threshold = 8 << 20; // X factor 0, Y factor 0, Z factor 8
}
if (anchorpoint)
{
toucher->tracer->flags |= MF_GRENADEBOUNCE; // custom radius factors
toucher->tracer->threshold = 8 << 20; // X factor 0, Y factor 0, Z factor 8
}
P_SetTarget(&orbittarget->hnext, toucher->tracer);

View File

@ -9610,6 +9610,7 @@ void P_SpawnPlayer(INT32 playernum)
if (p == players) // this is totally the wrong place to do this aaargh.
{
mobj_t *idya = P_SpawnMobjFromMobj(mobj, 0, 0, mobj->height, MT_GOTEMERALD);
idya->health = 0; // for identification
P_SetTarget(&idya->target, mobj);
P_SetMobjState(idya, mobjinfo[MT_GOTEMERALD].missilestate);
P_SetTarget(&mobj->tracer, idya);

View File

@ -6055,6 +6055,7 @@ static void P_DoNiGHTSCapsule(player_t *player)
UINT8 em = P_GetNextEmerald();
// Only give it to ONE person, and THAT player has to get to the goal!
mobj_t *emmo = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height, MT_GOTEMERALD);
emmo->health = em; // for identification
P_SetTarget(&emmo->target, player->mo);
P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em);
P_SetTarget(&player->mo->tracer, emmo);
@ -6081,6 +6082,7 @@ static void P_DoNiGHTSCapsule(player_t *player)
}*/
mobj_t *idya = P_SpawnMobjFromMobj(player->mo, 0, 0, player->mo->height, MT_GOTEMERALD);
idya->extravalue2 = player->mare/5;
idya->health = player->mare + 1; // for identification
P_SetTarget(&idya->target, player->mo);
P_SetMobjState(idya, mobjinfo[MT_GOTEMERALD].missilestate + ((player->mare + 1) % 5));
P_SetTarget(&player->mo->tracer, idya);