- checkfluid

This commit is contained in:
Christoph Oelckers 2021-11-14 17:59:48 +01:00
parent 5b84755aed
commit 09950ffa0a
19 changed files with 23 additions and 22 deletions

View file

@ -427,7 +427,7 @@ void aiProcess() {
int i = actor->GetSpriteIndex(); int i = actor->GetSpriteIndex();
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z = zr_florz + (tileHeight(spr.picnum) << 5); spr.z = zr_florz + (tileHeight(spr.picnum) << 5);
@ -560,8 +560,9 @@ boolean checksector6(DWHActor* actor) {
return false; return false;
} }
int checkfluid(int i, Collision& florHit) { int checkfluid(DWHActor* actor, Collision& florHit)
SPRITE& spr = sprite[i]; {
SPRITE& spr = actor->s();
if (isValidSector(spr.sectnum) && florHit.type == kHitSector && (spr.sector()->floorpicnum == WATER if (isValidSector(spr.sectnum) && florHit.type == kHitSector && (spr.sector()->floorpicnum == WATER
/* || spr.sector()->floorpicnum == LAVA2 */ || spr.sector()->floorpicnum == LAVA /* || spr.sector()->floorpicnum == LAVA2 */ || spr.sector()->floorpicnum == LAVA
|| spr.sector()->floorpicnum == SLIME || spr.sector()->floorpicnum == FLOORMIRROR || spr.sector()->floorpicnum == SLIME || spr.sector()->floorpicnum == FLOORMIRROR
@ -583,7 +584,7 @@ int checkfluid(int i, Collision& florHit) {
void processfluid(DWHActor* actor, Collision& florHit, boolean fly) { void processfluid(DWHActor* actor, Collision& florHit, boolean fly) {
SPRITE& spr = actor->s(); SPRITE& spr = actor->s();
switch (checkfluid(actor->GetSpriteIndex(), florHit)) { switch (checkfluid(actor, florHit)) {
case TYPELAVA: case TYPELAVA:
if (!fly) { if (!fly) {
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -124,7 +124,7 @@ Collision aimove(DWHActor* actor);
Collision aifly(DWHActor* i); Collision aifly(DWHActor* i);
void aisearch(PLAYER& plr, DWHActor* i, boolean fly); void aisearch(PLAYER& plr, DWHActor* i, boolean fly);
boolean checksector6(DWHActor* i); boolean checksector6(DWHActor* i);
int checkfluid(int i, Collision& florhit); int checkfluid(DWHActor* i, Collision& florhit);
void processfluid(DWHActor* i, Collision& florHit, boolean fly); void processfluid(DWHActor* i, Collision& florHit, boolean fly);
void castspell(PLAYER& plr, DWHActor* i); void castspell(PLAYER& plr, DWHActor* i);
void skullycastspell(PLAYER& plr, int i); void skullycastspell(PLAYER& plr, int i);

View file

@ -173,7 +173,7 @@ static void attackdevil(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -151,7 +151,7 @@ static void attackfatwitch(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -91,7 +91,7 @@ static void attackfish(PLAYER& plr, DWHActor* actor)
spr.z = spr.sector()->floorz; spr.z = spr.sector()->floorz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)

View file

@ -191,7 +191,7 @@ static void attackfred(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)

View file

@ -237,7 +237,7 @@ static void attackgoblin(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)

View file

@ -363,7 +363,7 @@ static void attackgonzo(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -292,7 +292,7 @@ static void attackgron(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)

View file

@ -243,7 +243,7 @@ static void attackimp(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)

View file

@ -163,7 +163,7 @@ static void attackjudy(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -138,7 +138,7 @@ static void attackkatie(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -211,7 +211,7 @@ static void attackkobold(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) switch (checkfluid(actor, zr_florHit))
{ {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:

View file

@ -215,7 +215,7 @@ static void attackminotaur(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)

View file

@ -270,7 +270,7 @@ static void attacknewguy(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -73,7 +73,7 @@ static void fleerat(PLAYER& plr, DWHActor* actor)
processfluid(actor, zr_florHit, false); processfluid(actor, zr_florHit, false);
// switch (checkfluid(i, zr_florHit)) { // switch (checkfluid(actor, zr_florHit)) {
// case TYPELAVA: // case TYPELAVA:
// case TYPEWATER: // case TYPEWATER:
// spr.z += tileHeight(spr.picnum) << 5; // spr.z += tileHeight(spr.picnum) << 5;

View file

@ -219,7 +219,7 @@ static void attackskeleton(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -150,7 +150,7 @@ static void attackskully(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
case TYPEWATER: case TYPEWATER:
spr.z += tileHeight(spr.picnum) << 5; spr.z += tileHeight(spr.picnum) << 5;

View file

@ -192,7 +192,7 @@ static void attackspider(PLAYER& plr, DWHActor* actor)
getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0); getzrange(spr.x, spr.y, spr.z - 1, spr.sectnum, (spr.clipdist) << 2, CLIPMASK0);
spr.z = zr_florz; spr.z = zr_florz;
switch (checkfluid(i, zr_florHit)) { switch (checkfluid(actor, zr_florHit)) {
case TYPELAVA: case TYPELAVA:
spr.hitag--; spr.hitag--;
if (spr.hitag < 0) if (spr.hitag < 0)