⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 q_shared.pas

📁 delphi编的不错的贪吃蛇
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  TE_BLUEHYPERBLASTER,
  TE_PLASMA_EXPLOSION,
  TE_TUNNEL_SPARKS,
  //ROGUE
  TE_BLASTER2,
  TE_RAILTRAIL2,
  TE_FLAME,
  TE_LIGHTNING,
  TE_DEBUGTRAIL,
  TE_PLAIN_EXPLOSION,
  TE_FLASHLIGHT,
  TE_FORCEWALL,
  TE_HEATBEAM,
  TE_MONSTER_HEATBEAM,
  TE_STEAM,
  TE_BUBBLETRAIL2,
  TE_MOREBLOOD,
  TE_HEATBEAM_SPARKS,
  TE_HEATBEAM_STEAM,
  TE_CHAINFIST_SMOKE,
  TE_ELECTRIC_SPARKS,
  TE_TRACKER_EXPLOSION,
  TE_TELEPORT_EFFECT,
  TE_DBALL_GOAL,
  TE_WIDOWBEAMOUT,
  TE_NUKEBLAST,
  TE_WIDOWSPLASH,
  TE_EXPLOSION1_BIG,
  TE_EXPLOSION1_NP,
  TE_FLECHETTE
//ROGUE
);

const SPLASH_UNKNOWN = 0;
const SPLASH_SPARKS = 1;
const SPLASH_BLUE_WATER	= 2;
const SPLASH_BROWN_WATER = 3;
const SPLASH_SLIME = 4;
const SPLASH_LAVA = 5;
const SPLASH_BLOOD = 6;






// sound channels
// channel 0 never willingly overrides
// other channels (1-7) allways override a playing sound on that channel
const
  CHAN_AUTO = 0;
  CHAN_WEAPON = 1;
  CHAN_VOICE = 2;
  CHAN_ITEM = 3;
  CHAN_BODY = 4;
  // modifier flags
  CHAN_NO_PHS_ADD = 8;	// send to all clients, not just ones in PHS (ATTN 0 will also do this)
  CHAN_RELIABLE	= 16;	// send by reliable message, not datagram


  // sound attenuation values
  ATTN_NONE = 0;	// full volume the entire level
  ATTN_NORM = 1;
  ATTN_IDLE = 2;
  ATTN_STATIC = 3;	// diminish very rapidly with distance


  // player_state->stats[] indexes
  STAT_HEALTH_ICON = 0;
  STAT_HEALTH = 1;
  STAT_AMMO_ICON = 2;
  STAT_AMMO = 3;
  STAT_ARMOR_ICON = 4;
  STAT_ARMOR = 5;
  STAT_SELECTED_ICON = 6;
  STAT_PICKUP_ICON = 7;
  STAT_PICKUP_STRING = 8;
  STAT_TIMER_ICON = 9;
  STAT_TIMER = 10;
  STAT_HELPICON	= 11;
  STAT_SELECTED_ITEM = 12;
  STAT_LAYOUTS = 13;
  STAT_FRAGS = 14;
  STAT_FLASHES = 15; // cleared each frame, 1 = health, 2 = armor
  STAT_CHASE = 16;
  STAT_SPECTATOR = 17;

  MAX_STATS = g_local.MAX_STATS; // CAK - MOVED to g_local


// dmflags->value flags
  DF_NO_HEALTH	       =	$00000001;	// 1
  DF_NO_ITEMS	       =	$00000002;	// 2
  DF_WEAPONS_STAY      =	$00000004;	// 4
  DF_NO_FALLING	       =	$00000008;	// 8
  DF_INSTANT_ITEMS     =	$00000010;	// 16
  DF_SAME_LEVEL	       =	$00000020;	// 32
  DF_SKINTEAMS	       =	$00000040;	// 64
  DF_MODELTEAMS	       =	$00000080;	// 128
  DF_NO_FRIENDLY_FIRE  =	$00000100;	// 256
  DF_SPAWN_FARTHEST    =	$00000200;	// 512
  DF_FORCE_RESPAWN     =	$00000400;	// 1024
  DF_NO_ARMOR	       =	$00000800;	// 2048
  DF_ALLOW_EXIT	       =	$00001000;	// 4096
  DF_INFINITE_AMMO     =	$00002000;	// 8192
  DF_QUAD_DROP	       =	$00004000;	// 16384
  DF_FIXED_FOV	       =	$00008000;	// 32768

  // RAFAEL
  DF_QUADFIRE_DROP     =	$00010000;	// 65536

//ROGUE
const
  DF_NO_MINES = $00020000;
  DF_NO_STACK_DOUBLE = $00040000;
  DF_NO_NUKES = $00080000;
  DF_NO_SPHERES	= $00100000;
//ROGUE

// player_state_t is the information needed in addition to pmove_state_t
// to rendered a view.  There will only be 10 player_state_t sent each second,
// but the number of pmove_state_t changes will be reletive to client
// frame rates
// this structure needs to be communicated bit-accurate
// from the server to the client to guarantee that
// prediction stays in sync, so no floats are used.
// if any part of the game code modifies this struct, it
// will result in a prediction error of some degree.

type
  // client data that stays across multiple level loads
  Pclient_persistant_t = ^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: boolean;			// 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,
    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,			// for calculating total unit score in coop games

    game_helpchanged,
    helpchanged: integer;

    spectator: boolean;			// client is a spectator
  end;

  gclient_s = 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
    showinventory,		// set layout stat
    showhelp,
    showhelpicon: boolean;

    ammo_index,
    buttons,
    oldbuttons,
    latched_buttons: integer;

    weapon_thunk: boolean;

    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;
    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,
    machinegun_shots: integer;	// for weapon raising

          // animation vars
    anim_end,
    anim_priority: integer;
    anim_duck,
    anim_run: boolean;

          // powerup timers
    quad_framenum,
    invincible_framenum,
    breather_framenum,
    enviro_framenum: single;

    grenade_blew_up: boolean;
    grenade_time: single;
    silencer_shots,
    weapon_sound: integer;

    pickup_msg_time,
    flood_locktill: single;		// locked from talking
    flood_when: array[0..9] of single;		// when messages were said
    flood_whenhead: integer;		// head pointer for when said

    respawn_time: single;		// can respawn when time > this

    chase_target: edict_p;		// player we are chasing
    update_chase: boolean;		// need to update chase info?
  end;


  edict_p = ^edict_t;
  edict_s = record
    s: entity_state_t;
    client: Pgclient_s;	// NULL if not a player
                        // the server expects the first part
                        // of gclient_s to be a player_state_t
                        // but the rest of it is opaque
    inuse: boolean;
    linkcount: integer;

          // FIXME: move these fields to a server private sv_entity_t
    area: link_t;				// linked to a division node or leaf

    num_clusters: integer;		// if -1, use headnode instead
    clusternums: array[0..MAX_ENT_CLUSTERS - 1] of integer;
    headnode: integer;			// unused if num_clusters != -1
    areanum, areanum2: integer;

    //================================

    svflags :integer;
    mins, maxs: vec3_t;
    absmin, absmax, size: vec3_t;
    solid: solid_t;
    clipmask: integer;
    owner: edict_p;


    // DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER
    // EXPECTS THE FIELDS IN THAT ORDER!

    //================================
    movetype,
    flags: integer;

    model: Pchar;
    freetime: single;			// sv.time when the object was freed

          //
          // only used locally in game, not by server
          //
    _message,
    classname: Pchar;
    spawnflags: integer;

    timestamp: Single;

    angle: Single;			// set in qe3, -1 = up, -2 = down
    target,
    targetname,
    killtarget,
    team,
    pathtarget,
    deathtarget,
    combattarget: Pchar;
    target_ent: edict_p	;

    speed, accel, decel: Single;
    movedir: vec3_t;
    pos1, pos2: vec3_t;

    velocity: vec3_t;
    avelocity: vec3_t;
    mass: integer;
    air_finished,
    gravity: Single;		// per entity gravity multiplier (1.0 is normal)
								// use for lowgrav artifact, flares

    goalentity: edict_p;
    movetarget: edict_p;
    yaw_speed,
    ideal_yaw,

    nextthink: single;
    prethink: Proc_Pedictt;
    think: Proc_Pedictt;
    blocked: Proc_2Pedictt;	//move to moveinfo?
    touch: Proc_2edictt_cplanet_csurfacet;
    use: Proc_3edictt;
    pain: Proc_2edictt_single_int;
    die: Proc_3edictt_int_vec3t;

    touch_debounce_time,		// are all these legit?  do we need more/less of them?
    pain_debounce_time,
    damage_debounce_time,
    fly_sound_debounce_time,	//move to clientinfo
    last_move_time: single;

    health,
    max_health,
    gib_health,
    deadflag: integer;
    show_hostile: boolean;

    powerarmor_time: Single;

    map: Pchar;			// target_changelevel

    viewheight,		// height above origin where eyesight is determined
    takedamage,
    dmg,
    radius_dmg,
    sounds,			//make this a spawntemp var
    count: integer;
    dmg_radius: Single;

    chain,
    enemy,
    oldenemy,
    activator,
    groundentity: edict_p;
    groundentity_linkcount: integer;

    teamchain,
    teammaster,

    mynoise,		// can go in client only
    mynoise2: edict_p;

    noise_index,
    noise_index2: integer;
    volume,
    attenuation: Single;

	// timing variables
    wait,
    delay,			// before firing targets
    random,
    teleport_time: single;

    watertype,
    waterlevel: integer;

    move_origin: vec3_t;
    move_angles: vec3_t;

	// move this to clientinfo?
    light_level,
    style: integer;			// also used as areaportal number

    item: gitem_p;			// for bonus items

	// common data blocks
    moveinfo: moveinfo_t;
    monsterinfo: monsterinfo_t;
  end;
  edict_t = edict_s;
  pedict_t = edict_p;
  pedict_s = edict_p;

// a trace is returned when a box is swept through the world
  trace_p = ^trace_t;
  ptrace_t = trace_p;
  trace_t = record
    allsolid: qboolean; // if true, plane is not valid
    startsolid: qboolean; // if true, the initial po : integer was in a solid area
    fraction: single; // time completed, 1.0 := didn't hit anything
    endpos: vec3_t; // final position
    plane: cplane_t; // surface normal at impact
    surface: csurface_p; // surface hit
    contents: Integer; // contents on other side of surface hit
    ent: edict_p; // not set by CM_* functions
  end;
  TTrace = trace_t;
  PTrace = trace_p;

  pmove_p = ^pmove_t;
  ppmove_t = pmove_p;
  pmove_t = record
   // state (in / out)
   s: pmove_state_t;

   // command (in)
   cmd: usercmd_t;
   snapinitial: qboolean; // if s has been changed outside pmove

   // results (out)
   numtouch: integer;
   touchents: array[0..MAXTOUCH - 1] of edict_p;

   viewangles: vec3_t; // clamped
   viewheight: single;

   mins, maxs: vec3_t; // bounding box size

   groundentity: edict_p;
   watertype: integer;
   waterlevel: integer;

   // callbacks to test the world
   trace: function(var start,mins,maxs,_end: vec3_t): trace_t;
   pointcontents: function(var point: vec3_t): Integer;
  end;
  TPMove = pmove_t;
  PPMove = pmove_p;




(*
ROGUE - VERSIONS
1234	08/13/1998		Activision
1235	08/14/1998		Id Software
1236	08/15/1998		Steve Tietze
1237	08/15/1998		Phil Dobranski
1238	08/15/1998		John Sheley
1239	08/17/1998		Barrett Alexander
1230	08/17/1998		Brandon Fish
1245	08/17/1998		Don MacAskill
1246	08/17/1998		David "Zoid" Kirsch

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -