Temporary build rogue as separate library

This commit is contained in:
Denis Pauk 2023-10-19 02:07:19 +03:00
parent 0826949edc
commit 9702700225
121 changed files with 280 additions and 5279 deletions

132
Makefile
View File

@ -377,12 +377,12 @@ endif
# ----------
# Phony targets
.PHONY : all client game icon server ref_gl1 ref_gl3 ref_gles3 ref_soft ref_vk ref_gl4 xatrix
.PHONY : all client game icon server ref_gl1 ref_gl3 ref_gles3 ref_soft ref_vk ref_gl4 xatrix rogue
# ----------
# Builds everything
all: config client server game ref_gl1 ref_gl3 ref_gles3 ref_soft ref_vk ref_gl4 xatrix
all: config client server game ref_gl1 ref_gl3 ref_gles3 ref_soft ref_vk ref_gl4 xatrix rogue
# ----------
@ -1453,7 +1453,7 @@ XATRIX_OBJS_ = \
src/xatrix/g_combat.o \
src/xatrix/g_func.o \
src/xatrix/g_items.o \
src/xatrix/g_main.o \
src/game/g_main.o \
src/xatrix/g_misc.o \
src/xatrix/g_monster.o \
src/xatrix/g_phys.o \
@ -1529,3 +1529,129 @@ release/xatrix/game.so : $(XATRIX_OBJS)
endif
# ----------
# The rogue game
ifeq ($(YQ2_OSTYPE), Windows)
rogue:
@echo "===> Building rogue/game.dll"
${Q}mkdir -p release/rogue
$(MAKE) release/rogue/game.dll
else ifeq ($(YQ2_OSTYPE), Darwin)
rogue:
@echo "===> Building rogue/game.dylib"
${Q}mkdir -p release/rogue
$(MAKE) release/rogue/game.dylib
else
rogue:
@echo "===> Building rogue/game.so"
${Q}mkdir -p release/rogue
$(MAKE) release/rogue/game.so
release/rogue/game.so : CFLAGS += -fPIC -Wno-unused-result
release/rogue/game.so : LDFLAGS += -shared
endif
build/rogue/%.o: %.c
@echo "===> CC $<"
${Q}mkdir -p $(@D)
${Q}$(CC) -c $(CFLAGS) -o $@ $<
# ----------
ROGUE_OBJS_ = \
src/common/shared/flash.o \
src/common/shared/rand.o \
src/common/shared/shared.o \
src/rogue/g_ai.o \
src/rogue/g_chase.o \
src/rogue/g_cmds.o \
src/rogue/g_combat.o \
src/rogue/g_func.o \
src/rogue/g_items.o \
src/rogue/g_main.o \
src/rogue/g_misc.o \
src/rogue/g_monster.o \
src/rogue/g_newai.o \
src/rogue/g_newdm.o \
src/rogue/g_newfnc.o \
src/rogue/g_newtarg.o \
src/rogue/g_newtrig.o \
src/rogue/g_newweap.o \
src/rogue/g_phys.o \
src/rogue/g_spawn.o \
src/rogue/g_sphere.o \
src/rogue/g_svcmds.o \
src/rogue/g_target.o \
src/rogue/g_trigger.o \
src/rogue/g_turret.o \
src/rogue/g_utils.o \
src/rogue/g_weapon.o \
src/rogue/dm/ball.o \
src/rogue/dm/tag.o \
src/rogue/monster/berserker/berserker.o \
src/rogue/monster/boss2/boss2.o \
src/rogue/monster/boss3/boss3.o \
src/rogue/monster/boss3/boss31.o \
src/rogue/monster/boss3/boss32.o \
src/rogue/monster/brain/brain.o \
src/rogue/monster/carrier/carrier.o \
src/rogue/monster/chick/chick.o \
src/rogue/monster/flipper/flipper.o \
src/rogue/monster/float/float.o \
src/rogue/monster/flyer/flyer.o \
src/rogue/monster/gladiator/gladiator.o \
src/rogue/monster/gunner/gunner.o \
src/rogue/monster/hover/hover.o \
src/rogue/monster/infantry/infantry.o \
src/rogue/monster/insane/insane.o \
src/rogue/monster/medic/medic.o \
src/rogue/monster/misc/move.o \
src/rogue/monster/mutant/mutant.o \
src/rogue/monster/parasite/parasite.o \
src/rogue/monster/soldier/soldier.o \
src/rogue/monster/stalker/stalker.o \
src/rogue/monster/supertank/supertank.o \
src/rogue/monster/tank/tank.o \
src/rogue/monster/turret/turret.o \
src/rogue/monster/widow/widow.o \
src/rogue/monster/widow/widow2.o \
src/rogue/player/client.o \
src/rogue/player/hud.o \
src/rogue/player/trail.o \
src/rogue/player/view.o \
src/rogue/player/weapon.o \
src/rogue/savegame/savegame.o
# ----------
# Rewrite paths to our object directory
ROGUE_OBJS = $(patsubst %,build/rogue/%,$(ROGUE_OBJS_))
# ----------
# Generate header dependencies
ROGUE_DEPS= $(ROGUE_OBJS:.o=.d)
# ----------
# Suck header dependencies in
-include $(ROGUE_DEPS)
# ----------
ifeq ($(YQ2_OSTYPE), Windows)
release/rogue/game.dll : $(ROGUE_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(LDFLAGS) $(ROGUE_OBJS) $(LDLIBS) -o $@
else ifeq ($(YQ2_OSTYPE), Darwin)
release/rogue/game.dylib : $(ROGUE_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(LDFLAGS) $(ROGUE_OBJS) $(LDLIBS) -o $@
else
release/rogue/game.so : $(ROGUE_OBJS)
@echo "===> LD $@"
${Q}$(CC) $(LDFLAGS) $(ROGUE_OBJS) $(LDLIBS) -o $@
endif
# ----------

View File

@ -1,493 +0,0 @@
/*
* Copyright (c) ZeniMax Media Inc.
* Licensed under the GNU General Public License 2.0.
*/
/*
* =======================================================================
*
* Jump in into the game.so and support functions.
*
* =======================================================================
*/
#include "header/local.h"
game_locals_t game;
level_locals_t level;
game_import_t gi;
game_export_t globals;
spawn_temp_t st;
int sm_meat_index;
int snd_fry;
int meansOfDeath;
edict_t *g_edicts;
cvar_t *deathmatch;
cvar_t *coop;
cvar_t *coop_baseq2; /* treat spawnflags according to baseq2 rules */
cvar_t *coop_elevator_delay;
cvar_t *coop_pickup_weapons;
cvar_t *dmflags;
cvar_t *skill;
cvar_t *fraglimit;
cvar_t *timelimit;
cvar_t *password;
cvar_t *spectator_password;
cvar_t *needpass;
cvar_t *maxclients;
cvar_t *maxspectators;
cvar_t *maxentities;
cvar_t *g_select_empty;
cvar_t *dedicated;
cvar_t *g_footsteps;
cvar_t *g_fix_triggered;
cvar_t *filterban;
cvar_t *sv_maxvelocity;
cvar_t *sv_gravity;
cvar_t *sv_rollspeed;
cvar_t *sv_rollangle;
cvar_t *gun_x;
cvar_t *gun_y;
cvar_t *gun_z;
cvar_t *run_pitch;
cvar_t *run_roll;
cvar_t *bob_up;
cvar_t *bob_pitch;
cvar_t *bob_roll;
cvar_t *sv_cheats;
cvar_t *flood_msgs;
cvar_t *flood_persecond;
cvar_t *flood_waitdelay;
cvar_t *sv_maplist;
cvar_t *sv_stopspeed;
cvar_t *g_showlogic;
cvar_t *gamerules;
cvar_t *huntercam;
cvar_t *strong_mines;
cvar_t *randomrespawn;
cvar_t *g_disruptor;
cvar_t *aimfix;
cvar_t *g_machinegun_norecoil;
cvar_t *g_swap_speed;
void SpawnEntities(char *mapname, char *entities, char *spawnpoint);
void ClientThink(edict_t *ent, usercmd_t *cmd);
qboolean ClientConnect(edict_t *ent, char *userinfo);
void ClientUserinfoChanged(edict_t *ent, char *userinfo);
void ClientDisconnect(edict_t *ent);
void ClientBegin(edict_t *ent);
void ClientCommand(edict_t *ent);
void RunEntity(edict_t *ent);
void WriteGame(char *filename, qboolean autosave);
void ReadGame(char *filename);
void WriteLevel(char *filename);
void ReadLevel(char *filename);
void InitGame(void);
void G_RunFrame(void);
/* =================================================================== */
void
ShutdownGame(void)
{
gi.dprintf("==== ShutdownGame ====\n");
gi.FreeTags(TAG_LEVEL);
gi.FreeTags(TAG_GAME);
}
/*
* Returns a pointer to the structure with
* all entry points and global variables
*/
game_export_t *
GetGameAPI(game_import_t *import)
{
gi = *import;
globals.apiversion = GAME_API_VERSION;
globals.Init = InitGame;
globals.Shutdown = ShutdownGame;
globals.SpawnEntities = SpawnEntities;
globals.WriteGame = WriteGame;
globals.ReadGame = ReadGame;
globals.WriteLevel = WriteLevel;
globals.ReadLevel = ReadLevel;
globals.ClientThink = ClientThink;
globals.ClientConnect = ClientConnect;
globals.ClientUserinfoChanged = ClientUserinfoChanged;
globals.ClientDisconnect = ClientDisconnect;
globals.ClientBegin = ClientBegin;
globals.ClientCommand = ClientCommand;
globals.RunFrame = G_RunFrame;
globals.ServerCommand = ServerCommand;
globals.edict_size = sizeof(edict_t);
/* Seed the PRNG */
randk_seed();
return &globals;
}
/*
* this is only here so the functions in
* q_shared.c and q_shwin.c can link
*/
void
Sys_Error(char *error, ...)
{
va_list argptr;
char text[1024];
va_start(argptr, error);
vsprintf(text, error, argptr);
va_end(argptr);
gi.error("%s", text);
}
void
Com_Printf(char *msg, ...)
{
va_list argptr;
char text[1024];
va_start(argptr, msg);
vsprintf(text, msg, argptr);
va_end(argptr);
gi.dprintf("%s", text);
}
/* ====================================================================== */
void
ClientEndServerFrames(void)
{
int i;
edict_t *ent;
/* calc the player views now that all
pushing and damage has been added */
for (i = 0; i < maxclients->value; i++)
{
ent = g_edicts + 1 + i;
if (!ent->inuse || !ent->client)
{
continue;
}
ClientEndServerFrame(ent);
}
}
/*
* Returns the created target changelevel
*/
edict_t *
CreateTargetChangeLevel(char *map)
{
edict_t *ent;
if (!map)
{
return NULL;
}
ent = G_Spawn();
ent->classname = "target_changelevel";
Com_sprintf(level.nextmap, sizeof(level.nextmap), "%s", map);
ent->map = level.nextmap;
return ent;
}
/*
* The timelimit or fraglimit has been exceeded
*/
void
EndDMLevel(void)
{
edict_t *ent;
char *s, *t, *f;
static const char *seps = " ,\n\r";
/* stay on same level flag */
if ((int)dmflags->value & DF_SAME_LEVEL)
{
BeginIntermission(CreateTargetChangeLevel(level.mapname));
return;
}
/* see if it's in the map list */
if (*sv_maplist->string)
{
s = strdup(sv_maplist->string);
f = NULL;
t = strtok(s, seps);
while (t != NULL)
{
if (Q_stricmp(t, level.mapname) == 0)
{
/* it's in the list, go to the next one */
t = strtok(NULL, seps);
if (t == NULL) /* end of list, go to first one */
{
if (f == NULL) /* there isn't a first one, same level */
{
BeginIntermission(CreateTargetChangeLevel(level.mapname));
}
else
{
BeginIntermission(CreateTargetChangeLevel(f));
}
}
else
{
BeginIntermission(CreateTargetChangeLevel(t));
}
free(s);
return;
}
if (!f)
{
f = t;
}
t = strtok(NULL, seps);
}
free(s);
}
if (level.nextmap[0]) /* go to a specific map */
{
BeginIntermission(CreateTargetChangeLevel(level.nextmap));
}
else /* search for a changelevel */
{
ent = G_Find(NULL, FOFS(classname), "target_changelevel");
if (!ent)
{
/* the map designer didn't include a changelevel,
so create a fake ent that goes back to the same
level */
BeginIntermission(CreateTargetChangeLevel(level.mapname));
return;
}
BeginIntermission(ent);
}
}
void
CheckNeedPass(void)
{
int need;
/* if password or spectator_password has
changed, update needpass as needed */
if (password->modified || spectator_password->modified)
{
password->modified = spectator_password->modified = false;
need = 0;
if (*password->string && Q_stricmp(password->string, "none"))
{
need |= 1;
}
if (*spectator_password->string &&
Q_stricmp(spectator_password->string, "none"))
{
need |= 2;
}
gi.cvar_set("needpass", va("%d", need));
}
}
void
CheckDMRules(void)
{
int i;
gclient_t *cl;
if (level.intermissiontime)
{
return;
}
if (!deathmatch->value)
{
return;
}
if (gamerules && gamerules->value && DMGame.CheckDMRules)
{
if (DMGame.CheckDMRules())
{
return;
}
}
if (timelimit->value)
{
if (level.time >= timelimit->value * 60)
{
gi.bprintf(PRINT_HIGH, "Timelimit hit.\n");
EndDMLevel();
return;
}
}
if (fraglimit->value)
{
for (i = 0; i < maxclients->value; i++)
{
cl = game.clients + i;
if (!g_edicts[i + 1].inuse)
{
continue;
}
if (cl->resp.score >= fraglimit->value)
{
gi.bprintf(PRINT_HIGH, "Fraglimit hit.\n");
EndDMLevel();
return;
}
}
}
}
void
ExitLevel(void)
{
int i;
edict_t *ent;
char command[256];
Com_sprintf(command, sizeof(command), "gamemap \"%s\"\n", level.changemap);
gi.AddCommandString(command);
level.changemap = NULL;
level.exitintermission = 0;
level.intermissiontime = 0;
ClientEndServerFrames();
/* clear some things before going to next level */
for (i = 0; i < maxclients->value; i++)
{
ent = g_edicts + 1 + i;
if (!ent->inuse)
{
continue;
}
if (ent->health > ent->max_health)
{
ent->health = ent->max_health;
}
}
debristhisframe = 0;
gibsthisframe = 0;
}
/*
* Advances the world by 0.1 seconds
*/
void
G_RunFrame(void)
{
int i;
edict_t *ent;
level.framenum++;
level.time = level.framenum * FRAMETIME;
debristhisframe = 0;
gibsthisframe = 0;
/* choose a client for monsters to target this frame */
AI_SetSightClient();
/* exit intermissions */
if (level.exitintermission)
{
ExitLevel();
return;
}
/* treat each object in turn even the
world gets a chance to think */
ent = &g_edicts[0];
for (i = 0; i < globals.num_edicts; i++, ent++)
{
if (!ent->inuse)
{
continue;
}
level.current_entity = ent;
VectorCopy(ent->s.origin, ent->s.old_origin);
/* if the ground entity moved, make sure we are still on it */
if ((ent->groundentity) &&
(ent->groundentity->linkcount != ent->groundentity_linkcount))
{
ent->groundentity = NULL;
if (!(ent->flags & (FL_SWIM | FL_FLY)) &&
(ent->svflags & SVF_MONSTER))
{
M_CheckGround(ent);
}
}
if ((i > 0) && (i <= maxclients->value))
{
ClientBeginServerFrame(ent);
continue;
}
G_RunEntity(ent);
}
/* see if it is time to end a deathmatch */
CheckDMRules();
/* see if needpass needs updated */
CheckNeedPass();
/* build the playerstate_t structures for all players */
ClientEndServerFrames();
}

View File

@ -1,246 +0,0 @@
/*
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (c) ZeniMax Media Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Here are the client, server and game are tied together.
*
* =======================================================================
*/
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* THIS FILE IS _VERY_ FRAGILE AND THERE'S NOTHING IN IT THAT CAN OR
* MUST BE CHANGED. IT'S MOST LIKELY A VERY GOOD IDEA TO CLOSE THE
* EDITOR NOW AND NEVER LOOK BACK. OTHERWISE YOU MAY SCREW UP EVERYTHING!
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
#ifndef ROGUE_GAME_H
#define ROGUE_GAME_H
#define GAME_API_VERSION 3
#define SVF_NOCLIENT 0x00000001 /* don't send entity to clients, even if it has effects */
#define SVF_DEADMONSTER 0x00000002 /* treat as CONTENTS_DEADMONSTER for collision */
#define SVF_MONSTER 0x00000004 /* treat as CONTENTS_MONSTER for collision */
#define SVF_DAMAGEABLE 0x00000008
#define MAX_ENT_CLUSTERS 16
typedef enum
{
SOLID_NOT, /* no interaction with other objects */
SOLID_TRIGGER, /* only touch when inside, after moving */
SOLID_BBOX, /* touch on edge */
SOLID_BSP /* bsp clip, touch on edge */
} solid_t;
/* =============================================================== */
/* link_t is only used for entity area links now */
typedef struct link_s
{
struct link_s *prev, *next;
} link_t;
typedef struct edict_s edict_t;
typedef struct gclient_s gclient_t;
#ifndef GAME_INCLUDE
struct gclient_s
{
player_state_t ps; /* communicated by server to clients */
int ping;
/* the game dll can add anything it wants
after this point in the structure */
};
struct edict_s
{
entity_state_t s;
struct gclient_s *client;
qboolean inuse;
int linkcount;
link_t area; /* linked to a division node or leaf */
int num_clusters; /* if -1, use headnode instead */
int clusternums[MAX_ENT_CLUSTERS];
int headnode; /* unused if num_clusters != -1 */
int areanum, areanum2;
/* ================================ */
int svflags; /* SVF_NOCLIENT, SVF_DEADMONSTER, SVF_MONSTER, etc */
vec3_t mins, maxs;
vec3_t absmin, absmax, size;
solid_t solid;
int clipmask;
edict_t *owner;
/* the game dll can add anything it wants
after this point in the structure */
};
#endif /* GAME_INCLUDE */
/* =============================================================== */
/* functions provided by the main engine */
typedef struct
{
/* special messages */
void (*bprintf)(int printlevel, const char *fmt, ...);
void (*dprintf)(const char *fmt, ...);
void (*cprintf)(edict_t *ent, int printlevel, const char *fmt, ...);
void (*centerprintf)(edict_t *ent, const char *fmt, ...);
void (*sound)(edict_t *ent, int channel, int soundindex, float volume,
float attenuation, float timeofs);
void (*positioned_sound)(vec3_t origin, edict_t *ent, int channel,
int soundinedex, float volume, float attenuation, float timeofs);
/* config strings hold all the index strings, the lightstyles,
and misc data like the sky definition and cdtrack.
All of the current configstrings are sent to clients when
they connect, and changes are sent to all connected clients. */
void (*configstring)(int num, const char *string);
YQ2_ATTR_NORETURN_FUNCPTR void (*error)(const char *fmt, ...);
/* the *index functions create configstrings
and some internal server state */
int (*modelindex)(const char *name);
int (*soundindex)(const char *name);
int (*imageindex)(const char *name);
void (*setmodel)(edict_t *ent, const char *name);
/* collision detection */
trace_t (*trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end,
edict_t *passent, int contentmask);
int (*pointcontents)(vec3_t point);
qboolean (*inPVS)(vec3_t p1, vec3_t p2);
qboolean (*inPHS)(vec3_t p1, vec3_t p2);
void (*SetAreaPortalState)(int portalnum, qboolean open);
qboolean (*AreasConnected)(int area1, int area2);
/* an entity will never be sent to a client or used for collision
if it is not passed to linkentity. If the size, position, or
solidity changes, it must be relinked. */
void (*linkentity)(edict_t *ent);
void (*unlinkentity)(edict_t *ent); /* call before removing an interactive edict */
int (*BoxEdicts)(vec3_t mins, vec3_t maxs, edict_t **list, int maxcount,
int areatype);
void (*Pmove)(pmove_t *pmove); /* player movement code common with client prediction */
/* network messaging */
void (*multicast)(vec3_t origin, multicast_t to);
void (*unicast)(edict_t *ent, qboolean reliable);
void (*WriteChar)(int c);
void (*WriteByte)(int c);
void (*WriteShort)(int c);
void (*WriteLong)(int c);
void (*WriteFloat)(float f);
void (*WriteString)(const char *s);
void (*WritePosition)(vec3_t pos); /* some fractional bits */
void (*WriteDir)(vec3_t pos); /* single byte encoded, very coarse */
void (*WriteAngle)(float f);
/* managed memory allocation */
void *(*TagMalloc)(int size, int tag);
void (*TagFree)(void *block);
void (*FreeTags)(int tag);
/* console variable interaction */
cvar_t *(*cvar)(const char *var_name, const char *value, int flags);
cvar_t *(*cvar_set)(const char *var_name, const char *value);
cvar_t *(*cvar_forceset)(const char *var_name, const char *value);
/* ClientCommand and ServerCommand parameter access */
int (*argc)(void);
char *(*argv)(int n);
char *(*args)(void); /* concatenation of all argv >= 1 */
/* add commands to the server console as if
they were typed in for map changing, etc */
void (*AddCommandString)(const char *text);
void (*DebugGraph)(float value, int color);
} game_import_t;
/* functions exported by the game subsystem */
typedef struct
{
int apiversion;
/* the init function will only be called when a game starts,
not each time a level is loaded. Persistant data for clients
and the server can be allocated in init */
void (*Init)(void);
void (*Shutdown)(void);
/* each new level entered will cause a call to SpawnEntities */
void (*SpawnEntities)(const char *mapname, char *entstring, const char *spawnpoint);
/* Read/Write Game is for storing persistant cross level information
about the world state and the clients.
WriteGame is called every time a level is exited.
ReadGame is called on a loadgame. */
void (*WriteGame)(const char *filename, qboolean autosave);
void (*ReadGame)(const char *filename);
/* ReadLevel is called after the default
map information has been loaded with
SpawnEntities */
void (*WriteLevel)(const char *filename);
void (*ReadLevel)(const char *filename);
qboolean (*ClientConnect)(edict_t *ent, char *userinfo);
void (*ClientBegin)(edict_t *ent);
void (*ClientUserinfoChanged)(edict_t *ent, char *userinfo);
void (*ClientDisconnect)(edict_t *ent);
void (*ClientCommand)(edict_t *ent);
void (*ClientThink)(edict_t *ent, usercmd_t *cmd);
void (*RunFrame)(void);
/* ServerCommand will be called when an "sv <command>"
command is issued on the server console. The game can
issue gi.argc() / gi.argv() commands to get the rest
of the parameters */
void (*ServerCommand)(void);
/* global variables shared between game and server */
/* The edict array is allocated in the game dll so it
can vary in size from one game to another.
The size will be fixed when ge->Init() is called */
struct edict_s *edicts;
int edict_size;
int num_edicts; /* current number, <= max_edicts */
int max_edicts;
} game_export_t;
#endif /* ROGUE_GAME_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,467 +0,0 @@
/*
* Copyright (c) ZeniMax Media Inc.
* Licensed under the GNU General Public License 2.0.
*/
/*
* =======================================================================
*
* Muzzle flash posititions.
*
* =======================================================================
*/
#include "../header/shared.h"
vec3_t monster_flash_offset[] = {
/* flash 0 is not used */
{0.0, 0.0, 0.0},
/* MZ2_TANK_BLASTER_1 1 */
{20.7, -18.5, 28.7},
/* MZ2_TANK_BLASTER_2 2 */
{16.6, -21.5, 30.1},
/* MZ2_TANK_BLASTER_3 3 */
{11.8, -23.9, 32.1},
/* MZ2_TANK_MACHINEGUN_1 4 */
{22.9, -0.7, 25.3},
/* MZ2_TANK_MACHINEGUN_2 5 */
{22.2, 6.2, 22.3},
/* MZ2_TANK_MACHINEGUN_3 6 */
{19.4, 13.1, 18.6},
/* MZ2_TANK_MACHINEGUN_4 7 */
{19.4, 18.8, 18.6},
/* MZ2_TANK_MACHINEGUN_5 8 */
{17.9, 25.0, 18.6},
/* MZ2_TANK_MACHINEGUN_6 9 */
{14.1, 30.5, 20.6},
/* MZ2_TANK_MACHINEGUN_7 10 */
{9.3, 35.3, 22.1},
/* MZ2_TANK_MACHINEGUN_8 11 */
{4.7, 38.4, 22.1},
/* MZ2_TANK_MACHINEGUN_9 12 */
{-1.1, 40.4, 24.1},
/* MZ2_TANK_MACHINEGUN_10 13 */
{-6.5, 41.2, 24.1},
/* MZ2_TANK_MACHINEGUN_11 14 */
{3.2, 40.1, 24.7},
/* MZ2_TANK_MACHINEGUN_12 15 */
{11.7, 36.7, 26.0},
/* MZ2_TANK_MACHINEGUN_13 16 */
{18.9, 31.3, 26.0},
/* MZ2_TANK_MACHINEGUN_14 17 */
{24.4, 24.4, 26.4},
/* MZ2_TANK_MACHINEGUN_15 18 */
{27.1, 17.1, 27.2},
/* MZ2_TANK_MACHINEGUN_16 19 */
{28.5, 9.1, 28.0},
/* MZ2_TANK_MACHINEGUN_17 20 */
{27.1, 2.2, 28.0},
/* MZ2_TANK_MACHINEGUN_18 21 */
{24.9, -2.8, 28.0},
/* MZ2_TANK_MACHINEGUN_19 22 */
{21.6, -7.0, 26.4},
/* MZ2_TANK_ROCKET_1 23 */
{6.2, 29.1, 49.1},
/* MZ2_TANK_ROCKET_2 24 */
{6.9, 23.8, 49.1},
/* MZ2_TANK_ROCKET_3 25 */
{8.3, 17.8, 49.5},
/* MZ2_INFANTRY_MACHINEGUN_1 26 */
{26.6, 7.1, 13.1},
/* MZ2_INFANTRY_MACHINEGUN_2 27 */
{18.2, 7.5, 15.4},
/* MZ2_INFANTRY_MACHINEGUN_3 28 */
{17.2, 10.3, 17.9},
/* MZ2_INFANTRY_MACHINEGUN_4 29 */
{17.0, 12.8, 20.1},
/* MZ2_INFANTRY_MACHINEGUN_5 30 */
{15.1, 14.1, 21.8},
/* MZ2_INFANTRY_MACHINEGUN_6 31 */
{11.8, 17.2, 23.1},
/* MZ2_INFANTRY_MACHINEGUN_7 32 */
{11.4, 20.2, 21.0},
/* MZ2_INFANTRY_MACHINEGUN_8 33 */
{9.0, 23.0, 18.9},
/* MZ2_INFANTRY_MACHINEGUN_9 34 */
{13.9, 18.6, 17.7},
/* MZ2_INFANTRY_MACHINEGUN_10 35 */
{15.4, 15.6, 15.8},
/* MZ2_INFANTRY_MACHINEGUN_11 36 */
{10.2, 15.2, 25.1},
/* MZ2_INFANTRY_MACHINEGUN_12 37 */
{-1.9, 15.1, 28.2},
/* MZ2_INFANTRY_MACHINEGUN_13 38 */
{-12.4, 13.0, 20.2},
/* MZ2_SOLDIER_BLASTER_1 39 */
{10.6 * 1.2, 7.7 * 1.2, 7.8 * 1.2},
/* MZ2_SOLDIER_BLASTER_2 40 */
{21.1 * 1.2, 3.6 * 1.2, 19.0 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_1 41 */
{10.6 * 1.2, 7.7 * 1.2, 7.8 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_2 42 */
{21.1 * 1.2, 3.6 * 1.2, 19.0 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_1 43 */
{10.6 * 1.2, 7.7 * 1.2, 7.8 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_2 44 */
{21.1 * 1.2, 3.6 * 1.2, 19.0 * 1.2},
/* MZ2_GUNNER_MACHINEGUN_1 45 */
{30.1 * 1.15, 3.9 * 1.15, 19.6 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_2 46 */
{29.1 * 1.15, 2.5 * 1.15, 20.7 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_3 47 */
{28.2 * 1.15, 2.5 * 1.15, 22.2 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_4 48 */
{28.2 * 1.15, 3.6 * 1.15, 22.0 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_5 49 */
{26.9 * 1.15, 2.0 * 1.15, 23.4 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_6 50 */
{26.5 * 1.15, 0.6 * 1.15, 20.8 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_7 51 */
{26.9 * 1.15, 0.5 * 1.15, 21.5 * 1.15},
/* MZ2_GUNNER_MACHINEGUN_8 52 */
{29.0 * 1.15, 2.4 * 1.15, 19.5 * 1.15},
/* MZ2_GUNNER_GRENADE_1 53 */
{4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15},
/* MZ2_GUNNER_GRENADE_2 54 */
{4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15},
/* MZ2_GUNNER_GRENADE_3 55 */
{4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15},
/* MZ2_GUNNER_GRENADE_4 56 */
{4.6 * 1.15, -16.8 * 1.15, 7.3 * 1.15},
/* MZ2_CHICK_ROCKET_1 57 */
{24.8, -9.0, 39.0},
/* MZ2_FLYER_BLASTER_1 58 */
{12.1, 13.4, -14.5},
/* MZ2_FLYER_BLASTER_2 59 */
{12.1, -7.4, -14.5},
/* MZ2_MEDIC_BLASTER_1 60 */
{12.1, 5.4, 16.5},
/* MZ2_GLADIATOR_RAILGUN_1 61 */
{30.0, 18.0, 28.0},
/* MZ2_HOVER_BLASTER_1 62 */
{32.5, -0.8, 10.0},
/* MZ2_ACTOR_MACHINEGUN_1 63 */
{18.4, 7.4, 9.6},
/* MZ2_SUPERTANK_MACHINEGUN_1 64 */
{30.0, 30.0, 88.5},
/* MZ2_SUPERTANK_MACHINEGUN_2 65 */
{30.0, 30.0, 88.5},
/* MZ2_SUPERTANK_MACHINEGUN_3 66 */
{30.0, 30.0, 88.5},
/* MZ2_SUPERTANK_MACHINEGUN_4 67 */
{30.0, 30.0, 88.5},
/* MZ2_SUPERTANK_MACHINEGUN_5 68 */
{30.0, 30.0, 88.5},
/* MZ2_SUPERTANK_MACHINEGUN_6 69 */
{30.0, 30.0, 88.5},
/* MZ2_SUPERTANK_ROCKET_1 70 */
{16.0, -22.5, 91.2},
/* MZ2_SUPERTANK_ROCKET_2 71 */
{16.0, -33.4, 86.7},
/* MZ2_SUPERTANK_ROCKET_3 72 */
{16.0, -42.8, 83.3},
/* MZ2_BOSS2_MACHINEGUN_L1 73 */
{32, -40, 70},
/* MZ2_BOSS2_MACHINEGUN_L2 74 */
{32, -40, 70},
/* MZ2_BOSS2_MACHINEGUN_L3 75 */
{32, -40, 70},
/* MZ2_BOSS2_MACHINEGUN_L4 76 */
{32, -40, 70},
/* MZ2_BOSS2_MACHINEGUN_L5 77 */
{32, -40, 70},
/* MZ2_BOSS2_ROCKET_1 78 */
{22.0, 16.0, 10.0},
/* MZ2_BOSS2_ROCKET_2 79 */
{22.0, 8.0, 10.0},
/* MZ2_BOSS2_ROCKET_3 80 */
{22.0, -8.0, 10.0},
/* MZ2_BOSS2_ROCKET_4 81 */
{22.0, -16.0, 10.0},
/* MZ2_FLOAT_BLASTER_1 82 */
{32.5, -0.8, 10},
/* MZ2_SOLDIER_BLASTER_3 83 */
{20.8 * 1.2, 10.1 * 1.2, -2.7 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_3 84 */
{20.8 * 1.2, 10.1 * 1.2, -2.7 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_3 85 */
{20.8 * 1.2, 10.1 * 1.2, -2.7 * 1.2},
/* MZ2_SOLDIER_BLASTER_4 86 */
{7.6 * 1.2, 9.3 * 1.2, 0.8 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_4 87 */
{7.6 * 1.2, 9.3 * 1.2, 0.8 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_4 88 */
{7.6 * 1.2, 9.3 * 1.2, 0.8 * 1.2},
/* MZ2_SOLDIER_BLASTER_5 89 */
{30.5 * 1.2, 9.9 * 1.2, -18.7 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_5 90 */
{30.5 * 1.2, 9.9 * 1.2, -18.7 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_5 91 */
{30.5 * 1.2, 9.9 * 1.2, -18.7 * 1.2},
/* MZ2_SOLDIER_BLASTER_6 92 */
{27.6 * 1.2, 3.4 * 1.2, -10.4 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_6 93 */
{27.6 * 1.2, 3.4 * 1.2, -10.4 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_6 94 */
{27.6 * 1.2, 3.4 * 1.2, -10.4 * 1.2},
/* MZ2_SOLDIER_BLASTER_7 95 */
{28.9 * 1.2, 4.6 * 1.2, -8.1 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_7 96 */
{28.9 * 1.2, 4.6 * 1.2, -8.1 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_7 97 */
{28.9 * 1.2, 4.6 * 1.2, -8.1 * 1.2},
/* MZ2_SOLDIER_BLASTER_8 98 */
{31.5 * 1.2, 9.6 * 1.2, 10.1 * 1.2},
/* MZ2_SOLDIER_SHOTGUN_8 99 */
{34.5 * 1.2, 9.6 * 1.2, 6.1 * 1.2},
/* MZ2_SOLDIER_MACHINEGUN_8 100 */
{34.5 * 1.2, 9.6 * 1.2, 6.1 * 1.2},
/* MZ2_MAKRON_BFG 101 */
{17, -19.5, 62.9},
/* MZ2_MAKRON_BLASTER_1 102 */
{-3.6, -24.1, 59.5},
/* MZ2_MAKRON_BLASTER_2 103 */
{-1.6, -19.3, 59.5},
/* MZ2_MAKRON_BLASTER_3 104 */
{-0.1, -14.4, 59.5},
/* MZ2_MAKRON_BLASTER_4 105 */
{2.0, -7.6, 59.5},
/* MZ2_MAKRON_BLASTER_5 106 */
{3.4, 1.3, 59.5},
/* MZ2_MAKRON_BLASTER_6 107 */
{3.7, 11.1, 59.5},
/* MZ2_MAKRON_BLASTER_7 108 */
{-0.3, 22.3, 59.5},
/* MZ2_MAKRON_BLASTER_8 109 */
{-6, 33, 59.5},
/* MZ2_MAKRON_BLASTER_9 110 */
{-9.3, 36.4, 59.5},
/* MZ2_MAKRON_BLASTER_10 111 */
{-7, 35, 59.5},
/* MZ2_MAKRON_BLASTER_11 112 */
{-2.1, 29, 59.5},
/* MZ2_MAKRON_BLASTER_12 113 */
{3.9, 17.3, 59.5},
/* MZ2_MAKRON_BLASTER_13 114 */
{6.1, 5.8, 59.5},
/* MZ2_MAKRON_BLASTER_14 115 */
{5.9, -4.4, 59.5},
/* MZ2_MAKRON_BLASTER_15 116 */
{4.2, -14.1, 59.5},
/* MZ2_MAKRON_BLASTER_16 117 */
{2.4, -18.8, 59.5},
/* MZ2_MAKRON_BLASTER_17 118 */
{-1.8, -25.5, 59.5},
/* MZ2_MAKRON_RAILGUN_1 119 */
{-17.3, 7.8, 72.4},
/* MZ2_JORG_MACHINEGUN_L1 120 */
{78.5, -47.1, 96},
/* MZ2_JORG_MACHINEGUN_L2 121 */
{78.5, -47.1, 96},
/* MZ2_JORG_MACHINEGUN_L3 122 */
{78.5, -47.1, 96},
/* MZ2_JORG_MACHINEGUN_L4 123 */
{78.5, -47.1, 96},
/* MZ2_JORG_MACHINEGUN_L5 124 */
{78.5, -47.1, 96},
/* MZ2_JORG_MACHINEGUN_L6 125 */
{78.5, -47.1, 96},
/* MZ2_JORG_MACHINEGUN_R1 126 */
{78.5, 46.7, 96},
/* MZ2_JORG_MACHINEGUN_R2 127 */
{78.5, 46.7, 96},
/* MZ2_JORG_MACHINEGUN_R3 128 */
{78.5, 46.7, 96},
/* MZ2_JORG_MACHINEGUN_R4 129 */
{78.5, 46.7, 96},
/* MZ2_JORG_MACHINEGUN_R5 130 */
{78.5, 46.7, 96},
/* MZ2_JORG_MACHINEGUN_R6 131 */
{78.5, 46.7, 96},
/* MZ2_JORG_BFG_1 132 */
{6.3, -9, 111.2},
/* MZ2_BOSS2_MACHINEGUN_R1 73 */
{32, 40, 70},
/* MZ2_BOSS2_MACHINEGUN_R2 74 */
{32, 40, 70},
/* MZ2_BOSS2_MACHINEGUN_R3 75 */
{32, 40, 70},
/* MZ2_BOSS2_MACHINEGUN_R4 76 */
{32, 40, 70},
/* MZ2_BOSS2_MACHINEGUN_R5 77 */
{32, 40, 70},
/* MZ2_CARRIER_MACHINEGUN_L1 */
{56, -32, 32},
/* MZ2_CARRIER_MACHINEGUN_R1 */
{56, 32, 32},
/* MZ2_CARRIER_GRENADE */
{42, 24, 50},
/* MZ2_TURRET_MACHINEGUN 141 */
{16, 0, 0},
/* MZ2_TURRET_ROCKET 142 */
{16, 0, 0},
/* MZ2_TURRET_BLASTER 143 */
{16, 0, 0},
/* MZ2_STALKER_BLASTER 144 */
{24, 0, 6},
/* MZ2_DAEDALUS_BLASTER 145 */
{32.5, -0.8, 10.0},
/* MZ2_MEDIC_BLASTER_2 146 */
{12.1, 5.4, 16.5},
/* MZ2_CARRIER_RAILGUN 147 */
{32, 0, 6},
/* MZ2_WIDOW_DISRUPTOR 148 */
{57.72, 14.50, 88.81},
/* MZ2_WIDOW_BLASTER 149 */
{56, 32, 32},
/* MZ2_WIDOW_RAIL 150 */
{62, -20, 84},
/* MZ2_WIDOW_PLASMABEAM 151 */
{32, 0, 6},
/* MZ2_CARRIER_MACHINEGUN_L2 152 */
{61, -32, 12},
/* MZ2_CARRIER_MACHINEGUN_R2 153 */
{61, 32, 12},
/* MZ2_WIDOW_RAIL_LEFT 154 */
{17, -62, 91},
/* MZ2_WIDOW_RAIL_RIGHT 155 */
{68, 12, 86},
/* MZ2_WIDOW_BLASTER_SWEEP1 156 */
{47.5, 56, 89},
/* MZ2_WIDOW_BLASTER_SWEEP2 157 */
{54, 52, 91},
/* MZ2_WIDOW_BLASTER_SWEEP3 158 */
{58, 40, 91},
/* MZ2_WIDOW_BLASTER_SWEEP4 159 */
{68, 30, 88},
/* MZ2_WIDOW_BLASTER_SWEEP5 160 */
{74, 20, 88},
/* MZ2_WIDOW_BLASTER_SWEEP6 161 */
{73, 11, 87},
/* MZ2_WIDOW_BLASTER_SWEEP7 162 */
{73, 3, 87},
/* MZ2_WIDOW_BLASTER_SWEEP8 163 */
{70, -12, 87},
/* MZ2_WIDOW_BLASTER_SWEEP9 164 */
{67, -20, 90},
/* MZ2_WIDOW_BLASTER_100 165 */
{-20, 76, 90},
/* MZ2_WIDOW_BLASTER_90 166 */
{-8, 74, 90},
/* MZ2_WIDOW_BLASTER_80 167 */
{0, 72, 90},
/* MZ2_WIDOW_BLASTER_70 168 d06 */
{10, 71, 89},
/* MZ2_WIDOW_BLASTER_60 169 d07 */
{23, 70, 87},
/* MZ2_WIDOW_BLASTER_50 170 d08 */
{32, 64, 85},
/* MZ2_WIDOW_BLASTER_40 171 */
{40, 58, 84},
/* MZ2_WIDOW_BLASTER_30 172 d10 */
{48, 50, 83},
/* MZ2_WIDOW_BLASTER_20 173 */
{54, 42, 82},
/* MZ2_WIDOW_BLASTER_10 174 d12 */
{56, 34, 82},
/* MZ2_WIDOW_BLASTER_0 175 */
{58, 26, 82},
/* MZ2_WIDOW_BLASTER_10L 176 d14 */
{60, 16, 82},
/* MZ2_WIDOW_BLASTER_20L 177 */
{59, 6, 81},
/* MZ2_WIDOW_BLASTER_30L 178 d16 */
{58, -2, 80},
/* MZ2_WIDOW_BLASTER_40L 179 */
{57, -10, 79},
/* MZ2_WIDOW_BLASTER_50L 180 d18 */
{54, -18, 78},
/* MZ2_WIDOW_BLASTER_60L 181 */
{42, -32, 80},
/* MZ2_WIDOW_BLASTER_70L 182 d20 */
{36, -40, 78},
/* MZ2_WIDOW_RUN_1 183 */
{68.4, 10.88, 82.08},
/* MZ2_WIDOW_RUN_2 184 */
{68.51, 8.64, 85.14},
/* MZ2_WIDOW_RUN_3 185 */
{68.66, 6.38, 88.78},
/* MZ2_WIDOW_RUN_4 186 */
{68.73, 5.1, 84.47},
/* MZ2_WIDOW_RUN_5 187 */
{68.82, 4.79, 80.52},
/* MZ2_WIDOW_RUN_6 188 */
{68.77, 6.11, 85.37},
/* MZ2_WIDOW_RUN_7 189 */
{68.67, 7.99, 90.24},
/* MZ2_WIDOW_RUN_8 190 */
{68.55, 9.54, 87.36},
/* MZ2_CARRIER_ROCKET_1 191 */
{0, 0, -5},
/* MZ2_CARRIER_ROCKET_2 192 */
{0, 0, -5},
/* MZ2_CARRIER_ROCKET_3 193 */
{0, 0, -5},
/* MZ2_CARRIER_ROCKET_4 194 */
{0, 0, -5},
/* MZ2_WIDOW2_BEAMER_1 195 */
/* { 72.13, -17.63, 93.77 }, */
{69.00, -17.63, 93.77},
/* MZ2_WIDOW2_BEAMER_2 196 */
/* { 71.46, -17.08, 89.82 }, */
{69.00, -17.08, 89.82},
/* MZ2_WIDOW2_BEAMER_3 197 */
/* { 71.47, -18.40, 90.70 }, */
{69.00, -18.40, 90.70},
/* MZ2_WIDOW2_BEAMER_4 198 */
/* { 71.96, -18.34, 94.32 }, */
{69.00, -18.34, 94.32},
/* MZ2_WIDOW2_BEAMER_5 199 */
/* { 72.25, -18.30, 97.98 }, */
{69.00, -18.30, 97.98},
/* MZ2_WIDOW2_BEAM_SWEEP_1 200 */
{45.04, -59.02, 92.24},
/* MZ2_WIDOW2_BEAM_SWEEP_2 201 */
{50.68, -54.70, 91.96},
/* MZ2_WIDOW2_BEAM_SWEEP_3 202 */
{56.57, -47.72, 91.65},
/* MZ2_WIDOW2_BEAM_SWEEP_4 203 */
{61.75, -38.75, 91.38},
/* MZ2_WIDOW2_BEAM_SWEEP_5 204 */
{65.55, -28.76, 91.24},
/* MZ2_WIDOW2_BEAM_SWEEP_6 205 */
{67.79, -18.90, 91.22},
/* MZ2_WIDOW2_BEAM_SWEEP_7 206 */
{68.60, -9.52, 91.23},
/* MZ2_WIDOW2_BEAM_SWEEP_8 207 */
{68.08, 0.18, 91.32},
/* MZ2_WIDOW2_BEAM_SWEEP_9 208 */
{66.14, 9.79, 91.44},
/* MZ2_WIDOW2_BEAM_SWEEP_10 209 */
{62.77, 18.91, 91.65},
/* MZ2_WIDOW2_BEAM_SWEEP_11 210 */
{58.29, 27.11, 92.00},
/* end of table */
{0.0, 0.0, 0.0}
};

View File

@ -1,97 +0,0 @@
/*
* KISS PRNG (c) 2011 Shinobu
*
* This file was optained from zuttobenkyou.wordpress.com
* and modified by the Yamagi Quake II developers.
*
* LICENSE: Public domain
*
* =======================================================================
*
* KISS PRNG, as devised by Dr. George Marsaglia
*
* =======================================================================
*/
#include <stdint.h>
#define QSIZE 0x200000
#define CNG (cng = 6906969069ULL * cng + 13579)
#define XS (xs ^= (xs << 13), xs ^= (xs >> 17), xs ^= (xs << 43))
#define KISS (B64MWC() + CNG + XS)
static uint64_t QARY[QSIZE];
static int j;
static uint64_t carry;
static uint64_t xs;
static uint64_t cng;
uint64_t
B64MWC(void)
{
uint64_t t, x;
j = (j + 1) & (QSIZE - 1);
x = QARY[j];
t = (x << 28) + carry;
carry = (x >> 36) - (t < x);
return QARY[j] = t - x;
}
/*
* Generate a pseudorandom
* integer >0.
*/
int
randk(void)
{
int r;
r = (int)KISS;
r = (r < 0) ? (r * -1) : r;
return r;
}
/*
* Generate a pseudorandom
* signed float between
* 0 and 1.
*/
float
frandk(void)
{
return (randk()&32767)* (1.0/32767);
}
/* Generate a pseudorandom
* float between -1 and 1.
*/
float
crandk(void)
{
return (randk()&32767)* (2.0/32767) - 1;
}
/*
* Seeds the PRNG
*/
void
randk_seed(void)
{
uint64_t i;
/* Seed QARY[] with CNG+XS: */
for (i = 0; i < QSIZE; i++)
{
QARY[i] = CNG + XS;
}
/* Run through several rounds
to warm up the state */
for (i = 0; i < 256; i++)
{
randk();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -182,7 +182,7 @@ ClientEndServerFrames(void)
edict_t *ent;
/* calc the player views now that all
pushing and damage has been added */
pushing and damage has been added */
for (i = 0; i < maxclients->value; i++)
{
ent = g_edicts + 1 + i;
@ -287,8 +287,10 @@ EndDMLevel(void)
ent = G_Find(NULL, FOFS(classname), "target_changelevel");
if (!ent)
{ /* the map designer didn't include a changelevel,
so create a fake ent that goes back to the same level */
{
/* the map designer didn't include a changelevel,
so create a fake ent that goes back to the same
level */
BeginIntermission(CreateTargetChangeLevel(level.mapname));
return;
}

View File

@ -64,7 +64,7 @@ check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed)
{
VectorSubtract(tr.endpos, start, v);
eta = (VectorLength(v) - tr.ent->maxs[0]) / speed;
tr.ent->monsterinfo.dodge(tr.ent, self, eta);
tr.ent->monsterinfo.dodge(tr.ent, self, eta, &tr);
}
}

View File

@ -462,7 +462,7 @@ typedef struct
void (*search)(edict_t *self);
void (*walk)(edict_t *self);
void (*run)(edict_t *self);
void (*dodge)(edict_t *self, edict_t *other, float eta);
void (*dodge)(edict_t *self, edict_t *other, float eta, trace_t *tr);
void (*attack)(edict_t *self);
void (*melee)(edict_t *self);
void (*sight)(edict_t *self, edict_t *other);
@ -839,6 +839,8 @@ void monster_fire_ionripper(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, int flashtype, int effect);
void monster_fire_heat(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, int flashtype);
void monster_fire_heatbeam(edict_t *self, vec3_t start, vec3_t dir, vec3_t offset,
int damage, int kick, int flashtype);
void monster_dabeam(edict_t *self);
void monster_fire_blueblaster(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, int flashtype, int effect);
@ -909,6 +911,8 @@ void fire_ionripper(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
int speed, int effect);
void fire_heat(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed,
float damage_radius, int radius_damage);
void fire_heatbeam(edict_t *self, vec3_t start, vec3_t aimdir, vec3_t offset,
int damage, int kick, qboolean monster);
void fire_blueblaster(edict_t *self, vec3_t start, vec3_t aimdir, int damage,
int speed, int effect);
void fire_plasma(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed,
@ -1008,6 +1012,8 @@ void fire_tracker(edict_t *self, vec3_t start, vec3_t dir, int damage,
int speed, edict_t *enemy);
/* g_newai.c */
qboolean blind_rocket_ok(edict_t *self, vec3_t start, vec3_t right, vec3_t target, float ofs,
vec3_t dir);
qboolean blocked_checkplat(edict_t *self, float dist);
qboolean blocked_checkjump(edict_t *self, float dist, float maxDown, float maxUp);
qboolean blocked_checknewenemy(edict_t *self);

View File

@ -395,7 +395,8 @@ mmove_t brain_move_duck =
};
void
brain_dodge(edict_t *self, edict_t *attacker, float eta)
brain_dodge(edict_t *self, edict_t *attacker, float eta,
trace_t *tr /* unused */)
{
if (!self || !attacker)
{

View File

@ -629,7 +629,8 @@ mmove_t chick_move_duck =
};
void
chick_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
chick_dodge(edict_t *self, edict_t *attacker, float eta /* unused */,
trace_t *tr /* unused */)
{
if (!self || !attacker)
{

View File

@ -626,7 +626,8 @@ mmove_t gunner_move_duck =
};
void
gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
gunner_dodge(edict_t *self, edict_t *attacker, float eta /* unused */,
trace_t *tr /* unused */)
{
if (!self || !attacker)
{

View File

@ -645,7 +645,8 @@ mmove_t infantry_move_duck =
};
void
infantry_dodge(edict_t *self, edict_t *attacker, float eta /* unused */)
infantry_dodge(edict_t *self, edict_t *attacker, float eta /* unused */,
trace_t *tr /* unused */)
{
if (!self || !attacker)
{

View File

@ -706,7 +706,8 @@ mmove_t medic_move_duck =
};
void
medic_dodge(edict_t *self, edict_t *attacker, float eta)
medic_dodge(edict_t *self, edict_t *attacker, float eta,
trace_t *tr /* unused */)
{
if (!self || !attacker)
{

View File

@ -1115,7 +1115,8 @@ mmove_t soldier_move_duck =
};
void
soldier_dodge(edict_t *self, edict_t *attacker, float eta)
soldier_dodge(edict_t *self, edict_t *attacker, float eta,
trace_t *tr /* unused */)
{
float r;

View File

@ -247,7 +247,7 @@ extern void soldier_die ( edict_t * self , edict_t * inflictor , edict_t * attac
extern void soldier_dead ( edict_t * self ) ;
extern void soldier_fire7 ( edict_t * self ) ;
extern void soldier_fire6 ( edict_t * self ) ;
extern void soldier_dodge ( edict_t * self , edict_t * attacker , float eta ) ;
extern void soldier_dodge ( edict_t * self , edict_t * attacker , float eta, trace_t *tr ) ;
extern void soldier_duck_hold ( edict_t * self ) ;
extern void soldier_sight ( edict_t * self , edict_t * other ) ;
extern void soldier_attack ( edict_t * self ) ;
@ -336,7 +336,7 @@ extern void medic_hook_retract ( edict_t * self ) ;
extern void medic_cable_attack ( edict_t * self ) ;
extern void medic_hook_launch ( edict_t * self ) ;
extern void medic_continue ( edict_t * self ) ;
extern void medic_dodge ( edict_t * self , edict_t * attacker , float eta ) ;
extern void medic_dodge ( edict_t * self , edict_t * attacker , float eta, trace_t *tr ) ;
extern void medic_duck_up ( edict_t * self ) ;
extern void medic_duck_hold ( edict_t * self ) ;
extern void medic_duck_down ( edict_t * self ) ;
@ -374,7 +374,7 @@ extern void infantry_smack ( edict_t * self ) ;
extern void infantry_swing ( edict_t * self ) ;
extern void infantry_fire ( edict_t * self ) ;
extern void infantry_cock_gun ( edict_t * self ) ;
extern void infantry_dodge ( edict_t * self , edict_t * attacker , float eta ) ;
extern void infantry_dodge ( edict_t * self , edict_t * attacker , float eta, trace_t *tr ) ;
extern void infantry_duck_up ( edict_t * self ) ;
extern void infantry_duck_hold ( edict_t * self ) ;
extern void infantry_duck_down ( edict_t * self ) ;
@ -409,7 +409,7 @@ extern void gunner_attack ( edict_t * self ) ;
extern void GunnerGrenade ( edict_t * self ) ;
extern void GunnerFire ( edict_t * self ) ;
extern void gunner_opengun ( edict_t * self ) ;
extern void gunner_dodge ( edict_t * self , edict_t * attacker , float eta ) ;
extern void gunner_dodge ( edict_t * self , edict_t * attacker , float eta, trace_t *tr) ;
extern void gunner_duck_up ( edict_t * self ) ;
extern void gunner_duck_hold ( edict_t * self ) ;
extern void gunner_duck_down ( edict_t * self ) ;
@ -502,7 +502,7 @@ extern void ChickReload ( edict_t * self ) ;
extern void Chick_PreAttack1 ( edict_t * self ) ;
extern void ChickRocket ( edict_t * self ) ;
extern void ChickSlash ( edict_t * self ) ;
extern void chick_dodge ( edict_t * self , edict_t * attacker , float eta ) ;
extern void chick_dodge ( edict_t * self , edict_t * attacker , float eta, trace_t *tr ) ;
extern void chick_duck_up ( edict_t * self ) ;
extern void chick_duck_hold ( edict_t * self ) ;
extern void chick_duck_down ( edict_t * self ) ;
@ -528,7 +528,7 @@ extern void brain_hit_left ( edict_t * self ) ;
extern void brain_swing_left ( edict_t * self ) ;
extern void brain_hit_right ( edict_t * self ) ;
extern void brain_swing_right ( edict_t * self ) ;
extern void brain_dodge ( edict_t * self , edict_t * attacker , float eta ) ;
extern void brain_dodge ( edict_t * self , edict_t * attacker , float eta, trace_t *tr ) ;
extern void brain_duck_up ( edict_t * self ) ;
extern void brain_duck_hold ( edict_t * self ) ;
extern void brain_duck_down ( edict_t * self ) ;

View File

@ -41,6 +41,7 @@ edict_t *g_edicts;
cvar_t *deathmatch;
cvar_t *coop;
cvar_t *coop_baseq2; /* treat spawnflags according to baseq2 rules */
cvar_t *coop_pickup_weapons;
cvar_t *coop_elevator_delay;
cvar_t *dmflags;
@ -84,8 +85,15 @@ cvar_t *flood_persecond;
cvar_t *flood_waitdelay;
cvar_t *sv_maplist;
cvar_t *sv_stopspeed;
cvar_t *gib_on;
cvar_t *g_showlogic;
cvar_t *gamerules;
cvar_t *huntercam;
cvar_t *strong_mines;
cvar_t *randomrespawn;
cvar_t *g_disruptor;
cvar_t *aimfix;
cvar_t *g_machinegun_norecoil;
@ -195,7 +203,7 @@ ClientEndServerFrames(void)
edict_t *ent;
/* calc the player views now that all
pushing and damage has been added */
pushing and damage has been added */
for (i = 0; i < maxclients->value; i++)
{
ent = g_edicts + 1 + i;
@ -300,8 +308,10 @@ EndDMLevel(void)
ent = G_Find(NULL, FOFS(classname), "target_changelevel");
if (!ent)
{ /* the map designer didn't include a changelevel,
so create a fake ent that goes back to the same level */
{
/* the map designer didn't include a changelevel,
so create a fake ent that goes back to the same
level */
BeginIntermission(CreateTargetChangeLevel(level.mapname));
return;
}
@ -354,6 +364,14 @@ CheckDMRules(void)
return;
}
if (gamerules && gamerules->value && DMGame.CheckDMRules)
{
if (DMGame.CheckDMRules())
{
return;
}
}
if (timelimit->value)
{
if (level.time >= timelimit->value * 60)

View File

@ -3,8 +3,7 @@
* Licensed under the GNU General Public License 2.0.
*/
/*
* =======================================================================
/* =======================================================================
*
* Monster utility functions.
*
@ -100,7 +99,7 @@ monster_fire_tracker(edict_t *self, vec3_t start, vec3_t dir, int damage,
}
void
monster_fire_heat(edict_t *self, vec3_t start, vec3_t dir, vec3_t offset,
monster_fire_heatbeam(edict_t *self, vec3_t start, vec3_t dir, vec3_t offset,
int damage, int kick, int flashtype)
{
if (!self)
@ -108,7 +107,7 @@ monster_fire_heat(edict_t *self, vec3_t start, vec3_t dir, vec3_t offset,
return;
}
fire_heat(self, start, dir, offset, damage, kick, true);
fire_heatbeam(self, start, dir, offset, damage, kick, true);
gi.WriteByte(svc_muzzleflash2);
gi.WriteShort(self - g_edicts);

View File

@ -1753,7 +1753,7 @@ monster_jump_finished(edict_t *self)
}
qboolean
blind_rocket_ok (edict_t *self, vec3_t start, vec3_t right, vec3_t target, float ofs,
blind_rocket_ok(edict_t *self, vec3_t start, vec3_t right, vec3_t target, float ofs,
vec3_t dir)
{
trace_t tr;

View File

@ -1482,7 +1482,7 @@ fire_beams(edict_t *self, vec3_t start, vec3_t aimdir, vec3_t offset,
}
void
fire_heat(edict_t *self, vec3_t start, vec3_t aimdir, vec3_t offset,
fire_heatbeam(edict_t *self, vec3_t start, vec3_t aimdir, vec3_t offset,
int damage, int kick, qboolean monster)
{
if (!self)

1
src/rogue/header/game.h Normal file
View File

@ -0,0 +1 @@
#include "../../game/header/game.h"

1
src/rogue/header/local.h Normal file
View File

@ -0,0 +1 @@
#include "../../game/header/local.h"

View File

@ -844,14 +844,14 @@ calcJumpAngle(vec3_t start, vec3_t end, float velocity, vec3_t angles)
one = one - (float)sin(U);
angles[0] = (float)asin(one);
if (_isnan(angles[0]))
if (isnan(angles[0]))
{
angles[2] = 1.0;
}
angles[1] = (float)PI - angles[0];
if (_isnan(angles[1]))
if (isnan(angles[1]))
{
angles[2] = 1.0;
}
@ -869,14 +869,14 @@ calcJumpAngle(vec3_t start, vec3_t end, float velocity, vec3_t angles)
one = one / (velocity * velocity);
angles[0] = (float)asin(one);
if (_isnan(angles[0]))
if (isnan(angles[0]))
{
angles[2] = 1.0;
}
angles[1] = (float)PI - angles[0];
if (_isnan(angles[1]))
if (isnan(angles[1]))
{
angles[2] = 1.0;
}
@ -1016,7 +1016,7 @@ stalker_do_pounce(edict_t *self, vec3_t dest)
{
calcJumpAngle(self->s.origin, jumpLZ, velocity, jumpAngles);
if ((!_isnan(jumpAngles[0])) || (!_isnan(jumpAngles[1])))
if ((!isnan(jumpAngles[0])) || (!isnan(jumpAngles[1])))
{
break;
}
@ -1024,7 +1024,7 @@ stalker_do_pounce(edict_t *self, vec3_t dest)
velocity += 200;
}
if (!preferHighJump && (!_isnan(jumpAngles[0])))
if (!preferHighJump && (!isnan(jumpAngles[0])))
{
AngleVectors(self->s.angles, forward, right, NULL);
VectorNormalize(forward);
@ -1034,7 +1034,7 @@ stalker_do_pounce(edict_t *self, vec3_t dest)
return 1;
}
if (!_isnan(jumpAngles[1]))
if (!isnan(jumpAngles[1]))
{
AngleVectors(self->s.angles, forward, right, NULL);
VectorNormalize(forward);

View File

@ -146,7 +146,7 @@ Widow2Beam(edict_t *self)
target[2] += self->enemy->viewheight - 10;
VectorSubtract(target, start, forward);
VectorNormalize(forward);
monster_fire_heat(self, start, forward, vec3_origin, 10, 50, flashnum);
monster_fire_heatbeam(self, start, forward, vec3_origin, 10, 50, flashnum);
}
else if ((self->s.frame >= FRAME_spawn04) && (self->s.frame <= FRAME_spawn14))
{
@ -163,7 +163,7 @@ Widow2Beam(edict_t *self)
vec[YAW] -= sweep_angles[flashnum - MZ2_WIDOW2_BEAM_SWEEP_1];
AngleVectors(vec, forward, NULL, NULL);
monster_fire_heat(self, start, forward, vec3_origin, 10, 50, flashnum);
monster_fire_heatbeam(self, start, forward, vec3_origin, 10, 50, flashnum);
}
else
{
@ -177,7 +177,7 @@ Widow2Beam(edict_t *self)
VectorSubtract(target, start, forward);
VectorNormalize(forward);
monster_fire_heat(self, start, forward, vec3_origin, 10, 50, 0);
monster_fire_heatbeam(self, start, forward, vec3_origin, 10, 50, 0);
}
}

Some files were not shown because too many files have changed in this diff Show More