I try adding Blake Stone type enemy respawn in my Wolf 3D mod. But I found problem. Not respawn enemy as in The Lost Relic,that respawn enemy.
WL_DEF.H:
WL_ACT2.CPP:
WL_DEF.H:
- Code:
FL_SOLID = 0x00000200,
WL_ACT2.CPP:
- Code:
void T_GuardWound(objtype *ob);
statetype s_grddie4 = {false,SPR_GRD_DEAD,0,(statefunc)T_GuardWound,NULL,&s_grddie4};
//---------------------------------------------------------------------------
// T_GuardWound()
//---------------------------------------------------------------------------
void T_GuardWound(objtype *ob)
{
int32_t dx,dy;
if (ob->state == &s_grddie4)
{
ob->flags |= FL_SOLID |FL_SHOOTABLE;
}
else
{
if (ob->temp2)
if (tics < ob->temp2)
{
ob->temp2 -= tics;
return;
}
ob->temp2 = 0;
dx = player->x - ob->x;
dx = LABS(dx);
dy = player->y - ob->y;
dy = LABS(dy);
if (dy > TILEGLOBAL || dx > TILEGLOBAL)
{
ob->flags |= FL_SOLID | FL_SHOOTABLE;
NewState (ob,&s_grddie1);
}
// if ((ob->tilex != player->tilex) && (ob->tiley != player->tiley))
// NewState(ob,&s_grddie1);
}
}