Skip to content

Commit

Permalink
Merge pull request #130 from ampreeT/killfeed-sleepstate
Browse files Browse the repository at this point in the history
Sleep State & Native Death Notices
  • Loading branch information
ampreeT authored Jun 23, 2024
2 parents e3336bf + 5a7c0cc commit 4b17c80
Show file tree
Hide file tree
Showing 12 changed files with 1,701 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/*
*.code-workspace
plugins/*
60 changes: 60 additions & 0 deletions gamedata/srccoop.games.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"windows" "IEngineSoundServer003"
"linux" "IEngineSoundServer003"
}

"CSoundSize"
{
"windows" "52"
"linux" "52"
}
}
"Offsets"
{
Expand Down Expand Up @@ -550,6 +556,20 @@
"return" "void"
"this" "entity"
}
"CAI_BaseNPC::UpdateSleepState"
{
"signature" "CAI_BaseNPC::UpdateSleepState"
"callconv" "thiscall"
"return" "void"
"this" "entity"
"arguments"
{
"bInPVS"
{
"type" "bool"
}
}
}
"CBoneSetup::AccumulatePose"
{
"signature" "CBoneSetup::AccumulatePose"
Expand Down Expand Up @@ -717,6 +737,11 @@
"windows" "\x55\x8B\xEC\x83\xEC\x5C\x53\x57\x8B\xF9"
"linux" "@_ZN11CAI_BaseNPC19SetPlayerAvoidStateEv"
}
"CAI_BaseNPC::UpdateSleepState" // void CAI_BaseNPC::UpdateSleepState( bool bInPVS )
{
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x83\xBE\x8C\x09\x00\x00\x00\x2A\x2A\x2A\x2A\x2A\x2A\xA1\xD0\x91" // str: "CAI_BaseNPC::UpdateSleepState called with NULL pLocalPlayer\n"
"linux" "@_ZN11CAI_BaseNPC16UpdateSleepStateEb"
}
"CreateServerRagdoll" // CBaseEntity CreateServerRagdoll(CBaseAnimating *, int, const CTakeDamageInfo *, int, bool)
{
"windows" "\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\xB8\x78\x30\x00\x00"
Expand Down Expand Up @@ -878,6 +903,21 @@
"windows" "468"
"linux" "469"
}
"CAI_BaseNPC::QueryHearSound" // bool CAI_BaseNPC::QueryHearSound(CSound*)
{
"windows" "420"
"linux" "421"
}
"CAI_BaseNPC::GetSoundInterests" // int CAI_BaseNPC::GetSoundInterests( void )
{
"windows" "426"
"linux" "427"
}
"CAI_BaseNPC::HearingSensitivity" // float CAI_BaseNPC::HearingSensitivity()
{
"windows" "430"
"linux" "431"
}
"CAI_BaseNPC::UpdateEnemyMemory" // CAI_BaseNPC::UpdateEnemyMemory(CBaseEntity*, Vector const&, CBaseEntity*)
{
"windows" "529"
Expand Down Expand Up @@ -1018,6 +1058,11 @@
"windows" "\x55\x8B\xEC\x83\xEC\x5C\x53\x57"
"linux" "@_ZN11CAI_BaseNPC19SetPlayerAvoidStateEv"
}
"CAI_BaseNPC::UpdateSleepState" // void CAI_BaseNPC::UpdateSleepState( bool bInPVS )
{
"windows" "\x55\x8B\xEC\x56\x8B\xF1\x83\xBE\x3C\x09\x00\x00\x00\x2A\x2A\x2A\x2A\x2A\x2A\xA1\x50" // str: "CAI_BaseNPC::UpdateSleepState called with NULL pLocalPlayer\n"
"linux" "@_ZN11CAI_BaseNPC16UpdateSleepStateEb"
}
"GlobalEntity_GetIndex" // int GlobalEntity_GetIndex( const char *pGlobalname );
{
"windows" "\x55\x8B\xEC\x51\xFF\x75\x08\x8D\x45\xFC"
Expand Down Expand Up @@ -1192,6 +1237,21 @@
"windows" "31"
"linux" "30"
}
"CAI_BaseNPC::QueryHearSound" // bool CAI_BaseNPC::QueryHearSound(CSound*)
{
"windows" "387"
"linux" "388"
}
"CAI_BaseNPC::GetSoundInterests" // int CAI_BaseNPC::GetSoundInterests( void )
{
"windows" "393"
"linux" "394"
}
"CAI_BaseNPC::HearingSensitivity" // float CAI_BaseNPC::HearingSensitivity()
{
"windows" "397"
"linux" "398"
}
"CAI_BaseNPC::UpdateEnemyMemory" // CAI_BaseNPC::UpdateEnemyMemory(CBaseEntity*, Vector const&, CBaseEntity*)
{
"windows" "496"
Expand Down
6 changes: 6 additions & 0 deletions scripting/include/srccoop.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#define ENTPATCH_GOALENTITY_RESOLVENAMES
#define ENTPATCH_GOAL_LEAD
#define ENTPATCH_SETPLAYERAVOIDSTATE
#define ENTPATCH_NPC_SLEEP
#define ENTPATCH_FUNC_TRACKAUTOCHANGE
#define ENTPATCH_FUNC_TRACKTRAIN

Expand Down Expand Up @@ -88,6 +89,7 @@
#define ENTPATCH_GOALENTITY_RESOLVENAMES
#define ENTPATCH_GOAL_LEAD
#define ENTPATCH_SETPLAYERAVOIDSTATE
#define ENTPATCH_NPC_SLEEP
#define ENTPATCH_BM_XENTURRET
#define ENTPATCH_BM_ICHTHYOSAUR
#define ENTPATCH_BM_GARGANTUA
Expand Down Expand Up @@ -159,7 +161,11 @@
#include <srccoop/entitypatch>
#if defined SRCCOOP_BLACKMESA
#include <srccoop/blackmesa/entitypatch>
#include <srccoop/blackmesa/deathnotice>
#elseif defined SRCCOOP_HL2DM
#include <srccoop/hl2dm/deathnotice>
#endif
#include <srccoop/deathnotice>
#include <srccoop/instancing>
#include <srccoop/playerpatch>
#include <srccoop/menu>
Expand Down
162 changes: 162 additions & 0 deletions scripting/include/srccoop/blackmesa/deathnotice.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#if defined _srccoop_deathnotice_game_included
#endinput
#endif
#define _srccoop_deathnotice_game_included

#pragma newdecls required
#pragma semicolon 1

char g_pDnDisplayList[][2][] =
{
// NPCS.
{ "npc_abrams", "Tank" },
{ "npc_alien_controller", "Alien Controller" },
{ "npc_alien_grunt", "Alien Grunt" },
{ "npc_alien_grunt_elite", "Elite Alien Grunt" },
{ "npc_alien_grunt_melee", "Alien Grunt" },
{ "npc_alien_slave", "Alien Slave" },
{ "npc_alien_slave_dummy", "Alien Slave" },
{ "npc_apache", "Apache" },
{ "npc_barnacle", "Barnacle" },
{ "npc_beneathticle", "Underwater Barnacle" },
{ "npc_boid", "Boid" },
{ "npc_boid_flock", "Boid Flock" },
{ "npc_bullsquid", "Bullsquid" },
{ "npc_bullsquid_melee", "Bullsquid" },
{ "npc_crow", "Crow" },
{ "npc_eli", "Dr. Eli" },
{ "npc_furniture", "Furniture" },
{ "npc_gargantua", "Gargantua" },
{ "npc_Gonarch", "Gonarch" },
{ "npc_headcrab", "Headcrab" },
{ "npc_headcrab_baby", "Baby Headcrab" },
{ "npc_headcrab_black", "Poison Headcrab" },
{ "npc_headcrab_fast", "Fast Headcrab" },
{ "npc_headcrab_poison", "Poison Headcrab" },
{ "npc_hecu_marine", "HECU Soldier" },
{ "npc_houndeye", "Houndeye" },
{ "npc_houndeye_knockback", "Knockback Houndeye" },
{ "npc_houndeye_suicide", "Explosive Houndeye" },
{ "npc_human_assassin", "Assassin" },
{ "npc_human_commander", "HECU Commander" },
{ "npc_human_grenadier", "HECU Soldier" },
{ "npc_human_grunt", "HECU Soldier" },
{ "npc_human_medic", "HECU Soldier" },
{ "npc_human_scientist", "Scientist" },
{ "npc_human_scientist_eli", "Dr. Eli" },
{ "npc_human_scientist_female", "Scientist" },
{ "npc_human_scientist_kleiner", "Dr. Kleiner" },
{ "npc_human_security", "Security Guard" },
{ "npc_ichthyosaur", "Ichthyosaur" },
{ "npc_kleiner", "Dr. Kliener" },
{ "npc_lav", "LAV" },
{ "npc_leech", "Leech" },
{ "npc_nihilanth", "Nihilanth" },
{ "npc_osprey", "Osprey" },
{ "npc_pigeon", "Pigeon" },
{ "npc_plantlight", "Plantlight" },
{ "npc_plantlight_stalker", "Plantlight" },
{ "npc_protozoan", "Protozoan" },
{ "npc_puffballfungus", "Puffball Fungus" },
{ "npc_seagull", "Seagull" },
{ "npc_sentry_ceiling", "Turret" },
{ "npc_sentry_ground", "Turret" },
{ "npc_snark", "Snark" },
{ "npc_sniper", "Marine Sniper" },
{ "npc_tentacle", "Alien Tentacle" },
{ "npc_vortigaunt", "Alien Slave" },
{ "npc_xen_grunt", "Alien Grunt" },
{ "npc_xentacle", "Alien Tentacle" },
{ "npc_xentree", "Alien Tree" },
{ "npc_xenturret", "Alien Turret" },
{ "npc_xontroller", "Alien Xontroller" },
{ "npc_xort", "Alien Slave" },
{ "npc_xortEB", "Alien Slave" },
{ "npc_zombie_grunt", "Zombie" },
{ "npc_zombie_grunt_torso", "Zombie" },
{ "npc_zombie_hev", "Zombie" },
{ "npc_zombie_scientist", "Zombie" },
{ "npc_zombie_scientist_torso", "Zombie" },
{ "npc_zombie_security", "Zombie" },

// Entities.
{ "env_beam", "Laser Beam" },
{ "env_explosion", "Explosion" },
{ "env_fire", "Fire" },
{ "env_laser", "Laser Beam" },
{ "entityflame", "Fire" },
{ "func_movelinear", "Dynamic Prop" },
{ "prop_physics", "Physics Prop" },
{ "prop_xen_int_barrel", "Physics Prop" },
{ "prop_barrel_cactus", "Cactus" },
{ "prop_barrel_cactus_semilarge", "Cactus" },
{ "func_minefield", "Landmine" },

// Weapon Projectiles.
{ "grenade_bolt", "Crossbow Bolt" },
{ "grenade_frag", "Frag Grenade" },
{ "grenade_hornet", "Hornet" },
{ "grenade_mp5_contact", "MP5 Grenade" },
{ "grenade_rpg", "RPG" },
{ "grenade_apache_rpg", "Apache" },
{ "grenade_satchel", "Satchel" },
{ "grenade_tripmine", "Tripmine" },
{ "npc_snark", "Snark" },

// Entity Projectiles.
{ "grenade_mortar", "Mortar Shell" },
{ "grenade_mortar_small", "Mortar Shell" },
{ "grenade_mortar_large", "Mortar Shell" },
};

char g_pDnWeaponIconList[][2][] =
{
// Weapons.
{ "weapon_357", "357" },
{ "weapon_assassin_glock", "assassin_glock" },
{ "weapon_crossbow", "crossbow" },
{ "weapon_crowbar", "crowbar" },
{ "weapon_frag", "frag" },
{ "weapon_glock", "glock" },
{ "weapon_gluon", "gluon" },
{ "weapon_headcrab", "headcrab" },
{ "weapon_hivehand", "hivehand" },
{ "weapon_mp5", "mp5" },
{ "weapon_rpg", "rpg" },
{ "weapon_satchel", "satchel" },
{ "weapon_shotgun", "shotgun" },
{ "weapon_snark", "snark" },
{ "weapon_tau", "tau" },
{ "weapon_tripmine", "tripmine" },

// Weapon Projectiles.
{ "grenade_bolt", "crossbow" },
{ "grenade_frag", "frag" },
{ "grenade_hornet", "hivehand" },
{ "grenade_mp5_contact", "mp5" },
{ "grenade_rpg", "rpg" },
{ "grenade_apache_rpg", "rpg" },
{ "grenade_satchel", "satchel" },
{ "grenade_tripmine", "tripmine" },
{ "npc_snark", "snark" },
};

// TODO:
// Check the following:
//
// env_gunfire
// env_mortar_launcher
// env_sporeexplosion
// func_50cal
// func_door
// func_tow
// func_tow_mp

// grenade_nuke

// grenade_spit
// grenade_tank_shell
// grenade_tow


// proto_sniper
Loading

0 comments on commit 4b17c80

Please sign in to comment.