mirror of
https://github.com/id-Software/quake2-rerelease-dll.git
synced 2026-03-19 16:39:46 +01:00
Initial commit
This commit is contained in:
178
rerelease/xatrix/g_xatrix_func.cpp
Normal file
178
rerelease/xatrix/g_xatrix_func.cpp
Normal file
@@ -0,0 +1,178 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
|
||||
#include "../g_local.h"
|
||||
|
||||
/*QUAKED rotating_light (0 .5 .8) (-8 -8 -8) (8 8 8) START_OFF ALARM
|
||||
"health" if set, the light may be killed.
|
||||
*/
|
||||
|
||||
// RAFAEL
|
||||
// note to self
|
||||
// the lights will take damage from explosions
|
||||
// this could leave a player in total darkness very bad
|
||||
|
||||
constexpr spawnflags_t SPAWNFLAG_ROTATING_LIGHT_START_OFF = 1_spawnflag;
|
||||
constexpr spawnflags_t SPAWNFLAG_ROTATING_LIGHT_ALARM = 2_spawnflag;
|
||||
|
||||
THINK(rotating_light_alarm) (edict_t *self) -> void
|
||||
{
|
||||
if (self->spawnflags.has(SPAWNFLAG_ROTATING_LIGHT_START_OFF))
|
||||
{
|
||||
self->think = nullptr;
|
||||
self->nextthink = 0_ms;
|
||||
}
|
||||
else
|
||||
{
|
||||
gi.sound(self, CHAN_NO_PHS_ADD | CHAN_VOICE, self->moveinfo.sound_start, 1, ATTN_STATIC, 0);
|
||||
self->nextthink = level.time + 1_sec;
|
||||
}
|
||||
}
|
||||
|
||||
DIE(rotating_light_killed) (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, const vec3_t &point, const mod_t &mod) -> void
|
||||
{
|
||||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_WELDING_SPARKS);
|
||||
gi.WriteByte(30);
|
||||
gi.WritePosition(self->s.origin);
|
||||
gi.WriteDir(vec3_origin);
|
||||
gi.WriteByte(irandom(0xe0, 0xe8));
|
||||
gi.multicast(self->s.origin, MULTICAST_PVS, false);
|
||||
|
||||
self->s.effects &= ~EF_SPINNINGLIGHTS;
|
||||
self->use = nullptr;
|
||||
|
||||
self->think = G_FreeEdict;
|
||||
self->nextthink = level.time + FRAME_TIME_S;
|
||||
}
|
||||
|
||||
USE(rotating_light_use) (edict_t *self, edict_t *other, edict_t *activator) -> void
|
||||
{
|
||||
if (self->spawnflags.has(SPAWNFLAG_ROTATING_LIGHT_START_OFF))
|
||||
{
|
||||
self->spawnflags &= ~SPAWNFLAG_ROTATING_LIGHT_START_OFF;
|
||||
self->s.effects |= EF_SPINNINGLIGHTS;
|
||||
|
||||
if (self->spawnflags.has(SPAWNFLAG_ROTATING_LIGHT_ALARM))
|
||||
{
|
||||
self->think = rotating_light_alarm;
|
||||
self->nextthink = level.time + FRAME_TIME_S;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self->spawnflags |= SPAWNFLAG_ROTATING_LIGHT_START_OFF;
|
||||
self->s.effects &= ~EF_SPINNINGLIGHTS;
|
||||
}
|
||||
}
|
||||
|
||||
void SP_rotating_light(edict_t *self)
|
||||
{
|
||||
self->movetype = MOVETYPE_STOP;
|
||||
self->solid = SOLID_BBOX;
|
||||
|
||||
self->s.modelindex = gi.modelindex("models/objects/light/tris.md2");
|
||||
|
||||
self->s.frame = 0;
|
||||
|
||||
self->use = rotating_light_use;
|
||||
|
||||
if (self->spawnflags.has(SPAWNFLAG_ROTATING_LIGHT_START_OFF))
|
||||
self->s.effects &= ~EF_SPINNINGLIGHTS;
|
||||
else
|
||||
{
|
||||
self->s.effects |= EF_SPINNINGLIGHTS;
|
||||
}
|
||||
|
||||
if (!self->speed)
|
||||
self->speed = 32;
|
||||
// this is a real cheap way
|
||||
// to set the radius of the light
|
||||
// self->s.frame = self->speed;
|
||||
|
||||
if (!self->health)
|
||||
{
|
||||
self->health = 10;
|
||||
self->max_health = self->health;
|
||||
self->die = rotating_light_killed;
|
||||
self->takedamage = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->max_health = self->health;
|
||||
self->die = rotating_light_killed;
|
||||
self->takedamage = true;
|
||||
}
|
||||
|
||||
if (self->spawnflags.has(SPAWNFLAG_ROTATING_LIGHT_ALARM))
|
||||
{
|
||||
self->moveinfo.sound_start = gi.soundindex("misc/alarm.wav");
|
||||
}
|
||||
|
||||
gi.linkentity(self);
|
||||
}
|
||||
|
||||
/*QUAKED func_object_repair (1 .5 0) (-8 -8 -8) (8 8 8)
|
||||
object to be repaired.
|
||||
The default delay is 1 second
|
||||
"delay" the delay in seconds for spark to occur
|
||||
*/
|
||||
|
||||
THINK(object_repair_fx) (edict_t *ent) -> void
|
||||
{
|
||||
ent->nextthink = level.time + gtime_t::from_sec(ent->delay);
|
||||
|
||||
if (ent->health <= 100)
|
||||
ent->health++;
|
||||
else
|
||||
{
|
||||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_WELDING_SPARKS);
|
||||
gi.WriteByte(10);
|
||||
gi.WritePosition(ent->s.origin);
|
||||
gi.WriteDir(vec3_origin);
|
||||
gi.WriteByte(irandom(0xe0, 0xe8));
|
||||
gi.multicast(ent->s.origin, MULTICAST_PVS, false);
|
||||
}
|
||||
}
|
||||
|
||||
THINK(object_repair_dead) (edict_t *ent) -> void
|
||||
{
|
||||
G_UseTargets(ent, ent);
|
||||
ent->nextthink = level.time + 10_hz;
|
||||
ent->think = object_repair_fx;
|
||||
}
|
||||
|
||||
THINK(object_repair_sparks) (edict_t *ent) -> void
|
||||
{
|
||||
if (ent->health <= 0)
|
||||
{
|
||||
ent->nextthink = level.time + 10_hz;
|
||||
ent->think = object_repair_dead;
|
||||
return;
|
||||
}
|
||||
|
||||
ent->nextthink = level.time + gtime_t::from_sec(ent->delay);
|
||||
|
||||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_WELDING_SPARKS);
|
||||
gi.WriteByte(10);
|
||||
gi.WritePosition(ent->s.origin);
|
||||
gi.WriteDir(vec3_origin);
|
||||
gi.WriteByte(irandom(0xe0, 0xe8));
|
||||
gi.multicast(ent->s.origin, MULTICAST_PVS, false);
|
||||
}
|
||||
|
||||
void SP_object_repair(edict_t *ent)
|
||||
{
|
||||
ent->movetype = MOVETYPE_NONE;
|
||||
ent->solid = SOLID_BBOX;
|
||||
ent->classname = "object_repair";
|
||||
ent->mins = { -8, -8, 8 };
|
||||
ent->maxs = { 8, 8, 8 };
|
||||
ent->think = object_repair_sparks;
|
||||
ent->nextthink = level.time + 1_sec;
|
||||
ent->health = 100;
|
||||
if (!ent->delay)
|
||||
ent->delay = 1.0;
|
||||
}
|
||||
31
rerelease/xatrix/g_xatrix_items.cpp
Normal file
31
rerelease/xatrix/g_xatrix_items.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
|
||||
#include "../g_local.h"
|
||||
|
||||
// RAFAEL
|
||||
void SP_item_foodcube(edict_t *self)
|
||||
{
|
||||
if (deathmatch->integer && g_no_health->integer)
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
|
||||
self->model = "models/objects/trapfx/tris.md2";
|
||||
SpawnItem(self, GetItemByIndex(IT_HEALTH_SMALL));
|
||||
self->spawnflags |= SPAWNFLAG_ITEM_DROPPED;
|
||||
self->style = HEALTH_IGNORE_MAX;
|
||||
self->classname = "item_foodcube";
|
||||
self->s.effects |= EF_GIB;
|
||||
|
||||
// Paril: set pickup noise for foodcube based on amount
|
||||
if (self->count < 10)
|
||||
self->noise_index = gi.soundindex("items/s_health.wav");
|
||||
else if (self->count < 25)
|
||||
self->noise_index = gi.soundindex("items/n_health.wav");
|
||||
else if (self->count < 50)
|
||||
self->noise_index = gi.soundindex("items/l_health.wav");
|
||||
else
|
||||
self->noise_index = gi.soundindex("items/m_health.wav");
|
||||
}
|
||||
143
rerelease/xatrix/g_xatrix_misc.cpp
Normal file
143
rerelease/xatrix/g_xatrix_misc.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
|
||||
#include "../g_local.h"
|
||||
|
||||
/*QUAKED misc_crashviper (1 .5 0) (-176 -120 -24) (176 120 72)
|
||||
This is a large viper about to crash
|
||||
*/
|
||||
void SP_misc_crashviper(edict_t *ent)
|
||||
{
|
||||
if (!ent->target)
|
||||
{
|
||||
gi.Com_PrintFmt("{}: no target\n", *ent);
|
||||
G_FreeEdict(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ent->speed)
|
||||
ent->speed = 300;
|
||||
|
||||
ent->movetype = MOVETYPE_PUSH;
|
||||
ent->solid = SOLID_NOT;
|
||||
ent->s.modelindex = gi.modelindex("models/ships/bigviper/tris.md2");
|
||||
ent->mins = { -16, -16, 0 };
|
||||
ent->maxs = { 16, 16, 32 };
|
||||
|
||||
ent->think = func_train_find;
|
||||
ent->nextthink = level.time + 10_hz;
|
||||
ent->use = misc_viper_use;
|
||||
ent->svflags |= SVF_NOCLIENT;
|
||||
ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
|
||||
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
/*QUAKED misc_viper_missile (1 0 0) (-8 -8 -8) (8 8 8)
|
||||
"dmg" how much boom should the bomb make? the default value is 250
|
||||
*/
|
||||
|
||||
USE(misc_viper_missile_use) (edict_t *self, edict_t *other, edict_t *activator) -> void
|
||||
{
|
||||
vec3_t forward, right, up;
|
||||
vec3_t start, dir;
|
||||
vec3_t vec;
|
||||
|
||||
AngleVectors(self->s.angles, forward, right, up);
|
||||
|
||||
self->enemy = G_FindByString<&edict_t::targetname>(nullptr, self->target);
|
||||
|
||||
vec = self->enemy->s.origin;
|
||||
|
||||
start = self->s.origin;
|
||||
dir = vec - start;
|
||||
dir.normalize();
|
||||
|
||||
monster_fire_rocket(self, start, dir, self->dmg, 500, MZ2_CHICK_ROCKET_1);
|
||||
|
||||
self->nextthink = level.time + 10_hz;
|
||||
self->think = G_FreeEdict;
|
||||
}
|
||||
|
||||
void SP_misc_viper_missile(edict_t *self)
|
||||
{
|
||||
self->movetype = MOVETYPE_NONE;
|
||||
self->solid = SOLID_NOT;
|
||||
self->mins = { -8, -8, -8 };
|
||||
self->maxs = { 8, 8, 8 };
|
||||
|
||||
if (!self->dmg)
|
||||
self->dmg = 250;
|
||||
|
||||
self->s.modelindex = gi.modelindex("models/objects/bomb/tris.md2");
|
||||
|
||||
self->use = misc_viper_missile_use;
|
||||
self->svflags |= SVF_NOCLIENT;
|
||||
|
||||
gi.linkentity(self);
|
||||
}
|
||||
|
||||
// RAFAEL 17-APR-98
|
||||
/*QUAKED misc_transport (1 0 0) (-8 -8 -8) (8 8 8)
|
||||
Maxx's transport at end of game
|
||||
*/
|
||||
void SP_misc_transport(edict_t *ent)
|
||||
{
|
||||
if (!ent->target)
|
||||
{
|
||||
gi.Com_PrintFmt("{}: no target\n", *ent);
|
||||
G_FreeEdict(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ent->speed)
|
||||
ent->speed = 300;
|
||||
|
||||
ent->movetype = MOVETYPE_PUSH;
|
||||
ent->solid = SOLID_NOT;
|
||||
ent->s.modelindex = gi.modelindex("models/objects/ship/tris.md2");
|
||||
|
||||
ent->mins = { -16, -16, 0 };
|
||||
ent->maxs = { 16, 16, 32 };
|
||||
|
||||
ent->think = func_train_find;
|
||||
ent->nextthink = level.time + 10_hz;
|
||||
ent->use = misc_strogg_ship_use;
|
||||
ent->svflags |= SVF_NOCLIENT;
|
||||
ent->moveinfo.accel = ent->moveinfo.decel = ent->moveinfo.speed = ent->speed;
|
||||
|
||||
if (!(ent->spawnflags & SPAWNFLAG_TRAIN_START_ON))
|
||||
ent->spawnflags |= SPAWNFLAG_TRAIN_START_ON;
|
||||
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
// END 17-APR-98
|
||||
|
||||
/*QUAKED misc_amb4 (1 0 0) (-16 -16 -16) (16 16 16)
|
||||
Mal's amb4 loop entity
|
||||
*/
|
||||
static int amb4sound;
|
||||
|
||||
THINK(amb4_think) (edict_t *ent) -> void
|
||||
{
|
||||
ent->nextthink = level.time + 2.7_sec;
|
||||
gi.sound(ent, CHAN_VOICE, amb4sound, 1, ATTN_NONE, 0);
|
||||
}
|
||||
|
||||
void SP_misc_amb4(edict_t *ent)
|
||||
{
|
||||
ent->think = amb4_think;
|
||||
ent->nextthink = level.time + 1_sec;
|
||||
amb4sound = gi.soundindex("world/amb4.wav");
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
|
||||
/*QUAKED misc_nuke (1 0 0) (-16 -16 -16) (16 16 16)
|
||||
*/
|
||||
extern void target_killplayers_use(edict_t *self, edict_t *other, edict_t *activator);
|
||||
|
||||
void SP_misc_nuke(edict_t *ent)
|
||||
{
|
||||
ent->use = target_killplayers_use;
|
||||
}
|
||||
142
rerelease/xatrix/g_xatrix_monster.cpp
Normal file
142
rerelease/xatrix/g_xatrix_monster.cpp
Normal file
@@ -0,0 +1,142 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
|
||||
#include "../g_local.h"
|
||||
|
||||
// RAFAEL
|
||||
void monster_fire_blueblaster(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, monster_muzzleflash_id_t flashtype, effects_t effect)
|
||||
{
|
||||
fire_blueblaster(self, start, dir, damage, speed, effect);
|
||||
monster_muzzleflash(self, start, flashtype);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void monster_fire_ionripper(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, monster_muzzleflash_id_t flashtype, effects_t effect)
|
||||
{
|
||||
fire_ionripper(self, start, dir, damage, speed, effect);
|
||||
monster_muzzleflash(self, start, flashtype);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void monster_fire_heat(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, monster_muzzleflash_id_t flashtype, float turn_fraction)
|
||||
{
|
||||
fire_heat(self, start, dir, damage, speed, (float) damage, damage, turn_fraction);
|
||||
monster_muzzleflash(self, start, flashtype);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
struct dabeam_pierce_t : pierce_args_t
|
||||
{
|
||||
edict_t *self;
|
||||
bool damage;
|
||||
|
||||
inline dabeam_pierce_t(edict_t *self, bool damage) :
|
||||
pierce_args_t(),
|
||||
self(self),
|
||||
damage(damage)
|
||||
{
|
||||
}
|
||||
|
||||
// we hit an entity; return false to stop the piercing.
|
||||
// you can adjust the mask for the re-trace (for water, etc).
|
||||
virtual bool hit(contents_t &mask, vec3_t &end) override
|
||||
{
|
||||
if (damage)
|
||||
{
|
||||
// hurt it if we can
|
||||
if (self->dmg > 0 && (tr.ent->takedamage) && !(tr.ent->flags & FL_IMMUNE_LASER) && (tr.ent != self->owner))
|
||||
T_Damage(tr.ent, self, self->owner, self->movedir, tr.endpos, vec3_origin, self->dmg, skill->integer, DAMAGE_ENERGY, MOD_TARGET_LASER);
|
||||
|
||||
if (self->dmg < 0) // healer ray
|
||||
{
|
||||
// when player is at 100 health
|
||||
// just undo health fix
|
||||
// keeping fx
|
||||
if (tr.ent->health < tr.ent->max_health)
|
||||
tr.ent->health = min(tr.ent->max_health, tr.ent->health - self->dmg);
|
||||
}
|
||||
}
|
||||
|
||||
// if we hit something that's not a monster or player or is immune to lasers, we're done
|
||||
if (!(tr.ent->svflags & SVF_MONSTER) && (!tr.ent->client))
|
||||
{
|
||||
if (damage)
|
||||
{
|
||||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_LASER_SPARKS);
|
||||
gi.WriteByte(10);
|
||||
gi.WritePosition(tr.endpos);
|
||||
gi.WriteDir(tr.plane.normal);
|
||||
gi.WriteByte(self->s.skinnum);
|
||||
gi.multicast(tr.endpos, MULTICAST_PVS, false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mark(tr.ent))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void dabeam_update(edict_t *self, bool damage)
|
||||
{
|
||||
vec3_t start = self->s.origin;
|
||||
vec3_t end = start + (self->movedir * 2048);
|
||||
|
||||
dabeam_pierce_t args {
|
||||
self,
|
||||
damage
|
||||
};
|
||||
|
||||
pierce_trace(start, end, self, args, CONTENTS_SOLID | CONTENTS_MONSTER | CONTENTS_PLAYER | CONTENTS_DEADMONSTER);
|
||||
|
||||
self->s.old_origin = args.tr.endpos + (args.tr.plane.normal * 1.f);
|
||||
gi.linkentity(self);
|
||||
}
|
||||
|
||||
constexpr spawnflags_t SPAWNFLAG_DABEAM_SECONDARY = 1_spawnflag;
|
||||
|
||||
THINK(beam_think) (edict_t *self) -> void
|
||||
{
|
||||
if (self->spawnflags.has(SPAWNFLAG_DABEAM_SECONDARY))
|
||||
self->owner->beam2 = nullptr;
|
||||
else
|
||||
self->owner->beam = nullptr;
|
||||
G_FreeEdict(self);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void monster_fire_dabeam(edict_t *self, int damage, bool secondary, void(*update_func)(edict_t *self))
|
||||
{
|
||||
edict_t *&beam_ptr = secondary ? self->beam2 : self->beam;
|
||||
|
||||
if (!beam_ptr)
|
||||
{
|
||||
beam_ptr = G_Spawn();
|
||||
|
||||
beam_ptr->movetype = MOVETYPE_NONE;
|
||||
beam_ptr->solid = SOLID_NOT;
|
||||
beam_ptr->s.renderfx |= RF_BEAM;
|
||||
beam_ptr->s.modelindex = MODELINDEX_WORLD;
|
||||
beam_ptr->owner = self;
|
||||
beam_ptr->dmg = damage;
|
||||
beam_ptr->s.frame = 2;
|
||||
beam_ptr->spawnflags = secondary ? SPAWNFLAG_DABEAM_SECONDARY : SPAWNFLAG_NONE;
|
||||
|
||||
if (self->monsterinfo.aiflags & AI_MEDIC)
|
||||
beam_ptr->s.skinnum = 0xf3f3f1f1;
|
||||
else
|
||||
beam_ptr->s.skinnum = 0xf2f2f0f0;
|
||||
|
||||
beam_ptr->think = beam_think;
|
||||
beam_ptr->s.sound = gi.soundindex("misc/lasfly.wav");
|
||||
beam_ptr->postthink = update_func;
|
||||
}
|
||||
|
||||
beam_ptr->nextthink = level.time + 200_ms;
|
||||
update_func(beam_ptr);
|
||||
dabeam_update(beam_ptr, true);
|
||||
}
|
||||
99
rerelease/xatrix/g_xatrix_target.cpp
Normal file
99
rerelease/xatrix/g_xatrix_target.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
|
||||
#include "../g_local.h"
|
||||
|
||||
/*QUAKED target_mal_laser (1 0 0) (-4 -4 -4) (4 4 4) START_ON RED GREEN BLUE YELLOW ORANGE FAT
|
||||
Mal's laser
|
||||
*/
|
||||
void target_mal_laser_on(edict_t *self)
|
||||
{
|
||||
if (!self->activator)
|
||||
self->activator = self;
|
||||
self->spawnflags |= SPAWNFLAG_LASER_ZAP | SPAWNFLAG_LASER_ON;
|
||||
self->svflags &= ~SVF_NOCLIENT;
|
||||
self->flags |= FL_TRAP;
|
||||
// target_laser_think (self);
|
||||
self->nextthink = level.time + gtime_t::from_sec(self->wait + self->delay);
|
||||
}
|
||||
|
||||
USE(target_mal_laser_use) (edict_t *self, edict_t *other, edict_t *activator) -> void
|
||||
{
|
||||
self->activator = activator;
|
||||
if (self->spawnflags.has(SPAWNFLAG_LASER_ON))
|
||||
target_laser_off(self);
|
||||
else
|
||||
target_mal_laser_on(self);
|
||||
}
|
||||
|
||||
void mal_laser_think(edict_t *self);
|
||||
|
||||
THINK(mal_laser_think2) (edict_t *self) -> void
|
||||
{
|
||||
self->svflags |= SVF_NOCLIENT;
|
||||
self->think = mal_laser_think;
|
||||
self->nextthink = level.time + gtime_t::from_sec(self->wait);
|
||||
self->spawnflags |= SPAWNFLAG_LASER_ZAP;
|
||||
}
|
||||
|
||||
THINK(mal_laser_think) (edict_t *self) -> void
|
||||
{
|
||||
self->svflags &= ~SVF_NOCLIENT;
|
||||
target_laser_think(self);
|
||||
self->think = mal_laser_think2;
|
||||
self->nextthink = level.time + 100_ms;
|
||||
}
|
||||
|
||||
void SP_target_mal_laser(edict_t *self)
|
||||
{
|
||||
self->movetype = MOVETYPE_NONE;
|
||||
self->solid = SOLID_NOT;
|
||||
self->s.renderfx |= RF_BEAM;
|
||||
self->s.modelindex = MODELINDEX_WORLD; // must be non-zero
|
||||
self->flags |= FL_TRAP_LASER_FIELD;
|
||||
|
||||
// set the beam diameter
|
||||
if (self->spawnflags.has(SPAWNFLAG_LASER_FAT))
|
||||
self->s.frame = 16;
|
||||
else
|
||||
self->s.frame = 4;
|
||||
|
||||
// set the color
|
||||
if (self->spawnflags.has(SPAWNFLAG_LASER_RED))
|
||||
self->s.skinnum = 0xf2f2f0f0;
|
||||
else if (self->spawnflags.has(SPAWNFLAG_LASER_GREEN))
|
||||
self->s.skinnum = 0xd0d1d2d3;
|
||||
else if (self->spawnflags.has(SPAWNFLAG_LASER_BLUE))
|
||||
self->s.skinnum = 0xf3f3f1f1;
|
||||
else if (self->spawnflags.has(SPAWNFLAG_LASER_YELLOW))
|
||||
self->s.skinnum = 0xdcdddedf;
|
||||
else if (self->spawnflags.has(SPAWNFLAG_LASER_ORANGE))
|
||||
self->s.skinnum = 0xe0e1e2e3;
|
||||
|
||||
G_SetMovedir(self->s.angles, self->movedir);
|
||||
|
||||
if (!self->delay)
|
||||
self->delay = 0.1f;
|
||||
|
||||
if (!self->wait)
|
||||
self->wait = 0.1f;
|
||||
|
||||
if (!self->dmg)
|
||||
self->dmg = 5;
|
||||
|
||||
self->mins = { -8, -8, -8 };
|
||||
self->maxs = { 8, 8, 8 };
|
||||
|
||||
self->nextthink = level.time + gtime_t::from_sec(self->delay);
|
||||
self->think = mal_laser_think;
|
||||
|
||||
self->use = target_mal_laser_use;
|
||||
|
||||
gi.linkentity(self);
|
||||
|
||||
if (self->spawnflags.has(SPAWNFLAG_LASER_ON))
|
||||
target_mal_laser_on(self);
|
||||
else
|
||||
target_laser_off(self);
|
||||
}
|
||||
// END 15-APR-98
|
||||
605
rerelease/xatrix/g_xatrix_weapon.cpp
Normal file
605
rerelease/xatrix/g_xatrix_weapon.cpp
Normal file
@@ -0,0 +1,605 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
|
||||
#include "../g_local.h"
|
||||
|
||||
// RAFAEL
|
||||
void fire_blueblaster(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, effects_t effect)
|
||||
{
|
||||
edict_t *bolt;
|
||||
trace_t tr;
|
||||
|
||||
bolt = G_Spawn();
|
||||
bolt->s.origin = start;
|
||||
bolt->s.old_origin = start;
|
||||
bolt->s.angles = vectoangles(dir);
|
||||
bolt->velocity = dir * speed;
|
||||
bolt->svflags |= SVF_PROJECTILE;
|
||||
bolt->movetype = MOVETYPE_FLYMISSILE;
|
||||
bolt->flags |= FL_DODGE;
|
||||
bolt->clipmask = MASK_PROJECTILE;
|
||||
bolt->solid = SOLID_BBOX;
|
||||
bolt->s.effects |= effect;
|
||||
bolt->s.modelindex = gi.modelindex("models/objects/laser/tris.md2");
|
||||
bolt->s.skinnum = 1;
|
||||
bolt->s.sound = gi.soundindex("misc/lasfly.wav");
|
||||
bolt->owner = self;
|
||||
bolt->touch = blaster_touch;
|
||||
bolt->nextthink = level.time + 2_sec;
|
||||
bolt->think = G_FreeEdict;
|
||||
bolt->dmg = damage;
|
||||
bolt->classname = "bolt";
|
||||
bolt->style = MOD_BLUEBLASTER;
|
||||
gi.linkentity(bolt);
|
||||
|
||||
tr = gi.traceline(self->s.origin, bolt->s.origin, bolt, bolt->clipmask);
|
||||
|
||||
if (tr.fraction < 1.0f)
|
||||
{
|
||||
bolt->s.origin = tr.endpos + (tr.plane.normal * 1.f);
|
||||
bolt->touch(bolt, tr.ent, tr, false);
|
||||
}
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
|
||||
/*
|
||||
fire_ionripper
|
||||
*/
|
||||
|
||||
THINK(ionripper_sparks) (edict_t *self) -> void
|
||||
{
|
||||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_WELDING_SPARKS);
|
||||
gi.WriteByte(0);
|
||||
gi.WritePosition(self->s.origin);
|
||||
gi.WriteDir(vec3_origin);
|
||||
gi.WriteByte(irandom(0xe4, 0xe8));
|
||||
gi.multicast(self->s.origin, MULTICAST_PVS, false);
|
||||
|
||||
G_FreeEdict(self);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
TOUCH(ionripper_touch) (edict_t *self, edict_t *other, const trace_t &tr, bool other_touching_self) -> void
|
||||
{
|
||||
if (other == self->owner)
|
||||
return;
|
||||
|
||||
if (tr.surface && (tr.surface->flags & SURF_SKY))
|
||||
{
|
||||
G_FreeEdict(self);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self->owner->client)
|
||||
PlayerNoise(self->owner, self->s.origin, PNOISE_IMPACT);
|
||||
|
||||
if (other->takedamage)
|
||||
{
|
||||
T_Damage(other, self, self->owner, self->velocity, self->s.origin, tr.plane.normal, self->dmg, 1, DAMAGE_ENERGY, MOD_RIPPER);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
G_FreeEdict(self);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void fire_ionripper(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, effects_t effect)
|
||||
{
|
||||
edict_t *ion;
|
||||
trace_t tr;
|
||||
|
||||
ion = G_Spawn();
|
||||
ion->s.origin = start;
|
||||
ion->s.old_origin = start;
|
||||
ion->s.angles = vectoangles(dir);
|
||||
ion->velocity = dir * speed;
|
||||
ion->movetype = MOVETYPE_WALLBOUNCE;
|
||||
ion->clipmask = MASK_PROJECTILE;
|
||||
|
||||
// [Paril-KEX]
|
||||
if (self->client && !G_ShouldPlayersCollide(true))
|
||||
ion->clipmask &= ~CONTENTS_PLAYER;
|
||||
|
||||
ion->solid = SOLID_BBOX;
|
||||
ion->s.effects |= effect;
|
||||
ion->svflags |= SVF_PROJECTILE;
|
||||
ion->flags |= FL_DODGE;
|
||||
ion->s.renderfx |= RF_FULLBRIGHT;
|
||||
ion->s.modelindex = gi.modelindex("models/objects/boomrang/tris.md2");
|
||||
ion->s.sound = gi.soundindex("misc/lasfly.wav");
|
||||
ion->owner = self;
|
||||
ion->touch = ionripper_touch;
|
||||
ion->nextthink = level.time + 3_sec;
|
||||
ion->think = ionripper_sparks;
|
||||
ion->dmg = damage;
|
||||
ion->dmg_radius = 100;
|
||||
gi.linkentity(ion);
|
||||
|
||||
tr = gi.traceline(self->s.origin, ion->s.origin, ion, ion->clipmask);
|
||||
if (tr.fraction < 1.0f)
|
||||
{
|
||||
ion->s.origin = tr.endpos + (tr.plane.normal * 1.f);
|
||||
ion->touch(ion, tr.ent, tr, false);
|
||||
}
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
/*
|
||||
fire_heat
|
||||
*/
|
||||
|
||||
THINK(heat_think) (edict_t *self) -> void
|
||||
{
|
||||
edict_t *target = nullptr;
|
||||
edict_t *acquire = nullptr;
|
||||
vec3_t vec;
|
||||
vec3_t oldang;
|
||||
float len;
|
||||
float oldlen = 0;
|
||||
float dot, olddot = 1;
|
||||
|
||||
vec3_t fwd = AngleVectors(self->s.angles).forward;
|
||||
|
||||
// acquire new target
|
||||
while ((target = findradius(target, self->s.origin, 1024)) != nullptr)
|
||||
{
|
||||
if (self->owner == target)
|
||||
continue;
|
||||
if (!target->client)
|
||||
continue;
|
||||
if (target->health <= 0)
|
||||
continue;
|
||||
if (!visible(self, target))
|
||||
continue;
|
||||
//if (!infront(self, target))
|
||||
// continue;
|
||||
|
||||
vec = self->s.origin - target->s.origin;
|
||||
len = vec.length();
|
||||
|
||||
dot = vec.normalized().dot(fwd);
|
||||
|
||||
// targets that require us to turn less are preferred
|
||||
if (dot >= olddot)
|
||||
continue;
|
||||
|
||||
if (acquire == nullptr || dot < olddot || len < oldlen)
|
||||
{
|
||||
acquire = target;
|
||||
oldlen = len;
|
||||
olddot = dot;
|
||||
}
|
||||
}
|
||||
|
||||
if (acquire != nullptr)
|
||||
{
|
||||
oldang = self->s.angles;
|
||||
vec = (acquire->s.origin - self->s.origin).normalized();
|
||||
float t = self->accel;
|
||||
|
||||
float d = self->movedir.dot(vec);
|
||||
|
||||
if (d < 0.45f && d > -0.45f)
|
||||
vec = -vec;
|
||||
|
||||
self->movedir = slerp(self->movedir, vec, t).normalized();
|
||||
self->s.angles = vectoangles(self->movedir);
|
||||
|
||||
if (!self->enemy)
|
||||
{
|
||||
gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/railgr1a.wav"), 1.f, 0.25f, 0);
|
||||
self->enemy = acquire;
|
||||
}
|
||||
}
|
||||
else
|
||||
self->enemy = nullptr;
|
||||
|
||||
self->velocity = self->movedir * self->speed;
|
||||
self->nextthink = level.time + FRAME_TIME_MS;
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void fire_heat(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, float damage_radius, int radius_damage, float turn_fraction)
|
||||
{
|
||||
edict_t *heat;
|
||||
|
||||
heat = G_Spawn();
|
||||
heat->s.origin = start;
|
||||
heat->movedir = dir;
|
||||
heat->s.angles = vectoangles(dir);
|
||||
heat->velocity = dir * speed;
|
||||
heat->flags |= FL_DODGE;
|
||||
heat->movetype = MOVETYPE_FLYMISSILE;
|
||||
heat->svflags |= SVF_PROJECTILE;
|
||||
heat->clipmask = MASK_PROJECTILE;
|
||||
heat->solid = SOLID_BBOX;
|
||||
heat->s.effects |= EF_ROCKET;
|
||||
heat->s.modelindex = gi.modelindex("models/objects/rocket/tris.md2");
|
||||
heat->owner = self;
|
||||
heat->touch = rocket_touch;
|
||||
heat->speed = speed;
|
||||
heat->accel = turn_fraction;
|
||||
|
||||
heat->nextthink = level.time + FRAME_TIME_MS;
|
||||
heat->think = heat_think;
|
||||
|
||||
heat->dmg = damage;
|
||||
heat->radius_dmg = radius_damage;
|
||||
heat->dmg_radius = damage_radius;
|
||||
heat->s.sound = gi.soundindex("weapons/rockfly.wav");
|
||||
|
||||
gi.linkentity(heat);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
|
||||
/*
|
||||
fire_plasma
|
||||
*/
|
||||
|
||||
TOUCH(plasma_touch) (edict_t *ent, edict_t *other, const trace_t &tr, bool other_touching_self) -> void
|
||||
{
|
||||
vec3_t origin;
|
||||
|
||||
if (other == ent->owner)
|
||||
return;
|
||||
|
||||
if (tr.surface && (tr.surface->flags & SURF_SKY))
|
||||
{
|
||||
G_FreeEdict(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ent->owner->client)
|
||||
PlayerNoise(ent->owner, ent->s.origin, PNOISE_IMPACT);
|
||||
|
||||
// calculate position for the explosion entity
|
||||
origin = ent->s.origin + (ent->velocity * -0.02f);
|
||||
|
||||
if (other->takedamage)
|
||||
{
|
||||
T_Damage(other, ent, ent->owner, ent->velocity, ent->s.origin, tr.plane.normal, ent->dmg, 0, DAMAGE_ENERGY, MOD_PHALANX);
|
||||
}
|
||||
|
||||
T_RadiusDamage(ent, ent->owner, (float) ent->radius_dmg, other, ent->dmg_radius, DAMAGE_ENERGY, MOD_PHALANX);
|
||||
|
||||
gi.WriteByte(svc_temp_entity);
|
||||
gi.WriteByte(TE_PLASMA_EXPLOSION);
|
||||
gi.WritePosition(origin);
|
||||
gi.multicast(ent->s.origin, MULTICAST_PHS, false);
|
||||
|
||||
G_FreeEdict(ent);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void fire_plasma(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, float damage_radius, int radius_damage)
|
||||
{
|
||||
edict_t *plasma;
|
||||
|
||||
plasma = G_Spawn();
|
||||
plasma->s.origin = start;
|
||||
plasma->movedir = dir;
|
||||
plasma->s.angles = vectoangles(dir);
|
||||
plasma->velocity = dir * speed;
|
||||
plasma->movetype = MOVETYPE_FLYMISSILE;
|
||||
plasma->clipmask = MASK_PROJECTILE;
|
||||
|
||||
// [Paril-KEX]
|
||||
if (self->client && !G_ShouldPlayersCollide(true))
|
||||
plasma->clipmask &= ~CONTENTS_PLAYER;
|
||||
|
||||
plasma->solid = SOLID_BBOX;
|
||||
plasma->svflags |= SVF_PROJECTILE;
|
||||
plasma->flags |= FL_DODGE;
|
||||
plasma->owner = self;
|
||||
plasma->touch = plasma_touch;
|
||||
plasma->nextthink = level.time + gtime_t::from_sec(8000.f / speed);
|
||||
plasma->think = G_FreeEdict;
|
||||
plasma->dmg = damage;
|
||||
plasma->radius_dmg = radius_damage;
|
||||
plasma->dmg_radius = damage_radius;
|
||||
plasma->s.sound = gi.soundindex("weapons/rockfly.wav");
|
||||
|
||||
plasma->s.modelindex = gi.modelindex("sprites/s_photon.sp2");
|
||||
plasma->s.effects |= EF_PLASMA | EF_ANIM_ALLFAST;
|
||||
|
||||
gi.linkentity(plasma);
|
||||
}
|
||||
|
||||
THINK(Trap_Gib_Think) (edict_t *ent) -> void
|
||||
{
|
||||
if (ent->owner->s.frame != 5)
|
||||
{
|
||||
G_FreeEdict(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
vec3_t forward, right, up;
|
||||
vec3_t vec;
|
||||
|
||||
AngleVectors(ent->owner->s.angles, forward, right, up);
|
||||
|
||||
// rotate us around the center
|
||||
float degrees = (150.f * gi.frame_time_s) + ent->owner->delay;
|
||||
vec3_t diff = ent->owner->s.origin - ent->s.origin;
|
||||
vec = RotatePointAroundVector(up, diff, degrees);
|
||||
ent->s.angles[1] += degrees;
|
||||
vec3_t new_origin = ent->owner->s.origin - vec;
|
||||
|
||||
trace_t tr = gi.traceline(ent->s.origin, new_origin, ent, MASK_SOLID);
|
||||
ent->s.origin = tr.endpos;
|
||||
|
||||
// pull us towards the trap's center
|
||||
diff.normalize();
|
||||
ent->s.origin += diff * (15.0f * gi.frame_time_s);
|
||||
|
||||
ent->watertype = gi.pointcontents(ent->s.origin);
|
||||
if (ent->watertype & MASK_WATER)
|
||||
ent->waterlevel = WATER_FEET;
|
||||
|
||||
ent->nextthink = level.time + FRAME_TIME_S;
|
||||
gi.linkentity(ent);
|
||||
}
|
||||
|
||||
DIE(trap_die) (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, const vec3_t &point, const mod_t &mod) -> void
|
||||
{
|
||||
BecomeExplosion1(self);
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void SP_item_foodcube(edict_t *best);
|
||||
void SpawnDamage(int type, const vec3_t &origin, const vec3_t &normal, int damage);
|
||||
// RAFAEL
|
||||
THINK(Trap_Think) (edict_t *ent) -> void
|
||||
{
|
||||
edict_t *target = nullptr;
|
||||
edict_t *best = nullptr;
|
||||
vec3_t vec;
|
||||
float len;
|
||||
float oldlen = 8000;
|
||||
|
||||
if (ent->timestamp < level.time)
|
||||
{
|
||||
BecomeExplosion1(ent);
|
||||
// note to self
|
||||
// cause explosion damage???
|
||||
return;
|
||||
}
|
||||
|
||||
ent->nextthink = level.time + 10_hz;
|
||||
|
||||
if (!ent->groundentity)
|
||||
return;
|
||||
|
||||
// ok lets do the blood effect
|
||||
if (ent->s.frame > 4)
|
||||
{
|
||||
if (ent->s.frame == 5)
|
||||
{
|
||||
bool spawn = ent->wait == 64;
|
||||
|
||||
ent->wait -= 2;
|
||||
|
||||
if (spawn)
|
||||
gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/trapdown.wav"), 1, ATTN_IDLE, 0);
|
||||
|
||||
ent->delay += 2.f;
|
||||
|
||||
if (ent->wait < 19)
|
||||
ent->s.frame++;
|
||||
|
||||
return;
|
||||
}
|
||||
ent->s.frame++;
|
||||
if (ent->s.frame == 8)
|
||||
{
|
||||
ent->nextthink = level.time + 1_sec;
|
||||
ent->think = G_FreeEdict;
|
||||
ent->s.effects &= ~EF_TRAP;
|
||||
|
||||
best = G_Spawn();
|
||||
best->count = ent->mass;
|
||||
best->s.scale = 1.f + ((ent->accel - 100.f) / 300.f) * 1.0f;
|
||||
SP_item_foodcube(best);
|
||||
best->s.origin = ent->s.origin;
|
||||
best->s.origin[2] += 24 * best->s.scale;
|
||||
best->s.angles[YAW] = frandom() * 360;
|
||||
best->velocity[2] = 400;
|
||||
best->think(best);
|
||||
best->nextthink = 0_ms;
|
||||
best->s.old_origin = best->s.origin;
|
||||
gi.linkentity(best);
|
||||
|
||||
gi.sound(best, CHAN_AUTO, gi.soundindex("misc/fhit3.wav"), 1.f, ATTN_NORM, 0.f);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
ent->s.effects &= ~EF_TRAP;
|
||||
if (ent->s.frame >= 4)
|
||||
{
|
||||
ent->s.effects |= EF_TRAP;
|
||||
// clear the owner if in deathmatch
|
||||
if (deathmatch->integer)
|
||||
ent->owner = nullptr;
|
||||
}
|
||||
|
||||
if (ent->s.frame < 4)
|
||||
{
|
||||
ent->s.frame++;
|
||||
return;
|
||||
}
|
||||
|
||||
while ((target = findradius(target, ent->s.origin, 256)) != nullptr)
|
||||
{
|
||||
if (target == ent)
|
||||
continue;
|
||||
|
||||
// [Paril-KEX] don't allow traps to be placed near flags or teleporters
|
||||
// if it's a monster or player with health > 0
|
||||
// or it's a player start point
|
||||
// and we can see it
|
||||
// blow up
|
||||
if (target->classname && ((deathmatch->integer &&
|
||||
((!strncmp(target->classname, "info_player_", 12)) ||
|
||||
(!strcmp(target->classname, "misc_teleporter_dest")) ||
|
||||
(!strncmp(target->classname, "item_flag_", 10))))) &&
|
||||
(visible(target, ent)))
|
||||
{
|
||||
BecomeExplosion1(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(target->svflags & SVF_MONSTER) && !target->client)
|
||||
continue;
|
||||
if (target != ent->teammaster && CheckTeamDamage(target, ent->teammaster))
|
||||
continue;
|
||||
// [Paril-KEX]
|
||||
if (!deathmatch->integer && target->client)
|
||||
continue;
|
||||
if (target->health <= 0)
|
||||
continue;
|
||||
if (!visible(ent, target))
|
||||
continue;
|
||||
vec = ent->s.origin - target->s.origin;
|
||||
len = vec.length();
|
||||
if (!best)
|
||||
{
|
||||
best = target;
|
||||
oldlen = len;
|
||||
continue;
|
||||
}
|
||||
if (len < oldlen)
|
||||
{
|
||||
oldlen = len;
|
||||
best = target;
|
||||
}
|
||||
}
|
||||
|
||||
// pull the enemy in
|
||||
if (best)
|
||||
{
|
||||
if (best->groundentity)
|
||||
{
|
||||
best->s.origin[2] += 1;
|
||||
best->groundentity = nullptr;
|
||||
}
|
||||
vec = ent->s.origin - best->s.origin;
|
||||
len = vec.normalize();
|
||||
|
||||
float max_speed = best->client ? 290.f : 150.f;
|
||||
|
||||
best->velocity += (vec * clamp(max_speed - len, 64.f, max_speed));
|
||||
|
||||
ent->s.sound = gi.soundindex("weapons/trapsuck.wav");
|
||||
|
||||
if (len < 48)
|
||||
{
|
||||
if (best->mass < 400)
|
||||
{
|
||||
ent->takedamage = false;
|
||||
ent->solid = SOLID_NOT;
|
||||
ent->die = nullptr;
|
||||
|
||||
T_Damage(best, ent, ent->teammaster, vec3_origin, best->s.origin, vec3_origin, 100000, 1, DAMAGE_NONE, MOD_TRAP);
|
||||
|
||||
if (best->svflags & SVF_MONSTER)
|
||||
M_ProcessPain(best);
|
||||
|
||||
ent->enemy = best;
|
||||
ent->wait = 64;
|
||||
ent->s.old_origin = ent->s.origin;
|
||||
ent->timestamp = level.time + 30_sec;
|
||||
ent->accel = best->mass;
|
||||
if (deathmatch->integer)
|
||||
ent->mass = best->mass / 4;
|
||||
else
|
||||
ent->mass = best->mass / 10;
|
||||
// ok spawn the food cube
|
||||
ent->s.frame = 5;
|
||||
|
||||
// link up any gibs that this monster may have spawned
|
||||
for (uint32_t i = 0; i < globals.num_edicts; i++)
|
||||
{
|
||||
edict_t *e = &g_edicts[i];
|
||||
|
||||
if (!e->inuse)
|
||||
continue;
|
||||
else if (strcmp(e->classname, "gib"))
|
||||
continue;
|
||||
else if ((e->s.origin - ent->s.origin).length() > 128.f)
|
||||
continue;
|
||||
|
||||
e->movetype = MOVETYPE_NONE;
|
||||
e->nextthink = level.time + FRAME_TIME_S;
|
||||
e->think = Trap_Gib_Think;
|
||||
e->owner = ent;
|
||||
Trap_Gib_Think(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BecomeExplosion1(ent);
|
||||
// note to self
|
||||
// cause explosion damage???
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RAFAEL
|
||||
void fire_trap(edict_t *self, const vec3_t &start, const vec3_t &aimdir, int speed)
|
||||
{
|
||||
edict_t *trap;
|
||||
vec3_t dir;
|
||||
vec3_t forward, right, up;
|
||||
|
||||
dir = vectoangles(aimdir);
|
||||
AngleVectors(dir, forward, right, up);
|
||||
|
||||
trap = G_Spawn();
|
||||
trap->s.origin = start;
|
||||
trap->velocity = aimdir * speed;
|
||||
|
||||
float gravityAdjustment = level.gravity / 800.f;
|
||||
|
||||
trap->velocity += up * (200 + crandom() * 10.0f) * gravityAdjustment;
|
||||
trap->velocity += right * (crandom() * 10.0f);
|
||||
|
||||
trap->avelocity = { 0, 300, 0 };
|
||||
trap->movetype = MOVETYPE_BOUNCE;
|
||||
|
||||
trap->solid = SOLID_BBOX;
|
||||
trap->takedamage = true;
|
||||
trap->mins = { -4, -4, 0 };
|
||||
trap->maxs = { 4, 4, 8 };
|
||||
trap->die = trap_die;
|
||||
trap->health = 20;
|
||||
trap->s.modelindex = gi.modelindex("models/weapons/z_trap/tris.md2");
|
||||
trap->owner = trap->teammaster = self;
|
||||
trap->nextthink = level.time + 1_sec;
|
||||
trap->think = Trap_Think;
|
||||
trap->classname = "food_cube_trap";
|
||||
// RAFAEL 16-APR-98
|
||||
trap->s.sound = gi.soundindex("weapons/traploop.wav");
|
||||
// END 16-APR-98
|
||||
|
||||
trap->flags |= ( FL_DAMAGEABLE | FL_MECHANICAL | FL_TRAP );
|
||||
trap->clipmask = MASK_PROJECTILE & ~CONTENTS_DEADMONSTER;
|
||||
|
||||
// [Paril-KEX]
|
||||
if (self->client && !G_ShouldPlayersCollide(true))
|
||||
trap->clipmask &= ~CONTENTS_PLAYER;
|
||||
|
||||
gi.linkentity(trap);
|
||||
|
||||
trap->timestamp = level.time + 30_sec;
|
||||
}
|
||||
1401
rerelease/xatrix/m_xatrix_fixbot.cpp
Normal file
1401
rerelease/xatrix/m_xatrix_fixbot.cpp
Normal file
File diff suppressed because it is too large
Load Diff
223
rerelease/xatrix/m_xatrix_fixbot.h
Normal file
223
rerelease/xatrix/m_xatrix_fixbot.h
Normal file
@@ -0,0 +1,223 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
// ./fixbot
|
||||
|
||||
// This file generated by ModelGen - Do NOT Modify
|
||||
|
||||
enum
|
||||
{
|
||||
FRAME_charging_01,
|
||||
FRAME_charging_02,
|
||||
FRAME_charging_03,
|
||||
FRAME_charging_04,
|
||||
FRAME_charging_05,
|
||||
FRAME_charging_06,
|
||||
FRAME_charging_07,
|
||||
FRAME_charging_08,
|
||||
FRAME_charging_09,
|
||||
FRAME_charging_10,
|
||||
FRAME_charging_11,
|
||||
FRAME_charging_12,
|
||||
FRAME_charging_13,
|
||||
FRAME_charging_14,
|
||||
FRAME_charging_15,
|
||||
FRAME_charging_16,
|
||||
FRAME_charging_17,
|
||||
FRAME_charging_18,
|
||||
FRAME_charging_19,
|
||||
FRAME_charging_20,
|
||||
FRAME_charging_21,
|
||||
FRAME_charging_22,
|
||||
FRAME_charging_23,
|
||||
FRAME_charging_24,
|
||||
FRAME_charging_25,
|
||||
FRAME_charging_26,
|
||||
FRAME_charging_27,
|
||||
FRAME_charging_28,
|
||||
FRAME_charging_29,
|
||||
FRAME_charging_30,
|
||||
FRAME_charging_31,
|
||||
FRAME_landing_01,
|
||||
FRAME_landing_02,
|
||||
FRAME_landing_03,
|
||||
FRAME_landing_04,
|
||||
FRAME_landing_05,
|
||||
FRAME_landing_06,
|
||||
FRAME_landing_07,
|
||||
FRAME_landing_08,
|
||||
FRAME_landing_09,
|
||||
FRAME_landing_10,
|
||||
FRAME_landing_11,
|
||||
FRAME_landing_12,
|
||||
FRAME_landing_13,
|
||||
FRAME_landing_14,
|
||||
FRAME_landing_15,
|
||||
FRAME_landing_16,
|
||||
FRAME_landing_17,
|
||||
FRAME_landing_18,
|
||||
FRAME_landing_19,
|
||||
FRAME_landing_20,
|
||||
FRAME_landing_21,
|
||||
FRAME_landing_22,
|
||||
FRAME_landing_23,
|
||||
FRAME_landing_24,
|
||||
FRAME_landing_25,
|
||||
FRAME_landing_26,
|
||||
FRAME_landing_27,
|
||||
FRAME_landing_28,
|
||||
FRAME_landing_29,
|
||||
FRAME_landing_30,
|
||||
FRAME_landing_31,
|
||||
FRAME_landing_32,
|
||||
FRAME_landing_33,
|
||||
FRAME_landing_34,
|
||||
FRAME_landing_35,
|
||||
FRAME_landing_36,
|
||||
FRAME_landing_37,
|
||||
FRAME_landing_38,
|
||||
FRAME_landing_39,
|
||||
FRAME_landing_40,
|
||||
FRAME_landing_41,
|
||||
FRAME_landing_42,
|
||||
FRAME_landing_43,
|
||||
FRAME_landing_44,
|
||||
FRAME_landing_45,
|
||||
FRAME_landing_46,
|
||||
FRAME_landing_47,
|
||||
FRAME_landing_48,
|
||||
FRAME_landing_49,
|
||||
FRAME_landing_50,
|
||||
FRAME_landing_51,
|
||||
FRAME_landing_52,
|
||||
FRAME_landing_53,
|
||||
FRAME_landing_54,
|
||||
FRAME_landing_55,
|
||||
FRAME_landing_56,
|
||||
FRAME_landing_57,
|
||||
FRAME_landing_58,
|
||||
FRAME_pushback_01,
|
||||
FRAME_pushback_02,
|
||||
FRAME_pushback_03,
|
||||
FRAME_pushback_04,
|
||||
FRAME_pushback_05,
|
||||
FRAME_pushback_06,
|
||||
FRAME_pushback_07,
|
||||
FRAME_pushback_08,
|
||||
FRAME_pushback_09,
|
||||
FRAME_pushback_10,
|
||||
FRAME_pushback_11,
|
||||
FRAME_pushback_12,
|
||||
FRAME_pushback_13,
|
||||
FRAME_pushback_14,
|
||||
FRAME_pushback_15,
|
||||
FRAME_pushback_16,
|
||||
FRAME_takeoff_01,
|
||||
FRAME_takeoff_02,
|
||||
FRAME_takeoff_03,
|
||||
FRAME_takeoff_04,
|
||||
FRAME_takeoff_05,
|
||||
FRAME_takeoff_06,
|
||||
FRAME_takeoff_07,
|
||||
FRAME_takeoff_08,
|
||||
FRAME_takeoff_09,
|
||||
FRAME_takeoff_10,
|
||||
FRAME_takeoff_11,
|
||||
FRAME_takeoff_12,
|
||||
FRAME_takeoff_13,
|
||||
FRAME_takeoff_14,
|
||||
FRAME_takeoff_15,
|
||||
FRAME_takeoff_16,
|
||||
FRAME_ambient_01,
|
||||
FRAME_ambient_02,
|
||||
FRAME_ambient_03,
|
||||
FRAME_ambient_04,
|
||||
FRAME_ambient_05,
|
||||
FRAME_ambient_06,
|
||||
FRAME_ambient_07,
|
||||
FRAME_ambient_08,
|
||||
FRAME_ambient_09,
|
||||
FRAME_ambient_10,
|
||||
FRAME_ambient_11,
|
||||
FRAME_ambient_12,
|
||||
FRAME_ambient_13,
|
||||
FRAME_ambient_14,
|
||||
FRAME_ambient_15,
|
||||
FRAME_ambient_16,
|
||||
FRAME_ambient_17,
|
||||
FRAME_ambient_18,
|
||||
FRAME_ambient_19,
|
||||
FRAME_paina_01,
|
||||
FRAME_paina_02,
|
||||
FRAME_paina_03,
|
||||
FRAME_paina_04,
|
||||
FRAME_paina_05,
|
||||
FRAME_paina_06,
|
||||
FRAME_painb_01,
|
||||
FRAME_painb_02,
|
||||
FRAME_painb_03,
|
||||
FRAME_painb_04,
|
||||
FRAME_painb_05,
|
||||
FRAME_painb_06,
|
||||
FRAME_painb_07,
|
||||
FRAME_painb_08,
|
||||
FRAME_pickup_01,
|
||||
FRAME_pickup_02,
|
||||
FRAME_pickup_03,
|
||||
FRAME_pickup_04,
|
||||
FRAME_pickup_05,
|
||||
FRAME_pickup_06,
|
||||
FRAME_pickup_07,
|
||||
FRAME_pickup_08,
|
||||
FRAME_pickup_09,
|
||||
FRAME_pickup_10,
|
||||
FRAME_pickup_11,
|
||||
FRAME_pickup_12,
|
||||
FRAME_pickup_13,
|
||||
FRAME_pickup_14,
|
||||
FRAME_pickup_15,
|
||||
FRAME_pickup_16,
|
||||
FRAME_pickup_17,
|
||||
FRAME_pickup_18,
|
||||
FRAME_pickup_19,
|
||||
FRAME_pickup_20,
|
||||
FRAME_pickup_21,
|
||||
FRAME_pickup_22,
|
||||
FRAME_pickup_23,
|
||||
FRAME_pickup_24,
|
||||
FRAME_pickup_25,
|
||||
FRAME_pickup_26,
|
||||
FRAME_pickup_27,
|
||||
FRAME_freeze_01,
|
||||
FRAME_shoot_01,
|
||||
FRAME_shoot_02,
|
||||
FRAME_shoot_03,
|
||||
FRAME_shoot_04,
|
||||
FRAME_shoot_05,
|
||||
FRAME_shoot_06,
|
||||
FRAME_weldstart_01,
|
||||
FRAME_weldstart_02,
|
||||
FRAME_weldstart_03,
|
||||
FRAME_weldstart_04,
|
||||
FRAME_weldstart_05,
|
||||
FRAME_weldstart_06,
|
||||
FRAME_weldstart_07,
|
||||
FRAME_weldstart_08,
|
||||
FRAME_weldstart_09,
|
||||
FRAME_weldstart_10,
|
||||
FRAME_weldmiddle_01,
|
||||
FRAME_weldmiddle_02,
|
||||
FRAME_weldmiddle_03,
|
||||
FRAME_weldmiddle_04,
|
||||
FRAME_weldmiddle_05,
|
||||
FRAME_weldmiddle_06,
|
||||
FRAME_weldmiddle_07,
|
||||
FRAME_weldend_01,
|
||||
FRAME_weldend_02,
|
||||
FRAME_weldend_03,
|
||||
FRAME_weldend_04,
|
||||
FRAME_weldend_05,
|
||||
FRAME_weldend_06,
|
||||
FRAME_weldend_07
|
||||
};
|
||||
|
||||
constexpr float MODEL_SCALE = 1.000000f;
|
||||
1686
rerelease/xatrix/m_xatrix_gekk.cpp
Normal file
1686
rerelease/xatrix/m_xatrix_gekk.cpp
Normal file
File diff suppressed because it is too large
Load Diff
361
rerelease/xatrix/m_xatrix_gekk.h
Normal file
361
rerelease/xatrix/m_xatrix_gekk.h
Normal file
@@ -0,0 +1,361 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
// ./gekk
|
||||
|
||||
// This file generated by ModelGen - Do NOT Modify
|
||||
|
||||
enum
|
||||
{
|
||||
FRAME_stand_01,
|
||||
FRAME_stand_02,
|
||||
FRAME_stand_03,
|
||||
FRAME_stand_04,
|
||||
FRAME_stand_05,
|
||||
FRAME_stand_06,
|
||||
FRAME_stand_07,
|
||||
FRAME_stand_08,
|
||||
FRAME_stand_09,
|
||||
FRAME_stand_10,
|
||||
FRAME_stand_11,
|
||||
FRAME_stand_12,
|
||||
FRAME_stand_13,
|
||||
FRAME_stand_14,
|
||||
FRAME_stand_15,
|
||||
FRAME_stand_16,
|
||||
FRAME_stand_17,
|
||||
FRAME_stand_18,
|
||||
FRAME_stand_19,
|
||||
FRAME_stand_20,
|
||||
FRAME_stand_21,
|
||||
FRAME_stand_22,
|
||||
FRAME_stand_23,
|
||||
FRAME_stand_24,
|
||||
FRAME_stand_25,
|
||||
FRAME_stand_26,
|
||||
FRAME_stand_27,
|
||||
FRAME_stand_28,
|
||||
FRAME_stand_29,
|
||||
FRAME_stand_30,
|
||||
FRAME_stand_31,
|
||||
FRAME_stand_32,
|
||||
FRAME_stand_33,
|
||||
FRAME_stand_34,
|
||||
FRAME_stand_35,
|
||||
FRAME_stand_36,
|
||||
FRAME_stand_37,
|
||||
FRAME_stand_38,
|
||||
FRAME_stand_39,
|
||||
FRAME_run_01,
|
||||
FRAME_run_02,
|
||||
FRAME_run_03,
|
||||
FRAME_run_04,
|
||||
FRAME_run_05,
|
||||
FRAME_run_06,
|
||||
FRAME_clawatk3_01,
|
||||
FRAME_clawatk3_02,
|
||||
FRAME_clawatk3_03,
|
||||
FRAME_clawatk3_04,
|
||||
FRAME_clawatk3_05,
|
||||
FRAME_clawatk3_06,
|
||||
FRAME_clawatk3_07,
|
||||
FRAME_clawatk3_08,
|
||||
FRAME_clawatk3_09,
|
||||
FRAME_clawatk4_01,
|
||||
FRAME_clawatk4_02,
|
||||
FRAME_clawatk4_03,
|
||||
FRAME_clawatk4_04,
|
||||
FRAME_clawatk4_05,
|
||||
FRAME_clawatk4_06,
|
||||
FRAME_clawatk4_07,
|
||||
FRAME_clawatk4_08,
|
||||
FRAME_clawatk5_01,
|
||||
FRAME_clawatk5_02,
|
||||
FRAME_clawatk5_03,
|
||||
FRAME_clawatk5_04,
|
||||
FRAME_clawatk5_05,
|
||||
FRAME_clawatk5_06,
|
||||
FRAME_clawatk5_07,
|
||||
FRAME_clawatk5_08,
|
||||
FRAME_clawatk5_09,
|
||||
FRAME_leapatk_01,
|
||||
FRAME_leapatk_02,
|
||||
FRAME_leapatk_03,
|
||||
FRAME_leapatk_04,
|
||||
FRAME_leapatk_05,
|
||||
FRAME_leapatk_06,
|
||||
FRAME_leapatk_07,
|
||||
FRAME_leapatk_08,
|
||||
FRAME_leapatk_09,
|
||||
FRAME_leapatk_10,
|
||||
FRAME_leapatk_11,
|
||||
FRAME_leapatk_12,
|
||||
FRAME_leapatk_13,
|
||||
FRAME_leapatk_14,
|
||||
FRAME_leapatk_15,
|
||||
FRAME_leapatk_16,
|
||||
FRAME_leapatk_17,
|
||||
FRAME_leapatk_18,
|
||||
FRAME_leapatk_19,
|
||||
FRAME_pain3_01,
|
||||
FRAME_pain3_02,
|
||||
FRAME_pain3_03,
|
||||
FRAME_pain3_04,
|
||||
FRAME_pain3_05,
|
||||
FRAME_pain3_06,
|
||||
FRAME_pain3_07,
|
||||
FRAME_pain3_08,
|
||||
FRAME_pain3_09,
|
||||
FRAME_pain3_10,
|
||||
FRAME_pain3_11,
|
||||
FRAME_pain4_01,
|
||||
FRAME_pain4_02,
|
||||
FRAME_pain4_03,
|
||||
FRAME_pain4_04,
|
||||
FRAME_pain4_05,
|
||||
FRAME_pain4_06,
|
||||
FRAME_pain4_07,
|
||||
FRAME_pain4_08,
|
||||
FRAME_pain4_09,
|
||||
FRAME_pain4_10,
|
||||
FRAME_pain4_11,
|
||||
FRAME_pain4_12,
|
||||
FRAME_pain4_13,
|
||||
FRAME_death1_01,
|
||||
FRAME_death1_02,
|
||||
FRAME_death1_03,
|
||||
FRAME_death1_04,
|
||||
FRAME_death1_05,
|
||||
FRAME_death1_06,
|
||||
FRAME_death1_07,
|
||||
FRAME_death1_08,
|
||||
FRAME_death1_09,
|
||||
FRAME_death1_10,
|
||||
FRAME_death2_01,
|
||||
FRAME_death2_02,
|
||||
FRAME_death2_03,
|
||||
FRAME_death2_04,
|
||||
FRAME_death2_05,
|
||||
FRAME_death2_06,
|
||||
FRAME_death2_07,
|
||||
FRAME_death2_08,
|
||||
FRAME_death2_09,
|
||||
FRAME_death2_10,
|
||||
FRAME_death2_11,
|
||||
FRAME_death3_01,
|
||||
FRAME_death3_02,
|
||||
FRAME_death3_03,
|
||||
FRAME_death3_04,
|
||||
FRAME_death3_05,
|
||||
FRAME_death3_06,
|
||||
FRAME_death3_07,
|
||||
FRAME_death4_01,
|
||||
FRAME_death4_02,
|
||||
FRAME_death4_03,
|
||||
FRAME_death4_04,
|
||||
FRAME_death4_05,
|
||||
FRAME_death4_06,
|
||||
FRAME_death4_07,
|
||||
FRAME_death4_08,
|
||||
FRAME_death4_09,
|
||||
FRAME_death4_10,
|
||||
FRAME_death4_11,
|
||||
FRAME_death4_12,
|
||||
FRAME_death4_13,
|
||||
FRAME_death4_14,
|
||||
FRAME_death4_15,
|
||||
FRAME_death4_16,
|
||||
FRAME_death4_17,
|
||||
FRAME_death4_18,
|
||||
FRAME_death4_19,
|
||||
FRAME_death4_20,
|
||||
FRAME_death4_21,
|
||||
FRAME_death4_22,
|
||||
FRAME_death4_23,
|
||||
FRAME_death4_24,
|
||||
FRAME_death4_25,
|
||||
FRAME_death4_26,
|
||||
FRAME_death4_27,
|
||||
FRAME_death4_28,
|
||||
FRAME_death4_29,
|
||||
FRAME_death4_30,
|
||||
FRAME_death4_31,
|
||||
FRAME_death4_32,
|
||||
FRAME_death4_33,
|
||||
FRAME_death4_34,
|
||||
FRAME_death4_35,
|
||||
FRAME_rduck_01,
|
||||
FRAME_rduck_02,
|
||||
FRAME_rduck_03,
|
||||
FRAME_rduck_04,
|
||||
FRAME_rduck_05,
|
||||
FRAME_rduck_06,
|
||||
FRAME_rduck_07,
|
||||
FRAME_rduck_08,
|
||||
FRAME_rduck_09,
|
||||
FRAME_rduck_10,
|
||||
FRAME_rduck_11,
|
||||
FRAME_rduck_12,
|
||||
FRAME_rduck_13,
|
||||
FRAME_lduck_01,
|
||||
FRAME_lduck_02,
|
||||
FRAME_lduck_03,
|
||||
FRAME_lduck_04,
|
||||
FRAME_lduck_05,
|
||||
FRAME_lduck_06,
|
||||
FRAME_lduck_07,
|
||||
FRAME_lduck_08,
|
||||
FRAME_lduck_09,
|
||||
FRAME_lduck_10,
|
||||
FRAME_lduck_11,
|
||||
FRAME_lduck_12,
|
||||
FRAME_lduck_13,
|
||||
FRAME_idle_01,
|
||||
FRAME_idle_02,
|
||||
FRAME_idle_03,
|
||||
FRAME_idle_04,
|
||||
FRAME_idle_05,
|
||||
FRAME_idle_06,
|
||||
FRAME_idle_07,
|
||||
FRAME_idle_08,
|
||||
FRAME_idle_09,
|
||||
FRAME_idle_10,
|
||||
FRAME_idle_11,
|
||||
FRAME_idle_12,
|
||||
FRAME_idle_13,
|
||||
FRAME_idle_14,
|
||||
FRAME_idle_15,
|
||||
FRAME_idle_16,
|
||||
FRAME_idle_17,
|
||||
FRAME_idle_18,
|
||||
FRAME_idle_19,
|
||||
FRAME_idle_20,
|
||||
FRAME_idle_21,
|
||||
FRAME_idle_22,
|
||||
FRAME_idle_23,
|
||||
FRAME_idle_24,
|
||||
FRAME_idle_25,
|
||||
FRAME_idle_26,
|
||||
FRAME_idle_27,
|
||||
FRAME_idle_28,
|
||||
FRAME_idle_29,
|
||||
FRAME_idle_30,
|
||||
FRAME_idle_31,
|
||||
FRAME_idle_32,
|
||||
FRAME_spit_01,
|
||||
FRAME_spit_02,
|
||||
FRAME_spit_03,
|
||||
FRAME_spit_04,
|
||||
FRAME_spit_05,
|
||||
FRAME_spit_06,
|
||||
FRAME_spit_07,
|
||||
FRAME_amb_01,
|
||||
FRAME_amb_02,
|
||||
FRAME_amb_03,
|
||||
FRAME_amb_04,
|
||||
FRAME_wdeath_01,
|
||||
FRAME_wdeath_02,
|
||||
FRAME_wdeath_03,
|
||||
FRAME_wdeath_04,
|
||||
FRAME_wdeath_05,
|
||||
FRAME_wdeath_06,
|
||||
FRAME_wdeath_07,
|
||||
FRAME_wdeath_08,
|
||||
FRAME_wdeath_09,
|
||||
FRAME_wdeath_10,
|
||||
FRAME_wdeath_11,
|
||||
FRAME_wdeath_12,
|
||||
FRAME_wdeath_13,
|
||||
FRAME_wdeath_14,
|
||||
FRAME_wdeath_15,
|
||||
FRAME_wdeath_16,
|
||||
FRAME_wdeath_17,
|
||||
FRAME_wdeath_18,
|
||||
FRAME_wdeath_19,
|
||||
FRAME_wdeath_20,
|
||||
FRAME_wdeath_21,
|
||||
FRAME_wdeath_22,
|
||||
FRAME_wdeath_23,
|
||||
FRAME_wdeath_24,
|
||||
FRAME_wdeath_25,
|
||||
FRAME_wdeath_26,
|
||||
FRAME_wdeath_27,
|
||||
FRAME_wdeath_28,
|
||||
FRAME_wdeath_29,
|
||||
FRAME_wdeath_30,
|
||||
FRAME_wdeath_31,
|
||||
FRAME_wdeath_32,
|
||||
FRAME_wdeath_33,
|
||||
FRAME_wdeath_34,
|
||||
FRAME_wdeath_35,
|
||||
FRAME_wdeath_36,
|
||||
FRAME_wdeath_37,
|
||||
FRAME_wdeath_38,
|
||||
FRAME_wdeath_39,
|
||||
FRAME_wdeath_40,
|
||||
FRAME_wdeath_41,
|
||||
FRAME_wdeath_42,
|
||||
FRAME_wdeath_43,
|
||||
FRAME_wdeath_44,
|
||||
FRAME_wdeath_45,
|
||||
FRAME_swim_01,
|
||||
FRAME_swim_02,
|
||||
FRAME_swim_03,
|
||||
FRAME_swim_04,
|
||||
FRAME_swim_05,
|
||||
FRAME_swim_06,
|
||||
FRAME_swim_07,
|
||||
FRAME_swim_08,
|
||||
FRAME_swim_09,
|
||||
FRAME_swim_10,
|
||||
FRAME_swim_11,
|
||||
FRAME_swim_12,
|
||||
FRAME_swim_13,
|
||||
FRAME_swim_14,
|
||||
FRAME_swim_15,
|
||||
FRAME_swim_16,
|
||||
FRAME_swim_17,
|
||||
FRAME_swim_18,
|
||||
FRAME_swim_19,
|
||||
FRAME_swim_20,
|
||||
FRAME_swim_21,
|
||||
FRAME_swim_22,
|
||||
FRAME_swim_23,
|
||||
FRAME_swim_24,
|
||||
FRAME_swim_25,
|
||||
FRAME_swim_26,
|
||||
FRAME_swim_27,
|
||||
FRAME_swim_28,
|
||||
FRAME_swim_29,
|
||||
FRAME_swim_30,
|
||||
FRAME_swim_31,
|
||||
FRAME_swim_32,
|
||||
FRAME_attack_01,
|
||||
FRAME_attack_02,
|
||||
FRAME_attack_03,
|
||||
FRAME_attack_04,
|
||||
FRAME_attack_05,
|
||||
FRAME_attack_06,
|
||||
FRAME_attack_07,
|
||||
FRAME_attack_08,
|
||||
FRAME_attack_09,
|
||||
FRAME_attack_10,
|
||||
FRAME_attack_11,
|
||||
FRAME_attack_12,
|
||||
FRAME_attack_13,
|
||||
FRAME_attack_14,
|
||||
FRAME_attack_15,
|
||||
FRAME_attack_16,
|
||||
FRAME_attack_17,
|
||||
FRAME_attack_18,
|
||||
FRAME_attack_19,
|
||||
FRAME_attack_20,
|
||||
FRAME_attack_21,
|
||||
FRAME_pain_01,
|
||||
FRAME_pain_02,
|
||||
FRAME_pain_03,
|
||||
FRAME_pain_04,
|
||||
FRAME_pain_05,
|
||||
FRAME_pain_06
|
||||
};
|
||||
|
||||
constexpr float MODEL_SCALE = 1.000000f;
|
||||
165
rerelease/xatrix/p_xatrix_weapon.cpp
Normal file
165
rerelease/xatrix/p_xatrix_weapon.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
// Copyright (c) ZeniMax Media Inc.
|
||||
// Licensed under the GNU General Public License 2.0.
|
||||
#include "../g_local.h"
|
||||
|
||||
// RAFAEL
|
||||
/*
|
||||
RipperGun
|
||||
*/
|
||||
|
||||
void weapon_ionripper_fire(edict_t *ent)
|
||||
{
|
||||
vec3_t tempang;
|
||||
int damage;
|
||||
|
||||
if (deathmatch->integer)
|
||||
// tone down for deathmatch
|
||||
damage = 30;
|
||||
else
|
||||
damage = 50;
|
||||
|
||||
if (is_quad)
|
||||
damage *= damage_multiplier;
|
||||
|
||||
tempang = ent->client->v_angle;
|
||||
tempang[YAW] += crandom();
|
||||
|
||||
vec3_t start, dir;
|
||||
P_ProjectSource(ent, tempang, { 16, 7, -8 }, start, dir);
|
||||
|
||||
P_AddWeaponKick(ent, ent->client->v_forward * -3, { -3.f, 0.f, 0.f });
|
||||
|
||||
fire_ionripper(ent, start, dir, damage, 500, EF_IONRIPPER);
|
||||
|
||||
// send muzzle flash
|
||||
gi.WriteByte(svc_muzzleflash);
|
||||
gi.WriteEntity(ent);
|
||||
gi.WriteByte(MZ_IONRIPPER | is_silenced);
|
||||
gi.multicast(ent->s.origin, MULTICAST_PVS, false);
|
||||
|
||||
PlayerNoise(ent, start, PNOISE_WEAPON);
|
||||
|
||||
G_RemoveAmmo(ent);
|
||||
}
|
||||
|
||||
void Weapon_Ionripper(edict_t *ent)
|
||||
{
|
||||
constexpr int pause_frames[] = { 36, 0 };
|
||||
constexpr int fire_frames[] = { 6, 0 };
|
||||
|
||||
Weapon_Generic(ent, 5, 7, 36, 39, pause_frames, fire_frames, weapon_ionripper_fire);
|
||||
}
|
||||
|
||||
//
|
||||
// Phalanx
|
||||
//
|
||||
|
||||
void weapon_phalanx_fire(edict_t *ent)
|
||||
{
|
||||
vec3_t v;
|
||||
int damage;
|
||||
float damage_radius;
|
||||
int radius_damage;
|
||||
|
||||
damage = irandom(70, 80);
|
||||
radius_damage = 120;
|
||||
damage_radius = 120;
|
||||
|
||||
if (is_quad)
|
||||
{
|
||||
damage *= damage_multiplier;
|
||||
radius_damage *= damage_multiplier;
|
||||
}
|
||||
|
||||
vec3_t dir;
|
||||
|
||||
if (ent->client->ps.gunframe == 8)
|
||||
{
|
||||
v[PITCH] = ent->client->v_angle[PITCH];
|
||||
v[YAW] = ent->client->v_angle[YAW] - 1.5f;
|
||||
v[ROLL] = ent->client->v_angle[ROLL];
|
||||
|
||||
vec3_t start;
|
||||
P_ProjectSource(ent, v, { 0, 8, -8 }, start, dir);
|
||||
|
||||
radius_damage = 30;
|
||||
damage_radius = 120;
|
||||
|
||||
fire_plasma(ent, start, dir, damage, 725, damage_radius, radius_damage);
|
||||
|
||||
// send muzzle flash
|
||||
gi.WriteByte(svc_muzzleflash);
|
||||
gi.WriteEntity(ent);
|
||||
gi.WriteByte(MZ_PHALANX2 | is_silenced);
|
||||
gi.multicast(ent->s.origin, MULTICAST_PVS, false);
|
||||
|
||||
G_RemoveAmmo(ent);
|
||||
}
|
||||
else
|
||||
{
|
||||
v[PITCH] = ent->client->v_angle[PITCH];
|
||||
v[YAW] = ent->client->v_angle[YAW] + 1.5f;
|
||||
v[ROLL] = ent->client->v_angle[ROLL];
|
||||
|
||||
vec3_t start;
|
||||
P_ProjectSource(ent, v, { 0, 8, -8 }, start, dir);
|
||||
|
||||
fire_plasma(ent, start, dir, damage, 725, damage_radius, radius_damage);
|
||||
|
||||
// send muzzle flash
|
||||
gi.WriteByte(svc_muzzleflash);
|
||||
gi.WriteEntity(ent);
|
||||
gi.WriteByte(MZ_PHALANX | is_silenced);
|
||||
gi.multicast(ent->s.origin, MULTICAST_PVS, false);
|
||||
|
||||
PlayerNoise(ent, start, PNOISE_WEAPON);
|
||||
}
|
||||
|
||||
P_AddWeaponKick(ent, ent->client->v_forward * -2, { -2.f, 0.f, 0.f });
|
||||
}
|
||||
|
||||
void Weapon_Phalanx(edict_t *ent)
|
||||
{
|
||||
constexpr int pause_frames[] = { 29, 42, 55, 0 };
|
||||
constexpr int fire_frames[] = { 7, 8, 0 };
|
||||
|
||||
Weapon_Generic(ent, 5, 20, 58, 63, pause_frames, fire_frames, weapon_phalanx_fire);
|
||||
}
|
||||
|
||||
/*
|
||||
======================================================================
|
||||
|
||||
TRAP
|
||||
|
||||
======================================================================
|
||||
*/
|
||||
|
||||
constexpr gtime_t TRAP_TIMER = 5_sec;
|
||||
constexpr float TRAP_MINSPEED = 300.f;
|
||||
constexpr float TRAP_MAXSPEED = 700.f;
|
||||
|
||||
void weapon_trap_fire(edict_t *ent, bool held)
|
||||
{
|
||||
int speed;
|
||||
|
||||
vec3_t start, dir;
|
||||
// Paril: kill sideways angle on grenades
|
||||
// limit upwards angle so you don't throw behind you
|
||||
P_ProjectSource(ent, { max(-62.5f, ent->client->v_angle[0]), ent->client->v_angle[1], ent->client->v_angle[2] }, { 8, 0, -8 }, start, dir);
|
||||
|
||||
gtime_t timer = ent->client->grenade_time - level.time;
|
||||
speed = (int) (ent->health <= 0 ? TRAP_MINSPEED : min(TRAP_MINSPEED + (TRAP_TIMER - timer).seconds() * ((TRAP_MAXSPEED - TRAP_MINSPEED) / TRAP_TIMER.seconds()), TRAP_MAXSPEED));
|
||||
|
||||
ent->client->grenade_time = 0_ms;
|
||||
|
||||
fire_trap(ent, start, dir, speed);
|
||||
|
||||
G_RemoveAmmo(ent, 1);
|
||||
}
|
||||
|
||||
void Weapon_Trap(edict_t *ent)
|
||||
{
|
||||
constexpr int pause_frames[] = { 29, 34, 39, 48, 0 };
|
||||
|
||||
Throw_Generic(ent, 15, 48, 5, "weapons/trapcock.wav", 11, 12, pause_frames, false, "weapons/traploop.wav", weapon_trap_fire, false);
|
||||
}
|
||||
Reference in New Issue
Block a user