Skip to content

Commit

Permalink
Add rip sound
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Apr 18, 2021
1 parent 0ccb6e5 commit 3d9fc1c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion prboom2/src/d_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ typedef struct
// killough 8/9/98: make DEH_BLOCKMAX self-adjusting
#define DEH_BLOCKMAX (sizeof deh_blocks/sizeof*deh_blocks) // size of array
#define DEH_MAXKEYLEN 32 // as much of any key as we'll look at
#define DEH_MOBJINFOMAX 29 // number of mobjinfo configuration keys
#define DEH_MOBJINFOMAX 30 // number of mobjinfo configuration keys

// Put all the block header values, and the function to be called when that
// one is encountered, in this array:
Expand Down Expand Up @@ -1130,6 +1130,7 @@ static const char *deh_mobjinfo[DEH_MOBJINFOMAX] =
"Projectile group", // .projectile_group
"Splash group", // .splash_group
"MBF21 Bits", // .flags2
"Rip sound", // .ripsound
};

// Strings that are used to indicate flags ("Bits" in mobjinfo)
Expand Down Expand Up @@ -1971,6 +1972,7 @@ static void setMobjInfoValue(int mobjInfoIndex, int keyIndex, uint_64_t value) {
}
mi->splash_group = mi->splash_group + SG_END;
return;
case 29: mi->ripsound = (int)value; return;

default: return;
}
Expand Down
2 changes: 2 additions & 0 deletions prboom2/src/dsda/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ static void dsda_InitDoom(void) {
mobjinfo[i].infighting_group = IG_DEFAULT;
mobjinfo[i].projectile_group = PG_DEFAULT;
mobjinfo[i].splash_group = SG_DEFAULT;
mobjinfo[i].ripsound = sfx_None;
}

// don't want to reorganize info.c structure for a few tweaks...
Expand Down Expand Up @@ -386,6 +387,7 @@ static void dsda_InitHeretic(void) {
mobjinfo[j].infighting_group = IG_DEFAULT;
mobjinfo[j].projectile_group = PG_DEFAULT;
mobjinfo[j].splash_group = SG_DEFAULT;
mobjinfo[i].ripsound = heretic_sfx_None;
}

// don't want to reorganize info.c structure for a few tweaks...
Expand Down
1 change: 1 addition & 0 deletions prboom2/src/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -3078,6 +3078,7 @@ typedef struct
int infighting_group;
int projectile_group;
int splash_group;
int ripsound;
} mobjinfo_t;

typedef struct
Expand Down
4 changes: 2 additions & 2 deletions prboom2/src/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,8 @@ static dboolean PIT_CheckThing(mobj_t *thing) // killough 3/26/98: make static
damage = ((P_Random(pr_mbf21) & 3) + 2) * tmthing->info->damage;
if (!(thing->flags & MF_NOBLOOD))
P_SpawnBlood(tmthing->x, tmthing->y, tmthing->z, damage);
if (tmthing->info->painsound)
S_StartSound(tmthing, tmthing->info->painsound);
if (tmthing->info->ripsound)
S_StartSound(tmthing, tmthing->info->ripsound);
}

P_DamageMobj(thing, tmthing, tmthing->target, damage);
Expand Down

0 comments on commit 3d9fc1c

Please sign in to comment.