Annotation of quake2/rogue/g_local.h, revision 1.1

1.1     ! root        1: // g_local.h -- local definitions for game module
        !             2: 
        !             3: #include "q_shared.h"
        !             4: 
        !             5: // define GAME_INCLUDE so that game.h does not define the
        !             6: // short, server-visible gclient_t and edict_t structures,
        !             7: // because we define the full size ones in this file
        !             8: #define        GAME_INCLUDE
        !             9: #include "game.h"
        !            10: 
        !            11: // the "gameversion" client command will print this plus compile date
        !            12: #define        GAMEVERSION     "baseq2"
        !            13: 
        !            14: // protocol bytes that can be directly added to messages
        !            15: #define        svc_muzzleflash         1
        !            16: #define        svc_muzzleflash2        2
        !            17: #define        svc_temp_entity         3
        !            18: #define        svc_layout                      4
        !            19: #define        svc_inventory           5
        !            20: #define        svc_stufftext           11
        !            21: 
        !            22: //==================================================================
        !            23: 
        !            24: // view pitching times
        !            25: #define DAMAGE_TIME            0.5
        !            26: #define        FALL_TIME               0.3
        !            27: 
        !            28: // ROGUE- id killed this weapon
        !            29: #define        KILL_DISRUPTOR  1
        !            30: // rogue
        !            31: 
        !            32: // edict->spawnflags
        !            33: // these are set with checkboxes on each entity in the map editor
        !            34: #define        SPAWNFLAG_NOT_EASY                      0x00000100
        !            35: #define        SPAWNFLAG_NOT_MEDIUM            0x00000200
        !            36: #define        SPAWNFLAG_NOT_HARD                      0x00000400
        !            37: #define        SPAWNFLAG_NOT_DEATHMATCH        0x00000800
        !            38: #define        SPAWNFLAG_NOT_COOP                      0x00001000
        !            39: 
        !            40: // edict->flags
        !            41: #define        FL_FLY                                  0x00000001
        !            42: #define        FL_SWIM                                 0x00000002      // implied immunity to drowining
        !            43: #define FL_IMMUNE_LASER                        0x00000004
        !            44: #define        FL_INWATER                              0x00000008
        !            45: #define        FL_GODMODE                              0x00000010
        !            46: #define        FL_NOTARGET                             0x00000020
        !            47: #define FL_IMMUNE_SLIME                        0x00000040
        !            48: #define FL_IMMUNE_LAVA                 0x00000080
        !            49: #define        FL_PARTIALGROUND                0x00000100      // not all corners are valid
        !            50: #define        FL_WATERJUMP                    0x00000200      // player jumping out of water
        !            51: #define        FL_TEAMSLAVE                    0x00000400      // not the first on the team
        !            52: #define FL_NO_KNOCKBACK                        0x00000800
        !            53: #define FL_POWER_ARMOR                 0x00001000      // power armor (if any) is active
        !            54: #define FL_RESPAWN                             0x80000000      // used for item respawning
        !            55: 
        !            56: //ROGUE
        !            57: #define FL_MECHANICAL                  0x00002000      // entity is mechanical, use sparks not blood
        !            58: #define FL_SAM_RAIMI                   0x00004000      // entity is in sam raimi cam mode
        !            59: #define FL_DISGUISED                   0x00008000      // entity is in disguise, monsters will not recognize.
        !            60: #define        FL_NOGIB                                0x00010000      // player has been vaporized by a nuke, drop no gibs
        !            61: //ROGUE
        !            62: 
        !            63: #define        FRAMETIME               0.1
        !            64: 
        !            65: // memory tags to allow dynamic memory to be cleaned up
        !            66: #define        TAG_GAME        765             // clear when unloading the dll
        !            67: #define        TAG_LEVEL       766             // clear when loading a new level
        !            68: 
        !            69: 
        !            70: #define MELEE_DISTANCE 80
        !            71: 
        !            72: #define BODY_QUEUE_SIZE                8
        !            73: 
        !            74: typedef enum
        !            75: {
        !            76:        DAMAGE_NO,
        !            77:        DAMAGE_YES,                     // will take damage if hit
        !            78:        DAMAGE_AIM                      // auto targeting recognizes this
        !            79: } damage_t;
        !            80: 
        !            81: typedef enum 
        !            82: {
        !            83:        WEAPON_READY, 
        !            84:        WEAPON_ACTIVATING,
        !            85:        WEAPON_DROPPING,
        !            86:        WEAPON_FIRING
        !            87: } weaponstate_t;
        !            88: 
        !            89: typedef enum
        !            90: {
        !            91:        AMMO_BULLETS,
        !            92:        AMMO_SHELLS,
        !            93:        AMMO_ROCKETS,
        !            94:        AMMO_GRENADES,
        !            95:        AMMO_CELLS,
        !            96:        AMMO_SLUGS,
        !            97: 
        !            98:        //ROGUE
        !            99:        AMMO_FLECHETTES,
        !           100:        AMMO_TESLA,
        !           101: #ifdef KILL_DISRUPTOR
        !           102:        AMMO_PROX
        !           103: #else
        !           104:        AMMO_PROX,
        !           105:        AMMO_DISRUPTOR
        !           106: #endif
        !           107: } ammo_t;
        !           108: 
        !           109: 
        !           110: //deadflag
        !           111: #define DEAD_NO                                        0
        !           112: #define DEAD_DYING                             1
        !           113: #define DEAD_DEAD                              2
        !           114: #define DEAD_RESPAWNABLE               3
        !           115: 
        !           116: //range
        !           117: #define RANGE_MELEE                            0
        !           118: #define RANGE_NEAR                             1
        !           119: #define RANGE_MID                              2
        !           120: #define RANGE_FAR                              3
        !           121: 
        !           122: //gib types
        !           123: #define GIB_ORGANIC                            0
        !           124: #define GIB_METALLIC                   1
        !           125: 
        !           126: //monster ai flags
        !           127: #define AI_STAND_GROUND                        0x00000001
        !           128: #define AI_TEMP_STAND_GROUND   0x00000002
        !           129: #define AI_SOUND_TARGET                        0x00000004
        !           130: #define AI_LOST_SIGHT                  0x00000008
        !           131: #define AI_PURSUIT_LAST_SEEN   0x00000010
        !           132: #define AI_PURSUE_NEXT                 0x00000020
        !           133: #define AI_PURSUE_TEMP                 0x00000040
        !           134: #define AI_HOLD_FRAME                  0x00000080
        !           135: #define AI_GOOD_GUY                            0x00000100
        !           136: #define AI_BRUTAL                              0x00000200
        !           137: #define AI_NOSTEP                              0x00000400
        !           138: #define AI_DUCKED                              0x00000800
        !           139: #define AI_COMBAT_POINT                        0x00001000
        !           140: #define AI_MEDIC                               0x00002000
        !           141: #define AI_RESURRECTING                        0x00004000
        !           142: 
        !           143: //ROGUE
        !           144: #define AI_WALK_WALLS                  0x00008000
        !           145: #define AI_MANUAL_STEERING             0x00010000
        !           146: #define AI_TARGET_ANGER                        0x00020000
        !           147: #define AI_DODGING                             0x00040000
        !           148: #define AI_CHARGING                            0x00080000
        !           149: #define AI_HINT_PATH                   0x00100000
        !           150: #define        AI_IGNORE_SHOTS                 0x00200000
        !           151: // PMM - FIXME - last second added for E3 .. there's probably a better way to do this, but
        !           152: // this works
        !           153: #define        AI_DO_NOT_COUNT                 0x00400000      // set for healed monsters
        !           154: #define        AI_SPAWNED_CARRIER              0x00800000      // both do_not_count and spawned are set for spawned monsters
        !           155: #define        AI_SPAWNED_MEDIC_C              0x01000000      // both do_not_count and spawned are set for spawned monsters
        !           156: #define        AI_SPAWNED_WIDOW                0x02000000      // both do_not_count and spawned are set for spawned monsters
        !           157: #define AI_SPAWNED_MASK                        0x03800000      // mask to catch all three flavors of spawned
        !           158: #define        AI_BLOCKED                              0x04000000      // used by blocked_checkattack: set to say I'm attacking while blocked 
        !           159:                                                                                        // (prevents run-attacks)
        !           160: //ROGUE
        !           161: 
        !           162: //monster attack state
        !           163: #define AS_STRAIGHT                            1
        !           164: #define AS_SLIDING                             2
        !           165: #define        AS_MELEE                                3
        !           166: #define        AS_MISSILE                              4
        !           167: #define        AS_BLIND                                5       // PMM - used by boss code to do nasty things even if it can't see you
        !           168: 
        !           169: // armor types
        !           170: #define ARMOR_NONE                             0
        !           171: #define ARMOR_JACKET                   1
        !           172: #define ARMOR_COMBAT                   2
        !           173: #define ARMOR_BODY                             3
        !           174: #define ARMOR_SHARD                            4
        !           175: 
        !           176: // power armor types
        !           177: #define POWER_ARMOR_NONE               0
        !           178: #define POWER_ARMOR_SCREEN             1
        !           179: #define POWER_ARMOR_SHIELD             2
        !           180: 
        !           181: // handedness values
        !           182: #define RIGHT_HANDED                   0
        !           183: #define LEFT_HANDED                            1
        !           184: #define CENTER_HANDED                  2
        !           185: 
        !           186: 
        !           187: // game.serverflags values
        !           188: #define SFL_CROSS_TRIGGER_1            0x00000001
        !           189: #define SFL_CROSS_TRIGGER_2            0x00000002
        !           190: #define SFL_CROSS_TRIGGER_3            0x00000004
        !           191: #define SFL_CROSS_TRIGGER_4            0x00000008
        !           192: #define SFL_CROSS_TRIGGER_5            0x00000010
        !           193: #define SFL_CROSS_TRIGGER_6            0x00000020
        !           194: #define SFL_CROSS_TRIGGER_7            0x00000040
        !           195: #define SFL_CROSS_TRIGGER_8            0x00000080
        !           196: #define SFL_CROSS_TRIGGER_MASK 0x000000ff
        !           197: 
        !           198: 
        !           199: // noise types for PlayerNoise
        !           200: #define PNOISE_SELF                            0
        !           201: #define PNOISE_WEAPON                  1
        !           202: #define PNOISE_IMPACT                  2
        !           203: 
        !           204: 
        !           205: // edict->movetype values
        !           206: typedef enum
        !           207: {
        !           208: MOVETYPE_NONE,                 // never moves
        !           209: MOVETYPE_NOCLIP,               // origin and angles change with no interaction
        !           210: MOVETYPE_PUSH,                 // no clip to world, push on box contact
        !           211: MOVETYPE_STOP,                 // no clip to world, stops on box contact
        !           212: 
        !           213: MOVETYPE_WALK,                 // gravity
        !           214: MOVETYPE_STEP,                 // gravity, special edge handling
        !           215: MOVETYPE_FLY,
        !           216: MOVETYPE_TOSS,                 // gravity
        !           217: MOVETYPE_FLYMISSILE,   // extra size to monsters
        !           218: MOVETYPE_BOUNCE,
        !           219: MOVETYPE_NEWTOSS               // PGM - for deathball
        !           220: } movetype_t;
        !           221: 
        !           222: 
        !           223: 
        !           224: typedef struct
        !           225: {
        !           226:        int             base_count;
        !           227:        int             max_count;
        !           228:        float   normal_protection;
        !           229:        float   energy_protection;
        !           230:        int             armor;
        !           231: } gitem_armor_t;
        !           232: 
        !           233: 
        !           234: // gitem_t->flags
        !           235: #define        IT_WEAPON                       0x00000001              // use makes active weapon
        !           236: #define        IT_AMMO                         0x00000002
        !           237: #define IT_ARMOR                       0x00000004
        !           238: #define IT_STAY_COOP           0x00000008
        !           239: #define IT_KEY                         0x00000010
        !           240: #define IT_POWERUP                     0x00000020
        !           241: 
        !           242: // ROGUE
        !           243: #define IT_MELEE                       0x00000040
        !           244: #define IT_NOT_GIVEABLE                0x00000080      // item can not be given
        !           245: // ROGUE
        !           246: 
        !           247: // gitem_t->weapmodel for weapons indicates model index
        !           248: #define WEAP_BLASTER                   1 
        !           249: #define WEAP_SHOTGUN                   2 
        !           250: #define WEAP_SUPERSHOTGUN              3 
        !           251: #define WEAP_MACHINEGUN                        4 
        !           252: #define WEAP_CHAINGUN                  5 
        !           253: #define WEAP_GRENADES                  6 
        !           254: #define WEAP_GRENADELAUNCHER   7 
        !           255: #define WEAP_ROCKETLAUNCHER            8 
        !           256: #define WEAP_HYPERBLASTER              9 
        !           257: #define WEAP_RAILGUN                   10
        !           258: #define WEAP_BFG                               11
        !           259: 
        !           260: #define WEAP_DISRUPTOR                 12              // PGM
        !           261: #define WEAP_ETFRIFLE                  13              // PGM
        !           262: #define WEAP_PLASMA                            14              // PGM
        !           263: #define WEAP_PROXLAUNCH                        15              // PGM
        !           264: #define WEAP_CHAINFIST                 16              // PGM
        !           265: 
        !           266: typedef struct gitem_s
        !           267: {
        !           268:        char            *classname;     // spawning name
        !           269:        qboolean        (*pickup)(struct edict_s *ent, struct edict_s *other);
        !           270:        void            (*use)(struct edict_s *ent, struct gitem_s *item);
        !           271:        void            (*drop)(struct edict_s *ent, struct gitem_s *item);
        !           272:        void            (*weaponthink)(struct edict_s *ent);
        !           273:        char            *pickup_sound;
        !           274:        char            *world_model;
        !           275:        int                     world_model_flags;
        !           276:        char            *view_model;
        !           277: 
        !           278:        // client side info
        !           279:        char            *icon;
        !           280:        char            *pickup_name;   // for printing on pickup
        !           281:        int                     count_width;            // number of digits to display by icon
        !           282: 
        !           283:        int                     quantity;               // for ammo how much, for weapons how much is used per shot
        !           284:        char            *ammo;                  // for weapons
        !           285:        int                     flags;                  // IT_* flags
        !           286: 
        !           287:        int                     weapmodel;              // weapon model index (for weapons)
        !           288: 
        !           289:        void            *info;
        !           290:        int                     tag;
        !           291: 
        !           292:        char            *precaches;             // string of all models, sounds, and images this item will use
        !           293: } gitem_t;
        !           294: 
        !           295: 
        !           296: 
        !           297: //
        !           298: // this structure is left intact through an entire game
        !           299: // it should be initialized at dll load time, and read/written to
        !           300: // the server.ssv file for savegames
        !           301: //
        !           302: typedef struct
        !           303: {
        !           304:        char            helpmessage1[512];
        !           305:        char            helpmessage2[512];
        !           306:        int                     helpchanged;    // flash F1 icon if non 0, play sound
        !           307:                                                                // and increment only if 1, 2, or 3
        !           308: 
        !           309:        gclient_t       *clients;               // [maxclients]
        !           310: 
        !           311:        // can't store spawnpoint in level, because
        !           312:        // it would get overwritten by the savegame restore
        !           313:        char            spawnpoint[512];        // needed for coop respawns
        !           314: 
        !           315:        // store latched cvars here that we want to get at often
        !           316:        int                     maxclients;
        !           317:        int                     maxentities;
        !           318: 
        !           319:        // cross level triggers
        !           320:        int                     serverflags;
        !           321: 
        !           322:        // items
        !           323:        int                     num_items;
        !           324: 
        !           325:        qboolean        autosaved;
        !           326: } game_locals_t;
        !           327: 
        !           328: 
        !           329: //
        !           330: // this structure is cleared as each map is entered
        !           331: // it is read/written to the level.sav file for savegames
        !           332: //
        !           333: typedef struct
        !           334: {
        !           335:        int                     framenum;
        !           336:        float           time;
        !           337: 
        !           338:        char            level_name[MAX_QPATH];  // the descriptive name (Outer Base, etc)
        !           339:        char            mapname[MAX_QPATH];             // the server name (base1, etc)
        !           340:        char            nextmap[MAX_QPATH];             // go here when fraglimit is hit
        !           341: 
        !           342:        // intermission state
        !           343:        float           intermissiontime;               // time the intermission was started
        !           344:        char            *changemap;
        !           345:        int                     exitintermission;
        !           346:        vec3_t          intermission_origin;
        !           347:        vec3_t          intermission_angle;
        !           348: 
        !           349:        edict_t         *sight_client;  // changed once each frame for coop games
        !           350: 
        !           351:        edict_t         *sight_entity;
        !           352:        int                     sight_entity_framenum;
        !           353:        edict_t         *sound_entity;
        !           354:        int                     sound_entity_framenum;
        !           355:        edict_t         *sound2_entity;
        !           356:        int                     sound2_entity_framenum;
        !           357: 
        !           358:        int                     pic_health;
        !           359: 
        !           360:        int                     total_secrets;
        !           361:        int                     found_secrets;
        !           362: 
        !           363:        int                     total_goals;
        !           364:        int                     found_goals;
        !           365: 
        !           366:        int                     total_monsters;
        !           367:        int                     killed_monsters;
        !           368: 
        !           369:        edict_t         *current_entity;        // entity running from G_RunFrame
        !           370:        int                     body_que;                       // dead bodies
        !           371: 
        !           372:        int                     power_cubes;            // ugly necessity for coop
        !           373: 
        !           374:        // ROGUE
        !           375:        edict_t         *disguise_violator;
        !           376:        int                     disguise_violation_framenum;
        !           377:        // ROGUE
        !           378: } level_locals_t;
        !           379: 
        !           380: 
        !           381: // spawn_temp_t is only used to hold entity field values that
        !           382: // can be set from the editor, but aren't actualy present
        !           383: // in edict_t during gameplay
        !           384: typedef struct
        !           385: {
        !           386:        // world vars
        !           387:        char            *sky;
        !           388:        float           skyrotate;
        !           389:        vec3_t          skyaxis;
        !           390:        char            *nextmap;
        !           391: 
        !           392:        int                     lip;
        !           393:        int                     distance;
        !           394:        int                     height;
        !           395:        char            *noise;
        !           396:        float           pausetime;
        !           397:        char            *item;
        !           398:        char            *gravity;
        !           399: 
        !           400:        float           minyaw;
        !           401:        float           maxyaw;
        !           402:        float           minpitch;
        !           403:        float           maxpitch;
        !           404: } spawn_temp_t;
        !           405: 
        !           406: 
        !           407: typedef struct
        !           408: {
        !           409:        // fixed data
        !           410:        vec3_t          start_origin;
        !           411:        vec3_t          start_angles;
        !           412:        vec3_t          end_origin;
        !           413:        vec3_t          end_angles;
        !           414: 
        !           415:        int                     sound_start;
        !           416:        int                     sound_middle;
        !           417:        int                     sound_end;
        !           418: 
        !           419:        float           accel;
        !           420:        float           speed;
        !           421:        float           decel;
        !           422:        float           distance;
        !           423: 
        !           424:        float           wait;
        !           425: 
        !           426:        // state data
        !           427:        int                     state;
        !           428:        vec3_t          dir;
        !           429:        float           current_speed;
        !           430:        float           move_speed;
        !           431:        float           next_speed;
        !           432:        float           remaining_distance;
        !           433:        float           decel_distance;
        !           434:        void            (*endfunc)(edict_t *);
        !           435: } moveinfo_t;
        !           436: 
        !           437: 
        !           438: typedef struct
        !           439: {
        !           440:        void    (*aifunc)(edict_t *self, float dist);
        !           441:        float   dist;
        !           442:        void    (*thinkfunc)(edict_t *self);
        !           443: } mframe_t;
        !           444: 
        !           445: typedef struct
        !           446: {
        !           447:        int                     firstframe;
        !           448:        int                     lastframe;
        !           449:        mframe_t        *frame;
        !           450:        void            (*endfunc)(edict_t *self);
        !           451: } mmove_t;
        !           452: 
        !           453: typedef struct
        !           454: {
        !           455:        mmove_t         *currentmove;
        !           456:        unsigned int    aiflags;                // PGM - unsigned, since we're close to the max
        !           457:        int                     nextframe;
        !           458:        float           scale;
        !           459: 
        !           460:        void            (*stand)(edict_t *self);
        !           461:        void            (*idle)(edict_t *self);
        !           462:        void            (*search)(edict_t *self);
        !           463:        void            (*walk)(edict_t *self);
        !           464:        void            (*run)(edict_t *self);
        !           465:        void            (*dodge)(edict_t *self, edict_t *other, float eta, trace_t *tr);
        !           466:        void            (*attack)(edict_t *self);
        !           467:        void            (*melee)(edict_t *self);
        !           468:        void            (*sight)(edict_t *self, edict_t *other);
        !           469:        qboolean        (*checkattack)(edict_t *self);
        !           470: 
        !           471:        float           pausetime;
        !           472:        float           attack_finished;
        !           473: 
        !           474:        vec3_t          saved_goal;
        !           475:        float           search_time;
        !           476:        float           trail_time;
        !           477:        vec3_t          last_sighting;
        !           478:        int                     attack_state;
        !           479:        int                     lefty;
        !           480:        float           idle_time;
        !           481:        int                     linkcount;
        !           482: 
        !           483:        int                     power_armor_type;
        !           484:        int                     power_armor_power;
        !           485: 
        !           486: //ROGUE
        !           487:        qboolean        (*blocked)(edict_t *self, float dist);
        !           488: //     edict_t         *last_hint;                     // last hint_path the monster touched
        !           489:        float           last_hint_time;         // last time the monster checked for hintpaths.
        !           490:        edict_t         *goal_hint;                     // which hint_path we're trying to get to
        !           491:        int                     medicTries;
        !           492:        edict_t         *badMedic1, *badMedic2; // these medics have declared this monster "unhealable"
        !           493:        edict_t         *healer;        // this is who is healing this monster
        !           494:        void            (*duck)(edict_t *self, float eta);
        !           495:        void            (*unduck)(edict_t *self);
        !           496:        void            (*sidestep)(edict_t *self);
        !           497:        //  while abort_duck would be nice, only monsters which duck but don't sidestep would use it .. only the brain
        !           498:        //  not really worth it.  sidestep is an implied abort_duck
        !           499: //     void            (*abort_duck)(edict_t *self);
        !           500:        float           base_height;
        !           501:        float           next_duck_time;
        !           502:        float           duck_wait_time;
        !           503:        edict_t         *last_player_enemy;
        !           504:        // blindfire stuff .. the boolean says whether the monster will do it, and blind_fire_time is the timing
        !           505:        // (set in the monster) of the next shot
        !           506:        qboolean        blindfire;              // will the monster blindfire?
        !           507:        float           blind_fire_delay;
        !           508:        vec3_t          blind_fire_target;
        !           509:        // used by the spawners to not spawn too much and keep track of #s of monsters spawned
        !           510:        int                     monster_slots;
        !           511:        int                     monster_used;
        !           512:        edict_t         *commander;
        !           513:        // powerup timers, used by widow, our friend
        !           514:        float           quad_framenum;
        !           515:        float           invincible_framenum;
        !           516:        float           double_framenum;
        !           517: //ROGUE
        !           518: } monsterinfo_t;
        !           519: 
        !           520: // ROGUE
        !           521: // this determines how long to wait after a duck to duck again.  this needs to be longer than
        !           522: // the time after the monster_duck_up in all of the animation sequences
        !           523: #define        DUCK_INTERVAL   0.5
        !           524: // ROGUE
        !           525: 
        !           526: extern game_locals_t   game;
        !           527: extern level_locals_t  level;
        !           528: extern game_import_t   gi;
        !           529: extern game_export_t   globals;
        !           530: extern spawn_temp_t    st;
        !           531: 
        !           532: extern int     sm_meat_index;
        !           533: extern int     snd_fry;
        !           534: 
        !           535: extern int     jacket_armor_index;
        !           536: extern int     combat_armor_index;
        !           537: extern int     body_armor_index;
        !           538: 
        !           539: 
        !           540: // means of death
        !           541: #define MOD_UNKNOWN                    0
        !           542: #define MOD_BLASTER                    1
        !           543: #define MOD_SHOTGUN                    2
        !           544: #define MOD_SSHOTGUN           3
        !           545: #define MOD_MACHINEGUN         4
        !           546: #define MOD_CHAINGUN           5
        !           547: #define MOD_GRENADE                    6
        !           548: #define MOD_G_SPLASH           7
        !           549: #define MOD_ROCKET                     8
        !           550: #define MOD_R_SPLASH           9
        !           551: #define MOD_HYPERBLASTER       10
        !           552: #define MOD_RAILGUN                    11
        !           553: #define MOD_BFG_LASER          12
        !           554: #define MOD_BFG_BLAST          13
        !           555: #define MOD_BFG_EFFECT         14
        !           556: #define MOD_HANDGRENADE                15
        !           557: #define MOD_HG_SPLASH          16
        !           558: #define MOD_WATER                      17
        !           559: #define MOD_SLIME                      18
        !           560: #define MOD_LAVA                       19
        !           561: #define MOD_CRUSH                      20
        !           562: #define MOD_TELEFRAG           21
        !           563: #define MOD_FALLING                    22
        !           564: #define MOD_SUICIDE                    23
        !           565: #define MOD_HELD_GRENADE       24
        !           566: #define MOD_EXPLOSIVE          25
        !           567: #define MOD_BARREL                     26
        !           568: #define MOD_BOMB                       27
        !           569: #define MOD_EXIT                       28
        !           570: #define MOD_SPLASH                     29
        !           571: #define MOD_TARGET_LASER       30
        !           572: #define MOD_TRIGGER_HURT       31
        !           573: #define MOD_HIT                                32
        !           574: #define MOD_TARGET_BLASTER     33
        !           575: #define MOD_FRIENDLY_FIRE      0x8000000
        !           576: 
        !           577: //========
        !           578: //ROGUE
        !           579: #define MOD_CHAINFIST                  40
        !           580: #define MOD_DISINTEGRATOR              41
        !           581: #define MOD_ETF_RIFLE                  42
        !           582: #define MOD_BLASTER2                   43
        !           583: #define MOD_HEATBEAM                   44
        !           584: #define MOD_TESLA                              45
        !           585: #define MOD_PROX                               46
        !           586: #define MOD_NUKE                               47
        !           587: #define MOD_VENGEANCE_SPHERE   48
        !           588: #define MOD_HUNTER_SPHERE              49
        !           589: #define MOD_DEFENDER_SPHERE            50
        !           590: #define MOD_TRACKER                            51
        !           591: #define MOD_DBALL_CRUSH                        52
        !           592: #define MOD_DOPPLE_EXPLODE             53
        !           593: #define MOD_DOPPLE_VENGEANCE   54
        !           594: #define MOD_DOPPLE_HUNTER              55
        !           595: //ROGUE
        !           596: //========
        !           597: 
        !           598: extern int     meansOfDeath;
        !           599: 
        !           600: 
        !           601: extern edict_t                 *g_edicts;
        !           602: 
        !           603: #define        FOFS(x) (int)&(((edict_t *)0)->x)
        !           604: #define        STOFS(x) (int)&(((spawn_temp_t *)0)->x)
        !           605: #define        LLOFS(x) (int)&(((level_locals_t *)0)->x)
        !           606: #define        CLOFS(x) (int)&(((gclient_t *)0)->x)
        !           607: 
        !           608: #define random()       ((rand () & 0x7fff) / ((float)0x7fff))
        !           609: #define crandom()      (2.0 * (random() - 0.5))
        !           610: 
        !           611: extern cvar_t  *maxentities;
        !           612: extern cvar_t  *deathmatch;
        !           613: extern cvar_t  *coop;
        !           614: extern cvar_t  *dmflags;
        !           615: extern cvar_t  *skill;
        !           616: extern cvar_t  *fraglimit;
        !           617: extern cvar_t  *timelimit;
        !           618: extern cvar_t  *password;
        !           619: extern cvar_t  *spectator_password;
        !           620: extern cvar_t  *g_select_empty;
        !           621: extern cvar_t  *dedicated;
        !           622: 
        !           623: extern cvar_t  *filterban;
        !           624: 
        !           625: extern cvar_t  *sv_gravity;
        !           626: extern cvar_t  *sv_maxvelocity;
        !           627: 
        !           628: extern cvar_t  *gun_x, *gun_y, *gun_z;
        !           629: extern cvar_t  *sv_rollspeed;
        !           630: extern cvar_t  *sv_rollangle;
        !           631: 
        !           632: extern cvar_t  *run_pitch;
        !           633: extern cvar_t  *run_roll;
        !           634: extern cvar_t  *bob_up;
        !           635: extern cvar_t  *bob_pitch;
        !           636: extern cvar_t  *bob_roll;
        !           637: 
        !           638: extern cvar_t  *sv_cheats;
        !           639: extern cvar_t  *maxclients;
        !           640: extern cvar_t  *maxspectators;
        !           641: 
        !           642: extern cvar_t  *flood_msgs;
        !           643: extern cvar_t  *flood_persecond;
        !           644: extern cvar_t  *flood_waitdelay;
        !           645: 
        !           646: extern cvar_t  *sv_maplist;
        !           647: 
        !           648: extern cvar_t  *sv_stopspeed;          // PGM - this was a define in g_phys.c
        !           649: 
        !           650: //ROGUE
        !           651: extern cvar_t  *g_showlogic;
        !           652: extern cvar_t  *gamerules;
        !           653: extern cvar_t  *huntercam;
        !           654: extern cvar_t  *randomrespawn;
        !           655: 
        !           656: // this is for the count of monsters
        !           657: #define ENT_SLOTS_LEFT         (ent->monsterinfo.monster_slots - ent->monsterinfo.monster_used)
        !           658: #define SELF_SLOTS_LEFT                (self->monsterinfo.monster_slots - self->monsterinfo.monster_used)
        !           659: //ROGUE
        !           660: 
        !           661: #define world  (&g_edicts[0])
        !           662: 
        !           663: // item spawnflags
        !           664: #define ITEM_TRIGGER_SPAWN             0x00000001
        !           665: #define ITEM_NO_TOUCH                  0x00000002
        !           666: // 6 bits reserved for editor flags
        !           667: // 8 bits used as power cube id bits for coop games
        !           668: #define DROPPED_ITEM                   0x00010000
        !           669: #define        DROPPED_PLAYER_ITEM             0x00020000
        !           670: #define ITEM_TARGETS_USED              0x00040000
        !           671: 
        !           672: //
        !           673: // fields are needed for spawning from the entity string
        !           674: // and saving / loading games
        !           675: //
        !           676: #define FFL_SPAWNTEMP          1
        !           677: #define FFL_NOSPAWN                    2
        !           678: 
        !           679: typedef enum {
        !           680:        F_INT, 
        !           681:        F_FLOAT,
        !           682:        F_LSTRING,                      // string on disk, pointer in memory, TAG_LEVEL
        !           683:        F_GSTRING,                      // string on disk, pointer in memory, TAG_GAME
        !           684:        F_VECTOR,
        !           685:        F_ANGLEHACK,
        !           686:        F_EDICT,                        // index on disk, pointer in memory
        !           687:        F_ITEM,                         // index on disk, pointer in memory
        !           688:        F_CLIENT,                       // index on disk, pointer in memory
        !           689:        F_FUNCTION,
        !           690:        F_MMOVE,
        !           691:        F_IGNORE
        !           692: } fieldtype_t;
        !           693: 
        !           694: typedef struct
        !           695: {
        !           696:        char    *name;
        !           697:        int             ofs;
        !           698:        fieldtype_t     type;
        !           699:        int             flags;
        !           700: } field_t;
        !           701: 
        !           702: 
        !           703: extern field_t fields[];
        !           704: extern gitem_t itemlist[];
        !           705: 
        !           706: 
        !           707: //
        !           708: // g_cmds.c
        !           709: //
        !           710: void Cmd_Help_f (edict_t *ent);
        !           711: void Cmd_Score_f (edict_t *ent);
        !           712: 
        !           713: //
        !           714: // g_items.c
        !           715: //
        !           716: void PrecacheItem (gitem_t *it);
        !           717: void InitItems (void);
        !           718: void SetItemNames (void);
        !           719: gitem_t        *FindItem (char *pickup_name);
        !           720: gitem_t        *FindItemByClassname (char *classname);
        !           721: #define        ITEM_INDEX(x) ((x)-itemlist)
        !           722: edict_t *Drop_Item (edict_t *ent, gitem_t *item);
        !           723: void SetRespawn (edict_t *ent, float delay);
        !           724: void ChangeWeapon (edict_t *ent);
        !           725: void SpawnItem (edict_t *ent, gitem_t *item);
        !           726: void Think_Weapon (edict_t *ent);
        !           727: int ArmorIndex (edict_t *ent);
        !           728: int PowerArmorType (edict_t *ent);
        !           729: gitem_t        *GetItemByIndex (int index);
        !           730: qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count);
        !           731: void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf);
        !           732: 
        !           733: //
        !           734: // g_utils.c
        !           735: //
        !           736: qboolean       KillBox (edict_t *ent);
        !           737: void   G_ProjectSource (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result);
        !           738: edict_t *G_Find (edict_t *from, int fieldofs, char *match);
        !           739: edict_t *findradius (edict_t *from, vec3_t org, float rad);
        !           740: edict_t *G_PickTarget (char *targetname);
        !           741: void   G_UseTargets (edict_t *ent, edict_t *activator);
        !           742: void   G_SetMovedir (vec3_t angles, vec3_t movedir);
        !           743: 
        !           744: void   G_InitEdict (edict_t *e);
        !           745: edict_t        *G_Spawn (void);
        !           746: void   G_FreeEdict (edict_t *e);
        !           747: 
        !           748: void   G_TouchTriggers (edict_t *ent);
        !           749: void   G_TouchSolids (edict_t *ent);
        !           750: 
        !           751: char   *G_CopyString (char *in);
        !           752: 
        !           753: float  *tv (float x, float y, float z);
        !           754: char   *vtos (vec3_t v);
        !           755: 
        !           756: float vectoyaw (vec3_t vec);
        !           757: void vectoangles (vec3_t vec, vec3_t angles);
        !           758: 
        !           759: //ROGUE
        !           760: void   G_ProjectSource2 (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t up, vec3_t result);
        !           761: float  vectoyaw2 (vec3_t vec);
        !           762: void   vectoangles2 (vec3_t vec, vec3_t angles);
        !           763: edict_t *findradius2 (edict_t *from, vec3_t org, float rad);
        !           764: //ROGUE
        !           765: 
        !           766: //
        !           767: // g_combat.c
        !           768: //
        !           769: qboolean OnSameTeam (edict_t *ent1, edict_t *ent2);
        !           770: qboolean CanDamage (edict_t *targ, edict_t *inflictor);
        !           771: void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod);
        !           772: void T_RadiusDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod);
        !           773: 
        !           774: //ROGUE
        !           775: void T_RadiusNukeDamage (edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod);
        !           776: void T_RadiusClassDamage (edict_t *inflictor, edict_t *attacker, float damage, char *ignoreClass, float radius, int mod);
        !           777: void cleanupHealTarget (edict_t *ent);
        !           778: //ROGUE
        !           779: 
        !           780: // damage flags
        !           781: #define DAMAGE_RADIUS                  0x00000001      // damage was indirect
        !           782: #define DAMAGE_NO_ARMOR                        0x00000002      // armour does not protect from this damage
        !           783: #define DAMAGE_ENERGY                  0x00000004      // damage is from an energy based weapon
        !           784: #define DAMAGE_NO_KNOCKBACK            0x00000008      // do not affect velocity, just view angles
        !           785: #define DAMAGE_BULLET                  0x00000010  // damage is from a bullet (used for ricochets)
        !           786: #define DAMAGE_NO_PROTECTION   0x00000020  // armor, shields, invulnerability, and godmode have no effect
        !           787: //ROGUE
        !           788: #define DAMAGE_DESTROY_ARMOR   0x00000040      // damage is done to armor and health.
        !           789: #define DAMAGE_NO_REG_ARMOR            0x00000080      // damage skips regular armor
        !           790: #define DAMAGE_NO_POWER_ARMOR  0x00000100      // damage skips power armor
        !           791: //ROGUE
        !           792: 
        !           793: 
        !           794: #define DEFAULT_BULLET_HSPREAD 300
        !           795: #define DEFAULT_BULLET_VSPREAD 500
        !           796: #define DEFAULT_SHOTGUN_HSPREAD        1000
        !           797: #define DEFAULT_SHOTGUN_VSPREAD        500
        !           798: #define DEFAULT_DEATHMATCH_SHOTGUN_COUNT       12
        !           799: #define DEFAULT_SHOTGUN_COUNT  12
        !           800: #define DEFAULT_SSHOTGUN_COUNT 20
        !           801: 
        !           802: //
        !           803: // g_monster.c
        !           804: //
        !           805: void monster_fire_bullet (edict_t *self, vec3_t start, vec3_t dir, int damage, int kick, int hspread, int vspread, int flashtype);
        !           806: void monster_fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int flashtype);
        !           807: void monster_fire_blaster (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
        !           808: void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype);
        !           809: void monster_fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype);
        !           810: void monster_fire_railgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int flashtype);
        !           811: void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype);
        !           812: void M_droptofloor (edict_t *ent);
        !           813: void monster_think (edict_t *self);
        !           814: void walkmonster_start (edict_t *self);
        !           815: void swimmonster_start (edict_t *self);
        !           816: void flymonster_start (edict_t *self);
        !           817: void AttackFinished (edict_t *self, float time);
        !           818: void monster_death_use (edict_t *self);
        !           819: void M_CatagorizePosition (edict_t *ent);
        !           820: qboolean M_CheckAttack (edict_t *self);
        !           821: void M_FlyCheck (edict_t *self);
        !           822: void M_CheckGround (edict_t *ent);
        !           823: //ROGUE
        !           824: void monster_fire_blaster2 (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int flashtype, int effect);
        !           825: void monster_fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, edict_t *enemy, int flashtype);
        !           826: void monster_fire_heat (edict_t *self, vec3_t start, vec3_t dir, vec3_t offset, int damage, int kick, int flashtype);
        !           827: void stationarymonster_start (edict_t *self);  
        !           828: void monster_done_dodge (edict_t *self);
        !           829: //ROGUE
        !           830: 
        !           831: 
        !           832: //
        !           833: // g_misc.c
        !           834: //
        !           835: void ThrowHead (edict_t *self, char *gibname, int damage, int type);
        !           836: void ThrowClientHead (edict_t *self, int damage);
        !           837: void ThrowGib (edict_t *self, char *gibname, int damage, int type);
        !           838: void BecomeExplosion1(edict_t *self);
        !           839: 
        !           840: //
        !           841: // g_ai.c
        !           842: //
        !           843: void AI_SetSightClient (void);
        !           844: 
        !           845: void ai_stand (edict_t *self, float dist);
        !           846: void ai_move (edict_t *self, float dist);
        !           847: void ai_walk (edict_t *self, float dist);
        !           848: void ai_turn (edict_t *self, float dist);
        !           849: void ai_run (edict_t *self, float dist);
        !           850: void ai_charge (edict_t *self, float dist);
        !           851: int range (edict_t *self, edict_t *other);
        !           852: 
        !           853: void FoundTarget (edict_t *self);
        !           854: qboolean infront (edict_t *self, edict_t *other);
        !           855: qboolean visible (edict_t *self, edict_t *other);
        !           856: qboolean FacingIdeal(edict_t *self);
        !           857: 
        !           858: //
        !           859: // g_weapon.c
        !           860: //
        !           861: void ThrowDebris (edict_t *self, char *modelname, float speed, vec3_t origin);
        !           862: qboolean fire_hit (edict_t *self, vec3_t aim, int damage, int kick);
        !           863: void fire_bullet (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod);
        !           864: void fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod);
        !           865: void fire_blaster (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper);
        !           866: void fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius);
        !           867: void fire_grenade2 (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, qboolean held);
        !           868: void fire_rocket (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage);
        !           869: void fire_rail (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick);
        !           870: void fire_bfg (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius);
        !           871: 
        !           872: //
        !           873: // g_ptrail.c
        !           874: //
        !           875: void PlayerTrail_Init (void);
        !           876: void PlayerTrail_Add (vec3_t spot);
        !           877: void PlayerTrail_New (vec3_t spot);
        !           878: edict_t *PlayerTrail_PickFirst (edict_t *self);
        !           879: edict_t *PlayerTrail_PickNext (edict_t *self);
        !           880: edict_t        *PlayerTrail_LastSpot (void);
        !           881: 
        !           882: //
        !           883: // g_client.c
        !           884: //
        !           885: void respawn (edict_t *ent);
        !           886: void BeginIntermission (edict_t *targ);
        !           887: void PutClientInServer (edict_t *ent);
        !           888: void InitClientPersistant (gclient_t *client);
        !           889: void InitClientResp (gclient_t *client);
        !           890: void InitBodyQue (void);
        !           891: void ClientBeginServerFrame (edict_t *ent);
        !           892: 
        !           893: //
        !           894: // g_player.c
        !           895: //
        !           896: void player_pain (edict_t *self, edict_t *other, float kick, int damage);
        !           897: void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
        !           898: 
        !           899: //
        !           900: // g_svcmds.c
        !           901: //
        !           902: void   ServerCommand (void);
        !           903: qboolean SV_FilterPacket (char *from);
        !           904: 
        !           905: //
        !           906: // p_view.c
        !           907: //
        !           908: void ClientEndServerFrame (edict_t *ent);
        !           909: 
        !           910: //
        !           911: // p_hud.c
        !           912: //
        !           913: void MoveClientToIntermission (edict_t *client);
        !           914: void G_SetStats (edict_t *ent);
        !           915: void G_SetSpectatorStats (edict_t *ent);
        !           916: void G_CheckChaseStats (edict_t *ent);
        !           917: void ValidateSelectedItem (edict_t *ent);
        !           918: void DeathmatchScoreboardMessage (edict_t *client, edict_t *killer);
        !           919: 
        !           920: //
        !           921: // g_pweapon.c
        !           922: //
        !           923: void PlayerNoise(edict_t *who, vec3_t where, int type);
        !           924: 
        !           925: //
        !           926: // m_move.c
        !           927: //
        !           928: qboolean M_CheckBottom (edict_t *ent);
        !           929: qboolean M_walkmove (edict_t *ent, float yaw, float dist);
        !           930: void M_MoveToGoal (edict_t *ent, float dist);
        !           931: void M_ChangeYaw (edict_t *ent);
        !           932: 
        !           933: //
        !           934: // g_phys.c
        !           935: //
        !           936: void G_RunEntity (edict_t *ent);
        !           937: 
        !           938: //
        !           939: // g_main.c
        !           940: //
        !           941: void SaveClientData (void);
        !           942: void FetchClientEntData (edict_t *ent);
        !           943: 
        !           944: //
        !           945: // g_chase.c
        !           946: //
        !           947: void UpdateChaseCam(edict_t *ent);
        !           948: void ChaseNext(edict_t *ent);
        !           949: void ChasePrev(edict_t *ent);
        !           950: void GetChaseTarget(edict_t *ent);
        !           951: 
        !           952: 
        !           953: //====================
        !           954: // ROGUE PROTOTYPES
        !           955: //
        !           956: // g_newweap.c
        !           957: //
        !           958: //extern float nuke_framenum;
        !           959: 
        !           960: void fire_flechette (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, int kick);
        !           961: void fire_prox (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed);            
        !           962: void fire_nuke (edict_t *self, vec3_t start, vec3_t aimdir, int speed);                
        !           963: void fire_flame (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed);
        !           964: void fire_burst (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed);
        !           965: void fire_maintain (edict_t *, edict_t *, vec3_t start, vec3_t aimdir, int damage, int speed);
        !           966: void fire_incendiary_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius);
        !           967: void fire_player_melee (edict_t *self, vec3_t start, vec3_t aim, int reach, int damage, int kick, int quiet, int mod);
        !           968: void fire_tesla (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed);
        !           969: void fire_blaster2 (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper);
        !           970: void fire_heat (edict_t *self, vec3_t start, vec3_t aimdir, vec3_t offset, int damage, int kick, qboolean monster);
        !           971: void fire_tracker (edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, edict_t *enemy);
        !           972: 
        !           973: //
        !           974: // g_newai.c
        !           975: //
        !           976: qboolean blocked_checkshot (edict_t *self, float shotChance);
        !           977: qboolean blocked_checkplat (edict_t *self, float dist);
        !           978: qboolean blocked_checkjump (edict_t *self, float dist, float maxDown, float maxUp);
        !           979: qboolean blocked_checknewenemy (edict_t *self);
        !           980: qboolean monsterlost_checkhint (edict_t *self);
        !           981: qboolean inback (edict_t *self, edict_t *other);
        !           982: float realrange (edict_t *self, edict_t *other);
        !           983: edict_t *SpawnBadArea(vec3_t mins, vec3_t maxs, float lifespan, edict_t *owner);
        !           984: edict_t *CheckForBadArea(edict_t *ent);
        !           985: qboolean MarkTeslaArea(edict_t *self, edict_t *tesla);
        !           986: void InitHintPaths (void);
        !           987: void PredictAim (edict_t *target, vec3_t start, float bolt_speed, qboolean eye_height, float offset, vec3_t aimdir, vec3_t aimpoint);
        !           988: qboolean below (edict_t *self, edict_t *other);
        !           989: void drawbbox (edict_t *self);
        !           990: void M_MonsterDodge (edict_t *self, edict_t *attacker, float eta, trace_t *tr);
        !           991: void monster_duck_down (edict_t *self);
        !           992: void monster_duck_hold (edict_t *self);
        !           993: void monster_duck_up (edict_t *self);
        !           994: qboolean has_valid_enemy (edict_t *self);
        !           995: void TargetTesla (edict_t *self, edict_t *tesla);
        !           996: void hintpath_stop (edict_t *self);
        !           997: edict_t * PickCoopTarget (edict_t *self);
        !           998: int CountPlayers (void);
        !           999: 
        !          1000: //
        !          1001: // g_sphere.c
        !          1002: //
        !          1003: void Defender_Launch (edict_t *self);
        !          1004: void Vengeance_Launch (edict_t *self);
        !          1005: void Hunter_Launch (edict_t *self);
        !          1006: 
        !          1007: //
        !          1008: // g_newdm.c
        !          1009: //
        !          1010: void InitGameRules(void);
        !          1011: edict_t *DoRandomRespawn (edict_t *ent);
        !          1012: void PrecacheForRandomRespawn (void);
        !          1013: qboolean Tag_PickupToken (edict_t *ent, edict_t *other);
        !          1014: void Tag_DropToken (edict_t *ent, gitem_t *item);
        !          1015: void Tag_PlayerDeath(edict_t *targ, edict_t *inflictor, edict_t *attacker);
        !          1016: void fire_doppleganger (edict_t *ent, vec3_t start, vec3_t aimdir);
        !          1017: 
        !          1018: //
        !          1019: // g_spawn.c
        !          1020: //
        !          1021: edict_t *CreateMonster(vec3_t origin, vec3_t angles, char *classname);
        !          1022: edict_t *CreateFlyMonster (vec3_t origin, vec3_t angles, vec3_t mins, vec3_t maxs, char *classname);
        !          1023: edict_t *CreateGroundMonster (vec3_t origin, vec3_t angles, vec3_t mins, vec3_t maxs, char *classname, int height);
        !          1024: qboolean FindSpawnPoint (vec3_t startpoint, vec3_t mins, vec3_t maxs, vec3_t spawnpoint, float maxMoveUp);
        !          1025: qboolean CheckSpawnPoint (vec3_t origin, vec3_t mins, vec3_t maxs);
        !          1026: qboolean CheckGroundSpawnPoint (vec3_t origin, vec3_t entMins, vec3_t entMaxs, float height, float gravity);
        !          1027: void DetermineBBox (char *classname, vec3_t mins, vec3_t maxs);
        !          1028: void SpawnGrow_Spawn (vec3_t startpos, int size);
        !          1029: void Widowlegs_Spawn (vec3_t startpos, vec3_t angles);
        !          1030: 
        !          1031: //
        !          1032: // p_client.c
        !          1033: //
        !          1034: void RemoveAttackingPainDaemons (edict_t *self);
        !          1035: 
        !          1036: 
        !          1037: // ROGUE PROTOTYPES
        !          1038: //====================
        !          1039: 
        !          1040: //============================================================================
        !          1041: 
        !          1042: // client_t->anim_priority
        !          1043: #define        ANIM_BASIC              0               // stand / run
        !          1044: #define        ANIM_WAVE               1
        !          1045: #define        ANIM_JUMP               2
        !          1046: #define        ANIM_PAIN               3
        !          1047: #define        ANIM_ATTACK             4
        !          1048: #define        ANIM_DEATH              5
        !          1049: #define        ANIM_REVERSE    6
        !          1050: 
        !          1051: 
        !          1052: // client data that stays across multiple level loads
        !          1053: typedef struct
        !          1054: {
        !          1055:        char            userinfo[MAX_INFO_STRING];
        !          1056:        char            netname[16];
        !          1057:        int                     hand;
        !          1058: 
        !          1059:        qboolean        connected;                      // a loadgame will leave valid entities that
        !          1060:                                                                        // just don't have a connection yet
        !          1061: 
        !          1062:        // values saved and restored from edicts when changing levels
        !          1063:        int                     health;
        !          1064:        int                     max_health;
        !          1065:        int                     savedFlags;
        !          1066: 
        !          1067:        int                     selected_item;
        !          1068:        int                     inventory[MAX_ITEMS];
        !          1069: 
        !          1070:        // ammo capacities
        !          1071:        int                     max_bullets;
        !          1072:        int                     max_shells;
        !          1073:        int                     max_rockets;
        !          1074:        int                     max_grenades;
        !          1075:        int                     max_cells;
        !          1076:        int                     max_slugs;
        !          1077: 
        !          1078:        gitem_t         *weapon;
        !          1079:        gitem_t         *lastweapon;
        !          1080: 
        !          1081:        int                     power_cubes;    // used for tracking the cubes in coop games
        !          1082:        int                     score;                  // for calculating total unit score in coop games
        !          1083: 
        !          1084:        int                     game_helpchanged;
        !          1085:        int                     helpchanged;
        !          1086: 
        !          1087:        qboolean        spectator;                      // client is a spectator
        !          1088: 
        !          1089: //=========
        !          1090: //ROGUE
        !          1091:        int                     max_tesla;
        !          1092:        int                     max_prox;
        !          1093:        int                     max_mines;
        !          1094:        int                     max_flechettes;
        !          1095: #ifndef KILL_DISRUPTOR
        !          1096:        int                     max_rounds;
        !          1097: #endif
        !          1098: //ROGUE
        !          1099: //=========
        !          1100: } client_persistant_t;
        !          1101: 
        !          1102: // client data that stays across deathmatch respawns
        !          1103: typedef struct
        !          1104: {
        !          1105:        client_persistant_t     coop_respawn;   // what to set client->pers to on a respawn
        !          1106:        int                     enterframe;                     // level.framenum the client entered the game
        !          1107:        int                     score;                          // frags, etc
        !          1108:        vec3_t          cmd_angles;                     // angles sent over in the last command
        !          1109: 
        !          1110:        qboolean        spectator;                      // client is a spectator
        !          1111: } client_respawn_t;
        !          1112: 
        !          1113: // this structure is cleared on each PutClientInServer(),
        !          1114: // except for 'client->pers'
        !          1115: struct gclient_s
        !          1116: {
        !          1117:        // known to server
        !          1118:        player_state_t  ps;                             // communicated by server to clients
        !          1119:        int                             ping;
        !          1120: 
        !          1121:        // private to game
        !          1122:        client_persistant_t     pers;
        !          1123:        client_respawn_t        resp;
        !          1124:        pmove_state_t           old_pmove;      // for detecting out-of-pmove changes
        !          1125: 
        !          1126:        qboolean        showscores;                     // set layout stat
        !          1127:        qboolean        showinventory;          // set layout stat
        !          1128:        qboolean        showhelp;
        !          1129:        qboolean        showhelpicon;
        !          1130: 
        !          1131:        int                     ammo_index;
        !          1132: 
        !          1133:        int                     buttons;
        !          1134:        int                     oldbuttons;
        !          1135:        int                     latched_buttons;
        !          1136: 
        !          1137:        qboolean        weapon_thunk;
        !          1138: 
        !          1139:        gitem_t         *newweapon;
        !          1140: 
        !          1141:        // sum up damage over an entire frame, so
        !          1142:        // shotgun blasts give a single big kick
        !          1143:        int                     damage_armor;           // damage absorbed by armor
        !          1144:        int                     damage_parmor;          // damage absorbed by power armor
        !          1145:        int                     damage_blood;           // damage taken out of health
        !          1146:        int                     damage_knockback;       // impact damage
        !          1147:        vec3_t          damage_from;            // origin for vector calculation
        !          1148: 
        !          1149:        float           killer_yaw;                     // when dead, look at killer
        !          1150: 
        !          1151:        weaponstate_t   weaponstate;
        !          1152:        vec3_t          kick_angles;    // weapon kicks
        !          1153:        vec3_t          kick_origin;
        !          1154:        float           v_dmg_roll, v_dmg_pitch, v_dmg_time;    // damage kicks
        !          1155:        float           fall_time, fall_value;          // for view drop on fall
        !          1156:        float           damage_alpha;
        !          1157:        float           bonus_alpha;
        !          1158:        vec3_t          damage_blend;
        !          1159:        vec3_t          v_angle;                        // aiming direction
        !          1160:        float           bobtime;                        // so off-ground doesn't change it
        !          1161:        vec3_t          oldviewangles;
        !          1162:        vec3_t          oldvelocity;
        !          1163: 
        !          1164:        float           next_drown_time;
        !          1165:        int                     old_waterlevel;
        !          1166:        int                     breather_sound;
        !          1167: 
        !          1168:        int                     machinegun_shots;       // for weapon raising
        !          1169: 
        !          1170:        // animation vars
        !          1171:        int                     anim_end;
        !          1172:        int                     anim_priority;
        !          1173:        qboolean        anim_duck;
        !          1174:        qboolean        anim_run;
        !          1175: 
        !          1176:        // powerup timers
        !          1177:        float           quad_framenum;
        !          1178:        float           invincible_framenum;
        !          1179:        float           breather_framenum;
        !          1180:        float           enviro_framenum;
        !          1181: 
        !          1182:        qboolean        grenade_blew_up;
        !          1183:        float           grenade_time;
        !          1184:        int                     silencer_shots;
        !          1185:        int                     weapon_sound;
        !          1186: 
        !          1187:        float           pickup_msg_time;
        !          1188: 
        !          1189:        float           flood_locktill;         // locked from talking
        !          1190:        float           flood_when[10];         // when messages were said
        !          1191:        int                     flood_whenhead;         // head pointer for when said
        !          1192: 
        !          1193:        float           respawn_time;           // can respawn when time > this
        !          1194: 
        !          1195:        edict_t         *chase_target;          // player we are chasing
        !          1196:        qboolean        update_chase;           // need to update chase info?
        !          1197: 
        !          1198: //=======
        !          1199: //ROGUE
        !          1200:        float           double_framenum;
        !          1201:        float           ir_framenum;
        !          1202:        float           torch_framenum;
        !          1203:        float           nuke_framenum;
        !          1204:        float           tracker_pain_framenum;
        !          1205: 
        !          1206:        edict_t         *owned_sphere;          // this points to the player's sphere
        !          1207: //ROGUE
        !          1208: //=======
        !          1209: };
        !          1210: 
        !          1211: 
        !          1212: struct edict_s
        !          1213: {
        !          1214:        entity_state_t  s;
        !          1215:        struct gclient_s        *client;        // NULL if not a player
        !          1216:                                                                        // the server expects the first part
        !          1217:                                                                        // of gclient_s to be a player_state_t
        !          1218:                                                                        // but the rest of it is opaque
        !          1219: 
        !          1220:        qboolean        inuse;
        !          1221:        int                     linkcount;
        !          1222: 
        !          1223:        // FIXME: move these fields to a server private sv_entity_t
        !          1224:        link_t          area;                           // linked to a division node or leaf
        !          1225:        
        !          1226:        int                     num_clusters;           // if -1, use headnode instead
        !          1227:        int                     clusternums[MAX_ENT_CLUSTERS];
        !          1228:        int                     headnode;                       // unused if num_clusters != -1
        !          1229:        int                     areanum, areanum2;
        !          1230: 
        !          1231:        //================================
        !          1232: 
        !          1233:        int                     svflags;
        !          1234:        vec3_t          mins, maxs;
        !          1235:        vec3_t          absmin, absmax, size;
        !          1236:        solid_t         solid;
        !          1237:        int                     clipmask;
        !          1238:        edict_t         *owner;
        !          1239: 
        !          1240: 
        !          1241:        // DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER
        !          1242:        // EXPECTS THE FIELDS IN THAT ORDER!
        !          1243: 
        !          1244:        //================================
        !          1245:        int                     movetype;
        !          1246:        int                     flags;
        !          1247: 
        !          1248:        char            *model;
        !          1249:        float           freetime;                       // sv.time when the object was freed
        !          1250:        
        !          1251:        //
        !          1252:        // only used locally in game, not by server
        !          1253:        //
        !          1254:        char            *message;
        !          1255:        char            *classname;
        !          1256:        int                     spawnflags;
        !          1257: 
        !          1258:        float           timestamp;
        !          1259: 
        !          1260:        float           angle;                  // set in qe3, -1 = up, -2 = down
        !          1261:        char            *target;
        !          1262:        char            *targetname;
        !          1263:        char            *killtarget;
        !          1264:        char            *team;
        !          1265:        char            *pathtarget;
        !          1266:        char            *deathtarget;
        !          1267:        char            *combattarget;
        !          1268:        edict_t         *target_ent;
        !          1269: 
        !          1270:        float           speed, accel, decel;
        !          1271:        vec3_t          movedir;
        !          1272:        vec3_t          pos1, pos2;
        !          1273: 
        !          1274:        vec3_t          velocity;
        !          1275:        vec3_t          avelocity;
        !          1276:        int                     mass;
        !          1277:        float           air_finished;
        !          1278:        float           gravity;                // per entity gravity multiplier (1.0 is normal)
        !          1279:                                                                // use for lowgrav artifact, flares
        !          1280: 
        !          1281:        edict_t         *goalentity;
        !          1282:        edict_t         *movetarget;
        !          1283:        float           yaw_speed;
        !          1284:        float           ideal_yaw;
        !          1285: 
        !          1286:        float           nextthink;
        !          1287:        void            (*prethink) (edict_t *ent);
        !          1288:        void            (*think)(edict_t *self);
        !          1289:        void            (*blocked)(edict_t *self, edict_t *other);      //move to moveinfo?
        !          1290:        void            (*touch)(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf);
        !          1291:        void            (*use)(edict_t *self, edict_t *other, edict_t *activator);
        !          1292:        void            (*pain)(edict_t *self, edict_t *other, float kick, int damage);
        !          1293:        void            (*die)(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point);
        !          1294: 
        !          1295:        float           touch_debounce_time;            // are all these legit?  do we need more/less of them?
        !          1296:        float           pain_debounce_time;
        !          1297:        float           damage_debounce_time;
        !          1298:        float           fly_sound_debounce_time;        //move to clientinfo
        !          1299:        float           last_move_time;
        !          1300: 
        !          1301:        int                     health;
        !          1302:        int                     max_health;
        !          1303:        int                     gib_health;
        !          1304:        int                     deadflag;
        !          1305:        qboolean        show_hostile;
        !          1306: 
        !          1307:        float           powerarmor_time;
        !          1308: 
        !          1309:        char            *map;                   // target_changelevel
        !          1310: 
        !          1311:        int                     viewheight;             // height above origin where eyesight is determined
        !          1312:        int                     takedamage;
        !          1313:        int                     dmg;
        !          1314:        int                     radius_dmg;
        !          1315:        float           dmg_radius;
        !          1316:        int                     sounds;                 //make this a spawntemp var?
        !          1317:        int                     count;
        !          1318: 
        !          1319:        edict_t         *chain;
        !          1320:        edict_t         *enemy;
        !          1321:        edict_t         *oldenemy;
        !          1322:        edict_t         *activator;
        !          1323:        edict_t         *groundentity;
        !          1324:        int                     groundentity_linkcount;
        !          1325:        edict_t         *teamchain;
        !          1326:        edict_t         *teammaster;
        !          1327: 
        !          1328:        edict_t         *mynoise;               // can go in client only
        !          1329:        edict_t         *mynoise2;
        !          1330: 
        !          1331:        int                     noise_index;
        !          1332:        int                     noise_index2;
        !          1333:        float           volume;
        !          1334:        float           attenuation;
        !          1335: 
        !          1336:        // timing variables
        !          1337:        float           wait;
        !          1338:        float           delay;                  // before firing targets
        !          1339:        float           random;
        !          1340: 
        !          1341:        float           teleport_time;
        !          1342: 
        !          1343:        int                     watertype;
        !          1344:        int                     waterlevel;
        !          1345: 
        !          1346:        vec3_t          move_origin;
        !          1347:        vec3_t          move_angles;
        !          1348: 
        !          1349:        // move this to clientinfo?
        !          1350:        int                     light_level;
        !          1351: 
        !          1352:        int                     style;                  // also used as areaportal number
        !          1353: 
        !          1354:        gitem_t         *item;                  // for bonus items
        !          1355: 
        !          1356:        // common data blocks
        !          1357:        moveinfo_t              moveinfo;
        !          1358:        monsterinfo_t   monsterinfo;
        !          1359: 
        !          1360: //=========
        !          1361: //ROGUE
        !          1362:        int                     plat2flags;
        !          1363:        vec3_t          offset;
        !          1364:        vec3_t          gravityVector;
        !          1365:        edict_t         *bad_area;
        !          1366:        edict_t         *hint_chain;
        !          1367:        edict_t         *monster_hint_chain;
        !          1368:        edict_t         *target_hint_chain;
        !          1369:        int                     hint_chain_id;
        !          1370:        // FIXME - debug help!
        !          1371:        float           lastMoveTime;
        !          1372: //ROGUE
        !          1373: //=========
        !          1374: };
        !          1375: 
        !          1376: //=============
        !          1377: //ROGUE
        !          1378: #define ROGUE_GRAVITY  1
        !          1379: 
        !          1380: #define SPHERE_DEFENDER                        0x0001
        !          1381: #define SPHERE_HUNTER                  0x0002
        !          1382: #define SPHERE_VENGEANCE               0x0004
        !          1383: #define SPHERE_DOPPLEGANGER            0x0100
        !          1384: 
        !          1385: #define SPHERE_TYPE                            0x00FF
        !          1386: #define SPHERE_FLAGS                   0xFF00
        !          1387: 
        !          1388: //
        !          1389: // deathmatch games
        !          1390: //
        !          1391: #define                RDM_TAG                 2
        !          1392: #define                RDM_DEATHBALL   3
        !          1393: 
        !          1394: typedef struct dm_game_rs
        !          1395: {
        !          1396:        void            (*GameInit)(void);
        !          1397:        void            (*PostInitSetup)(void);
        !          1398:        void            (*ClientBegin) (edict_t *ent);
        !          1399:        void            (*SelectSpawnPoint) (edict_t *ent, vec3_t origin, vec3_t angles);
        !          1400:        void            (*PlayerDeath)(edict_t *targ, edict_t *inflictor, edict_t *attacker);
        !          1401:        void            (*Score)(edict_t *attacker, edict_t *victim, int scoreChange);
        !          1402:        void            (*PlayerEffects)(edict_t *ent);
        !          1403:        void            (*DogTag)(edict_t *ent, edict_t *killer, char **pic);
        !          1404:        void            (*PlayerDisconnect)(edict_t *ent);
        !          1405:        int                     (*ChangeDamage)(edict_t *targ, edict_t *attacker, int damage, int mod);
        !          1406:        int                     (*ChangeKnockback)(edict_t *targ, edict_t *attacker, int knockback, int mod);
        !          1407:        int                     (*CheckDMRules)(void);
        !          1408: } dm_game_rt;
        !          1409: 
        !          1410: extern dm_game_rt      DMGame;
        !          1411: 
        !          1412: void Tag_GameInit (void);
        !          1413: void Tag_PostInitSetup (void);
        !          1414: void Tag_PlayerDeath (edict_t *targ, edict_t *inflictor, edict_t *attacker);
        !          1415: void Tag_Score (edict_t *attacker, edict_t *victim, int scoreChange);
        !          1416: void Tag_PlayerEffects (edict_t *ent);
        !          1417: void Tag_DogTag (edict_t *ent, edict_t *killer, char **pic);
        !          1418: void Tag_PlayerDisconnect (edict_t *ent);
        !          1419: int  Tag_ChangeDamage (edict_t *targ, edict_t *attacker, int damage, int mod);
        !          1420: 
        !          1421: void DBall_GameInit (void);
        !          1422: void DBall_ClientBegin (edict_t *ent);
        !          1423: void DBall_SelectSpawnPoint (edict_t *ent, vec3_t origin, vec3_t angles);
        !          1424: int  DBall_ChangeKnockback (edict_t *targ, edict_t *attacker, int knockback, int mod);
        !          1425: int  DBall_ChangeDamage (edict_t *targ, edict_t *attacker, int damage, int mod);
        !          1426: void DBall_PostInitSetup (void);
        !          1427: int  DBall_CheckDMRules (void);
        !          1428: //void Tag_PlayerDeath (edict_t *targ, edict_t *inflictor, edict_t *attacker);
        !          1429: //void Tag_Score (edict_t *attacker, edict_t *victim, int scoreChange);
        !          1430: //void Tag_PlayerEffects (edict_t *ent);
        !          1431: //void Tag_DogTag (edict_t *ent, edict_t *killer, char **pic);
        !          1432: //void Tag_PlayerDisconnect (edict_t *ent);
        !          1433: //int  Tag_ChangeDamage (edict_t *targ, edict_t *attacker, int damage);
        !          1434: 
        !          1435: //ROGUE
        !          1436: //============

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.