mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-19 07:51:03 +00:00
game: Partial implement misc_model, misc_flare
Based on: * https://github.com/id-Software/quake2-rerelease-dll/blob/main/rerelease/g_misc.cpp
This commit is contained in:
parent
da8ee87f37
commit
2c82f906e1
5 changed files with 87 additions and 0 deletions
|
@ -3273,3 +3273,84 @@ SP_misc_nuke_core(edict_t *ent)
|
|||
|
||||
ent->use = misc_nuke_core_use;
|
||||
}
|
||||
|
||||
/*
|
||||
* QUAKED misc_flare (1.0 1.0 0.0) (-32 -32 -32) (32 32 32) RED GREEN BLUE LOCK_ANGLE
|
||||
* Creates a flare seen in the N64 version.
|
||||
*/
|
||||
#define SPAWNFLAG_FLARE_RED 1
|
||||
#define SPAWNFLAG_FLARE_GREEN 2
|
||||
#define SPAWNFLAG_FLARE_BLUE 4
|
||||
#define SPAWNFLAG_FLARE_LOCK_ANGLE 8
|
||||
|
||||
/* TODO: implement FX_FLARE */
|
||||
#define RF_FLARE EF_BLUEHYPERBLASTER
|
||||
#define RF_FLARE_LOCK_ANGLE 0
|
||||
|
||||
void
|
||||
misc_flare_use(edict_t *ent, edict_t *other, edict_t *activator)
|
||||
{
|
||||
ent->svflags ^= SVF_NOCLIENT;
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
|
||||
void
|
||||
SP_misc_flare(edict_t* ent)
|
||||
{
|
||||
ent->s.modelindex = 0;
|
||||
ent->s.renderfx = RF_FLARE;
|
||||
ent->solid = SOLID_NOT;
|
||||
/*
|
||||
* TODO: Add scale field
|
||||
* ent->s.scale = st.radius;
|
||||
*/
|
||||
|
||||
if (ent->spawnflags & SPAWNFLAG_FLARE_RED)
|
||||
{
|
||||
ent->s.renderfx |= RF_SHELL_RED;
|
||||
}
|
||||
|
||||
if (ent->spawnflags & SPAWNFLAG_FLARE_GREEN)
|
||||
{
|
||||
ent->s.renderfx |= RF_SHELL_GREEN;
|
||||
}
|
||||
|
||||
if (ent->spawnflags & SPAWNFLAG_FLARE_BLUE)
|
||||
{
|
||||
ent->s.renderfx |= RF_SHELL_BLUE;
|
||||
}
|
||||
|
||||
if (ent->spawnflags & SPAWNFLAG_FLARE_LOCK_ANGLE)
|
||||
{
|
||||
ent->s.renderfx |= RF_FLARE_LOCK_ANGLE;
|
||||
}
|
||||
|
||||
if (st.image && *st.image)
|
||||
{
|
||||
ent->s.renderfx |= RF_CUSTOMSKIN;
|
||||
ent->s.frame = gi.imageindex(st.image);
|
||||
}
|
||||
|
||||
VectorSet(ent->mins, -32, -32, -32);
|
||||
VectorSet(ent->maxs, 32, 32, 32);
|
||||
|
||||
ent->s.modelindex2 = st.fade_start_dist;
|
||||
ent->s.modelindex3 = st.fade_end_dist;
|
||||
|
||||
if (ent->targetname)
|
||||
{
|
||||
ent->use = misc_flare_use;
|
||||
}
|
||||
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* QUAKED misc_model (1 0 0) (-8 -8 -8) (8 8 8)
|
||||
*/
|
||||
void SP_misc_model(edict_t *ent)
|
||||
{
|
||||
gi.setmodel(ent, ent->model);
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
|
|
|
@ -1026,6 +1026,7 @@ extern void misc_easterchick2_think ( edict_t * self ) ;
|
|||
extern void misc_easterchick_think ( edict_t * self ) ;
|
||||
extern void misc_eastertank_think ( edict_t * self ) ;
|
||||
extern void misc_nuke_core_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void misc_flare_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void misc_satellite_dish_think ( edict_t * self ) ;
|
||||
extern void misc_satellite_dish_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
extern void misc_strogg_ship_use ( edict_t * self , edict_t * other , edict_t * activator ) ;
|
||||
|
|
|
@ -1004,6 +1004,7 @@
|
|||
{"misc_easterchick_think", (byte *)misc_easterchick_think},
|
||||
{"misc_eastertank_think", (byte *)misc_eastertank_think},
|
||||
{"misc_nuke_core_use", (byte *)misc_nuke_core_use},
|
||||
{"misc_flare_use", (byte *)misc_flare_use},
|
||||
{"misc_satellite_dish_think", (byte *)misc_satellite_dish_think},
|
||||
{"misc_satellite_dish_use", (byte *)misc_satellite_dish_use},
|
||||
{"misc_strogg_ship_use", (byte *)misc_strogg_ship_use},
|
||||
|
|
|
@ -89,6 +89,8 @@ extern void SP_misc_gib_leg ( edict_t * ent ) ;
|
|||
extern void SP_misc_insane(edict_t * self);
|
||||
extern void SP_misc_nuke ( edict_t * ent ) ;
|
||||
extern void SP_misc_nuke_core ( edict_t * ent ) ;
|
||||
extern void SP_misc_flare ( edict_t * ent ) ;
|
||||
extern void SP_misc_model ( edict_t * ent ) ;
|
||||
extern void SP_misc_satellite_dish ( edict_t * ent ) ;
|
||||
extern void SP_misc_strogg_ship ( edict_t * ent ) ;
|
||||
extern void SP_misc_teleporter ( edict_t * ent ) ;
|
||||
|
|
|
@ -94,6 +94,8 @@
|
|||
{"misc_insane", SP_misc_insane},
|
||||
{"misc_nuke", SP_misc_nuke},
|
||||
{"misc_nuke_core", SP_misc_nuke_core},
|
||||
{"misc_flare", SP_misc_flare},
|
||||
{"misc_model", SP_misc_model},
|
||||
{"misc_satellite_dish", SP_misc_satellite_dish},
|
||||
{"misc_strogg_ship", SP_misc_strogg_ship},
|
||||
{"misc_teleporter", SP_misc_teleporter},
|
||||
|
|
Loading…
Reference in a new issue