diff --git a/extra/valve/bin/hl_monsterbridge.amxx b/extra/valve/bin/hl_monsterbridge.amxx index 59a174c..ada2c3e 100644 Binary files a/extra/valve/bin/hl_monsterbridge.amxx and b/extra/valve/bin/hl_monsterbridge.amxx differ diff --git a/extra/valve/src/hl_monsterbridge.sma b/extra/valve/src/hl_monsterbridge.sma index 199c817..cb4b933 100644 --- a/extra/valve/src/hl_monsterbridge.sma +++ b/extra/valve/src/hl_monsterbridge.sma @@ -16,7 +16,7 @@ new Trie:g_HLDefaultNames; public plugin_init() { - register_plugin( "HL-MONSTER Bridge", "1.0", "Giegue" ); + register_plugin( "HL-MONSTER Bridge", "1.1", "Giegue" ); RegisterHam( Ham_IRelationship, "monster_alien_controller", "mmIRelationship" ); RegisterHam( Ham_IRelationship, "monster_alien_grunt", "mmIRelationship" ); @@ -67,10 +67,12 @@ public plugin_init() TrieSetString( g_HLDefaultNames, "monster_osprey", "Osprey Helicopter" ); TrieSetString( g_HLDefaultNames, "monster_gargantua", "Gargantua" ); TrieSetString( g_HLDefaultNames, "monster_nihilanth", "Nihilanth" ); - TrieSetString( g_HLDefaultNames, "monster_tentacle"," Tentacle" ); + TrieSetString( g_HLDefaultNames, "monster_tentacle", "Tentacle" ); set_task( 0.3, "hlScan", 0, "", 0, "b" ); register_srvcmd( "monster_hurt_entity", "hlTakeDamage" ); + + RegisterHam( Ham_Killed, "player", "PlayerKilled", 1 ); } public plugin_end() { @@ -186,3 +188,17 @@ public hlTakeDamage() ExecuteHamB( Ham_TakeDamage, victim, inflictor, attacker, damage, damageBits ); } } + +public PlayerKilled( victim, attacker, shouldgib ) +{ + // don't obstruct monstermod + if ( victim == attacker ) + return HAM_IGNORED; + + // fix monster score + if ( entity_get_int( attacker, EV_INT_flags ) & FL_MONSTER ) + entity_set_float( attacker, EV_FL_frags, entity_get_float( attacker, EV_FL_frags ) + 2 ); + + entity_set_edict( victim, EV_ENT_dmg_inflictor, attacker ); + return HAM_IGNORED; +} diff --git a/src/dlls/dllapi.cpp b/src/dlls/dllapi.cpp index 21be0f7..e81a07f 100644 --- a/src/dlls/dllapi.cpp +++ b/src/dlls/dllapi.cpp @@ -399,12 +399,12 @@ void check_player_dead( edict_t *pPlayer ) } else { - // SOMETHING that is a monster + // Does this monster have a name? if ( !FStringNull( pAttacker->v.netname ) ) strcpy(szName, STRING( pAttacker->v.netname )); else { - // No netname, use classname + // No name, use class strcpy(szName, STRING( pAttacker->v.classname )); } } @@ -537,8 +537,8 @@ void check_monster_info( edict_t *pPlayer ) // It should be alive if ( UTIL_IsAlive( tr.pHit ) ) { - // Must be a monster - if (tr.pHit->v.flags & FL_MONSTER) + // Must be a monster (and strictly a monster!) + if (strncmp( STRING( tr.pHit->v.classname ), "monster_", 8 ) == 0 && tr.pHit->v.flags & FL_MONSTER) { char szName[129]; float monsterHealth, monsterFrags; diff --git a/src/dlls/hornet.cpp b/src/dlls/hornet.cpp index b41edc0..e4966e7 100644 --- a/src/dlls/hornet.cpp +++ b/src/dlls/hornet.cpp @@ -372,6 +372,8 @@ void CMHornet::DieTouch ( edict_t *pOther ) CMBaseMonster *pMonster = GetClassPtr((CMBaseMonster *)VARS(pOther)); pMonster->TakeDamage( pev, VARS( pev->owner ), pev->dmg, DMG_BULLET ); } + else + UTIL_TakeDamageExternal( pOther, pev, VARS( pev->owner ), pev->dmg, DMG_BULLET ); } pev->modelindex = 0;// so will disappear for the 0.1 secs we wait until NEXTTHINK gets rid diff --git a/src/dlls/hwgrunt.cpp b/src/dlls/hwgrunt.cpp index 09888bd..a768b6d 100644 --- a/src/dlls/hwgrunt.cpp +++ b/src/dlls/hwgrunt.cpp @@ -700,7 +700,18 @@ void CMHWGrunt :: SetActivity ( Activity NewActivity ) case ACT_RUN: case ACT_WALK: default: - iSequence = LookupActivity ( NewActivity ); + if ( m_flMinigunSpinTime != 0 ) + { + // if the hwgrunt used his minigun but became unable to attack + // then spin it down before doing anything else + refreshActivity = FALSE; + + EMIT_SOUND(ENT(pev), CHAN_WEAPON, "hassault/hw_spindown.wav", 0.8, ATTN_NORM); + m_flMinigunSpinTime = gpGlobals->time + 1.40; + iSequence = LookupSequence( "spindown" ); + } + else + iSequence = LookupActivity ( NewActivity ); break; } diff --git a/src/dlls/shockroach.cpp b/src/dlls/shockroach.cpp index baf7125..34d074d 100644 --- a/src/dlls/shockroach.cpp +++ b/src/dlls/shockroach.cpp @@ -153,7 +153,7 @@ void CMShockRoach::MonsterThink(void) { pev->health = -1; Killed(pev, 0); - return; + //return; // it still needs to think } CMHeadCrab::MonsterThink(); diff --git a/src/dlls/util.cpp b/src/dlls/util.cpp index fc65ad3..c6382ab 100644 --- a/src/dlls/util.cpp +++ b/src/dlls/util.cpp @@ -39,7 +39,7 @@ typedef struct { } gamedll_funcs_t; extern gamedll_funcs_t *gpGamedllFuncs; - +extern void check_player_dead( edict_t *pPlayer ); // Print to console. void META_CONS(char *fmt, ...) { @@ -1760,7 +1760,8 @@ int UTIL_TakeDamage( edict_t *pEdict, entvars_t *pevInflictor, entvars_t *pevAtt { pEdict->v.health = 1; // can't suicide if already dead! gpGamedllFuncs->dllapi_table->pfnClientKill(pEdict); - + check_player_dead(pEdict); // will you just fucking work? + // Add 1 score to the monster that killed this player if ( pevAttacker->flags & FL_MONSTER ) pevAttacker->frags += 1.0;