mirror of
https://github.com/yquake2/zaero.git
synced 2024-11-22 03:51:13 +00:00
Einige Dateien aufgeraemunt
This commit is contained in:
parent
2590b35e2a
commit
096c3faa1c
6 changed files with 166 additions and 357 deletions
71
src/g_ai.c
71
src/g_ai.c
|
@ -452,12 +452,12 @@ qboolean FindTarget (edict_t *self)
|
|||
if (self->monsterinfo.aiflags & AI_COMBAT_POINT)
|
||||
return false;
|
||||
|
||||
// if the first spawnflag bit is set, the monster will only wake up on
|
||||
// really seeing the player, not another monster getting angry or hearing
|
||||
// something
|
||||
// if the first spawnflag bit is set, the monster will only wake up on
|
||||
// really seeing the player, not another monster getting angry or hearing
|
||||
// something
|
||||
|
||||
// revised behavior so they will wake up if they "see" a player make a noise
|
||||
// but not weapon impact/explosion noises
|
||||
// revised behavior so they will wake up if they "see" a player make a noise
|
||||
// but not weapon impact/explosion noises
|
||||
|
||||
heardit = false;
|
||||
if ((level.sight_entity_framenum >= (level.framenum - 1)) && !(self->spawnflags & 1) )
|
||||
|
@ -519,8 +519,6 @@ qboolean FindTarget (edict_t *self)
|
|||
if (r == RANGE_FAR)
|
||||
return false;
|
||||
|
||||
// this is where we would check invisibility
|
||||
|
||||
// is client in an spot too dark to be seen?
|
||||
if (client->light_level <= 5)
|
||||
return false;
|
||||
|
@ -597,9 +595,9 @@ qboolean FindTarget (edict_t *self)
|
|||
self->enemy = client;
|
||||
}
|
||||
|
||||
//
|
||||
// got one
|
||||
//
|
||||
//
|
||||
// got one
|
||||
//
|
||||
FoundTarget (self);
|
||||
|
||||
if (!(self->monsterinfo.aiflags & AI_SOUND_TARGET) && (self->monsterinfo.sight))
|
||||
|
@ -664,7 +662,7 @@ qboolean M_CheckAttack (edict_t *self)
|
|||
return true;
|
||||
}
|
||||
|
||||
// missile attack
|
||||
// missile attack
|
||||
if (!self->monsterinfo.attack)
|
||||
return false;
|
||||
|
||||
|
@ -756,7 +754,7 @@ void ai_run_missile(edict_t *self)
|
|||
self->monsterinfo.attack (self);
|
||||
self->monsterinfo.attack_state = AS_STRAIGHT;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -824,7 +822,7 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
vec3_t temp;
|
||||
qboolean hesDeadJim;
|
||||
|
||||
// this causes monsters to run blindly to the combat point w/o firing
|
||||
// this causes monsters to run blindly to the combat point w/o firing
|
||||
if (self->goalentity)
|
||||
{
|
||||
if (self->monsterinfo.aiflags & AI_COMBAT_POINT)
|
||||
|
@ -834,11 +832,12 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
{
|
||||
if ((level.time - self->enemy->teleport_time) > 5.0)
|
||||
{
|
||||
if (self->goalentity == self->enemy)
|
||||
if (self->goalentity == self->enemy) {
|
||||
if (self->movetarget)
|
||||
self->goalentity = self->movetarget;
|
||||
else
|
||||
self->goalentity = NULL;
|
||||
}
|
||||
self->monsterinfo.aiflags &= ~AI_SOUND_TARGET;
|
||||
if (self->monsterinfo.aiflags & AI_TEMP_STAND_GROUND)
|
||||
self->monsterinfo.aiflags &= ~(AI_STAND_GROUND | AI_TEMP_STAND_GROUND);
|
||||
|
@ -853,7 +852,7 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
|
||||
enemy_vis = false;
|
||||
|
||||
// see if the enemy is dead
|
||||
// see if the enemy is dead
|
||||
hesDeadJim = false;
|
||||
if ((!self->enemy) || (!self->enemy->inuse))
|
||||
{
|
||||
|
@ -913,7 +912,7 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
|
||||
self->show_hostile = level.time + 1; // wake up other monsters
|
||||
|
||||
// check knowledge of enemy
|
||||
// check knowledge of enemy
|
||||
enemy_vis = visible(self, self->enemy);
|
||||
if (enemy_vis)
|
||||
{
|
||||
|
@ -921,20 +920,12 @@ qboolean ai_checkattack (edict_t *self, float dist)
|
|||
VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting);
|
||||
}
|
||||
|
||||
// look for other coop players here
|
||||
// if (coop && self->monsterinfo.search_time < level.time)
|
||||
// {
|
||||
// if (FindTarget (self))
|
||||
// return true;
|
||||
// }
|
||||
|
||||
enemy_infront = infront(self, self->enemy);
|
||||
enemy_range = range(self, self->enemy);
|
||||
VectorSubtract (self->enemy->s.origin, self->s.origin, temp);
|
||||
enemy_yaw = vectoyaw(temp);
|
||||
|
||||
|
||||
// JDC self->ideal_yaw = enemy_yaw;
|
||||
if (self->monsterinfo.attack_state == AS_MISSILE)
|
||||
{
|
||||
ai_run_missile (self);
|
||||
|
@ -1004,16 +995,10 @@ void ai_run (edict_t *self, float dist)
|
|||
}
|
||||
|
||||
if (self->monsterinfo.attack_state == AS_FLY_STRAFE)
|
||||
{
|
||||
if (self->monsterinfo.flyStrafeTimeout < level.time)
|
||||
self->monsterinfo.attack_state == AS_STRAIGHT;
|
||||
else
|
||||
{
|
||||
ai_fly_strafe(self, dist);
|
||||
//if (random() < 0.5)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ai_checkattack (self, dist))
|
||||
return;
|
||||
|
@ -1026,8 +1011,6 @@ void ai_run (edict_t *self, float dist)
|
|||
|
||||
if (enemy_vis)
|
||||
{
|
||||
// if (self.aiflags & AI_LOST_SIGHT)
|
||||
// dprint("regained sight\n");
|
||||
M_MoveToGoal (self, dist);
|
||||
self->monsterinfo.aiflags &= ~AI_LOST_SIGHT;
|
||||
VectorCopy (self->enemy->s.origin, self->monsterinfo.last_sighting);
|
||||
|
@ -1035,18 +1018,10 @@ void ai_run (edict_t *self, float dist)
|
|||
return;
|
||||
}
|
||||
|
||||
// coop will change to another enemy if visible
|
||||
if (coop->value)
|
||||
{ // FIXME: insane guys get mad with this, which causes crashes!
|
||||
if (FindTarget (self))
|
||||
return;
|
||||
}
|
||||
|
||||
if ((self->monsterinfo.search_time) && (level.time > (self->monsterinfo.search_time + 20)))
|
||||
{
|
||||
M_MoveToGoal (self, dist);
|
||||
self->monsterinfo.search_time = 0;
|
||||
// dprint("search timeout\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1059,7 +1034,6 @@ void ai_run (edict_t *self, float dist)
|
|||
if (!(self->monsterinfo.aiflags & AI_LOST_SIGHT))
|
||||
{
|
||||
// just lost sight of the player, decide where to go first
|
||||
// dprint("lost sight of player, last seen at "); dprint(vtos(self.last_sighting)); dprint("\n");
|
||||
self->monsterinfo.aiflags |= (AI_LOST_SIGHT | AI_PURSUIT_LAST_SEEN);
|
||||
self->monsterinfo.aiflags &= ~(AI_PURSUE_NEXT | AI_PURSUE_TEMP);
|
||||
new = true;
|
||||
|
@ -1068,14 +1042,12 @@ void ai_run (edict_t *self, float dist)
|
|||
if (self->monsterinfo.aiflags & AI_PURSUE_NEXT)
|
||||
{
|
||||
self->monsterinfo.aiflags &= ~AI_PURSUE_NEXT;
|
||||
// dprint("reached current goal: "); dprint(vtos(self.origin)); dprint(" "); dprint(vtos(self.last_sighting)); dprint(" "); dprint(ftos(vlen(self.origin - self.last_sighting))); dprint("\n");
|
||||
|
||||
// give ourself more time since we got this far
|
||||
self->monsterinfo.search_time = level.time + 5;
|
||||
|
||||
if (self->monsterinfo.aiflags & AI_PURSUE_TEMP)
|
||||
{
|
||||
// dprint("was temp goal; retrying original\n");
|
||||
self->monsterinfo.aiflags &= ~AI_PURSUE_TEMP;
|
||||
marker = NULL;
|
||||
VectorCopy (self->monsterinfo.saved_goal, self->monsterinfo.last_sighting);
|
||||
|
@ -1096,9 +1068,6 @@ void ai_run (edict_t *self, float dist)
|
|||
VectorCopy (marker->s.origin, self->monsterinfo.last_sighting);
|
||||
self->monsterinfo.trail_time = marker->timestamp;
|
||||
self->s.angles[YAW] = self->ideal_yaw = marker->s.angles[YAW];
|
||||
// dprint("heading is "); dprint(ftos(self.ideal_yaw)); dprint("\n");
|
||||
|
||||
// debug_drawline(self.origin, self.last_sighting, 52);
|
||||
new = true;
|
||||
}
|
||||
}
|
||||
|
@ -1115,8 +1084,6 @@ void ai_run (edict_t *self, float dist)
|
|||
|
||||
if (new)
|
||||
{
|
||||
// gi.dprintf("checking for course correction\n");
|
||||
|
||||
tr = gi.trace(self->s.origin, self->mins, self->maxs, self->monsterinfo.last_sighting, self, MASK_PLAYERSOLID);
|
||||
if (tr.fraction < 1)
|
||||
{
|
||||
|
@ -1144,7 +1111,6 @@ void ai_run (edict_t *self, float dist)
|
|||
{
|
||||
VectorSet(v, d2 * left * 0.5, -16, 0);
|
||||
G_ProjectSource (self->s.origin, v, v_forward, v_right, left_target);
|
||||
// gi.dprintf("incomplete path, go part way and adjust again\n");
|
||||
}
|
||||
VectorCopy (self->monsterinfo.last_sighting, self->monsterinfo.saved_goal);
|
||||
self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
|
||||
|
@ -1152,8 +1118,6 @@ void ai_run (edict_t *self, float dist)
|
|||
VectorCopy (left_target, self->monsterinfo.last_sighting);
|
||||
VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
|
||||
self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
|
||||
// gi.dprintf("adjusted left\n");
|
||||
// debug_drawline(self.origin, self.last_sighting, 152);
|
||||
}
|
||||
else if (right >= center && right > left)
|
||||
{
|
||||
|
@ -1161,7 +1125,6 @@ void ai_run (edict_t *self, float dist)
|
|||
{
|
||||
VectorSet(v, d2 * right * 0.5, 16, 0);
|
||||
G_ProjectSource (self->s.origin, v, v_forward, v_right, right_target);
|
||||
// gi.dprintf("incomplete path, go part way and adjust again\n");
|
||||
}
|
||||
VectorCopy (self->monsterinfo.last_sighting, self->monsterinfo.saved_goal);
|
||||
self->monsterinfo.aiflags |= AI_PURSUE_TEMP;
|
||||
|
@ -1169,11 +1132,8 @@ void ai_run (edict_t *self, float dist)
|
|||
VectorCopy (right_target, self->monsterinfo.last_sighting);
|
||||
VectorSubtract (self->goalentity->s.origin, self->s.origin, v);
|
||||
self->s.angles[YAW] = self->ideal_yaw = vectoyaw(v);
|
||||
// gi.dprintf("adjusted right\n");
|
||||
// debug_drawline(self.origin, self.last_sighting, 152);
|
||||
}
|
||||
}
|
||||
// else gi.dprintf("course was fine\n");
|
||||
}
|
||||
|
||||
M_MoveToGoal (self, dist);
|
||||
|
@ -1183,3 +1143,4 @@ void ai_run (edict_t *self, float dist)
|
|||
if (self)
|
||||
self->goalentity = save;
|
||||
}
|
||||
|
||||
|
|
39
src/g_cmds.c
39
src/g_cmds.c
|
@ -1,6 +1,7 @@
|
|||
#include "g_local.h"
|
||||
#include "m_player.h"
|
||||
|
||||
|
||||
char *ClientTeam (edict_t *ent)
|
||||
{
|
||||
char *p;
|
||||
|
@ -22,7 +23,6 @@ char *ClientTeam (edict_t *ent)
|
|||
return value;
|
||||
}
|
||||
|
||||
// if ((int)(dmflags->value) & DF_SKINTEAMS)
|
||||
return ++p;
|
||||
}
|
||||
|
||||
|
@ -314,7 +314,7 @@ void Cmd_God_f (edict_t *ent)
|
|||
{
|
||||
char *msg;
|
||||
|
||||
if (deathmatch->value && !sv_cheats->value)
|
||||
if ((deathmatch->value || coop->value) && !sv_cheats->value)
|
||||
{
|
||||
gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n");
|
||||
return;
|
||||
|
@ -343,7 +343,7 @@ void Cmd_Notarget_f (edict_t *ent)
|
|||
{
|
||||
char *msg;
|
||||
|
||||
if (deathmatch->value && !sv_cheats->value)
|
||||
if ((deathmatch->value || coop->value) && !sv_cheats->value)
|
||||
{
|
||||
gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n");
|
||||
return;
|
||||
|
@ -370,7 +370,7 @@ void Cmd_Noclip_f (edict_t *ent)
|
|||
{
|
||||
char *msg;
|
||||
|
||||
if (deathmatch->value && !sv_cheats->value)
|
||||
if ((deathmatch->value || coop->value) && !sv_cheats->value)
|
||||
{
|
||||
gi.cprintf (ent, PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n");
|
||||
return;
|
||||
|
@ -398,16 +398,16 @@ struct altsel_s
|
|||
} alternates[] =
|
||||
{
|
||||
{0}, // filler
|
||||
{2,"Blaster", "Flare Gun"},
|
||||
{1,"Shotgun"},
|
||||
{1,"Super Shotgun"},
|
||||
{1,"Machinegun"},
|
||||
{1,"Chaingun"},
|
||||
{1,"Grenade Launcher"},
|
||||
{1,"Rocket Launcher"},
|
||||
{1,"HyperBlaster"},
|
||||
{2,"Railgun", "Sniper Rifle"},
|
||||
{2,"BFG10K", "Sonic Cannon"}
|
||||
{2,{"Blaster", "Flare Gun"}},
|
||||
{1,{"Shotgun"}},
|
||||
{1,{"Super Shotgun"}},
|
||||
{1,{"Machinegun"}},
|
||||
{1,{"Chaingun"}},
|
||||
{1,{"Grenade Launcher"}},
|
||||
{1,{"Rocket Launcher"}},
|
||||
{1,{"HyperBlaster"}},
|
||||
{2,{"Railgun", "Sniper Rifle"}},
|
||||
{2,{"BFG10K", "Sonic Cannon"}}
|
||||
};
|
||||
|
||||
qboolean tryUse(edict_t *ent, char *s)
|
||||
|
@ -455,7 +455,6 @@ void findNext(edict_t *ent, struct altsel_s *ptr, int offset)
|
|||
|
||||
void altSelect(edict_t *ent, int num)
|
||||
{
|
||||
int index = 0;
|
||||
int offset = -1;
|
||||
int i = 0;
|
||||
struct altsel_s *ptr = NULL;
|
||||
|
@ -485,7 +484,7 @@ void altSelect(edict_t *ent, int num)
|
|||
offset = 0;
|
||||
else
|
||||
{
|
||||
offset = ((++offset) % ptr->num);
|
||||
offset = ((offset + 1) % (ptr->num));
|
||||
}
|
||||
|
||||
// now select this offset
|
||||
|
@ -539,8 +538,6 @@ void Cmd_Use_f (edict_t *ent)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
Cmd_Drop_f
|
||||
|
@ -556,7 +553,6 @@ void Cmd_Drop_f (edict_t *ent)
|
|||
|
||||
s = gi.args();
|
||||
it = FindItem (s);
|
||||
|
||||
if (!it)
|
||||
{
|
||||
gi.cprintf (ent, PRINT_HIGH, "unknown item: %s\n", s);
|
||||
|
@ -665,7 +661,6 @@ void Cmd_WeapPrev_f (edict_t *ent)
|
|||
for (i=1 ; i<=MAX_ITEMS ; i++)
|
||||
{
|
||||
index = (selected_weapon + MAX_ITEMS - i)%MAX_ITEMS;
|
||||
// index = (selected_weapon + i)%MAX_ITEMS;
|
||||
if (!cl->pers.inventory[index])
|
||||
continue;
|
||||
it = &itemlist[index];
|
||||
|
@ -676,7 +671,6 @@ void Cmd_WeapPrev_f (edict_t *ent)
|
|||
if (! (it->flags & IT_WEAPON) )
|
||||
continue;
|
||||
it->use (ent, it);
|
||||
// if (cl->pers.weapon == it)
|
||||
if (cl->newweapon == it)
|
||||
return; // successful
|
||||
}
|
||||
|
@ -705,7 +699,6 @@ void Cmd_WeapNext_f (edict_t *ent)
|
|||
for (i=1 ; i<=MAX_ITEMS ; i++)
|
||||
{
|
||||
index = (selected_weapon + i)%MAX_ITEMS;
|
||||
// index = (selected_weapon + MAX_ITEMS - i)%MAX_ITEMS;
|
||||
if (!cl->pers.inventory[index])
|
||||
continue;
|
||||
it = &itemlist[index];
|
||||
|
@ -716,7 +709,6 @@ void Cmd_WeapNext_f (edict_t *ent)
|
|||
if (! (it->flags & IT_WEAPON) )
|
||||
continue;
|
||||
it->use (ent, it);
|
||||
// if (cl->pers.weapon == it)
|
||||
if (cl->newweapon == it)
|
||||
return; // successful
|
||||
}
|
||||
|
@ -1128,3 +1120,4 @@ void ClientCommand (edict_t *ent)
|
|||
else // anything that doesn't match a command will be a chat
|
||||
Cmd_Say_f (ent, false, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ qboolean CanDamage (edict_t *targ, edict_t *inflictor)
|
|||
vec3_t dest;
|
||||
trace_t trace;
|
||||
|
||||
// bmodels need special checking because their origin is 0,0,0
|
||||
// bmodels need special checking because their origin is 0,0,0
|
||||
if (targ->movetype == MOVETYPE_PUSH)
|
||||
{
|
||||
VectorAdd (targ->absmin, targ->absmax, dest);
|
||||
|
@ -79,11 +79,9 @@ void Killed (edict_t *targ, edict_t *inflictor, edict_t *attacker, int damage, v
|
|||
|
||||
if ((targ->svflags & SVF_MONSTER) && (targ->deadflag != DEAD_DEAD))
|
||||
{
|
||||
// targ->svflags |= SVF_DEADMONSTER; // now treat as a different content type
|
||||
if (!(targ->monsterinfo.aiflags & AI_GOOD_GUY) && !(targ->spawnflags & 16))
|
||||
{
|
||||
level.killed_monsters++;
|
||||
|
||||
if (coop->value && attacker->client)
|
||||
attacker->client->resp.score++;
|
||||
// medics won't heal monsters that they kill themselves
|
||||
|
@ -119,7 +117,6 @@ void SpawnDamage (int type, vec3_t origin, vec3_t normal, int damage)
|
|||
damage = 255;
|
||||
gi.WriteByte (svc_temp_entity);
|
||||
gi.WriteByte (type);
|
||||
// gi.WriteByte (damage);
|
||||
gi.WritePosition (origin);
|
||||
gi.WriteDir (normal);
|
||||
gi.multicast (origin, MULTICAST_PVS);
|
||||
|
@ -156,7 +153,7 @@ static int CheckPowerArmor (edict_t *ent, vec3_t point, vec3_t normal, int damag
|
|||
gclient_t *client;
|
||||
int save;
|
||||
int power_armor_type;
|
||||
int index;
|
||||
int index = 0;
|
||||
int damagePerCell;
|
||||
int pa_te_type;
|
||||
int power;
|
||||
|
@ -255,7 +252,7 @@ static int CheckPowerArmor (edict_t *ent, vec3_t point, vec3_t normal, int damag
|
|||
|
||||
if (client)
|
||||
client->pers.inventory[index] -= power_used;
|
||||
else if (ent->svflags & SVF_MONSTER)
|
||||
else
|
||||
ent->monsterinfo.power_armor_power -= power_used;
|
||||
return save;
|
||||
}
|
||||
|
@ -355,18 +352,16 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker)
|
|||
(strcmp(attacker->classname, "monster_jorg") != 0) &&
|
||||
(!(attacker->mteam && targ->mteam && strcmp(attacker->mteam, targ->mteam) == 0)))
|
||||
{
|
||||
if (targ->enemy)
|
||||
if (targ->enemy->client)
|
||||
if (targ->enemy && targ->enemy->client)
|
||||
targ->oldenemy = targ->enemy;
|
||||
targ->enemy = attacker;
|
||||
if (!(targ->monsterinfo.aiflags & AI_DUCKED))
|
||||
FoundTarget (targ);
|
||||
}
|
||||
else if(attacker->enemy)
|
||||
// otherwise get mad at whoever they are mad at (help our buddy)
|
||||
// otherwise get mad at whoever they are mad at (help our buddy) unless it is us!
|
||||
else if (attacker->enemy && attacker->enemy != targ)
|
||||
{
|
||||
if (targ->enemy)
|
||||
if (targ->enemy->client)
|
||||
if (targ->enemy && targ->enemy->client)
|
||||
targ->oldenemy = targ->enemy;
|
||||
targ->enemy = attacker->enemy;
|
||||
if (!(targ->monsterinfo.aiflags & AI_DUCKED))
|
||||
|
@ -433,14 +428,14 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
|
|||
|
||||
VectorNormalize(dir);
|
||||
|
||||
// bonus damage for suprising a monster
|
||||
// bonus damage for suprising a monster
|
||||
if (!(dflags & DAMAGE_RADIUS) && (targ->svflags & SVF_MONSTER) && (attacker->client) && (!targ->enemy) && (targ->health > 0))
|
||||
damage *= 2;
|
||||
|
||||
if (targ->flags & FL_NO_KNOCKBACK)
|
||||
knockback = 0;
|
||||
|
||||
// knockback code moved foreward to take into account for DAMAGE_ARMORMOSTLY now
|
||||
// knockback code moved foreward to take into account for DAMAGE_ARMORMOSTLY now
|
||||
|
||||
take = damage;
|
||||
save = 0;
|
||||
|
@ -486,7 +481,7 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
|
|||
//treat cheat/powerup savings the same as armor
|
||||
asave += save;
|
||||
|
||||
// figure momentum add
|
||||
// figure momentum add
|
||||
if (!(dflags & DAMAGE_NO_KNOCKBACK))
|
||||
{
|
||||
if ((knockback) && (targ->movetype != MOVETYPE_NONE) && (targ->movetype != MOVETYPE_BOUNCE) && (targ->movetype != MOVETYPE_BOUNCEFLY) && (targ->movetype != MOVETYPE_PUSH) && (targ->movetype != MOVETYPE_STOP))
|
||||
|
@ -517,7 +512,7 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
|
|||
if (!(dflags & DAMAGE_NO_PROTECTION) && CheckTeamDamage (targ, attacker))
|
||||
return;
|
||||
|
||||
// do the damage
|
||||
// do the damage
|
||||
if (take)
|
||||
{
|
||||
if ((targ->svflags & SVF_MONSTER) || (client))
|
||||
|
@ -526,10 +521,8 @@ void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir,
|
|||
SpawnDamage (te_sparks, point, normal, take);
|
||||
|
||||
|
||||
if (targ->takedamage != DAMAGE_IMMORTAL)
|
||||
targ->health = targ->health - take;
|
||||
|
||||
// kill the entity
|
||||
if (targ->health <= 0)
|
||||
{
|
||||
if ((targ->svflags & SVF_MONSTER) || (client))
|
||||
|
@ -647,3 +640,4 @@ void T_RadiusDamagePosition (vec3_t origin, edict_t *inflictor, edict_t *attacke
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
24
src/g_func.c
24
src/g_func.c
|
@ -146,8 +146,6 @@ void Move_Calc (edict_t *ent, vec3_t dest, void(*func)(edict_t*), int smoothSpee
|
|||
}
|
||||
|
||||
// smooth speed change
|
||||
// ent->think = Think_SmoothAccelMove;
|
||||
// ent->nextthink = level.time + FRAMETIME;
|
||||
Think_SmoothAccelMove(ent);
|
||||
}
|
||||
else if (ent->moveinfo.speed == ent->moveinfo.accel && ent->moveinfo.speed == ent->moveinfo.decel)
|
||||
|
@ -291,7 +289,7 @@ void plat_CalcAcceleratedMove(moveinfo_t *moveinfo)
|
|||
}
|
||||
|
||||
moveinfo->decel_distance = decel_dist;
|
||||
};
|
||||
}
|
||||
|
||||
void plat_Accelerate (moveinfo_t *moveinfo)
|
||||
{
|
||||
|
@ -362,7 +360,7 @@ void plat_Accelerate (moveinfo_t *moveinfo)
|
|||
|
||||
// we are at constant velocity (move_speed)
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
void Think_AccelMove (edict_t *ent)
|
||||
{
|
||||
|
@ -430,8 +428,6 @@ void Think_SmoothAccelMove (edict_t *ent)
|
|||
ent->think = Think_SmoothAccelMove;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void plat_go_down (edict_t *ent);
|
||||
|
||||
void plat_hit_top (edict_t *ent)
|
||||
|
@ -514,7 +510,6 @@ void Use_Plat (edict_t *ent, edict_t *other, edict_t *activator)
|
|||
|
||||
void Touch_Plat_Center (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
{
|
||||
edict_t *trigger = ent;
|
||||
if (!other->client)
|
||||
return;
|
||||
|
||||
|
@ -541,9 +536,9 @@ void plat_spawn_inside_trigger (edict_t *ent)
|
|||
edict_t *trigger;
|
||||
vec3_t tmin, tmax;
|
||||
|
||||
//
|
||||
// middle trigger
|
||||
//
|
||||
//
|
||||
// middle trigger
|
||||
//
|
||||
trigger = G_Spawn();
|
||||
trigger->touch = Touch_Plat_Center;
|
||||
trigger->movetype = MOVETYPE_NONE;
|
||||
|
@ -794,8 +789,6 @@ void SP_func_rotating (edict_t *ent)
|
|||
if (!ent->dmg)
|
||||
ent->dmg = 2;
|
||||
|
||||
// ent->moveinfo.sound_middle = "doors/hydro1.wav";
|
||||
|
||||
ent->use = rotating_use;
|
||||
if (ent->dmg)
|
||||
ent->blocked = rotating_blocked;
|
||||
|
@ -1280,8 +1273,8 @@ void door_blocked (edict_t *self, edict_t *other)
|
|||
return;
|
||||
|
||||
|
||||
// if a door has a negative wait, it would never come back if blocked,
|
||||
// so let it just squash the object to death real fast
|
||||
// if a door has a negative wait, it would never come back if blocked,
|
||||
// so let it just squash the object to death real fast
|
||||
if (self->moveinfo.wait >= 0)
|
||||
{
|
||||
if (self->moveinfo.state == STATE_DOWN)
|
||||
|
@ -1495,8 +1488,6 @@ void SP_func_door_rotating (edict_t *ent)
|
|||
|
||||
if (!ent->wait)
|
||||
ent->wait = 3;
|
||||
//if (!ent->dmg)
|
||||
// ent->dmg = 2;
|
||||
|
||||
if (ent->sounds != 1)
|
||||
{
|
||||
|
@ -1734,7 +1725,6 @@ void train_next (edict_t *self)
|
|||
again:
|
||||
if (!self->target)
|
||||
{
|
||||
// gi.dprintf ("train_next: no next target\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
100
src/g_items.c
100
src/g_items.c
|
@ -46,16 +46,6 @@ void Action_Push(edict_t *ent);
|
|||
void Use_PlasmaShield (edict_t *ent, gitem_t *item);
|
||||
|
||||
|
||||
#if defined(_DEBUG) && defined(_Z_TESTMODE)
|
||||
|
||||
void Weapon_LineDraw (edict_t *ent);
|
||||
void Weapon_Test (edict_t *ent);
|
||||
|
||||
qboolean Pickup_TestItem (edict_t *ent, edict_t *other);
|
||||
void Drop_TestItem (edict_t *ent, gitem_t *item);
|
||||
|
||||
#endif
|
||||
|
||||
//======================================================================
|
||||
|
||||
/*
|
||||
|
@ -435,8 +425,6 @@ void Use_Breather (edict_t *ent, gitem_t *item)
|
|||
ent->client->breather_framenum += 300;
|
||||
else
|
||||
ent->client->breather_framenum = level.framenum + 300;
|
||||
|
||||
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -450,8 +438,6 @@ void Use_Envirosuit (edict_t *ent, gitem_t *item)
|
|||
ent->client->enviro_framenum += 300;
|
||||
else
|
||||
ent->client->enviro_framenum = level.framenum + 300;
|
||||
|
||||
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -476,8 +462,6 @@ void Use_Silencer (edict_t *ent, gitem_t *item)
|
|||
ent->client->pers.inventory[ITEM_INDEX(item)]--;
|
||||
ValidateSelectedItem (ent);
|
||||
ent->client->silencer_shots += 30;
|
||||
|
||||
// gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -527,7 +511,6 @@ qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
|
|||
max = ent->client->pers.max_cells;
|
||||
else if (item->tag == AMMO_SLUGS)
|
||||
max = ent->client->pers.max_slugs;
|
||||
// [evolve
|
||||
else if (item->tag == AMMO_LASERTRIPBOMB)
|
||||
max = ent->client->pers.max_tbombs;
|
||||
else if (item->tag == AMMO_FLARES)
|
||||
|
@ -538,7 +521,6 @@ qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
|
|||
max = ent->client->pers.max_a2k;
|
||||
else if (item->tag == AMMO_PLASMASHIELD)
|
||||
max = ent->client->pers.max_plasmashield;
|
||||
// evolve]
|
||||
else
|
||||
return false;
|
||||
|
||||
|
@ -973,7 +955,7 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf
|
|||
|
||||
//======================================================================
|
||||
|
||||
void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
|
||||
{
|
||||
if (other == ent->owner)
|
||||
return;
|
||||
|
@ -981,7 +963,7 @@ void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t
|
|||
Touch_Item (ent, other, plane, surf);
|
||||
}
|
||||
|
||||
void drop_make_touchable (edict_t *ent)
|
||||
static void drop_make_touchable (edict_t *ent)
|
||||
{
|
||||
ent->touch = Touch_Item;
|
||||
if (deathmatch->value)
|
||||
|
@ -1600,7 +1582,6 @@ always owned, never in the world
|
|||
/* pickup */ "Grenades",
|
||||
/* width */ 3,
|
||||
5,
|
||||
// "grenades",
|
||||
"Grenades",
|
||||
IT_AMMO|IT_WEAPON,
|
||||
NULL,
|
||||
|
@ -1984,8 +1965,6 @@ always owned, never in the world
|
|||
/* precache */ "items/empnuke/emp_trg.wav" //items/empnuke/emp_act.wav items/empnuke/emp_spin.wav items/empnuke/emp_idle.wav
|
||||
},
|
||||
|
||||
// EVOLVE]
|
||||
|
||||
//
|
||||
// POWERUP ITEMS
|
||||
//
|
||||
|
@ -2602,80 +2581,6 @@ security pass for the security level
|
|||
/* precache */ ""
|
||||
},
|
||||
|
||||
#if defined(_DEBUG) && defined(_Z_TESTMODE)
|
||||
|
||||
/* weapon_ldraw (.3 .3 1) (-16 -16 -16) (16 16 16)
|
||||
always owned, never in the world
|
||||
*/
|
||||
{
|
||||
"weapon_linedraw",
|
||||
NULL,
|
||||
Use_Weapon,
|
||||
NULL,
|
||||
Weapon_LineDraw,
|
||||
"misc/w_pkup.wav",
|
||||
NULL, 0,
|
||||
"models/weapons/v_blast/tris.md2",
|
||||
/* icon */ "w_blaster",
|
||||
/* pickup */ "Line Draw",
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
IT_WEAPON,
|
||||
NULL,
|
||||
0,
|
||||
/* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
|
||||
},
|
||||
|
||||
|
||||
/* weapon_testweapon (.3 .3 1) (-16 -16 -16) (16 16 16)
|
||||
loaded from weapon.cfg
|
||||
*/
|
||||
{
|
||||
"weapon_test",
|
||||
Pickup_Weapon,
|
||||
Use_Weapon,
|
||||
Drop_Weapon,
|
||||
Weapon_Test,
|
||||
"misc/w_pkup.wav",
|
||||
"models/weapons/v_blast/tris.md2", EF_ROTATE,
|
||||
"models/weapons/v_blast/tris.md2",
|
||||
/* icon */ "w_blaster",
|
||||
/* pickup */ "Test",
|
||||
0,
|
||||
0,
|
||||
"Shells",
|
||||
IT_WEAPON,
|
||||
NULL,
|
||||
0,
|
||||
/* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
|
||||
},
|
||||
|
||||
|
||||
/* weapon_testitem (.3 .3 1) (-16 -16 -16) (16 16 16)
|
||||
loaded from item.cfg
|
||||
*/
|
||||
{
|
||||
"item_test",
|
||||
Pickup_TestItem,
|
||||
NULL,
|
||||
Drop_TestItem,
|
||||
NULL,
|
||||
"misc/w_pkup.wav",
|
||||
"models/weapons/v_blast/tris.md2", 0,
|
||||
"models/weapons/v_blast/tris.md2",
|
||||
/* icon */ "w_blaster",
|
||||
/* pickup */ "Test",
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
/* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
|
||||
},
|
||||
#endif
|
||||
|
||||
// end of list marker
|
||||
{NULL}
|
||||
};
|
||||
|
@ -2779,3 +2684,4 @@ void SetItemNames (void)
|
|||
power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
|
||||
power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// g_local.h -- local definitions for game module
|
||||
|
||||
#include "q_shared.h"
|
||||
#include "z_anim.h"
|
||||
|
||||
// define GAME_INCLUDE so that game.h does not define the
|
||||
// short, server-visible gclient_t and edict_t structures,
|
||||
|
@ -24,9 +25,6 @@
|
|||
|
||||
// Zaero includes
|
||||
#include "z_debug.h"
|
||||
#ifdef CACHE_SOUND
|
||||
#include "z_list.h"
|
||||
#endif
|
||||
|
||||
// the "gamename" client command will print this plus compile date
|
||||
#define GAMEVERSION "Zaero 1.1"
|
||||
|
@ -600,9 +598,6 @@ extern cvar_t *gamedir;
|
|||
extern cvar_t *grenadeammotype;
|
||||
extern cvar_t *grenadeammo;
|
||||
extern cvar_t *bettyammo;
|
||||
#ifdef CACHE_SOUND
|
||||
extern cvar_t *printSoundRejects;
|
||||
#endif
|
||||
|
||||
#define world (&g_edicts[0])
|
||||
|
||||
|
@ -803,7 +798,6 @@ edict_t *PlayerTrail_PickFirst (edict_t *self);
|
|||
edict_t *PlayerTrail_PickNext (edict_t *self);
|
||||
edict_t *PlayerTrail_LastSpot (void);
|
||||
|
||||
|
||||
//
|
||||
// g_client.c
|
||||
//
|
||||
|
@ -825,6 +819,7 @@ void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
|
|||
// g_svcmds.c
|
||||
//
|
||||
void ServerCommand (void);
|
||||
qboolean SV_FilterPacket (char *from);
|
||||
|
||||
//
|
||||
// p_view.c
|
||||
|
@ -863,24 +858,6 @@ void G_RunEntity (edict_t *ent);
|
|||
void SaveClientData (void);
|
||||
void FetchClientEntData (edict_t *ent);
|
||||
|
||||
|
||||
#if defined(_DEBUG) && defined(_Z_TESTMODE)
|
||||
|
||||
//
|
||||
// z_mtest.c
|
||||
//
|
||||
void Cmd_TestItem (edict_t *ent);
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// z_trigger.c
|
||||
//
|
||||
#ifdef CACHE_SOUND
|
||||
void printSoundNum();
|
||||
void initSoundList();
|
||||
#endif
|
||||
|
||||
//
|
||||
// z_item.c
|
||||
//
|
||||
|
@ -1050,10 +1027,6 @@ struct gclient_s
|
|||
|
||||
float respawn_time; // can respawn when time > this
|
||||
|
||||
#if defined(_DEBUG) && defined(_Z_TESTMODE)
|
||||
struct edict_s *lineDraw;
|
||||
#endif
|
||||
|
||||
// used for blinding
|
||||
int flashTime;
|
||||
int flashBase;
|
||||
|
@ -1239,11 +1212,6 @@ struct edict_s
|
|||
|
||||
float weaponsound_time;
|
||||
|
||||
#if defined(_DEBUG) && defined(_Z_TESTMODE)
|
||||
//can't teach an old dog new tricks
|
||||
void *extra_data;
|
||||
#endif
|
||||
|
||||
// schooling info
|
||||
edict_t *zRaduisList, *zSchoolChain;
|
||||
float zDistance;
|
||||
|
@ -1272,10 +1240,7 @@ struct edict_s
|
|||
int bossFireCount;
|
||||
};
|
||||
|
||||
//zaero debug includes (need type info)
|
||||
#include "z_frames.h"
|
||||
#include "z_anim.h"
|
||||
|
||||
// Zaero dmflags
|
||||
#define ZDM_NO_GL_POLYBLEND_DAMAGE 1
|
||||
#define ZDM_ZAERO_ITEMS 2
|
||||
|
||||
|
|
Loading…
Reference in a new issue