Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8785 → Rev 8786

/source/duke3d/src/actors.cpp
101,8 → 101,13
auto const pSprite = (uspriteptr_t)&sprite[spriteNum];
auto const pOther = &sprite[otherSprite];
 
 
// DEFAULT, ZOMBIEACTOR, MISC
if (pOther->statnum == STAT_DEFAULT || pOther->statnum == STAT_ZOMBIEACTOR || pOther->statnum == STAT_MISC || AFLAMABLE(pOther->picnum))
if (pOther->statnum == STAT_DEFAULT || pOther->statnum == STAT_ZOMBIEACTOR || pOther->statnum == STAT_MISC
#ifndef EDUKE32_STANDALONE
|| (!FURY && AFLAMABLE(pOther->picnum))
#endif
)
{
#ifndef EDUKE32_STANDALONE
if (pSprite->picnum != SHRINKSPARK || (pOther->cstat&257))
155,7 → 160,8
#endif
)
dmgActor.picnum = pSprite->picnum;
else dmgActor.picnum = RADIUSEXPLOSION;
else
dmgActor.picnum = RADIUSEXPLOSION;
 
#ifndef EDUKE32_STANDALONE
if (pSprite->picnum != SHRINKSPARK)
1049,11 → 1055,12
: sector[pSprite->sectnum].floorshade;
actor[spriteNum].timetosleep = 0;
changespritestat(spriteNum, STAT_STANDABLE);
break;
}
break;
fallthrough__;
 
case RECON__STATIC:
if (!FURY)
if (!FURY && pSprite->picnum == RECON)
CS(spriteNum) |= 257;
fallthrough__;
#endif
3356,7 → 3363,8
case SPIT__STATIC:
case COOLEXPLOSION1__STATIC:
case FREEZEBLAST__STATIC:
case FIRELASER__STATIC: break;
case FIRELASER__STATIC:
break;
 
case RPG__STATIC:
{
/source/duke3d/src/cheats.cpp
413,9 → 413,9
{
case CHEAT_WEAPONS:
{
int const weaponLimit = (VOLUMEONE) ? 6 : 0;
int const weaponLimit = (VOLUMEONE) ? SHRINKER_WEAPON : MAX_WEAPONS;
 
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS-weaponLimit; weaponNum++)
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
{
P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]);
pPlayer->gotweapon |= (1<<weaponNum);
534,12 → 534,12
 
case CHEAT_STUFF:
{
int const weaponLimit = (VOLUMEONE) ? 6 : 0;
int const weaponLimit = (VOLUMEONE) ? SHRINKER_WEAPON : MAX_WEAPONS;
 
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS-weaponLimit; weaponNum++)
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
pPlayer->gotweapon |= (1<<weaponNum);
 
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS-weaponLimit; weaponNum++)
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]);
 
G_CheatGetInv(pPlayer);
/source/duke3d/src/game.cpp
1537,65 → 1537,10
#endif
switch (DYNAMICTILEMAP(pSprite->picnum))
{
default:
if (G_HaveActor(pSprite->picnum))
{
if (spriteNum == -1 && pSprite->lotag > ud.player_skill)
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
}
 
// Init the size
if (pSprite->xrepeat == 0 || pSprite->yrepeat == 0)
pSprite->xrepeat = pSprite->yrepeat = 1;
 
if (A_CheckSpriteFlags(newSprite, SFLAG_BADGUY))
{
if (ud.monsters_off == 1)
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
}
 
A_Fall(newSprite);
 
if (A_CheckSpriteFlags(newSprite, SFLAG_BADGUYSTAYPUT))
pActor->stayput = pSprite->sectnum;
 
g_player[myconnectindex].ps->max_actors_killed++;
pSprite->clipdist = 80;
 
if (spriteNum >= 0)
{
if (sprite[spriteNum].picnum == RESPAWN)
pActor->tempang = sprite[newSprite].pal = sprite[spriteNum].pal;
 
A_PlayAlertSound(newSprite);
changespritestat(newSprite, STAT_ACTOR);
}
else
changespritestat(newSprite, STAT_ZOMBIEACTOR);
}
else
{
pSprite->clipdist = 40;
pSprite->owner = newSprite;
changespritestat(newSprite, STAT_ACTOR);
}
 
pActor->timetosleep = 0;
 
if (spriteNum >= 0)
pSprite->ang = sprite[spriteNum].ang;
}
break;
case FOF__STATIC:
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
case CAMERA1__STATIC:
pSprite->extra = 1;
pSprite->cstat &= 32768;
1613,7 → 1558,7
pSprite->pal = 0;
changespritestat(newSprite, STAT_ACTOR);
}
break;
goto SPAWN_END;
#ifndef EDUKE32_STANDALONE
case CAMERAPOLE__STATIC:
pSprite->extra = 1;
1630,7 → 1575,7
}
else
pSprite->pal = 0;
break;
goto SPAWN_END;
 
case BOLT1__STATIC:
case SIDEBOLT1__STATIC:
1639,7 → 1584,7
pSprite->yvel = 0;
 
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case WATERSPLASH2__STATIC:
if (spriteNum >= 0)
1696,7 → 1641,7
case DUKEGUN__STATIC:
case DUKELEG__STATIC:
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
case TONGUE__STATIC:
if (spriteNum >= 0)
pSprite->ang = sprite[spriteNum].ang;
1704,14 → 1649,15
pSprite->zvel = 256-(krand()&511);
pSprite->xvel = 64-(krand()&127);
changespritestat(newSprite, STAT_PROJECTILE);
break;
goto SPAWN_END;
case NATURALLIGHTNING__STATIC:
pSprite->cstat &= ~257;
pSprite->cstat |= 32768;
break;
goto SPAWN_END;
case TRANSPORTERSTAR__STATIC:
case TRANSPORTERBEAM__STATIC:
if (spriteNum == -1) break;
if (spriteNum == -1)
goto SPAWN_END;
if (pSprite->picnum == TRANSPORTERBEAM)
{
pSprite->xrepeat = 31;
1739,12 → 1685,12
changespritestat(newSprite, STAT_MISC);
A_SetSprite(newSprite,CLIPMASK0);
setsprite(newSprite,&pSprite->pos);
break;
goto SPAWN_END;
case FEMMAG1__STATIC:
case FEMMAG2__STATIC:
pSprite->cstat &= ~257;
changespritestat(newSprite, STAT_DEFAULT);
break;
goto SPAWN_END;
case DUKETAG__STATIC:
case SIGN1__STATIC:
case SIGN2__STATIC:
1754,7 → 1700,7
changespritestat(newSprite, STAT_MISC);
}
else pSprite->pal = 0;
break;
goto SPAWN_END;
 
case MASKWALL1__STATIC:
case MASKWALL2__STATIC:
1775,7 → 1721,7
int const j = pSprite->cstat & SPAWN_PROTECT_CSTAT_MASK;
pSprite->cstat = j | CSTAT_SPRITE_BLOCK;
changespritestat(newSprite, STAT_DEFAULT);
break;
goto SPAWN_END;
}
 
case PODFEM1__STATIC:
1801,7 → 1747,7
pSprite->cstat |= 257;
pSprite->clipdist = 32;
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case QUEBALL__STATIC:
case STRIPEBALL__STATIC:
1808,7 → 1754,7
pSprite->cstat = 256;
pSprite->clipdist = 8;
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case DUKELYINGDEAD__STATIC:
if (spriteNum >= 0 && sprite[spriteNum].picnum == APLAYER)
1831,7 → 1777,7
pSprite->cstat |= 257;
pSprite->clipdist = 128;
changespritestat(newSprite, STAT_ACTOR);
break;
goto SPAWN_END;
 
case RESPAWNMARKERRED__STATIC:
pSprite->xrepeat = pSprite->yrepeat = 24;
1838,21 → 1784,21
if (spriteNum >= 0)
pSprite->z = actor[spriteNum].floorz; // -(1<<4);
changespritestat(newSprite, STAT_ACTOR);
break;
goto SPAWN_END;
 
case MIKE__STATIC:
pSprite->yvel = pSprite->hitag;
pSprite->hitag = 0;
changespritestat(newSprite, STAT_ACTOR);
break;
goto SPAWN_END;
case WEATHERWARN__STATIC:
changespritestat(newSprite, STAT_ACTOR);
break;
goto SPAWN_END;
 
case SPOTLITE__STATIC:
T1(newSprite) = pSprite->x;
T2(newSprite) = pSprite->y;
break;
goto SPAWN_END;
case BULLETHOLE__STATIC:
pSprite->xrepeat = 3;
pSprite->yrepeat = 3;
1860,7 → 1806,7
 
A_AddToDeleteQueue(newSprite);
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case MONEY__STATIC:
case MAIL__STATIC:
1873,7 → 1819,7
pSprite->ang = krand() & 2047;
 
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case SHELL__STATIC: //From the player
case SHOTGUNSHELL__STATIC:
1922,7 → 1868,7
 
changespritestat(newSprite, STAT_MISC);
}
break;
goto SPAWN_END;
 
case WATERBUBBLE__STATIC:
if (spriteNum >= 0)
1935,7 → 1881,7
 
pSprite->xrepeat = pSprite->yrepeat = 4;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case CRANE__STATIC:
 
1979,13 → 1925,13
pSprite->owner = -1;
pSprite->extra = 8;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case TRASH__STATIC:
pSprite->ang = krand()&2047;
pSprite->xrepeat = pSprite->yrepeat = 24;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case WATERDRIP__STATIC:
if (spriteNum >= 0 && (sprite[spriteNum].statnum == STAT_PLAYER || sprite[spriteNum].statnum == STAT_ACTOR))
2013,12 → 1959,12
case WATERDRIPSPLASH__STATIC:
pSprite->xrepeat = pSprite->yrepeat = 24;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case PLUG__STATIC:
pSprite->lotag = 9999;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
case TARGET__STATIC:
case DUCK__STATIC:
case LETTER__STATIC:
2025,7 → 1971,7
pSprite->extra = 1;
pSprite->cstat |= 257;
changespritestat(newSprite, STAT_ACTOR);
break;
goto SPAWN_END;
 
case OCTABRAINSTAYPUT__STATIC:
case LIZTROOPSTAYPUT__STATIC:
2125,7 → 2071,7
{
pSprite->xrepeat=pSprite->yrepeat=0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
else
{
2159,7 → 2105,7
if (pSprite->picnum == ROTATEGUN)
pSprite->zvel = 0;
 
break;
goto SPAWN_END;
 
case REACTOR2__STATIC:
case REACTOR__STATIC:
2169,7 → 2115,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
 
pSprite->pal = 0;
2176,7 → 2122,7
pSprite->shade = -17;
 
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case HEAVYHBOMB__STATIC:
if (spriteNum >= 0)
2191,13 → 2137,13
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
pSprite->pal = 0;
pSprite->shade = -17;
 
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case RECON__STATIC:
if (pSprite->lotag > ud.player_skill)
2212,7 → 2158,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
pSprite->extra = 130;
pSprite->cstat |= 256; // Make it hitable
2221,13 → 2167,13
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
pSprite->pal = 0;
pSprite->shade = -17;
 
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case ATOMICHEALTH__STATIC:
case STEROIDS__STATIC:
2279,7 → 2225,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
 
pSprite->pal = 0;
2293,7 → 2239,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
else
{
2313,7 → 2259,7
changespritestat(newSprite, STAT_ZOMBIEACTOR);
A_Fall(newSprite);
}
break;
goto SPAWN_END;
 
case WATERFOUNTAIN__STATIC:
SLT(newSprite) = 1;
2326,12 → 2272,12
pSprite->cstat = 257; // Make it hitable
sprite[newSprite].extra = 1;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case FLOORFLAME__STATIC:
pSprite->shade = -127;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case BOUNCEMINE__STATIC:
pSprite->owner = newSprite;
2340,7 → 2286,7
pSprite->shade = -127;
pSprite->extra = g_impactDamage<<2;
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case STEAM__STATIC:
if (spriteNum >= 0)
2354,7 → 2300,7
fallthrough__;
case CEILINGSTEAM__STATIC:
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case TOILET__STATIC:
case STALL__STATIC:
2362,7 → 2308,7
pSprite->cstat |= 257;
pSprite->clipdist = 8;
pSprite->owner = newSprite;
break;
goto SPAWN_END;
 
case CANWITHSOMETHING__STATIC:
case CANWITHSOMETHING2__STATIC:
2400,12 → 2346,12
pSprite->cstat = 257|(krand()&4);
changespritestat(newSprite, STAT_ZOMBIEACTOR);
}
break;
goto SPAWN_END;
 
case TOILETWATER__STATIC:
pSprite->shade = -16;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case LASERLINE__STATIC:
pSprite->yrepeat = 6;
2423,7 → 2369,7
 
if (spriteNum >= 0) pSprite->ang = actor[spriteNum].t_data[5]+512;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case FORCESPHERE__STATIC:
if (spriteNum == -1)
2436,7 → 2382,7
pSprite->xrepeat = pSprite->yrepeat = 1;
changespritestat(newSprite, STAT_MISC);
}
break;
goto SPAWN_END;
 
case BLOOD__STATIC:
pSprite->xrepeat = pSprite->yrepeat = 16;
2444,7 → 2390,8
if (spriteNum >= 0 && sprite[spriteNum].pal == 6)
pSprite->pal = 6;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case BLOODPOOL__STATIC:
case PUKE__STATIC:
{
2472,13 → 2419,13
zero_puke:
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
 
if (sector[sectNum].lotag == ST_1_ABOVE_WATER)
{
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
 
if (spriteNum >= 0 && pSprite->picnum != PUKE)
2500,7 → 2447,7
if (spriteNum >= 0)
pSprite->xrepeat = pSprite->yrepeat = 1;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case BLOODSPLAT1__STATIC:
case BLOODSPLAT2__STATIC:
2516,7 → 2463,7
 
A_AddToDeleteQueue(newSprite);
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case TRIPBOMB__STATIC:
if (pSprite->lotag > ud.player_skill)
2523,7 → 2470,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
 
pSprite->xrepeat = 4;
2539,18 → 2486,18
pActor->t_data[5] = pSprite->ang;
 
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
 
case SPACEMARINE__STATIC:
pSprite->extra = 20;
pSprite->cstat |= 257;
changespritestat(newSprite, STAT_ZOMBIEACTOR);
break;
goto SPAWN_END;
case DOORSHOCK__STATIC:
pSprite->cstat |= 1+256;
pSprite->shade = -12;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
case HYDRENT__STATIC:
case PANNEL1__STATIC:
case PANNEL2__STATIC:
2622,10 → 2569,11
fallthrough__;
case OCEANSPRITE4__STATIC:
changespritestat(newSprite, STAT_DEFAULT);
break;
goto SPAWN_END;
 
case FRAMEEFFECT1_13__STATIC:
if (PLUTOPAK) break;
if (PLUTOPAK)
break;
fallthrough__;
case FRAMEEFFECT1__STATIC:
if (spriteNum >= 0)
2638,7 → 2586,7
 
changespritestat(newSprite, STAT_MISC);
 
break;
goto SPAWN_END;
case FOOTPRINTS__STATIC:
case FOOTPRINTS2__STATIC:
case FOOTPRINTS3__STATIC:
2661,7 → 2609,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
}
else goto zero_footprint;
2672,7 → 2620,7
{
zero_footprint:
pSprite->xrepeat = pSprite->yrepeat = 0;
break;
goto SPAWN_END;
}
 
pSprite->cstat = 32 + ((g_player[P_Get(spriteNum)].ps->footprintcount & 1) << 2);
2686,7 → 2634,7
 
A_AddToDeleteQueue(newSprite);
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
 
case VIEWSCREEN__STATIC:
case VIEWSCREEN2__STATIC:
2693,7 → 2641,7
pSprite->owner = newSprite;
pSprite->lotag = pSprite->extra = 1;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
case RESPAWN__STATIC:
pSprite->extra = 66-13;
fallthrough__;
2702,11 → 2650,11
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
pSprite->cstat = 32768;
changespritestat(newSprite, STAT_FX);
break;
goto SPAWN_END;
 
case EXPLOSION2__STATIC:
#ifdef POLYMER
2760,7 → 2708,7
 
changespritestat(newSprite, STAT_MISC);
 
break;
goto SPAWN_END;
 
case PLAYERONWATER__STATIC:
if (spriteNum >= 0)
2772,7 → 2720,7
pSprite->cstat |= 32768;
}
changespritestat(newSprite, STAT_DUMMYPLAYER);
break;
goto SPAWN_END;
 
case APLAYER__STATIC:
pSprite->xrepeat = 0;
2783,7 → 2731,7
|| ((g_gametypeFlags[ud.coop] & GAMETYPE_COOPSPAWN) / GAMETYPE_COOPSPAWN) != pSprite->lotag)
? STAT_MISC
: STAT_PLAYER);
break;
goto SPAWN_END;
case TOUCHPLATE__STATIC:
T3(newSprite) = sector[sectNum].floorz;
 
2794,7 → 2742,7
{
pSprite->xrepeat=pSprite->yrepeat=0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
#ifndef EDUKE32_STANDALONE
fallthrough__;
2809,7 → 2757,7
#endif
pSprite->cstat |= 32768;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case MASTERSWITCH__STATIC:
if (pSprite->picnum == MASTERSWITCH)
2816,11 → 2764,11
pSprite->cstat |= 32768;
pSprite->yvel = 0;
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
case LOCATORS__STATIC:
pSprite->cstat |= 32768;
changespritestat(newSprite, STAT_LOCATOR);
break;
goto SPAWN_END;
 
case ACTIVATORLOCKED__STATIC:
case ACTIVATOR__STATIC:
2828,7 → 2776,7
if (pSprite->picnum == ACTIVATORLOCKED)
sector[pSprite->sectnum].lotag |= 16384;
changespritestat(newSprite, STAT_ACTIVATOR);
break;
goto SPAWN_END;
 
case OOZ__STATIC:
case OOZ2__STATIC:
2852,7 → 2800,7
pSprite->xrepeat = 25 - (oozSize >> 1);
pSprite->cstat |= (krand() & 4);
 
break;
goto SPAWN_END;
}
 
case SECTOREFFECTOR__STATIC:
3418,7 → 3366,7
}
 
changespritestat(newSprite, STAT_EFFECTOR);
break;
goto SPAWN_END;
 
case SEENINE__STATIC:
case OOZFILTER__STATIC:
3435,7 → 3383,7
pSprite->owner = newSprite;
 
changespritestat(newSprite, STAT_STANDABLE);
break;
goto SPAWN_END;
 
case CRACK1__STATIC:
case CRACK2__STATIC:
3457,7 → 3405,7
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
break;
goto SPAWN_END;
}
 
pSprite->pal = 0;
3466,9 → 3414,67
 
changespritestat(newSprite, STAT_STANDABLE);
A_SetSprite(newSprite,CLIPMASK0);
break;
goto SPAWN_END;
 
default:
break; // NOT goto
}
 
// implementation of the default case
if (G_HaveActor(pSprite->picnum))
{
if (spriteNum == -1 && pSprite->lotag > ud.player_skill)
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
goto SPAWN_END;
}
 
// Init the size
if (pSprite->xrepeat == 0 || pSprite->yrepeat == 0)
pSprite->xrepeat = pSprite->yrepeat = 1;
 
if (A_CheckSpriteFlags(newSprite, SFLAG_BADGUY))
{
if (ud.monsters_off == 1)
{
pSprite->xrepeat = pSprite->yrepeat = 0;
changespritestat(newSprite, STAT_MISC);
goto SPAWN_END;
}
 
A_Fall(newSprite);
 
if (A_CheckSpriteFlags(newSprite, SFLAG_BADGUYSTAYPUT))
pActor->stayput = pSprite->sectnum;
 
g_player[myconnectindex].ps->max_actors_killed++;
pSprite->clipdist = 80;
 
if (spriteNum >= 0)
{
if (sprite[spriteNum].picnum == RESPAWN)
pActor->tempang = sprite[newSprite].pal = sprite[spriteNum].pal;
 
A_PlayAlertSound(newSprite);
changespritestat(newSprite, STAT_ACTOR);
}
else
changespritestat(newSprite, STAT_ZOMBIEACTOR);
}
else
{
pSprite->clipdist = 40;
pSprite->owner = newSprite;
changespritestat(newSprite, STAT_ACTOR);
}
 
pActor->timetosleep = 0;
 
if (spriteNum >= 0)
pSprite->ang = sprite[spriteNum].ang;
}
 
SPAWN_END:
if (VM_HaveEvent(EVENT_SPAWN))
{
/source/duke3d/src/macros.h
57,8 → 57,6
 
#ifndef EDUKE32_STANDALONE
#define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE)
#else
#define AFLAMABLE(X) (0)
#endif
#define rnd(X) ((krand()>>8)>=(255-(X)))
 
/source/duke3d/src/sector.cpp
1935,7 → 1935,7
PN(spriteNum) = BGRATE1;
CS(spriteNum) &= (65535-256-1);
A_PlaySound(VENT_BUST, spriteNum);
break;
return;
 
case FANSPRITE__STATIC:
PN(spriteNum) = FANSPRITEBROKE;
1951,7 → 1951,7
auto const pSprite = &sprite[spriteNum];
RANDOMSCRAP(pSprite, spriteNum);
}
break;
return;
 
case OCEANSPRITE1__STATIC:
case OCEANSPRITE2__STATIC:
1960,7 → 1960,7
case OCEANSPRITE5__STATIC:
A_Spawn(spriteNum,SMALLSMOKE);
A_DeleteSprite(spriteNum);
break;
return;
 
case QUEBALL__STATIC:
case STRIPEBALL__STATIC:
1985,7 → 1985,7
A_DeleteSprite(spriteNum);
}
}
break;
return;
 
case TREE1__STATIC:
case TREE2__STATIC:
2011,7 → 2011,7
T1(spriteNum) = 1;
A_Spawn(spriteNum,BURNING);
}
break;
return;
}
 
case CACTUS__STATIC:
2041,7 → 2041,7
PN(spriteNum) = CACTUSBROKE;
CS(spriteNum) &= ~257;
}
break;
return;
}
 
case HANGLIGHT__STATIC:
2050,7 → 2050,7
A_InsertSprite(SECT(spriteNum),SX(spriteNum),SY(spriteNum),SZ(spriteNum)-ZOFFSET3,SCRAP1+(krand()&15),-8,48,48,krand()&2047,(krand()&63)+64,-(krand()&4095)-(sprite[spriteNum].zvel>>2),spriteNum,5);
A_PlaySound(GLASS_HEAVYBREAK,spriteNum);
A_DeleteSprite(spriteNum);
break;
return;
 
case WATERFOUNTAIN__STATIC:
// case WATERFOUNTAIN+1:
2057,7 → 2057,7
// case WATERFOUNTAIN+2:
PN(spriteNum) = WATERFOUNTAINBROKE;
A_Spawn(spriteNum,TOILETWATER);
break;
return;
 
case SATELITE__STATIC:
case FUELPOD__STATIC:
2071,7 → 2071,7
A_Spawn(spriteNum,EXPLOSION2);
A_DeleteSprite(spriteNum);
}
break;
return;
 
case BOTTLE1__STATIC:
case BOTTLE2__STATIC:
2115,13 → 2115,13
SA(spriteNum) = krand()&2047;
A_SpawnWallGlass(spriteNum,-1,8);
A_DeleteSprite(spriteNum);
break;
return;
 
case FETUS__STATIC:
PN(spriteNum) = FETUSBROKE;
A_PlaySound(GLASS_BREAKING,spriteNum);
A_SpawnWallGlass(spriteNum,-1,10);
break;
return;
 
case FETUSBROKE__STATIC:
for (bssize_t j=48; j>0; j--)
2136,13 → 2136,13
A_PlaySound(GLASS_BREAKING,spriteNum);
A_SpawnWallGlass(spriteNum,-1,10);
A_DeleteSprite(spriteNum);
break;
return;
 
case HYDROPLANT__STATIC:
PN(spriteNum) = BROKEHYDROPLANT;
A_PlaySound(GLASS_BREAKING,spriteNum);
A_SpawnWallGlass(spriteNum,-1,10);
break;
return;
 
case FORCESPHERE__STATIC:
sprite[spriteNum].xrepeat = 0;
2150,13 → 2150,13
actor[OW(spriteNum)].t_data[1] = !actor[OW(spriteNum)].t_data[1];
actor[OW(spriteNum)].t_data[2] ++;
A_Spawn(spriteNum,EXPLOSION2);
break;
return;
 
case BROKEHYDROPLANT__STATIC:
A_PlaySound(GLASS_BREAKING,spriteNum);
A_SpawnWallGlass(spriteNum,-1,5);
A_DeleteSprite(spriteNum);
break;
return;
 
case TOILET__STATIC:
PN(spriteNum) = TOILETBROKE;
2164,7 → 2164,7
CS(spriteNum) &= ~257;
A_Spawn(spriteNum,TOILETWATER);
A_PlaySound(GLASS_BREAKING,spriteNum);
break;
return;
 
case STALL__STATIC:
PN(spriteNum) = STALLBROKE;
2172,7 → 2172,7
CS(spriteNum) &= ~257;
A_Spawn(spriteNum,TOILETWATER);
A_PlaySound(GLASS_HEAVYBREAK,spriteNum);
break;
return;
 
case HYDRENT__STATIC:
PN(spriteNum) = BROKEFIREHYDRENT;
2184,13 → 2184,13
// sprite[j].pal = 2;
// }
A_PlaySound(GLASS_HEAVYBREAK,spriteNum);
break;
return;
 
case CIRCLEPANNEL__STATIC:
PN(spriteNum) = CIRCLEPANNELBROKE;
CS(spriteNum) &= (65535-256-1);
A_PlaySound(VENT_BUST,spriteNum);
break;
return;
 
case PANNEL1__STATIC:
case PANNEL2__STATIC:
2197,13 → 2197,13
PN(spriteNum) = BPANNEL1;
CS(spriteNum) &= (65535-256-1);
A_PlaySound(VENT_BUST,spriteNum);
break;
return;
 
case PANNEL3__STATIC:
PN(spriteNum) = BPANNEL3;
CS(spriteNum) &= (65535-256-1);
A_PlaySound(VENT_BUST,spriteNum);
break;
return;
 
case PIPE1__STATIC:
case PIPE2__STATIC:
2236,7 → 2236,7
 
int newSprite = A_Spawn(spriteNum, STEAM);
sprite[newSprite].z = sector[SECT(spriteNum)].floorz-ZOFFSET5;
break;
return;
}
 
case MONK__STATIC:
2248,7 → 2248,8
fallthrough__;
case SPACEMARINE__STATIC:
sprite[spriteNum].extra -= sprite[dmgSrc].extra;
if (sprite[spriteNum].extra > 0) break;
if (sprite[spriteNum].extra > 0)
return;
SA(spriteNum) = krand()&2047;
A_Shoot(spriteNum,BLOODSPLAT1);
SA(spriteNum) = krand()&2047;
2273,13 → 2274,13
A_DoGuts(spriteNum,JIBS3,6);
S_PlaySound(SQUISHED);
A_DeleteSprite(spriteNum);
break;
return;
 
case CHAIR1__STATIC:
case CHAIR2__STATIC:
PN(spriteNum) = BROKENCHAIR;
CS(spriteNum) = 0;
break;
return;
 
case CHAIR3__STATIC:
case MOVIECAMERA__STATIC:
2298,101 → 2299,104
RANDOMSCRAP(pSprite, spriteNum);
}
A_DeleteSprite(spriteNum);
break;
return;
 
case PLAYERONWATER__STATIC:
spriteNum = OW(spriteNum);
fallthrough__;
default:
if ((sprite[spriteNum].cstat&16) && SHT(spriteNum) == 0 && SLT(spriteNum) == 0 && sprite[spriteNum].statnum == STAT_DEFAULT)
break;
break; // NOT return
}
 
if ((sprite[dmgSrc].picnum == FREEZEBLAST || sprite[dmgSrc].owner != spriteNum) && sprite[spriteNum].statnum != STAT_PROJECTILE)
// implementation of the default case
 
if ((sprite[spriteNum].cstat&16) && SHT(spriteNum) == 0 && SLT(spriteNum) == 0 && sprite[spriteNum].statnum == STAT_DEFAULT)
return;
 
if ((sprite[dmgSrc].picnum == FREEZEBLAST || sprite[dmgSrc].owner != spriteNum) && sprite[spriteNum].statnum != STAT_PROJECTILE)
{
if (A_CheckEnemySprite(&sprite[spriteNum]) == 1)
{
if (A_CheckEnemySprite(&sprite[spriteNum]) == 1)
{
if (sprite[dmgSrc].picnum == RPG)
sprite[dmgSrc].extra <<= 1;
if (sprite[dmgSrc].picnum == RPG)
sprite[dmgSrc].extra <<= 1;
 
if ((PN(spriteNum) != DRONE) && (PN(spriteNum) != ROTATEGUN) && (PN(spriteNum) != COMMANDER)
&& (PN(spriteNum) < GREENSLIME || PN(spriteNum) > GREENSLIME + 7))
if (sprite[dmgSrc].picnum != FREEZEBLAST)
if (!A_CheckSpriteFlags(spriteNum, SFLAG_BADGUY) || A_CheckSpriteFlags(spriteNum, SFLAG_HURTSPAWNBLOOD))
{
int const newSprite = A_Spawn(dmgSrc, JIBS6);
sprite[newSprite].z += ZOFFSET6;
if (sprite[dmgSrc].pal == 6)
sprite[newSprite].pal = 6;
sprite[newSprite].xvel = 16;
sprite[newSprite].xrepeat = sprite[newSprite].yrepeat = 24;
sprite[newSprite].ang += 32 - (krand() & 63);
}
if ((PN(spriteNum) != DRONE) && (PN(spriteNum) != ROTATEGUN) && (PN(spriteNum) != COMMANDER)
&& (PN(spriteNum) < GREENSLIME || PN(spriteNum) > GREENSLIME + 7))
if (sprite[dmgSrc].picnum != FREEZEBLAST)
if (!A_CheckSpriteFlags(spriteNum, SFLAG_BADGUY) || A_CheckSpriteFlags(spriteNum, SFLAG_HURTSPAWNBLOOD))
{
int const newSprite = A_Spawn(dmgSrc, JIBS6);
sprite[newSprite].z += ZOFFSET6;
if (sprite[dmgSrc].pal == 6)
sprite[newSprite].pal = 6;
sprite[newSprite].xvel = 16;
sprite[newSprite].xrepeat = sprite[newSprite].yrepeat = 24;
sprite[newSprite].ang += 32 - (krand() & 63);
}
 
int const damageOwner = sprite[dmgSrc].owner;
int const damageOwner = sprite[dmgSrc].owner;
 
if (damageOwner >= 0 && sprite[damageOwner].picnum == APLAYER && PN(spriteNum) != ROTATEGUN && PN(spriteNum) != DRONE)
if (g_player[P_Get(damageOwner)].ps->curr_weapon == SHOTGUN_WEAPON)
if (!A_CheckSpriteFlags(spriteNum, SFLAG_BADGUY) || A_CheckSpriteFlags(spriteNum, SFLAG_HURTSPAWNBLOOD))
{
A_Shoot(spriteNum, BLOODSPLAT3);
A_Shoot(spriteNum, BLOODSPLAT1);
A_Shoot(spriteNum, BLOODSPLAT2);
A_Shoot(spriteNum, BLOODSPLAT4);
}
 
if (!A_CheckSpriteFlags(spriteNum, SFLAG_NODAMAGEPUSH))
{
if (sprite[spriteNum].extra > 0)
if (damageOwner >= 0 && sprite[damageOwner].picnum == APLAYER && PN(spriteNum) != ROTATEGUN && PN(spriteNum) != DRONE)
if (g_player[P_Get(damageOwner)].ps->curr_weapon == SHOTGUN_WEAPON)
if (!A_CheckSpriteFlags(spriteNum, SFLAG_BADGUY) || A_CheckSpriteFlags(spriteNum, SFLAG_HURTSPAWNBLOOD))
{
if ((sprite[spriteNum].cstat & 48) == 0)
SA(spriteNum) = (sprite[dmgSrc].ang + 1024) & 2047;
sprite[spriteNum].xvel = -(sprite[dmgSrc].extra << 2);
int16_t sectNum = SECT(spriteNum);
pushmove(&sprite[spriteNum].pos, &sectNum, 128L, (4L << 8), (4L << 8), CLIPMASK0);
if (sectNum != SECT(spriteNum) && (unsigned)sectNum < MAXSECTORS)
changespritesect(spriteNum, sectNum);
A_Shoot(spriteNum, BLOODSPLAT3);
A_Shoot(spriteNum, BLOODSPLAT1);
A_Shoot(spriteNum, BLOODSPLAT2);
A_Shoot(spriteNum, BLOODSPLAT4);
}
}
 
if (sprite[spriteNum].statnum == STAT_ZOMBIEACTOR)
if (!A_CheckSpriteFlags(spriteNum, SFLAG_NODAMAGEPUSH))
{
if (sprite[spriteNum].extra > 0)
{
changespritestat(spriteNum, STAT_ACTOR);
actor[spriteNum].timetosleep = SLEEPTIME;
if ((sprite[spriteNum].cstat & 48) == 0)
SA(spriteNum) = (sprite[dmgSrc].ang + 1024) & 2047;
sprite[spriteNum].xvel = -(sprite[dmgSrc].extra << 2);
int16_t sectNum = SECT(spriteNum);
pushmove(&sprite[spriteNum].pos, &sectNum, 128L, (4L << 8), (4L << 8), CLIPMASK0);
if (sectNum != SECT(spriteNum) && (unsigned)sectNum < MAXSECTORS)
changespritesect(spriteNum, sectNum);
}
if ((sprite[spriteNum].xrepeat < 24 || PN(spriteNum) == SHARK) && sprite[dmgSrc].picnum == SHRINKSPARK)
return;
}
 
if (sprite[spriteNum].statnum != STAT_ZOMBIEACTOR)
if (sprite[spriteNum].statnum == STAT_ZOMBIEACTOR)
{
if (sprite[dmgSrc].picnum == FREEZEBLAST && ((PN(spriteNum) == APLAYER && sprite[spriteNum].pal == 1) || (g_freezerSelfDamage == 0 && sprite[dmgSrc].owner == spriteNum)))
return;
actor[spriteNum].picnum = sprite[dmgSrc].picnum;
actor[spriteNum].extra += sprite[dmgSrc].extra;
actor[spriteNum].ang = sprite[dmgSrc].ang;
actor[spriteNum].owner = sprite[dmgSrc].owner;
 
if(A_CheckSpriteFlags(spriteNum, SFLAG_DAMAGEEVENT))
VM_OnEventWithReturn(EVENT_POSTDAMAGESPRITE, dmgSrc, -1, spriteNum);
changespritestat(spriteNum, STAT_ACTOR);
actor[spriteNum].timetosleep = SLEEPTIME;
}
if ((sprite[spriteNum].xrepeat < 24 || PN(spriteNum) == SHARK) && sprite[dmgSrc].picnum == SHRINKSPARK)
return;
}
 
if (sprite[spriteNum].statnum == STAT_PLAYER)
{
auto ps = g_player[P_Get(spriteNum)].ps;
if (sprite[spriteNum].statnum != STAT_ZOMBIEACTOR)
{
if (sprite[dmgSrc].picnum == FREEZEBLAST && ((PN(spriteNum) == APLAYER && sprite[spriteNum].pal == 1) || (g_freezerSelfDamage == 0 && sprite[dmgSrc].owner == spriteNum)))
return;
 
if (ps->newowner >= 0)
G_ClearCameraView(ps);
actor[spriteNum].picnum = sprite[dmgSrc].picnum;
actor[spriteNum].extra += sprite[dmgSrc].extra;
actor[spriteNum].ang = sprite[dmgSrc].ang;
actor[spriteNum].owner = sprite[dmgSrc].owner;
 
if (sprite[spriteNum].xrepeat < 24 && sprite[dmgSrc].picnum == SHRINKSPARK)
return;
if(A_CheckSpriteFlags(spriteNum, SFLAG_DAMAGEEVENT))
VM_OnEventWithReturn(EVENT_POSTDAMAGESPRITE, dmgSrc, -1, spriteNum);
}
 
if (sprite[actor[spriteNum].owner].picnum != APLAYER)
if (ud.player_skill >= 3)
sprite[dmgSrc].extra += (sprite[dmgSrc].extra>>1);
}
if (sprite[spriteNum].statnum == STAT_PLAYER)
{
auto ps = g_player[P_Get(spriteNum)].ps;
 
if (ps->newowner >= 0)
G_ClearCameraView(ps);
 
if (sprite[spriteNum].xrepeat < 24 && sprite[dmgSrc].picnum == SHRINKSPARK)
return;
 
if (sprite[actor[spriteNum].owner].picnum != APLAYER)
if (ud.player_skill >= 3)
sprite[dmgSrc].extra += (sprite[dmgSrc].extra>>1);
}
 
break;
}
}
#endif