Skip to content

Commit

Permalink
Add DDF BORE special; map MBF21 ripper behvaior to BORE instead of TU…
Browse files Browse the repository at this point in the history
…NNEL
  • Loading branch information
dashodanger committed Nov 1, 2024
1 parent 368e4fa commit 19180de
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions source_files/ddf/ddf_thing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,7 @@ static DDFSpecialFlags extended_specials[] = {{"RESPAWN", kExtendedFlagNoRespawn
{"USABLE", kExtendedFlagUsable, 0},
{"BLOCK_SHOTS", kExtendedFlagBlockShots, 0},
{"TUNNEL", kExtendedFlagTunnel, 0},
{"BORE", (kExtendedFlagTunnel|kExtendedFlagBore), 0},
{"SIMPLE_ARMOUR", kExtendedFlagSimpleArmour, 0},
{nullptr, 0, 0}};

Expand Down
6 changes: 5 additions & 1 deletion source_files/ddf/ddf_thing.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ enum ExtendedFlag
kExtendedFlagCrouching = (1 << 25),
// Missile can tunnel through enemies. -AJA- 2000/10/23
kExtendedFlagTunnel = (1 << 26),
// NO LONGER USED (1 << 27), // was: DLIGHT
// Missile tunnels through enemies, but damages each enemy for as long
// as it is in contact. This differs from the above in that TUNNEL
// only damages each mobj that it passes through once by keeping a simple
// hash list - Dasho
kExtendedFlagBore = (1 << 27),
// Thing has been gibbed.
kExtendedFlagGibbed = (1 << 28),
// -AJA- 2004/07/22: play the monster sounds at full volume
Expand Down
2 changes: 1 addition & 1 deletion source_files/dehacked/deh_things.cc
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ const FlagName mbf21flag_list[] = {
{kMBF21_RANGEHALF, "RANGEHALF", "TRIGGER_HAPPY"},
{kMBF21_NOTHRESHOLD, "NOTHRESHOLD", "NOGRUDGE"},
{kMBF21_BOSS, "BOSS", "BOSSMAN"},
{kMBF21_RIP, "RIP", "TUNNEL"},
{kMBF21_RIP, "RIP", "BORE"},
{kMBF21_FULLVOLSOUNDS, "FULLVOLSOUNDS", "ALWAYS_LOUD"},

// flags which don't produce an Edge special
Expand Down
16 changes: 10 additions & 6 deletions source_files/edge/p_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1790,14 +1790,18 @@ int MissileContact(MapObject *object, MapObject *target)
// the first impact.
if (object->extended_flags_ & kExtendedFlagTunnel)
{
// this hash is very basic, but should work OK
uint32_t hash = (uint32_t)(long long)target;
// unless it uses the new BORE special - Dasho
if (!(object->extended_flags_ & kExtendedFlagBore))
{
// this hash is very basic, but should work OK
uint32_t hash = (uint32_t)(long long)target;

if (object->tunnel_hash_[0] == hash || object->tunnel_hash_[1] == hash)
return -1;
if (object->tunnel_hash_[0] == hash || object->tunnel_hash_[1] == hash)
return -1;

object->tunnel_hash_[0] = object->tunnel_hash_[1];
object->tunnel_hash_[1] = hash;
object->tunnel_hash_[0] = object->tunnel_hash_[1];
object->tunnel_hash_[1] = hash;
}
if (object->info_->rip_sound_)
StartSoundEffect(object->info_->rip_sound_, kCategoryObject, object, 0);
}
Expand Down

0 comments on commit 19180de

Please sign in to comment.