Goomba damage is done like this:
Many thanks to /Demoman/
In g_active.c after
else
damage = 5; // never used
VectorSet (dir, 0, 0, 1);
Add this:
if ( ent->s.groundEntityNum == other->s.number && other->client ) {
damage = 50;
G_Damage (other, other, ent, NULL, NULL, damage, 0, MOD_GOOMBA);
other->pain_debounce_time = level.time + 200; // no normal pain sound
}else {
G_Damage (ent, NULL, NULL, NULL, NULL, damage, 0, MOD_FALLING);
ent->pain_debounce_time = level.time + 200; // no normal pain sound
}
break;
Also in g_active.c
Change this:
void ClientEvents( gentity_t *ent, int oldEventSequence ) {
Into this:
void ClientEvents( gentity_t *ent, int oldEventSequence, pmove_t *pm ) {
And add the following under:
vec3_t dir;
gentity_t *other = ent;
for (i = 0; i < pm->numtouch; i++) {
for (j = 0; j < i ; j++) {
if (pm->touchents[j] == pm->touchents[i] ) {
break;
}
}
if (j != i) {
continue; // duplicated
}
other = &g_entities[ pm->touchents[i] ];
}
Also add:
int j;
After int i;
And finally change this:
// execute client events
if(level.match_pause == PAUSE_NONE) {
ClientEvents( ent, oldEventSequence );
}
Into this:
// execute client events
if(level.match_pause == PAUSE_NONE) {
ClientEvents( ent, oldEventSequence, &pm );
}
Also add MOD_GOOMBA to the following files:
g_combat.c
g_match.c
bg_public.h
g_stats.c (if you want to give xp for it)
And to show a message, in cg_event.c after
case MOD_SATCHEL
case MOD_GOOMBA:
message = "experienced death from above by";
message2 = ".";
break;
Good luck…