From 9029beb87dc763f7772c9fa98dbe7a7a40607582 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Wed, 25 Dec 2024 12:13:34 +0200 Subject: [PATCH] game: Add npc_timeminder from Anachronox --- src/game/g_misc.c | 32 +++++++++++++++++++++++ src/game/savegame/tables/gamefunc_decs.h | 1 + src/game/savegame/tables/gamefunc_list.h | 1 + src/game/savegame/tables/spawnfunc_decs.h | 1 + src/game/savegame/tables/spawnfunc_list.h | 1 + stuff/models/entity.dat | 23 ++++++++-------- 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 50b1602e..56a0594d 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -3360,3 +3360,35 @@ void SP_misc_model(edict_t *ent) gi.setmodel(ent, ent->model); gi.linkentity(ent); } + +/* + * QUAKED npc_timeminder (0 1 0) (-8 -8 -8) (8 8 8) + * + * Anachronox: Save menu open. + */ +void +touch_npc_timeminder(edict_t *self, edict_t *other, cplane_t *plane /* unused */, + csurface_t *surf /* unused */) +{ + gi.AddCommandString("menu_savegame\n"); +} + +void +SP_npc_timeminder(edict_t *self) +{ + if (!self) + { + return; + } + + if (deathmatch->value) + { + G_FreeEdict(self); + return; + } + + self->movetype = MOVETYPE_NONE; + self->solid = SOLID_BBOX; + self->touch = touch_npc_timeminder; + gi.linkentity(self); +} diff --git a/src/game/savegame/tables/gamefunc_decs.h b/src/game/savegame/tables/gamefunc_decs.h index de45d31d..0b8183ec 100644 --- a/src/game/savegame/tables/gamefunc_decs.h +++ b/src/game/savegame/tables/gamefunc_decs.h @@ -1373,6 +1373,7 @@ extern void target_music_use ( edict_t * self , edict_t * other , edict_t * acti extern void target_sky_use ( edict_t * self , edict_t * other , edict_t * activator ) ; extern void target_steam_start ( edict_t * self ) ; extern void target_string_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void touch_npc_timeminder ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; extern void teleporter_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; extern void tesla_activate ( edict_t * self ) ; extern void tesla_blow ( edict_t * self ) ; diff --git a/src/game/savegame/tables/gamefunc_list.h b/src/game/savegame/tables/gamefunc_list.h index 9d7062ac..9033225b 100644 --- a/src/game/savegame/tables/gamefunc_list.h +++ b/src/game/savegame/tables/gamefunc_list.h @@ -1377,6 +1377,7 @@ {"tesla_think", (byte *)tesla_think}, {"tesla_think_active", (byte *)tesla_think_active}, {"tesla_zap", (byte *)tesla_zap}, +{"touch_npc_timeminder", (byte *)touch_npc_timeminder}, {"tracker_explode", (byte *)tracker_explode}, {"tracker_fly", (byte *)tracker_fly}, {"tracker_pain_daemon_spawn", (byte *)tracker_pain_daemon_spawn}, diff --git a/src/game/savegame/tables/spawnfunc_decs.h b/src/game/savegame/tables/spawnfunc_decs.h index 25246db1..b56313fc 100644 --- a/src/game/savegame/tables/spawnfunc_decs.h +++ b/src/game/savegame/tables/spawnfunc_decs.h @@ -156,6 +156,7 @@ extern void SP_monster_widow(edict_t * self); extern void SP_monster_widow2(edict_t * self); extern void SP_monster_wizard(edict_t * self); extern void SP_monster_zombie(edict_t * self); +extern void SP_npc_timeminder(edict_t * self); extern void SP_object_big_fire ( edict_t * ent ) ; extern void SP_object_campfire ( edict_t * ent ) ; extern void SP_object_flame1 ( edict_t * ent ) ; diff --git a/src/game/savegame/tables/spawnfunc_list.h b/src/game/savegame/tables/spawnfunc_list.h index 3ac31f72..69c99f84 100644 --- a/src/game/savegame/tables/spawnfunc_list.h +++ b/src/game/savegame/tables/spawnfunc_list.h @@ -163,6 +163,7 @@ {"monster_widow2", SP_monster_widow2}, {"monster_wizard", SP_monster_wizard}, {"monster_zombie", SP_monster_zombie}, +{"npc_timeminder", SP_npc_timeminder}, {"object_big_fire", SP_object_big_fire}, {"object_campfire", SP_object_campfire}, {"object_flame1", SP_object_flame1}, diff --git a/stuff/models/entity.dat b/stuff/models/entity.dat index 7daec956..1dd8dacf 100644 --- a/stuff/models/entity.dat +++ b/stuff/models/entity.dat @@ -299,19 +299,20 @@ trigger_fog||1.0|1.0|1.0|general|0.0|0.0|0.0|0.0|0.0|0.0|shadow|0|0.0|0.0|0|0|0| trigger_health_relay||1.0|1.0|1.0|general|-8|-8|-8|8|8|8|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Health relay trigger|0.5|0.5|0.5 // Quake 2 Remaster -monster_army|models/monsters/army/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_demon|models/monsters/demon/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|64|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_dog|models/monsters/dog/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_enforcer|models/monsters/enforcer/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_hknight|models/monsters/hknight/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_knight|models/monsters/knight/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_ogre|models/monsters/ogre/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|64|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 +monster_army|models/monsters/army/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Army soldier|1|.5|0 +monster_demon|models/monsters/demon/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|64|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Demon|1|.5|0 +monster_dog|models/monsters/dog/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Dog|1|.5|0 +monster_enforcer|models/monsters/enforcer/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Enforcer|1|.5|0 +monster_hknight|models/monsters/hknight/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|HKnight|1|.5|0 +monster_knight|models/monsters/knight/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Knight|1|.5|0 +monster_ogre|models/monsters/ogre/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|64|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Ogre|1|.5|0 monster_rotfish|models/monsters/rotfish/tris.md2|1.0|1.0|1.0|general|-25.0|-25.0|-14.0|25.0|25.0|14.0|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Rotfish|1.0|0.5|0.0 -monster_shalrath|models/monsters/shalrath/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|48|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 +monster_shalrath|models/monsters/shalrath/tris.md2|1.0|1.0|1.0|general|-32,|-32,|-24|32,|32,|48|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Shalrath|1|.5|0 monster_shambler|models/monsters/shambler/tris.md2|1.0|1.0|1.0|general|-32.0|-32.0|-24.0|32.0|32.0|64.0|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Shambler|1.0|0.5|0.0 -monster_tarbaby|models/monsters/tarbaby/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_wizard|models/monsters/wizard/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 -monster_zombie|models/monsters/zombie/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none||1|.5|0 +monster_tarbaby|models/monsters/tarbaby/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Tarbaby|1|.5|0 +monster_wizard|models/monsters/wizard/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Wizard|1|.5|0 +monster_zombie|models/monsters/zombie/tris.md2|1.0|1.0|1.0|general|-16,|-16,|-24|16,|16,|40|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Zombie|1|.5|0 +npc_timeminder|models/monsters/insane/tris.md2|1.0|1.0|1.0|general|-8|-8|-8|8|8|8|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Save Menu|0|1|0 // Kingpin ai_boundary||1.0|1.0|1.0|general|0.0|0.0|0.0|0.0|0.0|0.0|shadow|0|0.0|0.0|0|0|0|0:0|0|0|none|Character will abort pursuing player when touching this brush. Will take cover until the player is out of view, then return to guarding position (if character has been assigned one).|.5|.5|0