📄 g_local_add.pas
字号:
//100%
{$ALIGN ON}{$MINENUMSIZE 4}
{----------------------------------------------------------------------------}
{ }
{ File(s): g_local related }
{ Content: local definitions for game module }
{ }
{ Initial created by: Juha }
{ Initial created on: 02-Dec-2002 }
{ }
{ This File contains part of convertion of Quake2 source to ObjectPascal. }
{ More information about this project can be found at: }
{ http://www.sulaco.co.za/quake2/ }
{ }
{ Copyright (C) 1997-2001 Id Software, 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. }
{ }
{----------------------------------------------------------------------------}
{ Updated on: 2003-May-23 }
{ Updated by: Scott Price (scott.price@totalise.co.uk) }
{ Tidy-up and addition of header and completion percentile }
{----------------------------------------------------------------------------}
{ * Still dependent (to compile correctly) on: }
{ none }
{----------------------------------------------------------------------------}
{ * TODO: }
{ none }
{----------------------------------------------------------------------------}
{ * Note: }
{ none }
{----------------------------------------------------------------------------}
unit g_local_add;
interface
uses
game_add,
q_shared_add,
q_shared;
type
// edict->movetype values
movetype_p = ^movetype_t;
movetype_t = (
MOVETYPE_NONE, // never moves
MOVETYPE_NOCLIP, // origin and angles change with no interaction
MOVETYPE_PUSH, // no clip to world, push on box contact
MOVETYPE_STOP, // no clip to world, stops on box contact
MOVETYPE_WALK, // gravity
MOVETYPE_STEP, // gravity, special edge handling
MOVETYPE_FLY,
MOVETYPE_TOSS, // gravity
MOVETYPE_FLYMISSILE, // extra size to monsters
MOVETYPE_BOUNCE
);
damage_p = ^damage_t;
damage_t = (
DAMAGE_NO,
DAMAGE_YES, // will take damage if hit
DAMAGE_AIM // auto targeting recognizes this
);
edict_p = ^edict_t;
gitem_p = ^gitem_t;
BoolFunc_2edict_s = function(ent, other: edict_p): qboolean; cdecl;
Proc_edit_s__gitem_s = procedure(ent: edict_p; item: gitem_p); cdecl;
Proc_edit_s = procedure(ent: edict_p); cdecl;
gitem_t = record
classname: PChar; // spawning name
pickup: BoolFunc_2edict_s;
use: Proc_edit_s__gitem_s;
drop: Proc_edit_s__gitem_s;
weaponthink: Proc_edit_s;
pickup_sound: PChar;
world_model: PChar;
world_model_flags: integer;
view_model: PChar;
// client side info
icon: PChar;
pickup_name: PChar; // for printing on pickup
count_width: integer; // number of digits to display by icon
quantity: integer; // for ammo how much, for weapons how much is used per shot
ammo: PChar; // for weapons
flags: integer; // IT_* flags
weapmodel: integer; // weapon model index (for weapons)
info: Pointer;
tag: integer;
precaches: PChar; // string of all models, sounds, and images this item will use
end;
// client data that stays across multiple level loads
client_persistant_p = ^client_persistant_t;
client_persistant_t = record
userinfo: array[0..MAX_INFO_STRING -1] of char;
netname: array[0..15] of char;
hand: integer;
connected: qboolean; // a loadgame will leave valid entities that
// just don't have a connection yet
// values saved and restored from edicts when changing levels
health,
max_health,
savedFlags: integer;
selected_item: integer;
inventory: array[0..MAX_ITEMS-1] of integer;
// ammo capacities
max_bullets,
max_shells,
max_rockets,
max_grenades,
max_cells,
max_slugs: integer;
weapon,
lastweapon: gitem_p;
power_cubes, // used for tracking the cubes in coop games
score: integer; // for calculating total unit score in coop games
{$ifndef CTF}
game_helpchanged,
helpchanged: integer;
spectator: qboolean; // client is a spectator
{$endif}
end;
// client data that stays across deathmatch respawns
client_respawn_p = ^client_respawn_t;
client_respawn_t = record
coop_respawn: client_persistant_t; // what to set client->pers to on a respawn
enterframe, // level.framenum the client entered the game
score: integer; // frags, etc
{$ifdef CTF}
//ZOID
ctf_team, // CTF team
ctf_state: Integer;
ctf_lasthurtcarrier,
ctf_lastreturnedflag,
ctf_flagsince,
ctf_lastfraggedcarrier: Single;
id_state: qboolean;
lastidtime: Single;
voted, // for elections
ready,
admin: qboolean;
ghost: ghost_p; // for ghost codes
//ZOID
{$endif}
cmd_angles: vec3_t; // angles sent over in the last command
{$ifndef CTF}
spectator: qboolean; // client is a spectator
{$else}
game_helpchanged: Integer;
helpchanged: Integer;
{$endif}
end;
weaponstate_p = ^weaponstate_t;
weaponstate_t = (
WEAPON_READY,
WEAPON_ACTIVATING,
WEAPON_DROPPING,
WEAPON_FIRING
);
// this structure is cleared on each PutClientInServer(),
// except for 'client->pers'
gclient_p = ^gclient_t;
gclient_t = record
// known to server
ps: player_state_t; // communicated by server to clients
ping: integer;
// private to game
pers: client_persistant_t;
resp: client_respawn_t;
old_pmove: pmove_state_t; // for detecting out-of-pmove changes
showscores, // set layout stat
{$ifdef CTF}
//ZOID
inmenu: qboolean; // in menu
menu: pmenuhnd_p; // current menu
//ZOID
{$endif}
showinventory, // set layout stat
showhelp,
showhelpicon: qboolean;
ammo_index: integer;
buttons,
oldbuttons,
latched_buttons: integer;
weapon_thunk: qboolean;
newweapon: gitem_p;
// sum up damage over an entire frame, so
// shotgun blasts give a single big kick
damage_armor, // damage absorbed by armor
damage_parmor, // damage absorbed by power armor
damage_blood, // damage taken out of health
damage_knockback: integer; // impact damage
damage_from: vec3_t; // origin for vector calculation
killer_yaw: Single; // when dead, look at killer
weaponstate: weaponstate_t; //was Integer; modified by FAB
kick_angles: vec3_t; // weapon kicks
kick_origin: vec3_t;
v_dmg_roll, v_dmg_pitch, v_dmg_time, // damage kicks
fall_time, fall_value, // for view drop on fall
damage_alpha,
bonus_alpha: single;
damage_blend,
v_angle: vec3_t; // aiming direction
bobtime: Single; // so off-ground doesn't change it
oldviewangles: vec3_t;
oldvelocity: vec3_t;
next_drown_time: Single;
old_waterlevel,
breather_sound: integer;
machinegun_shots: integer; // for weapon raising
// animation vars
anim_end,
anim_priority: integer;
anim_duck,
anim_run: qboolean;
// powerup timers
quad_framenum,
invincible_framenum,
breather_framenum,
enviro_framenum: single;
grenade_blew_up: qboolean;
grenade_time: single;
silencer_shots,
weapon_sound: integer;
pickup_msg_time: Single;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -