From 67ff06d6e49c0b7cf378ec0542896f8e99605994 Mon Sep 17 00:00:00 2001 From: James Haley Date: Fri, 17 Sep 2010 01:52:09 +0000 Subject: Vetted all existing floor types and modified/added ones which changed. Finished up line type 145, WR Exit Level to Spot, and added the G_RiftPlayer call to G_DoWorldDone. Subversion-branch: /branches/strife-branch Subversion-revision: 2096 --- src/strife/p_floor.c | 366 +++++++++++++++++++++++++++------------------------ 1 file changed, 191 insertions(+), 175 deletions(-) (limited to 'src/strife/p_floor.c') diff --git a/src/strife/p_floor.c b/src/strife/p_floor.c index 8f434fe6..8c676452 100644 --- a/src/strife/p_floor.c +++ b/src/strife/p_floor.c @@ -263,189 +263,205 @@ void T_MoveFloor(floormove_t* floor) // // HANDLE FLOOR TYPES // +// haleyjd 09/16/2010: [STRIFE] Modifications to floortypes: +// * raiseFloor24 was changed into raiseFloor64 +// * turboLower does not appear to adjust the floor height (STRIFE-TODO: verify) +// * raiseFloor512AndChange type was added. +// int EV_DoFloor -( line_t* line, - floor_e floortype ) +( line_t* line, + floor_e floortype ) { - int secnum; - int rtn; - int i; - sector_t* sec; - floormove_t* floor; + int secnum; + int rtn; + int i; + sector_t* sec; + floormove_t* floor; secnum = -1; rtn = 0; while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0) { - sec = §ors[secnum]; - - // ALREADY MOVING? IF SO, KEEP GOING... - if (sec->specialdata) - continue; - - // new floor thinker - rtn = 1; - floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0); - P_AddThinker (&floor->thinker); - sec->specialdata = floor; - floor->thinker.function.acp1 = (actionf_p1) T_MoveFloor; - floor->type = floortype; - floor->crush = false; - - switch(floortype) - { - case lowerFloor: - floor->direction = -1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = - P_FindHighestFloorSurrounding(sec); - break; - - case lowerFloorToLowest: - floor->direction = -1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = - P_FindLowestFloorSurrounding(sec); - break; - - case turboLower: - floor->direction = -1; - floor->sector = sec; - floor->speed = FLOORSPEED * 4; - floor->floordestheight = - P_FindHighestFloorSurrounding(sec); - if (floor->floordestheight != sec->floorheight) - floor->floordestheight += 8*FRACUNIT; - break; - - case raiseFloorCrush: - floor->crush = true; - case raiseFloor: - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = - P_FindLowestCeilingSurrounding(sec); - if (floor->floordestheight > sec->ceilingheight) - floor->floordestheight = sec->ceilingheight; - floor->floordestheight -= (8*FRACUNIT)* - (floortype == raiseFloorCrush); - break; - - case raiseFloorTurbo: - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED*4; - floor->floordestheight = - P_FindNextHighestFloor(sec,sec->floorheight); - break; - - case raiseFloorToNearest: - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = - P_FindNextHighestFloor(sec,sec->floorheight); - break; - - case raiseFloor24: - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = floor->sector->floorheight + - 24 * FRACUNIT; - break; - case raiseFloor512: - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = floor->sector->floorheight + - 512 * FRACUNIT; - break; - - case raiseFloor24AndChange: - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = floor->sector->floorheight + - 24 * FRACUNIT; - sec->floorpic = line->frontsector->floorpic; - sec->special = line->frontsector->special; - break; - - case raiseToTexture: - { - int minsize = INT_MAX; - side_t* side; - - floor->direction = 1; - floor->sector = sec; - floor->speed = FLOORSPEED; - for (i = 0; i < sec->linecount; i++) - { - if (twoSided (secnum, i) ) - { - side = getSide(secnum,i,0); - if (side->bottomtexture >= 0) - if (textureheight[side->bottomtexture] < - minsize) - minsize = - textureheight[side->bottomtexture]; - side = getSide(secnum,i,1); - if (side->bottomtexture >= 0) - if (textureheight[side->bottomtexture] < - minsize) - minsize = - textureheight[side->bottomtexture]; - } - } - floor->floordestheight = - floor->sector->floorheight + minsize; - } - break; - - case lowerAndChange: - floor->direction = -1; - floor->sector = sec; - floor->speed = FLOORSPEED; - floor->floordestheight = - P_FindLowestFloorSurrounding(sec); - floor->texture = sec->floorpic; - - for (i = 0; i < sec->linecount; i++) - { - if ( twoSided(secnum, i) ) - { - if (getSide(secnum,i,0)->sector-sectors == secnum) - { - sec = getSector(secnum,i,1); - - if (sec->floorheight == floor->floordestheight) - { - floor->texture = sec->floorpic; - floor->newspecial = sec->special; - break; - } - } - else - { - sec = getSector(secnum,i,0); - - if (sec->floorheight == floor->floordestheight) - { - floor->texture = sec->floorpic; - floor->newspecial = sec->special; - break; - } - } - } - } - default: - break; - } + sec = §ors[secnum]; + + // ALREADY MOVING? IF SO, KEEP GOING... + if (sec->specialdata) + continue; + + // new floor thinker + rtn = 1; + floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0); + P_AddThinker (&floor->thinker); + sec->specialdata = floor; + floor->thinker.function.acp1 = (actionf_p1) T_MoveFloor; + floor->type = floortype; + floor->crush = false; + + switch(floortype) + { + case lowerFloor: // [STRIFE] verified unmodified + floor->direction = -1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = + P_FindHighestFloorSurrounding(sec); + break; + + case lowerFloorToLowest: // [STRIFE] verified unmodified + floor->direction = -1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = + P_FindLowestFloorSurrounding(sec); + break; + + case turboLower: // [STRIFE] Modified: does not += 8 + floor->direction = -1; + floor->sector = sec; + floor->speed = FLOORSPEED * 4; + floor->floordestheight = + P_FindHighestFloorSurrounding(sec); + //if (floor->floordestheight != sec->floorheight) + // floor->floordestheight += 8*FRACUNIT; + break; + + case raiseFloorCrush: // [STRIFE] verified unmodified + floor->crush = true; + case raiseFloor: + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = + P_FindLowestCeilingSurrounding(sec); + if (floor->floordestheight > sec->ceilingheight) + floor->floordestheight = sec->ceilingheight; + floor->floordestheight -= (8*FRACUNIT)* + (floortype == raiseFloorCrush); + break; + + case raiseFloorTurbo: // [STRIFE] verified unmodified + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED*4; + floor->floordestheight = + P_FindNextHighestFloor(sec,sec->floorheight); + break; + + case raiseFloorToNearest: // [STRIFE] verified unmodified + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = + P_FindNextHighestFloor(sec,sec->floorheight); + break; + + case raiseFloor64: // [STRIFE] modified from raiseFloor24! + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = floor->sector->floorheight + + 64 * FRACUNIT; // [STRIFE] + break; + + case raiseFloor512: // [STRIFE] verified unmodified + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = floor->sector->floorheight + + 512 * FRACUNIT; + break; + + case raiseFloor24AndChange: // [STRIFE] verified unmodified + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = floor->sector->floorheight + + 24 * FRACUNIT; + sec->floorpic = line->frontsector->floorpic; + sec->special = line->frontsector->special; + break; + + case raiseFloor512AndChange: // [STRIFE] New floor type + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = floor->sector->floorheight + + 512 * FRACUNIT; + sec->floorpic = line->frontsector->floorpic; + sec->special = line->frontsector->special; + break; + + case raiseToTexture: // [STRIFE] verified unmodified + { + int minsize = INT_MAX; + side_t* side; + + floor->direction = 1; + floor->sector = sec; + floor->speed = FLOORSPEED; + for (i = 0; i < sec->linecount; i++) + { + if (twoSided (secnum, i) ) + { + side = getSide(secnum,i,0); + if (side->bottomtexture >= 0) + if (textureheight[side->bottomtexture] < + minsize) + minsize = + textureheight[side->bottomtexture]; + side = getSide(secnum,i,1); + if (side->bottomtexture >= 0) + if (textureheight[side->bottomtexture] < + minsize) + minsize = + textureheight[side->bottomtexture]; + } + } + floor->floordestheight = + floor->sector->floorheight + minsize; + } + break; + + case lowerAndChange: // [STRIFE] verified unmodified + floor->direction = -1; + floor->sector = sec; + floor->speed = FLOORSPEED; + floor->floordestheight = + P_FindLowestFloorSurrounding(sec); + floor->texture = sec->floorpic; + + for (i = 0; i < sec->linecount; i++) + { + if ( twoSided(secnum, i) ) + { + if (getSide(secnum,i,0)->sector-sectors == secnum) + { + sec = getSector(secnum,i,1); + + if (sec->floorheight == floor->floordestheight) + { + floor->texture = sec->floorpic; + floor->newspecial = sec->special; + break; + } + } + else + { + sec = getSector(secnum,i,0); + + if (sec->floorheight == floor->floordestheight) + { + floor->texture = sec->floorpic; + floor->newspecial = sec->special; + break; + } + } + } + } + default: + break; + } } return rtn; } -- cgit v1.2.3