void T_WallDie (objtype *ob) { id0_unsigned_t tile,other; if (++ob->temp1 == 3) tile = 0; else tile = WALLEXP-1 + ob->temp1; /*(id0_unsigned_t)actorat[ob->tilex][ob->tiley] = */tilemap[ob->tilex][ob->tiley] = *(mapsegs[0]+farmapylookup[ob->tiley]+ob->tilex) = tile; actorat[ob->tilex][ob->tiley] = tilemap[ob->tilex][ob->tiley]; if (ob->temp1 == 1) { // // blow up nearby walls // other = tilemap[ob->tilex-1][ob->tiley]; if ((id0_unsigned_t)(other-EXPWALLSTART)<NUMEXPWALLS) ExplodeWall (ob->tilex-1,ob->tiley); other = tilemap[ob->tilex+1][ob->tiley]; if ((id0_unsigned_t)(other-EXPWALLSTART)<NUMEXPWALLS) ExplodeWall (ob->tilex+1,ob->tiley); other = tilemap[ob->tilex][ob->tiley-1]; if ((id0_unsigned_t)(other-EXPWALLSTART)<NUMEXPWALLS) ExplodeWall (ob->tilex,ob->tiley-1); other = tilemap[ob->tilex][ob->tiley+1]; if ((id0_unsigned_t)(other-EXPWALLSTART)<NUMEXPWALLS) ExplodeWall (ob->tilex,ob->tiley+1); } }
void T_WallDie (objtype *ob) { extern id0_unsigned_t gcolor; id0_unsigned_t tile/*,other*/,spot,x,y; if (++ob->temp1 == 3) tile = 0; else if (gcolor == 0x0101) tile = WATEREXP-1 + ob->temp1; else tile = WALLEXP-1 + ob->temp1; x = ob->tilex; y = ob->tiley; /*(id0_unsigned_t)actorat[x][y] = */tilemap[x][y] = *(mapsegs[0]+farmapylookup[y]+x) = tile; actorat[x][y] = tilemap[x][y]; if (ob->temp1 == 1) { // // blow up nearby walls // spot = (*(mapsegs[2]+farmapylookup[y]+(x-1))) >> 8; if (spot == EXP_WALL_CODE) ExplodeWall (x-1,y); spot = (*(mapsegs[2]+farmapylookup[y]+(x+1))) >> 8; if (spot == EXP_WALL_CODE) ExplodeWall (x+1,y); spot = (*(mapsegs[2]+farmapylookup[y-1]+x)) >> 8; if (spot == EXP_WALL_CODE) ExplodeWall (x,y-1); spot = (*(mapsegs[2]+farmapylookup[y+1]+x)) >> 8; if (spot == EXP_WALL_CODE) ExplodeWall (x,y+1); }
// ------------------------------------------------------------------------------- //when the CWall has used all its hitpoints, this will destroy it void CSegment::BlastWall (int nSide) { short nConnSide; CSegment* connSegP; int a, n; short nConnWall; CWall* wallP = Wall (nSide); if (!wallP) return; wallP->hps = -1; //say it's blasted if (m_children [nSide] < 0) { if (gameOpts->legacy.bWalls) Warning (TXT_BLAST_SINGLE, this - SEGMENTS, nSide, wallP - WALLS); connSegP = NULL; nConnSide = -1; nConnWall = NO_WALL; } else { connSegP = SEGMENTS + m_children [nSide]; nConnSide = ConnectedSide (connSegP); Assert (nConnSide != -1); nConnWall = connSegP->WallNum (nConnSide); KillStuckObjects (nConnWall); } KillStuckObjects (WallNum (nSide)); //if this is an exploding wall, explode it if ((gameData.walls.animP [wallP->nClip].flags & WCF_EXPLODES) && !(wallP->flags & WALL_BLASTED)) ExplodeWall (Index (), nSide); else { //if not exploding, set final frame, and make door passable a = wallP->nClip; n = AnimFrameCount (gameData.walls.animP + a); SetTexture (nSide, connSegP, nConnSide, a, n - 1); wallP->flags |= WALL_BLASTED; if (IS_WALL (nConnWall)) WALLS [nConnWall].flags |= WALL_BLASTED; } }