MCPcopy Create free account
hub / github.com/NBlood/NBlood / WeaponMoveHit

Function WeaponMoveHit

source/sw/src/weapon.cpp:4467–4712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4465
4466
4467SWBOOL
4468WeaponMoveHit(short SpriteNum)
4469{
4470 USERp u = User[SpriteNum];
4471 SPRITEp sp = User[SpriteNum]->SpriteP;
4472
4473
4474 if (!u->ret)
4475 return FALSE;
4476
4477 switch (TEST(u->ret, HIT_MASK))
4478 {
4479 case HIT_PLAX_WALL:
4480 SetSuicide(SpriteNum);
4481 return TRUE;
4482
4483 case HIT_SECTOR:
4484 {
4485 short hit_sect;
4486 SECTORp sectp;
4487 SECTOR_OBJECTp sop;
4488
4489 hit_sect = NORM_SECTOR(u->ret);
4490 sectp = &sector[hit_sect];
4491
4492 ASSERT(sectp->extra != -1);
4493
4494 // hit floor - closer to floor than ceiling
4495 if (sp->z > DIV2(u->hiz + u->loz))
4496 {
4497 // hit a floor sprite
4498 if (u->lo_sp)
4499 {
4500
4501 if (u->lo_sp->lotag == TAG_SPRITE_HIT_MATCH)
4502 {
4503 if (MissileHitMatch(SpriteNum, -1, u->lo_sp - sprite))
4504 return TRUE;
4505 //DoMatchEverything(NULL, u->lo_sp->hitag, -1);
4506 //return(TRUE);
4507 }
4508
4509 return TRUE;
4510 }
4511
4512 if (SectUser[hit_sect] && SectUser[hit_sect]->depth > 0)
4513 {
4514 SpawnSplash(SpriteNum);
4515 //SetSuicide(SpriteNum);
4516 return TRUE;
4517 }
4518
4519 }
4520 // hit ceiling
4521 else
4522 {
4523 // hit a floor sprite
4524 if (u->hi_sp)

Callers 15

DoShrapDamageFunction · 0.85
DoStarFunction · 0.85
DoCrossBoltFunction · 0.85
DoPlasmaFunction · 0.85
DoCoolgFireFunction · 0.85
DoBoltThinManFunction · 0.85
DoTracerFunction · 0.85
DoEMPFunction · 0.85
DoTankShellFunction · 0.85
DoTracerStartFunction · 0.85
DoLaserFunction · 0.85
DoLaserStartFunction · 0.85

Calls 11

SetSuicideFunction · 0.85
MissileHitMatchFunction · 0.85
SpawnSplashFunction · 0.85
DetectSectorObjectFunction · 0.85
DoDamageFunction · 0.85
HitBreakSpriteFunction · 0.85
PlaySoundFunction · 0.85
ChangeStateFunction · 0.85
ShootableSwitchFunction · 0.85
DetectSectorObjectByWallFunction · 0.85
HitBreakWallFunction · 0.85

Tested by

no test coverage detected