mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-04 17:02:24 +00:00
Bustable material updated to:
* Take advantage of FF_MIDDLESTARTCHANCE. * Be bound to the space of a slope.
This commit is contained in:
parent
0cbbe3a3b3
commit
bf01e9e5c3
2 changed files with 32 additions and 25 deletions
32
src/info.c
32
src/info.c
|
@ -2484,22 +2484,22 @@ state_t states[NUMSTATES] =
|
|||
|
||||
{SPR_NULL, 0, 1, {A_RockSpawn}, 0, 0, S_ROCKSPAWN}, // S_ROCKSPAWN
|
||||
|
||||
{SPR_ROIA, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEA}, // S_ROCKCRUMBLEA
|
||||
{SPR_ROIB, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEB}, // S_ROCKCRUMBLEB
|
||||
{SPR_ROIC, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEC}, // S_ROCKCRUMBLEC
|
||||
{SPR_ROID, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLED}, // S_ROCKCRUMBLED
|
||||
{SPR_ROIE, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEE}, // S_ROCKCRUMBLEE
|
||||
{SPR_ROIF, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEF}, // S_ROCKCRUMBLEF
|
||||
{SPR_ROIG, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEG}, // S_ROCKCRUMBLEG
|
||||
{SPR_ROIH, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEH}, // S_ROCKCRUMBLEH
|
||||
{SPR_ROII, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEI}, // S_ROCKCRUMBLEI
|
||||
{SPR_ROIJ, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEJ}, // S_ROCKCRUMBLEJ
|
||||
{SPR_ROIK, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEK}, // S_ROCKCRUMBLEK
|
||||
{SPR_ROIL, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEL}, // S_ROCKCRUMBLEL
|
||||
{SPR_ROIM, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEM}, // S_ROCKCRUMBLEM
|
||||
{SPR_ROIN, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEN}, // S_ROCKCRUMBLEN
|
||||
{SPR_ROIO, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEO}, // S_ROCKCRUMBLEO
|
||||
{SPR_ROIP, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEP}, // S_ROCKCRUMBLEP
|
||||
{SPR_ROIA, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEA}, // S_ROCKCRUMBLEA
|
||||
{SPR_ROIB, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEB}, // S_ROCKCRUMBLEB
|
||||
{SPR_ROIC, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEC}, // S_ROCKCRUMBLEC
|
||||
{SPR_ROID, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLED}, // S_ROCKCRUMBLED
|
||||
{SPR_ROIE, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEE}, // S_ROCKCRUMBLEE
|
||||
{SPR_ROIF, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEF}, // S_ROCKCRUMBLEF
|
||||
{SPR_ROIG, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEG}, // S_ROCKCRUMBLEG
|
||||
{SPR_ROIH, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEH}, // S_ROCKCRUMBLEH
|
||||
{SPR_ROII, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEI}, // S_ROCKCRUMBLEI
|
||||
{SPR_ROIJ, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEJ}, // S_ROCKCRUMBLEJ
|
||||
{SPR_ROIK, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEK}, // S_ROCKCRUMBLEK
|
||||
{SPR_ROIL, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEL}, // S_ROCKCRUMBLEL
|
||||
{SPR_ROIM, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEM}, // S_ROCKCRUMBLEM
|
||||
{SPR_ROIN, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEN}, // S_ROCKCRUMBLEN
|
||||
{SPR_ROIO, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEO}, // S_ROCKCRUMBLEO
|
||||
{SPR_ROIP, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEP}, // S_ROCKCRUMBLEP
|
||||
|
||||
{SPR_SRBA, 0, 5, {A_Look}, 0, 0, S_SRB1_CRAWLA1}, // S_SRB1_CRAWLA1
|
||||
{SPR_SRBA, 0, 3, {A_Chase}, 0, 0, S_SRB1_CRAWLA3}, // S_SRB1_CRAWLA2
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "doomstat.h"
|
||||
#include "m_random.h"
|
||||
#include "p_local.h"
|
||||
#include "p_slopes.h"
|
||||
#include "r_state.h"
|
||||
#include "s_sound.h"
|
||||
#include "z_zone.h"
|
||||
|
@ -2893,7 +2894,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
|
|||
size_t topmostvertex = 0, bottommostvertex = 0;
|
||||
fixed_t leftx, rightx;
|
||||
fixed_t topy, bottomy;
|
||||
fixed_t topz;
|
||||
fixed_t topz, bottomz;
|
||||
fixed_t widthfactor, heightfactor;
|
||||
fixed_t a, b, c;
|
||||
mobjtype_t type = MT_ROCKCRUMBLE1;
|
||||
|
@ -2950,10 +2951,15 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
|
|||
rightx = sec->lines[rightmostvertex]->v1->x;
|
||||
topy = sec->lines[topmostvertex]->v1->y-(spacing>>1);
|
||||
bottomy = sec->lines[bottommostvertex]->v1->y;
|
||||
topz = *rover->topheight-(spacing>>1);
|
||||
|
||||
widthfactor = (rightx + topy - leftx - bottomy)>>3;
|
||||
heightfactor = (topz - *rover->bottomheight)>>2;
|
||||
topz = *rover->topheight-(spacing>>1);
|
||||
bottomz = *rover->bottomheight;
|
||||
|
||||
if (flags & ML_EFFECT1)
|
||||
{
|
||||
widthfactor = (rightx + topy - leftx - bottomy)>>3;
|
||||
heightfactor = (topz - *rover->bottomheight)>>2;
|
||||
}
|
||||
|
||||
for (a = leftx; a < rightx; a += spacing)
|
||||
{
|
||||
|
@ -2962,13 +2968,14 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
|
|||
if (R_PointInSubsector(a, b)->sector == sec)
|
||||
{
|
||||
mobj_t *spawned = NULL;
|
||||
for (c = topz; c > *rover->bottomheight; c -= spacing)
|
||||
if (*rover->t_slope)
|
||||
topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1);
|
||||
if (*rover->b_slope)
|
||||
bottomz = P_GetZAt(*rover->b_slope, a, b);
|
||||
|
||||
for (c = topz; c > bottomz; c -= spacing)
|
||||
{
|
||||
spawned = P_SpawnMobj(a, b, c, type);
|
||||
|
||||
if (spawned->frame & FF_ANIMATE)
|
||||
spawned->frame += P_RandomKey(spawned->state->var1);
|
||||
|
||||
spawned->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones
|
||||
|
||||
if (flags & ML_EFFECT1)
|
||||
|
|
Loading…
Reference in a new issue