Annotation of quake2/rogue/g_items.c, revision 1.1

1.1     ! root        1: #include "g_local.h"
        !             2: 
        !             3: 
        !             4: qboolean       Pickup_Weapon (edict_t *ent, edict_t *other);
        !             5: void           Use_Weapon (edict_t *ent, gitem_t *inv);
        !             6: void           Drop_Weapon (edict_t *ent, gitem_t *inv);
        !             7: 
        !             8: void Weapon_Blaster (edict_t *ent);
        !             9: void Weapon_Shotgun (edict_t *ent);
        !            10: void Weapon_SuperShotgun (edict_t *ent);
        !            11: void Weapon_Machinegun (edict_t *ent);
        !            12: void Weapon_Chaingun (edict_t *ent);
        !            13: void Weapon_HyperBlaster (edict_t *ent);
        !            14: void Weapon_RocketLauncher (edict_t *ent);
        !            15: void Weapon_Grenade (edict_t *ent);
        !            16: void Weapon_GrenadeLauncher (edict_t *ent);
        !            17: void Weapon_Railgun (edict_t *ent);
        !            18: void Weapon_BFG (edict_t *ent);
        !            19: 
        !            20: //=========
        !            21: //Rogue Weapons
        !            22: void Weapon_ChainFist (edict_t *ent);
        !            23: void Weapon_Disintegrator (edict_t *ent);
        !            24: void Weapon_ETF_Rifle (edict_t *ent);
        !            25: void Weapon_Heatbeam (edict_t *ent);
        !            26: void Weapon_Prox (edict_t *ent);
        !            27: void Weapon_Tesla (edict_t *ent);
        !            28: void Weapon_ProxLauncher (edict_t *ent);
        !            29: //void Weapon_Nuke (edict_t *ent);
        !            30: //Rogue Weapons
        !            31: //=========
        !            32: 
        !            33: gitem_armor_t jacketarmor_info = { 25,  50, .30, .00, ARMOR_JACKET};
        !            34: gitem_armor_t combatarmor_info = { 50, 100, .60, .30, ARMOR_COMBAT};
        !            35: gitem_armor_t bodyarmor_info   = {100, 200, .80, .60, ARMOR_BODY};
        !            36: 
        !            37: static int     jacket_armor_index;
        !            38: static int     combat_armor_index;
        !            39: static int     body_armor_index;
        !            40: static int     power_screen_index;
        !            41: static int     power_shield_index;
        !            42: 
        !            43: #define HEALTH_IGNORE_MAX      1
        !            44: #define HEALTH_TIMED           2
        !            45: 
        !            46: void Use_Quad (edict_t *ent, gitem_t *item);
        !            47: static int     quad_drop_timeout_hack;
        !            48: 
        !            49: //======================================================================
        !            50: 
        !            51: /*
        !            52: ===============
        !            53: GetItemByIndex
        !            54: ===============
        !            55: */
        !            56: gitem_t        *GetItemByIndex (int index)
        !            57: {
        !            58:        if (index == 0 || index >= game.num_items)
        !            59:                return NULL;
        !            60: 
        !            61:        return &itemlist[index];
        !            62: }
        !            63: 
        !            64: 
        !            65: /*
        !            66: ===============
        !            67: FindItemByClassname
        !            68: 
        !            69: ===============
        !            70: */
        !            71: gitem_t        *FindItemByClassname (char *classname)
        !            72: {
        !            73:        int             i;
        !            74:        gitem_t *it;
        !            75: 
        !            76:        it = itemlist;
        !            77:        for (i=0 ; i<game.num_items ; i++, it++)
        !            78:        {
        !            79:                if (!it->classname)
        !            80:                        continue;
        !            81:                if (!Q_stricmp(it->classname, classname))
        !            82:                        return it;
        !            83:        }
        !            84: 
        !            85:        return NULL;
        !            86: }
        !            87: 
        !            88: /*
        !            89: ===============
        !            90: FindItem
        !            91: 
        !            92: ===============
        !            93: */
        !            94: gitem_t        *FindItem (char *pickup_name)
        !            95: {
        !            96:        int             i;
        !            97:        gitem_t *it;
        !            98: 
        !            99:        it = itemlist;
        !           100:        for (i=0 ; i<game.num_items ; i++, it++)
        !           101:        {
        !           102:                if (!it->pickup_name)
        !           103:                        continue;
        !           104:                if (!Q_stricmp(it->pickup_name, pickup_name))
        !           105:                        return it;
        !           106:        }
        !           107: 
        !           108:        return NULL;
        !           109: }
        !           110: 
        !           111: //======================================================================
        !           112: 
        !           113: void DoRespawn (edict_t *ent)
        !           114: {
        !           115:        if (ent->team)
        !           116:        {
        !           117:                edict_t *master;
        !           118:                int     count;
        !           119:                int choice;
        !           120: 
        !           121:                master = ent->teammaster;
        !           122: 
        !           123:                for (count = 0, ent = master; ent; ent = ent->chain, count++)
        !           124:                        ;
        !           125: 
        !           126:                choice = rand() % count;
        !           127: 
        !           128:                for (count = 0, ent = master; count < choice; ent = ent->chain, count++)
        !           129:                        ;
        !           130:        }
        !           131: 
        !           132: //=====
        !           133: //ROGUE
        !           134:        if(randomrespawn && randomrespawn->value)
        !           135:        {
        !           136:                edict_t *newEnt;
        !           137: 
        !           138:                newEnt = DoRandomRespawn (ent);
        !           139:                
        !           140:                // if we've changed entities, then do some sleight of hand.
        !           141:                // otherwise, the old entity will respawn
        !           142:                if(newEnt)
        !           143:                {
        !           144:                        G_FreeEdict (ent);
        !           145:                        ent = newEnt;
        !           146:                }
        !           147:        }
        !           148: //ROGUE
        !           149: //=====
        !           150: 
        !           151:        ent->svflags &= ~SVF_NOCLIENT;
        !           152:        ent->solid = SOLID_TRIGGER;
        !           153:        gi.linkentity (ent);
        !           154: 
        !           155:        // send an effect
        !           156:        ent->s.event = EV_ITEM_RESPAWN;
        !           157: }
        !           158: 
        !           159: void SetRespawn (edict_t *ent, float delay)
        !           160: {
        !           161:        ent->flags |= FL_RESPAWN;
        !           162:        ent->svflags |= SVF_NOCLIENT;
        !           163:        ent->solid = SOLID_NOT;
        !           164:        ent->nextthink = level.time + delay;
        !           165:        ent->think = DoRespawn;
        !           166:        gi.linkentity (ent);
        !           167: }
        !           168: 
        !           169: 
        !           170: //======================================================================
        !           171: 
        !           172: qboolean Pickup_Powerup (edict_t *ent, edict_t *other)
        !           173: {
        !           174:        int             quantity;
        !           175: 
        !           176:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
        !           177:        if ((skill->value == 1 && quantity >= 2) || (skill->value >= 2 && quantity >= 1))
        !           178:                return false;
        !           179: 
        !           180:        if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0))
        !           181:                return false;
        !           182: 
        !           183:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !           184: 
        !           185:        if (deathmatch->value)
        !           186:        {
        !           187:                if (!(ent->spawnflags & DROPPED_ITEM) )
        !           188:                        SetRespawn (ent, ent->item->quantity);
        !           189:                if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM)))
        !           190:                {
        !           191:                        if ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM))
        !           192:                                quad_drop_timeout_hack = (ent->nextthink - level.time) / FRAMETIME;
        !           193: //PGM
        !           194:                        if(ent->item->use)
        !           195:                                ent->item->use (other, ent->item);
        !           196:                        else
        !           197:                                gi.dprintf("Powerup has no use function!\n");
        !           198: //PGM
        !           199:                }
        !           200:        }
        !           201: 
        !           202:        return true;
        !           203: }
        !           204: 
        !           205: void Drop_General (edict_t *ent, gitem_t *item)
        !           206: {
        !           207:        Drop_Item (ent, item);
        !           208:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           209:        ValidateSelectedItem (ent);
        !           210: }
        !           211: 
        !           212: 
        !           213: //======================================================================
        !           214: 
        !           215: qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
        !           216: {
        !           217:        if (!deathmatch->value)
        !           218:                other->max_health += 1;
        !           219: 
        !           220:        if (other->health < other->max_health)
        !           221:                other->health = other->max_health;
        !           222: 
        !           223:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           224:                SetRespawn (ent, ent->item->quantity);
        !           225: 
        !           226:        return true;
        !           227: }
        !           228: 
        !           229: qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
        !           230: {
        !           231:        other->max_health += 2;
        !           232: 
        !           233:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           234:                SetRespawn (ent, ent->item->quantity);
        !           235: 
        !           236:        return true;
        !           237: }
        !           238: 
        !           239: qboolean Pickup_Bandolier (edict_t *ent, edict_t *other)
        !           240: {
        !           241:        gitem_t *item;
        !           242:        int             index;
        !           243: 
        !           244:        if (other->client->pers.max_bullets < 250)
        !           245:                other->client->pers.max_bullets = 250;
        !           246:        if (other->client->pers.max_shells < 150)
        !           247:                other->client->pers.max_shells = 150;
        !           248:        if (other->client->pers.max_cells < 250)
        !           249:                other->client->pers.max_cells = 250;
        !           250:        if (other->client->pers.max_slugs < 75)
        !           251:                other->client->pers.max_slugs = 75;
        !           252:        //PMM
        !           253:        if (other->client->pers.max_flechettes < 250)
        !           254:                other->client->pers.max_flechettes = 250;
        !           255: #ifndef KILL_DISRUPTOR
        !           256:        if (other->client->pers.max_rounds < 150)
        !           257:                other->client->pers.max_rounds = 150;
        !           258: #endif
        !           259:        //pmm
        !           260: 
        !           261:        item = FindItem("Bullets");
        !           262:        if (item)
        !           263:        {
        !           264:                index = ITEM_INDEX(item);
        !           265:                other->client->pers.inventory[index] += item->quantity;
        !           266:                if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
        !           267:                        other->client->pers.inventory[index] = other->client->pers.max_bullets;
        !           268:        }
        !           269: 
        !           270:        item = FindItem("Shells");
        !           271:        if (item)
        !           272:        {
        !           273:                index = ITEM_INDEX(item);
        !           274:                other->client->pers.inventory[index] += item->quantity;
        !           275:                if (other->client->pers.inventory[index] > other->client->pers.max_shells)
        !           276:                        other->client->pers.inventory[index] = other->client->pers.max_shells;
        !           277:        }
        !           278: 
        !           279:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           280:                SetRespawn (ent, ent->item->quantity);
        !           281: 
        !           282:        return true;
        !           283: }
        !           284: 
        !           285: qboolean Pickup_Pack (edict_t *ent, edict_t *other)
        !           286: {
        !           287:        gitem_t *item;
        !           288:        int             index;
        !           289: 
        !           290:        if (other->client->pers.max_bullets < 300)
        !           291:                other->client->pers.max_bullets = 300;
        !           292:        if (other->client->pers.max_shells < 200)
        !           293:                other->client->pers.max_shells = 200;
        !           294:        if (other->client->pers.max_rockets < 100)
        !           295:                other->client->pers.max_rockets = 100;
        !           296:        if (other->client->pers.max_grenades < 100)
        !           297:                other->client->pers.max_grenades = 100;
        !           298:        if (other->client->pers.max_cells < 300)
        !           299:                other->client->pers.max_cells = 300;
        !           300:        if (other->client->pers.max_slugs < 100)
        !           301:                other->client->pers.max_slugs = 100;
        !           302:        //PMM
        !           303:        if (other->client->pers.max_flechettes < 200)
        !           304:                other->client->pers.max_flechettes = 200;
        !           305: #ifndef KILL_DISRUPTOR
        !           306:        if (other->client->pers.max_rounds < 200)
        !           307:                other->client->pers.max_rounds = 200;
        !           308: #endif
        !           309:        //pmm
        !           310: 
        !           311:        item = FindItem("Bullets");
        !           312:        if (item)
        !           313:        {
        !           314:                index = ITEM_INDEX(item);
        !           315:                other->client->pers.inventory[index] += item->quantity;
        !           316:                if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
        !           317:                        other->client->pers.inventory[index] = other->client->pers.max_bullets;
        !           318:        }
        !           319: 
        !           320:        item = FindItem("Shells");
        !           321:        if (item)
        !           322:        {
        !           323:                index = ITEM_INDEX(item);
        !           324:                other->client->pers.inventory[index] += item->quantity;
        !           325:                if (other->client->pers.inventory[index] > other->client->pers.max_shells)
        !           326:                        other->client->pers.inventory[index] = other->client->pers.max_shells;
        !           327:        }
        !           328: 
        !           329:        item = FindItem("Cells");
        !           330:        if (item)
        !           331:        {
        !           332:                index = ITEM_INDEX(item);
        !           333:                other->client->pers.inventory[index] += item->quantity;
        !           334:                if (other->client->pers.inventory[index] > other->client->pers.max_cells)
        !           335:                        other->client->pers.inventory[index] = other->client->pers.max_cells;
        !           336:        }
        !           337: 
        !           338:        item = FindItem("Grenades");
        !           339:        if (item)
        !           340:        {
        !           341:                index = ITEM_INDEX(item);
        !           342:                other->client->pers.inventory[index] += item->quantity;
        !           343:                if (other->client->pers.inventory[index] > other->client->pers.max_grenades)
        !           344:                        other->client->pers.inventory[index] = other->client->pers.max_grenades;
        !           345:        }
        !           346: 
        !           347:        item = FindItem("Rockets");
        !           348:        if (item)
        !           349:        {
        !           350:                index = ITEM_INDEX(item);
        !           351:                other->client->pers.inventory[index] += item->quantity;
        !           352:                if (other->client->pers.inventory[index] > other->client->pers.max_rockets)
        !           353:                        other->client->pers.inventory[index] = other->client->pers.max_rockets;
        !           354:        }
        !           355: 
        !           356:        item = FindItem("Slugs");
        !           357:        if (item)
        !           358:        {
        !           359:                index = ITEM_INDEX(item);
        !           360:                other->client->pers.inventory[index] += item->quantity;
        !           361:                if (other->client->pers.inventory[index] > other->client->pers.max_slugs)
        !           362:                        other->client->pers.inventory[index] = other->client->pers.max_slugs;
        !           363:        }
        !           364: //PMM
        !           365:        item = FindItem("Flechettes");
        !           366:        if (item)
        !           367:        {
        !           368:                index = ITEM_INDEX(item);
        !           369:                other->client->pers.inventory[index] += item->quantity;
        !           370:                if (other->client->pers.inventory[index] > other->client->pers.max_flechettes)
        !           371:                        other->client->pers.inventory[index] = other->client->pers.max_flechettes;
        !           372:        }
        !           373: #ifndef KILL_DISRUPTOR
        !           374:        item = FindItem("Rounds");
        !           375:        if (item)
        !           376:        {
        !           377:                index = ITEM_INDEX(item);
        !           378:                other->client->pers.inventory[index] += item->quantity;
        !           379:                if (other->client->pers.inventory[index] > other->client->pers.max_rounds)
        !           380:                        other->client->pers.inventory[index] = other->client->pers.max_rounds;
        !           381:        }
        !           382: #endif
        !           383: //pmm
        !           384:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           385:                SetRespawn (ent, ent->item->quantity);
        !           386: 
        !           387:        return true;
        !           388: }
        !           389: // ================
        !           390: // PMM
        !           391: qboolean Pickup_Nuke (edict_t *ent, edict_t *other)
        !           392: {
        !           393:        int             quantity;
        !           394: 
        !           395: //     if (!deathmatch->value)
        !           396: //             return;
        !           397:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
        !           398: //     if ((skill->value == 1 && quantity >= 2) || (skill->value >= 2 && quantity >= 1))
        !           399: //             return false;
        !           400: 
        !           401:        if (quantity >= 1)
        !           402:                return false;
        !           403: 
        !           404:        if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0))
        !           405:                return false;
        !           406: 
        !           407:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !           408: 
        !           409:        if (deathmatch->value)
        !           410:        {
        !           411:                if (!(ent->spawnflags & DROPPED_ITEM) )
        !           412:                        SetRespawn (ent, ent->item->quantity);
        !           413:        }
        !           414: 
        !           415:        return true;
        !           416: }
        !           417: 
        !           418: // ================
        !           419: // PGM
        !           420: void Use_IR (edict_t *ent, gitem_t *item)
        !           421: {
        !           422:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           423:        ValidateSelectedItem (ent);
        !           424: 
        !           425:        if (ent->client->ir_framenum > level.framenum)
        !           426:                ent->client->ir_framenum += 600;
        !           427:        else
        !           428:                ent->client->ir_framenum = level.framenum + 600;
        !           429: 
        !           430: //     FIXME - SOUND!
        !           431: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
        !           432: }
        !           433: 
        !           434: void Use_Double (edict_t *ent, gitem_t *item)
        !           435: {
        !           436:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           437:        ValidateSelectedItem (ent);
        !           438: 
        !           439:        if (ent->client->double_framenum > level.framenum)
        !           440:                ent->client->double_framenum += 300;
        !           441:        else
        !           442:                ent->client->double_framenum = level.framenum + 300;
        !           443: 
        !           444:        gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
        !           445: }
        !           446: 
        !           447: void Use_Torch (edict_t *ent, gitem_t *item)
        !           448: {
        !           449:        ent->client->torch_framenum = level.framenum + 600;
        !           450: }
        !           451: 
        !           452: void Use_Compass (edict_t *ent, gitem_t *item)
        !           453: {
        !           454:        int ang;
        !           455: 
        !           456:        ang = (int)(ent->client->v_angle[1]);
        !           457:        if(ang<0)
        !           458:                ang += 360;
        !           459: 
        !           460:        gi.cprintf(ent, PRINT_HIGH, "Origin: %0.0f,%0.0f,%0.0f    Dir: %d\n", ent->s.origin[0], ent->s.origin[1],
        !           461:                                ent->s.origin[2], ang);
        !           462: }
        !           463: 
        !           464: void Use_Nuke (edict_t *ent, gitem_t *item)
        !           465: {
        !           466:        vec3_t  forward, right, start;
        !           467:        float   speed;
        !           468: 
        !           469:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           470:        ValidateSelectedItem (ent);
        !           471: 
        !           472:        AngleVectors (ent->client->v_angle, forward, right, NULL);
        !           473: 
        !           474:        VectorCopy (ent->s.origin, start);
        !           475:        speed = 100;
        !           476:        fire_nuke (ent, start, forward, speed);
        !           477: }
        !           478: 
        !           479: void Use_Doppleganger (edict_t *ent, gitem_t *item)
        !           480: {
        !           481:        vec3_t          forward, right;
        !           482:        vec3_t          createPt, spawnPt;
        !           483:        vec3_t          ang;
        !           484: 
        !           485:        VectorClear(ang);
        !           486:        ang[YAW] = ent->client->v_angle[YAW];
        !           487:        AngleVectors (ang, forward, right, NULL);
        !           488: 
        !           489:        VectorMA(ent->s.origin, 48, forward, createPt);
        !           490: 
        !           491:        if(!FindSpawnPoint(createPt, ent->mins, ent->maxs, spawnPt, 32))
        !           492:                return;
        !           493: 
        !           494:        if(!CheckGroundSpawnPoint(spawnPt, ent->mins, ent->maxs, 64, -1))
        !           495:                return;
        !           496: 
        !           497:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           498:        ValidateSelectedItem (ent);
        !           499: 
        !           500:        SpawnGrow_Spawn (spawnPt, 0);
        !           501:        fire_doppleganger (ent, spawnPt, forward);
        !           502: }
        !           503: 
        !           504: qboolean Pickup_Doppleganger (edict_t *ent, edict_t *other)
        !           505: {
        !           506:        int             quantity;
        !           507: 
        !           508:        if(!(deathmatch->value))                // item is DM only
        !           509:                return false;
        !           510: 
        !           511:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
        !           512:        if (quantity >= 1)              // FIXME - apply max to dopplegangers
        !           513:                return false;
        !           514: 
        !           515:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !           516: 
        !           517:        if (!(ent->spawnflags & DROPPED_ITEM) )
        !           518:                SetRespawn (ent, ent->item->quantity);
        !           519: 
        !           520:        return true;
        !           521: }
        !           522: 
        !           523: 
        !           524: qboolean Pickup_Sphere (edict_t *ent, edict_t *other)
        !           525: {
        !           526:        int             quantity;
        !           527: 
        !           528:        if(other->client && other->client->owned_sphere)
        !           529:        {
        !           530: //             gi.cprintf(other, PRINT_HIGH, "Only one sphere to a customer!\n");
        !           531:                return false;
        !           532:        }
        !           533: 
        !           534:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
        !           535:        if ((skill->value == 1 && quantity >= 2) || (skill->value >= 2 && quantity >= 1))
        !           536:                return false;
        !           537: 
        !           538:        if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0))
        !           539:                return false;
        !           540: 
        !           541:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !           542: 
        !           543:        if (deathmatch->value)
        !           544:        {
        !           545:                if (!(ent->spawnflags & DROPPED_ITEM) )
        !           546:                        SetRespawn (ent, ent->item->quantity);
        !           547:                if (((int)dmflags->value & DF_INSTANT_ITEMS))
        !           548:                {
        !           549: //PGM
        !           550:                        if(ent->item->use)
        !           551:                                ent->item->use (other, ent->item);
        !           552:                        else
        !           553:                                gi.dprintf("Powerup has no use function!\n");
        !           554: //PGM
        !           555:                }
        !           556:        }
        !           557: 
        !           558:        return true;
        !           559: }
        !           560: 
        !           561: void Use_Defender (edict_t *ent, gitem_t *item)
        !           562: {
        !           563:        if(ent->client && ent->client->owned_sphere)
        !           564:        {
        !           565:                gi.cprintf(ent, PRINT_HIGH, "Only one sphere at a time!\n");
        !           566:                return;
        !           567:        }
        !           568: 
        !           569:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           570:        ValidateSelectedItem (ent);
        !           571: 
        !           572:        Defender_Launch (ent);
        !           573: }
        !           574: 
        !           575: void Use_Hunter (edict_t *ent, gitem_t *item)
        !           576: {
        !           577:        if(ent->client && ent->client->owned_sphere)
        !           578:        {
        !           579:                gi.cprintf(ent, PRINT_HIGH, "Only one sphere at a time!\n");
        !           580:                return;
        !           581:        }
        !           582: 
        !           583:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           584:        ValidateSelectedItem (ent);
        !           585: 
        !           586:        Hunter_Launch (ent);
        !           587: }
        !           588: 
        !           589: void Use_Vengeance (edict_t *ent, gitem_t *item)
        !           590: {
        !           591:        if(ent->client && ent->client->owned_sphere)
        !           592:        {
        !           593:                gi.cprintf(ent, PRINT_HIGH, "Only one sphere at a time!\n");
        !           594:                return;
        !           595:        }
        !           596: 
        !           597:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           598:        ValidateSelectedItem (ent);
        !           599: 
        !           600:        Vengeance_Launch (ent);
        !           601: }
        !           602: 
        !           603: // PGM
        !           604: // ================
        !           605: 
        !           606: 
        !           607: //======================================================================
        !           608: 
        !           609: void Use_Quad (edict_t *ent, gitem_t *item)
        !           610: {
        !           611:        int             timeout;
        !           612: 
        !           613:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           614:        ValidateSelectedItem (ent);
        !           615: 
        !           616:        if (quad_drop_timeout_hack)
        !           617:        {
        !           618:                timeout = quad_drop_timeout_hack;
        !           619:                quad_drop_timeout_hack = 0;
        !           620:        }
        !           621:        else
        !           622:        {
        !           623:                timeout = 300;
        !           624:        }
        !           625: 
        !           626:        if (ent->client->quad_framenum > level.framenum)
        !           627:                ent->client->quad_framenum += timeout;
        !           628:        else
        !           629:                ent->client->quad_framenum = level.framenum + timeout;
        !           630: 
        !           631:        gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
        !           632: }
        !           633: 
        !           634: //======================================================================
        !           635: 
        !           636: void Use_Breather (edict_t *ent, gitem_t *item)
        !           637: {
        !           638:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           639:        ValidateSelectedItem (ent);
        !           640: 
        !           641:        if (ent->client->breather_framenum > level.framenum)
        !           642:                ent->client->breather_framenum += 300;
        !           643:        else
        !           644:                ent->client->breather_framenum = level.framenum + 300;
        !           645: 
        !           646: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
        !           647: }
        !           648: 
        !           649: //======================================================================
        !           650: 
        !           651: void Use_Envirosuit (edict_t *ent, gitem_t *item)
        !           652: {
        !           653:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           654:        ValidateSelectedItem (ent);
        !           655: 
        !           656:        if (ent->client->enviro_framenum > level.framenum)
        !           657:                ent->client->enviro_framenum += 300;
        !           658:        else
        !           659:                ent->client->enviro_framenum = level.framenum + 300;
        !           660: 
        !           661: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
        !           662: }
        !           663: 
        !           664: //======================================================================
        !           665: 
        !           666: void   Use_Invulnerability (edict_t *ent, gitem_t *item)
        !           667: {
        !           668:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           669:        ValidateSelectedItem (ent);
        !           670: 
        !           671:        if (ent->client->invincible_framenum > level.framenum)
        !           672:                ent->client->invincible_framenum += 300;
        !           673:        else
        !           674:                ent->client->invincible_framenum = level.framenum + 300;
        !           675: 
        !           676:        gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
        !           677: }
        !           678: 
        !           679: //======================================================================
        !           680: 
        !           681: void   Use_Silencer (edict_t *ent, gitem_t *item)
        !           682: {
        !           683:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
        !           684:        ValidateSelectedItem (ent);
        !           685:        ent->client->silencer_shots += 30;
        !           686: 
        !           687: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
        !           688: }
        !           689: 
        !           690: //======================================================================
        !           691: 
        !           692: qboolean Pickup_Key (edict_t *ent, edict_t *other)
        !           693: {
        !           694:        if (coop->value)
        !           695:        {
        !           696:                if (strcmp(ent->classname, "key_power_cube") == 0)
        !           697:                {
        !           698:                        if (other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00)>> 8))
        !           699:                                return false;
        !           700:                        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !           701:                        other->client->pers.power_cubes |= ((ent->spawnflags & 0x0000ff00) >> 8);
        !           702:                }
        !           703:                else
        !           704:                {
        !           705:                        if (other->client->pers.inventory[ITEM_INDEX(ent->item)])
        !           706:                                return false;
        !           707:                        other->client->pers.inventory[ITEM_INDEX(ent->item)] = 1;
        !           708:                }
        !           709:                return true;
        !           710:        }
        !           711:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !           712:        return true;
        !           713: }
        !           714: 
        !           715: //======================================================================
        !           716: 
        !           717: qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
        !           718: {
        !           719:        int                     index;
        !           720:        int                     max;
        !           721: 
        !           722:        if (!ent->client)
        !           723:                return false;
        !           724: 
        !           725:        if (item->tag == AMMO_BULLETS)
        !           726:                max = ent->client->pers.max_bullets;
        !           727:        else if (item->tag == AMMO_SHELLS)
        !           728:                max = ent->client->pers.max_shells;
        !           729:        else if (item->tag == AMMO_ROCKETS)
        !           730:                max = ent->client->pers.max_rockets;
        !           731:        else if (item->tag == AMMO_GRENADES)
        !           732:                max = ent->client->pers.max_grenades;
        !           733:        else if (item->tag == AMMO_CELLS)
        !           734:                max = ent->client->pers.max_cells;
        !           735:        else if (item->tag == AMMO_SLUGS)
        !           736:                max = ent->client->pers.max_slugs;
        !           737: // ROGUE
        !           738: //     else if (item->tag == AMMO_MINES)
        !           739: //             max = ent->client->pers.max_mines;
        !           740:        else if (item->tag == AMMO_FLECHETTES)
        !           741:                max = ent->client->pers.max_flechettes;
        !           742:        else if (item->tag == AMMO_PROX)
        !           743:                max = ent->client->pers.max_prox;
        !           744:        else if (item->tag == AMMO_TESLA)
        !           745:                max = ent->client->pers.max_tesla;
        !           746: #ifndef KILL_DISRUPTOR
        !           747:        else if (item->tag == AMMO_DISRUPTOR)
        !           748:                max = ent->client->pers.max_rounds;
        !           749: #endif
        !           750: // ROGUE
        !           751:        else
        !           752:        {
        !           753:                gi.dprintf("undefined ammo type\n");
        !           754:                return false;
        !           755:        }
        !           756: 
        !           757:        index = ITEM_INDEX(item);
        !           758: 
        !           759:        if (ent->client->pers.inventory[index] == max)
        !           760:                return false;
        !           761: 
        !           762:        ent->client->pers.inventory[index] += count;
        !           763: 
        !           764:        if (ent->client->pers.inventory[index] > max)
        !           765:                ent->client->pers.inventory[index] = max;
        !           766: 
        !           767:        return true;
        !           768: }
        !           769: 
        !           770: qboolean Pickup_Ammo (edict_t *ent, edict_t *other)
        !           771: {
        !           772:        int                     oldcount;
        !           773:        int                     count;
        !           774:        qboolean        weapon;
        !           775: 
        !           776:        weapon = (ent->item->flags & IT_WEAPON);
        !           777:        if ( (weapon) && ( (int)dmflags->value & DF_INFINITE_AMMO ) )
        !           778:                count = 1000;
        !           779:        else if (ent->count)
        !           780:                count = ent->count;
        !           781:        else
        !           782:                count = ent->item->quantity;
        !           783: 
        !           784:        oldcount = other->client->pers.inventory[ITEM_INDEX(ent->item)];
        !           785: 
        !           786:        if (!Add_Ammo (other, ent->item, count))
        !           787:                return false;
        !           788: 
        !           789:        if (weapon && !oldcount)
        !           790:        {
        !           791:                if (other->client->pers.weapon != ent->item && ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) )
        !           792:                        other->client->newweapon = ent->item;
        !           793:        }
        !           794: 
        !           795:        if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)) && (deathmatch->value))
        !           796:                SetRespawn (ent, 30);
        !           797:        return true;
        !           798: }
        !           799: 
        !           800: void Drop_Ammo (edict_t *ent, gitem_t *item)
        !           801: {
        !           802:        edict_t *dropped;
        !           803:        int             index;
        !           804: 
        !           805:        index = ITEM_INDEX(item);
        !           806:        dropped = Drop_Item (ent, item);
        !           807:        if (ent->client->pers.inventory[index] >= item->quantity)
        !           808:                dropped->count = item->quantity;
        !           809:        else
        !           810:                dropped->count = ent->client->pers.inventory[index];
        !           811: 
        !           812:        if (ent->client->pers.weapon && 
        !           813:                ent->client->pers.weapon->tag == AMMO_GRENADES &&
        !           814:                item->tag == AMMO_GRENADES &&
        !           815:                ent->client->pers.inventory[index] - dropped->count <= 0) {
        !           816:                gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n");
        !           817:                G_FreeEdict(dropped);
        !           818:                return;
        !           819:        }
        !           820: 
        !           821:        ent->client->pers.inventory[index] -= dropped->count;
        !           822:        ValidateSelectedItem (ent);
        !           823: }
        !           824: 
        !           825: 
        !           826: //======================================================================
        !           827: 
        !           828: void MegaHealth_think (edict_t *self)
        !           829: {
        !           830:        if (self->owner->health > self->owner->max_health)
        !           831:        {
        !           832:                self->nextthink = level.time + 1;
        !           833:                self->owner->health -= 1;
        !           834:                return;
        !           835:        }
        !           836: 
        !           837:        if (!(self->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           838:                SetRespawn (self, 20);
        !           839:        else
        !           840:                G_FreeEdict (self);
        !           841: }
        !           842: 
        !           843: qboolean Pickup_Health (edict_t *ent, edict_t *other)
        !           844: {
        !           845:        if (!(ent->style & HEALTH_IGNORE_MAX))
        !           846:                if (other->health >= other->max_health)
        !           847:                        return false;
        !           848: 
        !           849:        other->health += ent->count;
        !           850: 
        !           851:        if (!(ent->style & HEALTH_IGNORE_MAX))
        !           852:        {
        !           853:                if (other->health > other->max_health)
        !           854:                        other->health = other->max_health;
        !           855:        }
        !           856: 
        !           857:        if (ent->style & HEALTH_TIMED)
        !           858:        {
        !           859:                ent->think = MegaHealth_think;
        !           860:                ent->nextthink = level.time + 5;
        !           861:                ent->owner = other;
        !           862:                ent->flags |= FL_RESPAWN;
        !           863:                ent->svflags |= SVF_NOCLIENT;
        !           864:                ent->solid = SOLID_NOT;
        !           865:        }
        !           866:        else
        !           867:        {
        !           868:                if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           869:                        SetRespawn (ent, 30);
        !           870:        }
        !           871: 
        !           872:        return true;
        !           873: }
        !           874: 
        !           875: //======================================================================
        !           876: 
        !           877: int ArmorIndex (edict_t *ent)
        !           878: {
        !           879:        if (!ent->client)
        !           880:                return 0;
        !           881: 
        !           882:        if (ent->client->pers.inventory[jacket_armor_index] > 0)
        !           883:                return jacket_armor_index;
        !           884: 
        !           885:        if (ent->client->pers.inventory[combat_armor_index] > 0)
        !           886:                return combat_armor_index;
        !           887: 
        !           888:        if (ent->client->pers.inventory[body_armor_index] > 0)
        !           889:                return body_armor_index;
        !           890: 
        !           891:        return 0;
        !           892: }
        !           893: 
        !           894: qboolean Pickup_Armor (edict_t *ent, edict_t *other)
        !           895: {
        !           896:        int                             old_armor_index;
        !           897:        gitem_armor_t   *oldinfo;
        !           898:        gitem_armor_t   *newinfo;
        !           899:        int                             newcount;
        !           900:        float                   salvage;
        !           901:        int                             salvagecount;
        !           902: 
        !           903:        // get info on new armor
        !           904:        newinfo = (gitem_armor_t *)ent->item->info;
        !           905: 
        !           906:        old_armor_index = ArmorIndex (other);
        !           907: 
        !           908:        // handle armor shards specially
        !           909:        if (ent->item->tag == ARMOR_SHARD)
        !           910:        {
        !           911:                if (!old_armor_index)
        !           912:                        other->client->pers.inventory[jacket_armor_index] = 2;
        !           913:                else
        !           914:                        other->client->pers.inventory[old_armor_index] += 2;
        !           915:        }
        !           916: 
        !           917:        // if player has no armor, just use it
        !           918:        else if (!old_armor_index)
        !           919:        {
        !           920:                other->client->pers.inventory[ITEM_INDEX(ent->item)] = newinfo->base_count;
        !           921:        }
        !           922: 
        !           923:        // use the better armor
        !           924:        else
        !           925:        {
        !           926:                // get info on old armor
        !           927:                if (old_armor_index == jacket_armor_index)
        !           928:                        oldinfo = &jacketarmor_info;
        !           929:                else if (old_armor_index == combat_armor_index)
        !           930:                        oldinfo = &combatarmor_info;
        !           931:                else // (old_armor_index == body_armor_index)
        !           932:                        oldinfo = &bodyarmor_info;
        !           933: 
        !           934:                if (newinfo->normal_protection > oldinfo->normal_protection)
        !           935:                {
        !           936:                        // calc new armor values
        !           937:                        salvage = oldinfo->normal_protection / newinfo->normal_protection;
        !           938:                        salvagecount = salvage * other->client->pers.inventory[old_armor_index];
        !           939:                        newcount = newinfo->base_count + salvagecount;
        !           940:                        if (newcount > newinfo->max_count)
        !           941:                                newcount = newinfo->max_count;
        !           942: 
        !           943:                        // zero count of old armor so it goes away
        !           944:                        other->client->pers.inventory[old_armor_index] = 0;
        !           945: 
        !           946:                        // change armor to new item with computed value
        !           947:                        other->client->pers.inventory[ITEM_INDEX(ent->item)] = newcount;
        !           948:                }
        !           949:                else
        !           950:                {
        !           951:                        // calc new armor values
        !           952:                        salvage = newinfo->normal_protection / oldinfo->normal_protection;
        !           953:                        salvagecount = salvage * newinfo->base_count;
        !           954:                        newcount = other->client->pers.inventory[old_armor_index] + salvagecount;
        !           955:                        if (newcount > oldinfo->max_count)
        !           956:                                newcount = oldinfo->max_count;
        !           957: 
        !           958:                        // if we're already maxed out then we don't need the new armor
        !           959:                        if (other->client->pers.inventory[old_armor_index] >= newcount)
        !           960:                                return false;
        !           961: 
        !           962:                        // update current armor value
        !           963:                        other->client->pers.inventory[old_armor_index] = newcount;
        !           964:                }
        !           965:        }
        !           966: 
        !           967:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
        !           968:                SetRespawn (ent, 20);
        !           969: 
        !           970:        return true;
        !           971: }
        !           972: 
        !           973: //======================================================================
        !           974: 
        !           975: int PowerArmorType (edict_t *ent)
        !           976: {
        !           977:        if (!ent->client)
        !           978:                return POWER_ARMOR_NONE;
        !           979: 
        !           980:        if (!(ent->flags & FL_POWER_ARMOR))
        !           981:                return POWER_ARMOR_NONE;
        !           982: 
        !           983:        if (ent->client->pers.inventory[power_shield_index] > 0)
        !           984:                return POWER_ARMOR_SHIELD;
        !           985: 
        !           986:        if (ent->client->pers.inventory[power_screen_index] > 0)
        !           987:                return POWER_ARMOR_SCREEN;
        !           988: 
        !           989:        return POWER_ARMOR_NONE;
        !           990: }
        !           991: 
        !           992: void Use_PowerArmor (edict_t *ent, gitem_t *item)
        !           993: {
        !           994:        int             index;
        !           995: 
        !           996:        if (ent->flags & FL_POWER_ARMOR)
        !           997:        {
        !           998:                ent->flags &= ~FL_POWER_ARMOR;
        !           999:                gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
        !          1000:        }
        !          1001:        else
        !          1002:        {
        !          1003:                index = ITEM_INDEX(FindItem("cells"));
        !          1004:                if (!ent->client->pers.inventory[index])
        !          1005:                {
        !          1006:                        gi.cprintf (ent, PRINT_HIGH, "No cells for power armor.\n");
        !          1007:                        return;
        !          1008:                }
        !          1009:                ent->flags |= FL_POWER_ARMOR;
        !          1010:                gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);
        !          1011:        }
        !          1012: }
        !          1013: 
        !          1014: qboolean Pickup_PowerArmor (edict_t *ent, edict_t *other)
        !          1015: {
        !          1016:        int             quantity;
        !          1017: 
        !          1018:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
        !          1019: 
        !          1020:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
        !          1021: 
        !          1022:        if (deathmatch->value)
        !          1023:        {
        !          1024:                if (!(ent->spawnflags & DROPPED_ITEM) )
        !          1025:                        SetRespawn (ent, ent->item->quantity);
        !          1026:                // auto-use for DM only if we didn't already have one
        !          1027:                if (!quantity)
        !          1028:                        ent->item->use (other, ent->item);
        !          1029:        }
        !          1030: 
        !          1031:        return true;
        !          1032: }
        !          1033: 
        !          1034: void Drop_PowerArmor (edict_t *ent, gitem_t *item)
        !          1035: {
        !          1036:        if ((ent->flags & FL_POWER_ARMOR) && (ent->client->pers.inventory[ITEM_INDEX(item)] == 1))
        !          1037:                Use_PowerArmor (ent, item);
        !          1038:        Drop_General (ent, item);
        !          1039: }
        !          1040: 
        !          1041: //======================================================================
        !          1042: 
        !          1043: /*
        !          1044: ===============
        !          1045: Touch_Item
        !          1046: ===============
        !          1047: */
        !          1048: void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
        !          1049: {
        !          1050:        qboolean        taken;
        !          1051: 
        !          1052:        if (!other->client)
        !          1053:                return;
        !          1054:        if (other->health < 1)
        !          1055:                return;         // dead people can't pickup
        !          1056:        if (!ent->item->pickup)
        !          1057:                return;         // not a grabbable item?
        !          1058: 
        !          1059:        taken = ent->item->pickup(ent, other);
        !          1060: 
        !          1061:        if (taken)
        !          1062:        {
        !          1063:                // flash the screen
        !          1064:                other->client->bonus_alpha = 0.25;      
        !          1065: 
        !          1066:                // show icon and name on status bar
        !          1067:                other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon);
        !          1068:                other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS+ITEM_INDEX(ent->item);
        !          1069:                other->client->pickup_msg_time = level.time + 3.0;
        !          1070: 
        !          1071:                // change selected item
        !          1072:                if (ent->item->use)
        !          1073:                        other->client->pers.selected_item = other->client->ps.stats[STAT_SELECTED_ITEM] = ITEM_INDEX(ent->item);
        !          1074: 
        !          1075:                if (ent->item->pickup == Pickup_Health)
        !          1076:                {
        !          1077:                        if (ent->count == 2)
        !          1078:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/s_health.wav"), 1, ATTN_NORM, 0);
        !          1079:                        else if (ent->count == 10)
        !          1080:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/n_health.wav"), 1, ATTN_NORM, 0);
        !          1081:                        else if (ent->count == 25)
        !          1082:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/l_health.wav"), 1, ATTN_NORM, 0);
        !          1083:                        else // (ent->count == 100)
        !          1084:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/m_health.wav"), 1, ATTN_NORM, 0);
        !          1085:                }
        !          1086:                else if (ent->item->pickup_sound)
        !          1087:                {
        !          1088:                        gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
        !          1089:                }
        !          1090:        }
        !          1091: 
        !          1092:        if (!(ent->spawnflags & ITEM_TARGETS_USED))
        !          1093:        {
        !          1094:                G_UseTargets (ent, other);
        !          1095:                ent->spawnflags |= ITEM_TARGETS_USED;
        !          1096:        }
        !          1097: 
        !          1098:        if (!taken)
        !          1099:                return;
        !          1100: 
        !          1101:        if (!((coop->value) &&  (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)))
        !          1102:        {
        !          1103:                if (ent->flags & FL_RESPAWN)
        !          1104:                        ent->flags &= ~FL_RESPAWN;
        !          1105:                else
        !          1106:                        G_FreeEdict (ent);
        !          1107:        }
        !          1108: }
        !          1109: 
        !          1110: //======================================================================
        !          1111: 
        !          1112: static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
        !          1113: {
        !          1114:        if (other == ent->owner)
        !          1115:                return;
        !          1116: 
        !          1117:        Touch_Item (ent, other, plane, surf);
        !          1118: }
        !          1119: 
        !          1120: static void drop_make_touchable (edict_t *ent)
        !          1121: {
        !          1122:        ent->touch = Touch_Item;
        !          1123:        if (deathmatch->value)
        !          1124:        {
        !          1125:                ent->nextthink = level.time + 29;
        !          1126:                ent->think = G_FreeEdict;
        !          1127:        }
        !          1128: }
        !          1129: 
        !          1130: edict_t *Drop_Item (edict_t *ent, gitem_t *item)
        !          1131: {
        !          1132:        edict_t *dropped;
        !          1133:        vec3_t  forward, right;
        !          1134:        vec3_t  offset;
        !          1135: 
        !          1136:        dropped = G_Spawn();
        !          1137: 
        !          1138:        dropped->classname = item->classname;
        !          1139:        dropped->item = item;
        !          1140:        dropped->spawnflags = DROPPED_ITEM;
        !          1141:        dropped->s.effects = item->world_model_flags;
        !          1142:        dropped->s.renderfx = RF_GLOW | RF_IR_VISIBLE;          // PGM
        !          1143:        VectorSet (dropped->mins, -15, -15, -15);
        !          1144:        VectorSet (dropped->maxs, 15, 15, 15);
        !          1145:        gi.setmodel (dropped, dropped->item->world_model);
        !          1146:        dropped->solid = SOLID_TRIGGER;
        !          1147:        dropped->movetype = MOVETYPE_TOSS;  
        !          1148:        dropped->touch = drop_temp_touch;
        !          1149:        dropped->owner = ent;
        !          1150: 
        !          1151:        if (ent->client)
        !          1152:        {
        !          1153:                trace_t trace;
        !          1154: 
        !          1155:                AngleVectors (ent->client->v_angle, forward, right, NULL);
        !          1156:                VectorSet(offset, 24, 0, -16);
        !          1157:                G_ProjectSource (ent->s.origin, offset, forward, right, dropped->s.origin);
        !          1158:                trace = gi.trace (ent->s.origin, dropped->mins, dropped->maxs,
        !          1159:                        dropped->s.origin, ent, CONTENTS_SOLID);
        !          1160:                VectorCopy (trace.endpos, dropped->s.origin);
        !          1161:        }
        !          1162:        else
        !          1163:        {
        !          1164:                AngleVectors (ent->s.angles, forward, right, NULL);
        !          1165:                VectorCopy (ent->s.origin, dropped->s.origin);
        !          1166:        }
        !          1167: 
        !          1168:        VectorScale (forward, 100, dropped->velocity);
        !          1169:        dropped->velocity[2] = 300;
        !          1170: 
        !          1171:        dropped->think = drop_make_touchable;
        !          1172:        dropped->nextthink = level.time + 1;
        !          1173: 
        !          1174:        gi.linkentity (dropped);
        !          1175: 
        !          1176:        return dropped;
        !          1177: }
        !          1178: 
        !          1179: void Use_Item (edict_t *ent, edict_t *other, edict_t *activator)
        !          1180: {
        !          1181:        ent->svflags &= ~SVF_NOCLIENT;
        !          1182:        ent->use = NULL;
        !          1183: 
        !          1184:        if (ent->spawnflags & ITEM_NO_TOUCH)
        !          1185:        {
        !          1186:                ent->solid = SOLID_BBOX;
        !          1187:                ent->touch = NULL;
        !          1188:        }
        !          1189:        else
        !          1190:        {
        !          1191:                ent->solid = SOLID_TRIGGER;
        !          1192:                ent->touch = Touch_Item;
        !          1193:        }
        !          1194: 
        !          1195:        gi.linkentity (ent);
        !          1196: }
        !          1197: 
        !          1198: //======================================================================
        !          1199: 
        !          1200: /*
        !          1201: ================
        !          1202: droptofloor
        !          1203: ================
        !          1204: */
        !          1205: void droptofloor (edict_t *ent)
        !          1206: {
        !          1207:        trace_t         tr;
        !          1208:        vec3_t          dest;
        !          1209:        float           *v;
        !          1210: 
        !          1211:        v = tv(-15,-15,-15);
        !          1212:        VectorCopy (v, ent->mins);
        !          1213:        v = tv(15,15,15);
        !          1214:        VectorCopy (v, ent->maxs);
        !          1215: 
        !          1216:        if (ent->model)
        !          1217:                gi.setmodel (ent, ent->model);
        !          1218:        else if (ent->item->world_model)        // PGM we shouldn't need this check, but paranoia...
        !          1219:                gi.setmodel (ent, ent->item->world_model);
        !          1220:        ent->solid = SOLID_TRIGGER;
        !          1221:        ent->movetype = MOVETYPE_TOSS;  
        !          1222:        ent->touch = Touch_Item;
        !          1223: 
        !          1224:        v = tv(0,0,-128);
        !          1225:        VectorAdd (ent->s.origin, v, dest);
        !          1226: 
        !          1227:        tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID);
        !          1228:        if (tr.startsolid)
        !          1229:        {
        !          1230:                gi.dprintf ("droptofloor: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin));
        !          1231:                G_FreeEdict (ent);
        !          1232:                return;
        !          1233:        }
        !          1234: 
        !          1235:        VectorCopy (tr.endpos, ent->s.origin);
        !          1236: 
        !          1237:        if (ent->team)
        !          1238:        {
        !          1239:                ent->flags &= ~FL_TEAMSLAVE;
        !          1240:                ent->chain = ent->teamchain;
        !          1241:                ent->teamchain = NULL;
        !          1242: 
        !          1243:                ent->svflags |= SVF_NOCLIENT;
        !          1244:                ent->solid = SOLID_NOT;
        !          1245:                if (ent == ent->teammaster)
        !          1246:                {
        !          1247:                        ent->nextthink = level.time + FRAMETIME;
        !          1248:                        ent->think = DoRespawn;
        !          1249:                }
        !          1250:        }
        !          1251: 
        !          1252:        if (ent->spawnflags & ITEM_NO_TOUCH)
        !          1253:        {
        !          1254:                ent->solid = SOLID_BBOX;
        !          1255:                ent->touch = NULL;
        !          1256:                ent->s.effects &= ~EF_ROTATE;
        !          1257:                ent->s.renderfx &= ~RF_GLOW;
        !          1258:        }
        !          1259: 
        !          1260:        if (ent->spawnflags & ITEM_TRIGGER_SPAWN)
        !          1261:        {
        !          1262:                ent->svflags |= SVF_NOCLIENT;
        !          1263:                ent->solid = SOLID_NOT;
        !          1264:                ent->use = Use_Item;
        !          1265:        }
        !          1266: 
        !          1267:        gi.linkentity (ent);
        !          1268: }
        !          1269: 
        !          1270: 
        !          1271: /*
        !          1272: ===============
        !          1273: PrecacheItem
        !          1274: 
        !          1275: Precaches all data needed for a given item.
        !          1276: This will be called for each item spawned in a level,
        !          1277: and for each item in each client's inventory.
        !          1278: ===============
        !          1279: */
        !          1280: void PrecacheItem (gitem_t *it)
        !          1281: {
        !          1282:        char    *s, *start;
        !          1283:        char    data[MAX_QPATH];
        !          1284:        int             len;
        !          1285:        gitem_t *ammo;
        !          1286: 
        !          1287:        if (!it)
        !          1288:                return;
        !          1289: 
        !          1290:        if (it->pickup_sound)
        !          1291:                gi.soundindex (it->pickup_sound);
        !          1292:        if (it->world_model)
        !          1293:                gi.modelindex (it->world_model);
        !          1294:        if (it->view_model)
        !          1295:                gi.modelindex (it->view_model);
        !          1296:        if (it->icon)
        !          1297:                gi.imageindex (it->icon);
        !          1298: 
        !          1299:        // parse everything for its ammo
        !          1300:        if (it->ammo && it->ammo[0])
        !          1301:        {
        !          1302:                ammo = FindItem (it->ammo);
        !          1303:                if (ammo != it)
        !          1304:                        PrecacheItem (ammo);
        !          1305:        }
        !          1306: 
        !          1307:        // parse the space seperated precache string for other items
        !          1308:        s = it->precaches;
        !          1309:        if (!s || !s[0])
        !          1310:                return;
        !          1311: 
        !          1312:        while (*s)
        !          1313:        {
        !          1314:                start = s;
        !          1315:                while (*s && *s != ' ')
        !          1316:                        s++;
        !          1317: 
        !          1318:                len = s-start;
        !          1319:                if (len >= MAX_QPATH || len < 5)
        !          1320:                        gi.error ("PrecacheItem: %s has bad precache string", it->classname);
        !          1321:                memcpy (data, start, len);
        !          1322:                data[len] = 0;
        !          1323:                if (*s)
        !          1324:                        s++;
        !          1325: 
        !          1326:                // determine type based on extension
        !          1327:                if (!strcmp(data+len-3, "md2"))
        !          1328:                        gi.modelindex (data);
        !          1329:                else if (!strcmp(data+len-3, "sp2"))
        !          1330:                        gi.modelindex (data);
        !          1331:                else if (!strcmp(data+len-3, "wav"))
        !          1332:                        gi.soundindex (data);
        !          1333:                if (!strcmp(data+len-3, "pcx"))
        !          1334:                        gi.imageindex (data);
        !          1335:        }
        !          1336: }
        !          1337: 
        !          1338: 
        !          1339: //=================
        !          1340: // Item_TriggeredSpawn - create the item marked for spawn creation
        !          1341: //=================
        !          1342: void Item_TriggeredSpawn (edict_t *self, edict_t *other, edict_t *activator)
        !          1343: {
        !          1344: //     self->nextthink = level.time + 2 * FRAMETIME;    // items start after other solids
        !          1345: //     self->think = droptofloor;
        !          1346:        self->svflags &= ~SVF_NOCLIENT;
        !          1347:        self->use = NULL;
        !          1348:        if(strcmp(self->classname, "key_power_cube"))   // leave them be on key_power_cube..
        !          1349:                self->spawnflags = 0;
        !          1350:        droptofloor (self);
        !          1351: }
        !          1352: 
        !          1353: //=================
        !          1354: // SetTriggeredSpawn - set up an item to spawn in later.
        !          1355: //=================
        !          1356: void SetTriggeredSpawn (edict_t *ent)
        !          1357: {
        !          1358:        // don't do anything on key_power_cubes.
        !          1359:        if(!strcmp(ent->classname, "key_power_cube"))
        !          1360:                return;
        !          1361: 
        !          1362:        ent->think = NULL;
        !          1363:        ent->nextthink = 0;
        !          1364:        ent->use = Item_TriggeredSpawn;
        !          1365:        ent->svflags |= SVF_NOCLIENT;
        !          1366:        ent->solid = SOLID_NOT;
        !          1367: }
        !          1368: 
        !          1369: /*
        !          1370: ============
        !          1371: SpawnItem
        !          1372: 
        !          1373: Sets the clipping size and plants the object on the floor.
        !          1374: 
        !          1375: Items can't be immediately dropped to floor, because they might
        !          1376: be on an entity that hasn't spawned yet.
        !          1377: ============
        !          1378: */
        !          1379: void SpawnItem (edict_t *ent, gitem_t *item)
        !          1380: {
        !          1381: #if KILL_DISRUPTOR
        !          1382:        if ((!strcmp(ent->classname, "ammo_disruptor")) || (!strcmp(ent->classname, "weapon_disintegrator")))
        !          1383:        {
        !          1384:                G_FreeEdict (ent);
        !          1385:                return;
        !          1386:        }
        !          1387: #endif
        !          1388: 
        !          1389: // PGM - since the item may be freed by the following rules, go ahead
        !          1390: //              and move the precache until AFTER the following rules have been checked.
        !          1391: //              keep an eye on this.
        !          1392: //     PrecacheItem (item);
        !          1393: 
        !          1394:        if (ent->spawnflags > 1)                // PGM
        !          1395:        {
        !          1396:                if (strcmp(ent->classname, "key_power_cube") != 0)
        !          1397:                {
        !          1398:                        ent->spawnflags = 0;
        !          1399:                        gi.dprintf("%s at %s has invalid spawnflags set\n", ent->classname, vtos(ent->s.origin));
        !          1400:                }
        !          1401:        }
        !          1402: 
        !          1403:        // some items will be prevented in deathmatch
        !          1404:        if (deathmatch->value)
        !          1405:        {
        !          1406:                if ( (int)dmflags->value & DF_NO_ARMOR )
        !          1407:                {
        !          1408:                        if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor)
        !          1409:                        {
        !          1410:                                G_FreeEdict (ent);
        !          1411:                                return;
        !          1412:                        }
        !          1413:                }
        !          1414:                if ( (int)dmflags->value & DF_NO_ITEMS )
        !          1415:                {
        !          1416:                        if (item->pickup == Pickup_Powerup)
        !          1417:                        {
        !          1418:                                G_FreeEdict (ent);
        !          1419:                                return;
        !          1420:                        }
        !          1421:                }
        !          1422:                if ( (int)dmflags->value & DF_NO_HEALTH )
        !          1423:                {
        !          1424:                        if (item->pickup == Pickup_Health || item->pickup == Pickup_Adrenaline || item->pickup == Pickup_AncientHead)
        !          1425:                        {
        !          1426:                                G_FreeEdict (ent);
        !          1427:                                return;
        !          1428:                        }
        !          1429:                }
        !          1430:                if ( (int)dmflags->value & DF_INFINITE_AMMO )
        !          1431:                {
        !          1432:                        if ( (item->flags == IT_AMMO) || (strcmp(ent->classname, "weapon_bfg") == 0) )
        !          1433:                        {
        !          1434:                                G_FreeEdict (ent);
        !          1435:                                return;
        !          1436:                        }
        !          1437:                }
        !          1438: 
        !          1439: //==========
        !          1440: //ROGUE
        !          1441:                if ( (int)dmflags->value & DF_NO_MINES )
        !          1442:                {
        !          1443:                        if ( !strcmp(ent->classname, "ammo_prox") || 
        !          1444:                                 !strcmp(ent->classname, "ammo_tesla") )
        !          1445:                        {
        !          1446:                                G_FreeEdict (ent);
        !          1447:                                return;
        !          1448:                        }
        !          1449:                }
        !          1450:                if ( (int)dmflags->value & DF_NO_NUKES )
        !          1451:                {
        !          1452:                        if ( !strcmp(ent->classname, "ammo_nuke") )
        !          1453:                        {
        !          1454:                                G_FreeEdict (ent);
        !          1455:                                return;
        !          1456:                        }
        !          1457:                }
        !          1458: //ROGUE
        !          1459: //==========
        !          1460: 
        !          1461:        }
        !          1462: //==========
        !          1463: //ROGUE
        !          1464: // DM only items
        !          1465:        if (!deathmatch->value)
        !          1466:        {
        !          1467:                if (item->pickup == Pickup_Doppleganger || item->pickup == Pickup_Nuke)
        !          1468:                {
        !          1469:                        G_FreeEdict (ent);
        !          1470:                        return;
        !          1471:                }
        !          1472:                if ((item->use == Use_Vengeance) || (item->use == Use_Hunter))
        !          1473:                {
        !          1474:                        G_FreeEdict (ent);
        !          1475:                        return;
        !          1476:                }
        !          1477:        }
        !          1478: //ROGUE
        !          1479: //==========
        !          1480: 
        !          1481: //PGM 
        !          1482:        PrecacheItem (item);            
        !          1483: //PGM
        !          1484: 
        !          1485:        if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0))
        !          1486:        {
        !          1487:                ent->spawnflags |= (1 << (8 + level.power_cubes));
        !          1488:                level.power_cubes++;
        !          1489:        }
        !          1490: 
        !          1491:        // don't let them drop items that stay in a coop game
        !          1492:        if ((coop->value) && (item->flags & IT_STAY_COOP))
        !          1493:        {
        !          1494:                item->drop = NULL;
        !          1495:        }
        !          1496: 
        !          1497:        ent->item = item;
        !          1498:        ent->nextthink = level.time + 2 * FRAMETIME;    // items start after other solids
        !          1499:        ent->think = droptofloor;
        !          1500:        ent->s.effects = item->world_model_flags;
        !          1501:        ent->s.renderfx = RF_GLOW;
        !          1502:        if (ent->model)
        !          1503:                gi.modelindex (ent->model);
        !          1504: 
        !          1505:        if (ent->spawnflags & 1)
        !          1506:                SetTriggeredSpawn (ent);
        !          1507: }
        !          1508: 
        !          1509: //======================================================================
        !          1510: 
        !          1511: gitem_t        itemlist[] = 
        !          1512: {
        !          1513:        {
        !          1514:                NULL
        !          1515:        },      // leave index 0 alone
        !          1516: 
        !          1517:        //
        !          1518:        // ARMOR
        !          1519:        //
        !          1520: 
        !          1521: /*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1522: */
        !          1523:        {
        !          1524:                "item_armor_body", 
        !          1525:                Pickup_Armor,
        !          1526:                NULL,
        !          1527:                NULL,
        !          1528:                NULL,
        !          1529:                "misc/ar1_pkup.wav",
        !          1530:                "models/items/armor/body/tris.md2", EF_ROTATE,
        !          1531:                NULL,
        !          1532: /* icon */             "i_bodyarmor",
        !          1533: /* pickup */   "Body Armor",
        !          1534: /* width */            3,
        !          1535:                0,
        !          1536:                NULL,
        !          1537:                IT_ARMOR,
        !          1538:                0,
        !          1539:                &bodyarmor_info,
        !          1540:                ARMOR_BODY,
        !          1541: /* precache */ ""
        !          1542:        },
        !          1543: 
        !          1544: /*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1545: */
        !          1546:        {
        !          1547:                "item_armor_combat", 
        !          1548:                Pickup_Armor,
        !          1549:                NULL,
        !          1550:                NULL,
        !          1551:                NULL,
        !          1552:                "misc/ar1_pkup.wav",
        !          1553:                "models/items/armor/combat/tris.md2", EF_ROTATE,
        !          1554:                NULL,
        !          1555: /* icon */             "i_combatarmor",
        !          1556: /* pickup */   "Combat Armor",
        !          1557: /* width */            3,
        !          1558:                0,
        !          1559:                NULL,
        !          1560:                IT_ARMOR,
        !          1561:                0,
        !          1562:                &combatarmor_info,
        !          1563:                ARMOR_COMBAT,
        !          1564: /* precache */ ""
        !          1565:        },
        !          1566: 
        !          1567: /*QUAKED item_armor_jacket (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1568: */
        !          1569:        {
        !          1570:                "item_armor_jacket", 
        !          1571:                Pickup_Armor,
        !          1572:                NULL,
        !          1573:                NULL,
        !          1574:                NULL,
        !          1575:                "misc/ar1_pkup.wav",
        !          1576:                "models/items/armor/jacket/tris.md2", EF_ROTATE,
        !          1577:                NULL,
        !          1578: /* icon */             "i_jacketarmor",
        !          1579: /* pickup */   "Jacket Armor",
        !          1580: /* width */            3,
        !          1581:                0,
        !          1582:                NULL,
        !          1583:                IT_ARMOR,
        !          1584:                0,
        !          1585:                &jacketarmor_info,
        !          1586:                ARMOR_JACKET,
        !          1587: /* precache */ ""
        !          1588:        },
        !          1589: 
        !          1590: /*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1591: */
        !          1592:        {
        !          1593:                "item_armor_shard", 
        !          1594:                Pickup_Armor,
        !          1595:                NULL,
        !          1596:                NULL,
        !          1597:                NULL,
        !          1598:                "misc/ar2_pkup.wav",
        !          1599:                "models/items/armor/shard/tris.md2", EF_ROTATE,
        !          1600:                NULL,
        !          1601: /* icon */             "i_jacketarmor",
        !          1602: /* pickup */   "Armor Shard",
        !          1603: /* width */            3,
        !          1604:                0,
        !          1605:                NULL,
        !          1606:                IT_ARMOR,
        !          1607:                0,
        !          1608:                NULL,
        !          1609:                ARMOR_SHARD,
        !          1610: /* precache */ ""
        !          1611:        },
        !          1612: 
        !          1613: 
        !          1614: /*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1615: */
        !          1616:        {
        !          1617:                "item_power_screen", 
        !          1618:                Pickup_PowerArmor,
        !          1619:                Use_PowerArmor,
        !          1620:                Drop_PowerArmor,
        !          1621:                NULL,
        !          1622:                "misc/ar3_pkup.wav",
        !          1623:                "models/items/armor/screen/tris.md2", EF_ROTATE,
        !          1624:                NULL,
        !          1625: /* icon */             "i_powerscreen",
        !          1626: /* pickup */   "Power Screen",
        !          1627: /* width */            0,
        !          1628:                60,
        !          1629:                NULL,
        !          1630:                IT_ARMOR,
        !          1631:                0,
        !          1632:                NULL,
        !          1633:                0,
        !          1634: /* precache */ ""
        !          1635:        },
        !          1636: 
        !          1637: /*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1638: */
        !          1639:        {
        !          1640:                "item_power_shield",
        !          1641:                Pickup_PowerArmor,
        !          1642:                Use_PowerArmor,
        !          1643:                Drop_PowerArmor,
        !          1644:                NULL,
        !          1645:                "misc/ar3_pkup.wav",
        !          1646:                "models/items/armor/shield/tris.md2", EF_ROTATE,
        !          1647:                NULL,
        !          1648: /* icon */             "i_powershield",
        !          1649: /* pickup */   "Power Shield",
        !          1650: /* width */            0,
        !          1651:                60,
        !          1652:                NULL,
        !          1653:                IT_ARMOR,
        !          1654:                0,
        !          1655:                NULL,
        !          1656:                0,
        !          1657: /* precache */ "misc/power2.wav misc/power1.wav"
        !          1658:        },
        !          1659: 
        !          1660: 
        !          1661:        //
        !          1662:        // WEAPONS 
        !          1663:        //
        !          1664: 
        !          1665: /* weapon_blaster (.3 .3 1) (-16 -16 -16) (16 16 16)
        !          1666: always owned, never in the world
        !          1667: */
        !          1668:        {
        !          1669:                "weapon_blaster", 
        !          1670:                NULL,
        !          1671:                Use_Weapon,
        !          1672:                NULL,
        !          1673:                Weapon_Blaster,
        !          1674:                "misc/w_pkup.wav",
        !          1675:                NULL, 0,
        !          1676:                "models/weapons/v_blast/tris.md2",
        !          1677: /* icon */             "w_blaster",
        !          1678: /* pickup */   "Blaster",
        !          1679:                0,
        !          1680:                0,
        !          1681:                NULL,
        !          1682:                IT_WEAPON|IT_STAY_COOP,
        !          1683:                WEAP_BLASTER,
        !          1684:                NULL,
        !          1685:                0,
        !          1686: /* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
        !          1687:        },
        !          1688: 
        !          1689: /*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1690: */
        !          1691:        {
        !          1692:                "weapon_shotgun", 
        !          1693:                Pickup_Weapon,
        !          1694:                Use_Weapon,
        !          1695:                Drop_Weapon,
        !          1696:                Weapon_Shotgun,
        !          1697:                "misc/w_pkup.wav",
        !          1698:                "models/weapons/g_shotg/tris.md2", EF_ROTATE,
        !          1699:                "models/weapons/v_shotg/tris.md2",
        !          1700: /* icon */             "w_shotgun",
        !          1701: /* pickup */   "Shotgun",
        !          1702:                0,
        !          1703:                1,
        !          1704:                "Shells",
        !          1705:                IT_WEAPON|IT_STAY_COOP,
        !          1706:                WEAP_SHOTGUN,
        !          1707:                NULL,
        !          1708:                0,
        !          1709: /* precache */ "weapons/shotgf1b.wav weapons/shotgr1b.wav"
        !          1710:        },
        !          1711: 
        !          1712: /*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1713: */
        !          1714:        {
        !          1715:                "weapon_supershotgun", 
        !          1716:                Pickup_Weapon,
        !          1717:                Use_Weapon,
        !          1718:                Drop_Weapon,
        !          1719:                Weapon_SuperShotgun,
        !          1720:                "misc/w_pkup.wav",
        !          1721:                "models/weapons/g_shotg2/tris.md2", EF_ROTATE,
        !          1722:                "models/weapons/v_shotg2/tris.md2",
        !          1723: /* icon */             "w_sshotgun",
        !          1724: /* pickup */   "Super Shotgun",
        !          1725:                0,
        !          1726:                2,
        !          1727:                "Shells",
        !          1728:                IT_WEAPON|IT_STAY_COOP,
        !          1729:                WEAP_SUPERSHOTGUN,
        !          1730:                NULL,
        !          1731:                0,
        !          1732: /* precache */ "weapons/sshotf1b.wav"
        !          1733:        },
        !          1734: 
        !          1735: /*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1736: */
        !          1737:        {
        !          1738:                "weapon_machinegun", 
        !          1739:                Pickup_Weapon,
        !          1740:                Use_Weapon,
        !          1741:                Drop_Weapon,
        !          1742:                Weapon_Machinegun,
        !          1743:                "misc/w_pkup.wav",
        !          1744:                "models/weapons/g_machn/tris.md2", EF_ROTATE,
        !          1745:                "models/weapons/v_machn/tris.md2",
        !          1746: /* icon */             "w_machinegun",
        !          1747: /* pickup */   "Machinegun",
        !          1748:                0,
        !          1749:                1,
        !          1750:                "Bullets",
        !          1751:                IT_WEAPON|IT_STAY_COOP,
        !          1752:                WEAP_MACHINEGUN,
        !          1753:                NULL,
        !          1754:                0,
        !          1755: /* precache */ "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav"
        !          1756:        },
        !          1757: 
        !          1758: /*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1759: */
        !          1760:        {
        !          1761:                "weapon_chaingun", 
        !          1762:                Pickup_Weapon,
        !          1763:                Use_Weapon,
        !          1764:                Drop_Weapon,
        !          1765:                Weapon_Chaingun,
        !          1766:                "misc/w_pkup.wav",
        !          1767:                "models/weapons/g_chain/tris.md2", EF_ROTATE,
        !          1768:                "models/weapons/v_chain/tris.md2",
        !          1769: /* icon */             "w_chaingun",
        !          1770: /* pickup */   "Chaingun",
        !          1771:                0,
        !          1772:                1,
        !          1773:                "Bullets",
        !          1774:                IT_WEAPON|IT_STAY_COOP,
        !          1775:                WEAP_CHAINGUN,
        !          1776:                NULL,
        !          1777:                0,
        !          1778: /* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav"
        !          1779:        },
        !          1780: 
        !          1781:        // ROGUE
        !          1782: /*QUAKED weapon_nailgun (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1783: */
        !          1784: /*QUAKED weapon_etf_rifle (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1785: */
        !          1786:        {
        !          1787:                "weapon_etf_rifle",                                                                     // classname
        !          1788:                Pickup_Weapon,                                                                          // pickup function
        !          1789:                Use_Weapon,                                                                                     // use function
        !          1790:                Drop_Weapon,                                                                            // drop function
        !          1791:                Weapon_ETF_Rifle,                                                                       // weapon think function
        !          1792:                "misc/w_pkup.wav",                                                                      // pick up sound
        !          1793:                "models/weapons/g_etf_rifle/tris.md2", EF_ROTATE,               // world model, world model flags
        !          1794:                "models/weapons/v_etf_rifle/tris.md2",                                  // view model
        !          1795:                "w_etf_rifle",                                                                          // icon
        !          1796:                "ETF Rifle",                                                                            // name printed when picked up 
        !          1797:                0,                                                                                                      // number of digits for statusbar
        !          1798:                1,                                                                                                      // amount used / contained
        !          1799:                "Flechettes",                                                                           // ammo type used 
        !          1800:                IT_WEAPON,                                                                                      // inventory flags
        !          1801:                WEAP_ETFRIFLE,                                                                          // visible weapon
        !          1802:                NULL,                                                                                           // info (void *)
        !          1803:                0,                                                                                                      // tag
        !          1804:                "weapons/nail1.wav models/proj/flechette/tris.md2",     // precaches
        !          1805:        },
        !          1806: 
        !          1807:        // rogue
        !          1808: /*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1809: */
        !          1810:        {
        !          1811:                "ammo_grenades",
        !          1812:                Pickup_Ammo,
        !          1813:                Use_Weapon,
        !          1814:                Drop_Ammo,
        !          1815:                Weapon_Grenade,
        !          1816:                "misc/am_pkup.wav",
        !          1817:                "models/items/ammo/grenades/medium/tris.md2", 0,
        !          1818:                "models/weapons/v_handgr/tris.md2",
        !          1819: /* icon */             "a_grenades",
        !          1820: /* pickup */   "Grenades",
        !          1821: /* width */            3,
        !          1822:                5,
        !          1823:                "grenades",
        !          1824:                IT_AMMO|IT_WEAPON,
        !          1825:                WEAP_GRENADES,
        !          1826:                NULL,
        !          1827:                AMMO_GRENADES,
        !          1828: /* precache */ "weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav "
        !          1829:        },
        !          1830: 
        !          1831: /*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1832: */
        !          1833:        {
        !          1834:                "weapon_grenadelauncher",
        !          1835:                Pickup_Weapon,
        !          1836:                Use_Weapon,
        !          1837:                Drop_Weapon,
        !          1838:                Weapon_GrenadeLauncher,
        !          1839:                "misc/w_pkup.wav",
        !          1840:                "models/weapons/g_launch/tris.md2", EF_ROTATE,
        !          1841:                "models/weapons/v_launch/tris.md2",
        !          1842: /* icon */             "w_glauncher",
        !          1843: /* pickup */   "Grenade Launcher",
        !          1844:                0,
        !          1845:                1,
        !          1846:                "Grenades",
        !          1847:                IT_WEAPON|IT_STAY_COOP,
        !          1848:                WEAP_GRENADELAUNCHER,
        !          1849:                NULL,
        !          1850:                0,
        !          1851: /* precache */ "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav"
        !          1852:        },
        !          1853: 
        !          1854:        // ROGUE
        !          1855: /*QUAKED weapon_proxlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1856: */
        !          1857:        {
        !          1858:                "weapon_proxlauncher",                                                          // classname
        !          1859:                Pickup_Weapon,                                                                          // pickup
        !          1860:                Use_Weapon,                                                                                     // use
        !          1861:                Drop_Weapon,                                                                            // drop
        !          1862:                Weapon_ProxLauncher,                                                            // weapon think
        !          1863:                "misc/w_pkup.wav",                                                                      // pick up sound
        !          1864:                "models/weapons/g_plaunch/tris.md2", EF_ROTATE,         // world model, world model flags
        !          1865:                "models/weapons/v_plaunch/tris.md2",                            // view model
        !          1866:                "w_proxlaunch",                                                                         // icon
        !          1867:                "Prox Launcher",                                                                        // name printed when picked up
        !          1868:                0,                                                                                                      // number of digits for statusbar
        !          1869:                1,                                                                                                      // amount used
        !          1870:                "prox",                                                                                         // ammo type used
        !          1871:                IT_WEAPON,                                                                                      // inventory flags
        !          1872:                WEAP_PROXLAUNCH,                                                                        // visible weapon
        !          1873:                NULL,                                                                                           // info (void *)
        !          1874:                AMMO_PROX,                                                                                      // tag
        !          1875:                "weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav weapons/proxwarn.wav",
        !          1876:        },
        !          1877:        // rogue
        !          1878: 
        !          1879: /*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1880: */
        !          1881:        {
        !          1882:                "weapon_rocketlauncher",
        !          1883:                Pickup_Weapon,
        !          1884:                Use_Weapon,
        !          1885:                Drop_Weapon,
        !          1886:                Weapon_RocketLauncher,
        !          1887:                "misc/w_pkup.wav",
        !          1888:                "models/weapons/g_rocket/tris.md2", EF_ROTATE,
        !          1889:                "models/weapons/v_rocket/tris.md2",
        !          1890: /* icon */             "w_rlauncher",
        !          1891: /* pickup */   "Rocket Launcher",
        !          1892:                0,
        !          1893:                1,
        !          1894:                "Rockets",
        !          1895:                IT_WEAPON|IT_STAY_COOP,
        !          1896:                WEAP_ROCKETLAUNCHER,
        !          1897:                NULL,
        !          1898:                0,
        !          1899: /* precache */ "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2"
        !          1900:        },
        !          1901: 
        !          1902: /*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1903: */
        !          1904:        {
        !          1905:                "weapon_hyperblaster", 
        !          1906:                Pickup_Weapon,
        !          1907:                Use_Weapon,
        !          1908:                Drop_Weapon,
        !          1909:                Weapon_HyperBlaster,
        !          1910:                "misc/w_pkup.wav",
        !          1911:                "models/weapons/g_hyperb/tris.md2", EF_ROTATE,
        !          1912:                "models/weapons/v_hyperb/tris.md2",
        !          1913: /* icon */             "w_hyperblaster",
        !          1914: /* pickup */   "HyperBlaster",
        !          1915:                0,
        !          1916:                1,
        !          1917:                "Cells",
        !          1918:                IT_WEAPON|IT_STAY_COOP,
        !          1919:                WEAP_HYPERBLASTER,
        !          1920:                NULL,
        !          1921:                0,
        !          1922: /* precache */ "weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav"
        !          1923:        },
        !          1924: 
        !          1925:        // ROGUE
        !          1926: /*QUAKED weapon_heatbeam (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1927: */ 
        !          1928: /*QUAKED weapon_plasmabeam (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1929: */ 
        !          1930:        {
        !          1931:                "weapon_plasmabeam",                                                            // classname
        !          1932:                Pickup_Weapon,                                                                          // pickup function
        !          1933:                Use_Weapon,                                                                                     // use function
        !          1934:                Drop_Weapon,                                                                            // drop function
        !          1935:                Weapon_Heatbeam,                                                                        // weapon think function
        !          1936:                "misc/w_pkup.wav",                                                                      // pick up sound
        !          1937:                "models/weapons/g_beamer/tris.md2", EF_ROTATE,          // world model, world model flags
        !          1938:                "models/weapons/v_beamer/tris.md2",                                     // view model
        !          1939:                "w_heatbeam",                                                                                   // icon
        !          1940:                "Plasma Beam",                                                                                  // name printed when picked up 
        !          1941:                0,                                                                                                      // number of digits for statusbar
        !          1942:                // FIXME - if this changes, change it in NoAmmoWeaponChange as well
        !          1943:                2,                                                                                                      // amount used / contained
        !          1944:                "Cells",                                                                                        // ammo type used 
        !          1945:                IT_WEAPON,                                                                                      // inventory flags
        !          1946:                WEAP_PLASMA,                                                                            // visible weapon
        !          1947:                NULL,                                                                                           // info (void *)
        !          1948:                0,                                                                                                      // tag
        !          1949:                "models/weapons/v_beamer2/tris.md2 weapons/bfg__l1a.wav",               // precaches
        !          1950:        },
        !          1951:        //rogue
        !          1952: /*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1953: */
        !          1954:        {
        !          1955:                "weapon_railgun", 
        !          1956:                Pickup_Weapon,
        !          1957:                Use_Weapon,
        !          1958:                Drop_Weapon,
        !          1959:                Weapon_Railgun,
        !          1960:                "misc/w_pkup.wav",
        !          1961:                "models/weapons/g_rail/tris.md2", EF_ROTATE,
        !          1962:                "models/weapons/v_rail/tris.md2",
        !          1963: /* icon */             "w_railgun",
        !          1964: /* pickup */   "Railgun",
        !          1965:                0,
        !          1966:                1,
        !          1967:                "Slugs",
        !          1968:                IT_WEAPON|IT_STAY_COOP,
        !          1969:                WEAP_RAILGUN,
        !          1970:                NULL,
        !          1971:                0,
        !          1972: /* precache */ "weapons/rg_hum.wav"
        !          1973:        },
        !          1974: 
        !          1975: /*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          1976: */
        !          1977:        {
        !          1978:                "weapon_bfg",
        !          1979:                Pickup_Weapon,
        !          1980:                Use_Weapon,
        !          1981:                Drop_Weapon,
        !          1982:                Weapon_BFG,
        !          1983:                "misc/w_pkup.wav",
        !          1984:                "models/weapons/g_bfg/tris.md2", EF_ROTATE,
        !          1985:                "models/weapons/v_bfg/tris.md2",
        !          1986: /* icon */             "w_bfg",
        !          1987: /* pickup */   "BFG10K",
        !          1988:                0,
        !          1989:                50,
        !          1990:                "Cells",
        !          1991:                IT_WEAPON|IT_STAY_COOP,
        !          1992:                WEAP_BFG,
        !          1993:                NULL,
        !          1994:                0,
        !          1995: /* precache */ "sprites/s_bfg1.sp2 sprites/s_bfg2.sp2 sprites/s_bfg3.sp2 weapons/bfg__f1y.wav weapons/bfg__l1a.wav weapons/bfg__x1b.wav weapons/bfg_hum.wav"
        !          1996:        },
        !          1997: 
        !          1998: // =========================
        !          1999: // ROGUE WEAPONS
        !          2000: /*QUAKED weapon_chainfist (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2001: */
        !          2002:        {
        !          2003:                "weapon_chainfist",                                                                     // classname
        !          2004:                Pickup_Weapon,                                                                          // pickup function
        !          2005:                Use_Weapon,                                                                                     // use function
        !          2006:                Drop_Weapon,                                                                            // drop function
        !          2007:                Weapon_ChainFist,                                                                       // weapon think function
        !          2008:                "misc/w_pkup.wav",                                                                      // pick up sound
        !          2009:                "models/weapons/g_chainf/tris.md2", EF_ROTATE,          // world model, world model flags
        !          2010:                "models/weapons/v_chainf/tris.md2",                                     // view model
        !          2011:                "w_chainfist",                                                                          // icon
        !          2012:                "Chainfist",                                                                            // name printed when picked up 
        !          2013:                0,                                                                                                      // number of digits for statusbar
        !          2014:                0,                                                                                                      // amount used / contained
        !          2015:                NULL,                                                                                           // ammo type used 
        !          2016:                IT_WEAPON | IT_MELEE,                                                           // inventory flags
        !          2017:                WEAP_CHAINFIST,                                                                         // visible weapon
        !          2018:                NULL,                                                                                           // info (void *)
        !          2019:                1,                                                                                                      // tag
        !          2020:                "weapons/sawidle.wav weapons/sawhit.wav",                       // precaches
        !          2021:        },
        !          2022: 
        !          2023: /*QUAKED weapon_disintegrator (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2024: */
        !          2025:        {
        !          2026:                "weapon_disintegrator",                                                         // classname
        !          2027:                Pickup_Weapon,                                                                          // pickup function
        !          2028:                Use_Weapon,                                                                                     // use function
        !          2029:                Drop_Weapon,                                                                            // drop function
        !          2030:                Weapon_Disintegrator,                                                           // weapon think function
        !          2031:                "misc/w_pkup.wav",                                                                      // pick up sound
        !          2032:                "models/weapons/g_dist/tris.md2", EF_ROTATE,            // world model, world model flags
        !          2033:                "models/weapons/v_dist/tris.md2",                                       // view model
        !          2034:                "w_disintegrator",                                                                      // icon
        !          2035:                "Disruptor",                                                                            // name printed when picked up 
        !          2036:                0,                                                                                                      // number of digits for statusbar
        !          2037:                1,                                                                                                      // amount used / contained
        !          2038:                "Rounds",                                                                                       // ammo type used 
        !          2039: #ifdef KILL_DISRUPTOR
        !          2040:                IT_NOT_GIVEABLE,
        !          2041: #else
        !          2042:                IT_WEAPON,                                                                                      // inventory flags
        !          2043: #endif
        !          2044:                WEAP_DISRUPTOR,                                                                         // visible weapon
        !          2045:                NULL,                                                                                           // info (void *)
        !          2046:                1,                                                                                                      // tag
        !          2047:                "models/items/spawngro/tris.md2 models/proj/disintegrator/tris.md2 weapons/disrupt.wav weapons/disint2.wav weapons/disrupthit.wav",     // precaches
        !          2048:        },
        !          2049: 
        !          2050: // ROGUE WEAPONS
        !          2051: // =========================
        !          2052: 
        !          2053: 
        !          2054:        //
        !          2055:        // AMMO ITEMS
        !          2056:        //
        !          2057: 
        !          2058: /*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2059: */
        !          2060:        {
        !          2061:                "ammo_shells",
        !          2062:                Pickup_Ammo,
        !          2063:                NULL,
        !          2064:                Drop_Ammo,
        !          2065:                NULL,
        !          2066:                "misc/am_pkup.wav",
        !          2067:                "models/items/ammo/shells/medium/tris.md2", 0,
        !          2068:                NULL,
        !          2069: /* icon */             "a_shells",
        !          2070: /* pickup */   "Shells",
        !          2071: /* width */            3,
        !          2072:                10,
        !          2073:                NULL,
        !          2074:                IT_AMMO,
        !          2075:                0,
        !          2076:                NULL,
        !          2077:                AMMO_SHELLS,
        !          2078: /* precache */ ""
        !          2079:        },
        !          2080: 
        !          2081: /*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2082: */
        !          2083:        {
        !          2084:                "ammo_bullets",
        !          2085:                Pickup_Ammo,
        !          2086:                NULL,
        !          2087:                Drop_Ammo,
        !          2088:                NULL,
        !          2089:                "misc/am_pkup.wav",
        !          2090:                "models/items/ammo/bullets/medium/tris.md2", 0,
        !          2091:                NULL,
        !          2092: /* icon */             "a_bullets",
        !          2093: /* pickup */   "Bullets",
        !          2094: /* width */            3,
        !          2095:                50,
        !          2096:                NULL,
        !          2097:                IT_AMMO,
        !          2098:                0,
        !          2099:                NULL,
        !          2100:                AMMO_BULLETS,
        !          2101: /* precache */ ""
        !          2102:        },
        !          2103: 
        !          2104: /*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2105: */
        !          2106:        {
        !          2107:                "ammo_cells",
        !          2108:                Pickup_Ammo,
        !          2109:                NULL,
        !          2110:                Drop_Ammo,
        !          2111:                NULL,
        !          2112:                "misc/am_pkup.wav",
        !          2113:                "models/items/ammo/cells/medium/tris.md2", 0,
        !          2114:                NULL,
        !          2115: /* icon */             "a_cells",
        !          2116: /* pickup */   "Cells",
        !          2117: /* width */            3,
        !          2118:                50,
        !          2119:                NULL,
        !          2120:                IT_AMMO,
        !          2121:                0,
        !          2122:                NULL,
        !          2123:                AMMO_CELLS,
        !          2124: /* precache */ ""
        !          2125:        },
        !          2126: 
        !          2127: /*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2128: */
        !          2129:        {
        !          2130:                "ammo_rockets",
        !          2131:                Pickup_Ammo,
        !          2132:                NULL,
        !          2133:                Drop_Ammo,
        !          2134:                NULL,
        !          2135:                "misc/am_pkup.wav",
        !          2136:                "models/items/ammo/rockets/medium/tris.md2", 0,
        !          2137:                NULL,
        !          2138: /* icon */             "a_rockets",
        !          2139: /* pickup */   "Rockets",
        !          2140: /* width */            3,
        !          2141:                5,
        !          2142:                NULL,
        !          2143:                IT_AMMO,
        !          2144:                0,
        !          2145:                NULL,
        !          2146:                AMMO_ROCKETS,
        !          2147: /* precache */ ""
        !          2148:        },
        !          2149: 
        !          2150: /*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2151: */
        !          2152:        {
        !          2153:                "ammo_slugs",
        !          2154:                Pickup_Ammo,
        !          2155:                NULL,
        !          2156:                Drop_Ammo,
        !          2157:                NULL,
        !          2158:                "misc/am_pkup.wav",
        !          2159:                "models/items/ammo/slugs/medium/tris.md2", 0,
        !          2160:                NULL,
        !          2161: /* icon */             "a_slugs",
        !          2162: /* pickup */   "Slugs",
        !          2163: /* width */            3,
        !          2164:                10,
        !          2165:                NULL,
        !          2166:                IT_AMMO,
        !          2167:                0,
        !          2168:                NULL,
        !          2169:                AMMO_SLUGS,
        !          2170: /* precache */ ""
        !          2171:        },
        !          2172: 
        !          2173: // =======================================
        !          2174: // ROGUE AMMO
        !          2175: 
        !          2176: /*QUAKED ammo_nails (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2177: */
        !          2178: /*QUAKED ammo_flechettes (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2179: */
        !          2180:        {
        !          2181:                "ammo_flechettes",
        !          2182:                Pickup_Ammo,
        !          2183:                NULL,
        !          2184:                Drop_Ammo,
        !          2185:                NULL,
        !          2186:                "misc/am_pkup.wav",
        !          2187:                "models/ammo/am_flechette/tris.md2", 0,
        !          2188:                NULL,
        !          2189:                "a_flechettes",         //FIXME
        !          2190:                "Flechettes",
        !          2191:                3,
        !          2192:                50,
        !          2193:                NULL,
        !          2194:                IT_AMMO,
        !          2195:                0,
        !          2196:                NULL,
        !          2197:                AMMO_FLECHETTES
        !          2198:        },
        !          2199: /*QUAKED ammo_prox (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2200: */
        !          2201:        {
        !          2202:                "ammo_prox",
        !          2203:                Pickup_Ammo,
        !          2204:                NULL,                   // Use_Weapon,
        !          2205:                Drop_Ammo,
        !          2206:                NULL,                   // Weapon_Prox,
        !          2207:                "misc/am_pkup.wav",
        !          2208:                "models/ammo/am_prox/tris.md2", 0,
        !          2209:                NULL,           // "models/weapons/v_prox/tris.md2",
        !          2210:                "a_prox",
        !          2211:                "prox",         // FIXME 
        !          2212:                3,
        !          2213:                5,
        !          2214:                "prox",
        !          2215:                IT_AMMO,                // IT_AMMO | IT_WEAPON,
        !          2216:                0,
        !          2217:                NULL,
        !          2218:                AMMO_PROX,
        !          2219:                "models/weapons/g_prox/tris.md2 weapons/proxwarn.wav"
        !          2220:        },
        !          2221: 
        !          2222: /*QUAKED ammo_tesla (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2223: */
        !          2224:        {
        !          2225:                "ammo_tesla",
        !          2226:                Pickup_Ammo,
        !          2227:                Use_Weapon,                                             // PGM
        !          2228:                Drop_Ammo,
        !          2229:                Weapon_Tesla,                                   // PGM
        !          2230:                "misc/am_pkup.wav",
        !          2231: //             "models/weapons/g_tesla/tris.md2", 0,
        !          2232:                "models/ammo/am_tesl/tris.md2", 0,
        !          2233:                "models/weapons/v_tesla/tris.md2",
        !          2234:                "a_tesla",
        !          2235:                "Tesla",
        !          2236:                3,
        !          2237:                5,
        !          2238:                "Tesla",                                                                                                // PGM
        !          2239:                IT_AMMO | IT_WEAPON,                                            // inventory flags
        !          2240:                0,
        !          2241:                NULL,                                                                           // info (void *)
        !          2242:                AMMO_TESLA,                                                                     // tag
        !          2243:                "models/weapons/v_tesla2/tris.md2 weapons/hgrenb1a.wav weapons/hgrenb2a.wav models/weapons/g_tesla/tris.md2"                    // precache
        !          2244:        },
        !          2245: 
        !          2246: /*QUAKED ammo_nuke (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2247: */
        !          2248:        {
        !          2249:                "ammo_nuke",
        !          2250:                Pickup_Nuke,
        !          2251:                Use_Nuke,                                               // PMM
        !          2252:                Drop_Ammo,
        !          2253:                NULL,                                                   // PMM
        !          2254:                "misc/am_pkup.wav",
        !          2255:                "models/weapons/g_nuke/tris.md2", EF_ROTATE,
        !          2256:                NULL,
        !          2257: /* icon */             "p_nuke",
        !          2258: /* pickup */   "Nuke",
        !          2259: /* width */            3,
        !          2260:                300, /* quantity (used for respawn time) */
        !          2261:                "Nuke",
        !          2262:                IT_POWERUP,     
        !          2263:                0,
        !          2264:                NULL,
        !          2265:                0,
        !          2266:                "weapons/nukewarn2.wav world/rumble.wav"
        !          2267:        },
        !          2268: 
        !          2269: /*QUAKED ammo_disruptor (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2270: */
        !          2271:        {
        !          2272:                "ammo_disruptor",
        !          2273:                Pickup_Ammo,
        !          2274:                NULL,
        !          2275:                Drop_Ammo,
        !          2276:                NULL,
        !          2277:                "misc/am_pkup.wav",
        !          2278:                "models/ammo/am_disr/tris.md2", 0,
        !          2279:                NULL,
        !          2280:                "a_disruptor",
        !          2281:                "Rounds",               // FIXME 
        !          2282:                3,
        !          2283:                15,
        !          2284:                NULL,
        !          2285: #ifdef KILL_DISRUPTOR
        !          2286:                IT_NOT_GIVEABLE,
        !          2287: #else
        !          2288:                IT_AMMO,                                                                                        // inventory flags
        !          2289: #endif
        !          2290:                0,
        !          2291:                NULL,
        !          2292: #ifdef KILL_DISRUPTOR
        !          2293:                0,
        !          2294: #else
        !          2295:                AMMO_DISRUPTOR,
        !          2296: #endif
        !          2297:        },
        !          2298: // ROGUE AMMO
        !          2299: // =======================================
        !          2300: 
        !          2301:        //
        !          2302:        // POWERUP ITEMS
        !          2303:        //
        !          2304: /*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2305: */
        !          2306:        {
        !          2307:                "item_quad", 
        !          2308:                Pickup_Powerup,
        !          2309:                Use_Quad,
        !          2310:                Drop_General,
        !          2311:                NULL,
        !          2312:                "items/pkup.wav",
        !          2313:                "models/items/quaddama/tris.md2", EF_ROTATE,
        !          2314:                NULL,
        !          2315: /* icon */             "p_quad",
        !          2316: /* pickup */   "Quad Damage",
        !          2317: /* width */            2,
        !          2318:                60,
        !          2319:                NULL,
        !          2320:                IT_POWERUP,
        !          2321:                0,
        !          2322:                NULL,
        !          2323:                0,
        !          2324: /* precache */ "items/damage.wav items/damage2.wav items/damage3.wav"
        !          2325:        },
        !          2326: 
        !          2327: /*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2328: */
        !          2329:        {
        !          2330:                "item_invulnerability",
        !          2331:                Pickup_Powerup,
        !          2332:                Use_Invulnerability,
        !          2333:                Drop_General,
        !          2334:                NULL,
        !          2335:                "items/pkup.wav",
        !          2336:                "models/items/invulner/tris.md2", EF_ROTATE,
        !          2337:                NULL,
        !          2338: /* icon */             "p_invulnerability",
        !          2339: /* pickup */   "Invulnerability",
        !          2340: /* width */            2,
        !          2341:                300,
        !          2342:                NULL,
        !          2343:                IT_POWERUP,
        !          2344:                0,
        !          2345:                NULL,
        !          2346:                0,
        !          2347: /* precache */ "items/protect.wav items/protect2.wav items/protect4.wav"
        !          2348:        },
        !          2349: 
        !          2350: /*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2351: */
        !          2352:        {
        !          2353:                "item_silencer",
        !          2354:                Pickup_Powerup,
        !          2355:                Use_Silencer,
        !          2356:                Drop_General,
        !          2357:                NULL,
        !          2358:                "items/pkup.wav",
        !          2359:                "models/items/silencer/tris.md2", EF_ROTATE,
        !          2360:                NULL,
        !          2361: /* icon */             "p_silencer",
        !          2362: /* pickup */   "Silencer",
        !          2363: /* width */            2,
        !          2364:                60,
        !          2365:                NULL,
        !          2366:                IT_POWERUP,
        !          2367:                0,
        !          2368:                NULL,
        !          2369:                0,
        !          2370: /* precache */ ""
        !          2371:        },
        !          2372: 
        !          2373: /*QUAKED item_breather (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2374: */
        !          2375:        {
        !          2376:                "item_breather",
        !          2377:                Pickup_Powerup,
        !          2378:                Use_Breather,
        !          2379:                Drop_General,
        !          2380:                NULL,
        !          2381:                "items/pkup.wav",
        !          2382:                "models/items/breather/tris.md2", EF_ROTATE,
        !          2383:                NULL,
        !          2384: /* icon */             "p_rebreather",
        !          2385: /* pickup */   "Rebreather",
        !          2386: /* width */            2,
        !          2387:                60,
        !          2388:                NULL,
        !          2389:                IT_STAY_COOP|IT_POWERUP,
        !          2390:                0,
        !          2391:                NULL,
        !          2392:                0,
        !          2393: /* precache */ "items/airout.wav"
        !          2394:        },
        !          2395: 
        !          2396: /*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2397: */
        !          2398:        {
        !          2399:                "item_enviro",
        !          2400:                Pickup_Powerup,
        !          2401:                Use_Envirosuit,
        !          2402:                Drop_General,
        !          2403:                NULL,
        !          2404:                "items/pkup.wav",
        !          2405:                "models/items/enviro/tris.md2", EF_ROTATE,
        !          2406:                NULL,
        !          2407: /* icon */             "p_envirosuit",
        !          2408: /* pickup */   "Environment Suit",
        !          2409: /* width */            2,
        !          2410:                60,
        !          2411:                NULL,
        !          2412:                IT_STAY_COOP|IT_POWERUP,
        !          2413:                0,
        !          2414:                NULL,
        !          2415:                0,
        !          2416: /* precache */ "items/airout.wav"
        !          2417:        },
        !          2418: 
        !          2419: /*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2420: Special item that gives +2 to maximum health
        !          2421: */
        !          2422:        {
        !          2423:                "item_ancient_head",
        !          2424:                Pickup_AncientHead,
        !          2425:                NULL,
        !          2426:                NULL,
        !          2427:                NULL,
        !          2428:                "items/pkup.wav",
        !          2429:                "models/items/c_head/tris.md2", EF_ROTATE,
        !          2430:                NULL,
        !          2431: /* icon */             "i_fixme",
        !          2432: /* pickup */   "Ancient Head",
        !          2433: /* width */            2,
        !          2434:                60,
        !          2435:                NULL,
        !          2436:                0,
        !          2437:                0,
        !          2438:                NULL,
        !          2439:                0,
        !          2440: /* precache */ ""
        !          2441:        },
        !          2442: 
        !          2443: /*QUAKED item_adrenaline (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2444: gives +1 to maximum health
        !          2445: */
        !          2446:        {
        !          2447:                "item_adrenaline",
        !          2448:                Pickup_Adrenaline,
        !          2449:                NULL,
        !          2450:                NULL,
        !          2451:                NULL,
        !          2452:                "items/pkup.wav",
        !          2453:                "models/items/adrenal/tris.md2", EF_ROTATE,
        !          2454:                NULL,
        !          2455: /* icon */             "p_adrenaline",
        !          2456: /* pickup */   "Adrenaline",
        !          2457: /* width */            2,
        !          2458:                60,
        !          2459:                NULL,
        !          2460:                0,
        !          2461:                0,
        !          2462:                NULL,
        !          2463:                0,
        !          2464: /* precache */ ""
        !          2465:        },
        !          2466: 
        !          2467: /*QUAKED item_bandolier (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2468: */
        !          2469:        {
        !          2470:                "item_bandolier",
        !          2471:                Pickup_Bandolier,
        !          2472:                NULL,
        !          2473:                NULL,
        !          2474:                NULL,
        !          2475:                "items/pkup.wav",
        !          2476:                "models/items/band/tris.md2", EF_ROTATE,
        !          2477:                NULL,
        !          2478: /* icon */             "p_bandolier",
        !          2479: /* pickup */   "Bandolier",
        !          2480: /* width */            2,
        !          2481:                60,
        !          2482:                NULL,
        !          2483:                0,
        !          2484:                0,
        !          2485:                NULL,
        !          2486:                0,
        !          2487: /* precache */ ""
        !          2488:        },
        !          2489: 
        !          2490: /*QUAKED item_pack (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2491: */
        !          2492:        {
        !          2493:                "item_pack",
        !          2494:                Pickup_Pack,
        !          2495:                NULL,
        !          2496:                NULL,
        !          2497:                NULL,
        !          2498:                "items/pkup.wav",
        !          2499:                "models/items/pack/tris.md2", EF_ROTATE,
        !          2500:                NULL,
        !          2501: /* icon */             "i_pack",
        !          2502: /* pickup */   "Ammo Pack",
        !          2503: /* width */            2,
        !          2504:                180,
        !          2505:                NULL,
        !          2506:                0,
        !          2507:                0,
        !          2508:                NULL,
        !          2509:                0,
        !          2510: /* precache */ ""
        !          2511:        },
        !          2512: 
        !          2513: // ======================================
        !          2514: // PGM
        !          2515: 
        !          2516: /*QUAKED item_ir_goggles (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2517: gives +1 to maximum health
        !          2518: */
        !          2519:        {
        !          2520:                "item_ir_goggles",
        !          2521:                Pickup_Powerup,
        !          2522:                Use_IR,
        !          2523:                Drop_General,
        !          2524:                NULL,
        !          2525:                "items/pkup.wav",
        !          2526:                "models/items/goggles/tris.md2", EF_ROTATE,
        !          2527:                NULL,
        !          2528: /* icon */             "p_ir",
        !          2529: /* pickup */   "IR Goggles",
        !          2530: /* width */            2,
        !          2531:                60,
        !          2532:                NULL,
        !          2533:                IT_POWERUP,
        !          2534:                0,
        !          2535:                NULL,
        !          2536:                0,
        !          2537: /* precache */ ""
        !          2538:        },
        !          2539: 
        !          2540: /*QUAKED item_double (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2541: */
        !          2542:        {
        !          2543:                "item_double", 
        !          2544:                Pickup_Powerup,
        !          2545:                Use_Double,
        !          2546:                Drop_General,
        !          2547:                NULL,
        !          2548:                "items/pkup.wav",
        !          2549:                "models/items/ddamage/tris.md2", EF_ROTATE,
        !          2550:                NULL,
        !          2551: /* icon */             "p_double",
        !          2552: /* pickup */   "Double Damage",
        !          2553: /* width */            2,
        !          2554:                60,
        !          2555:                NULL,
        !          2556:                IT_POWERUP,
        !          2557:                0,
        !          2558:                NULL,
        !          2559:                0,
        !          2560: /* precache */ "items/damage.wav items/damage2.wav items/damage3.wav"
        !          2561:        },
        !          2562: 
        !          2563: /*QUAKED item_torch (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2564: */
        !          2565:        {
        !          2566:                "item_torch", 
        !          2567:                Pickup_Powerup,
        !          2568:                Use_Torch,
        !          2569:                Drop_General,
        !          2570:                NULL,
        !          2571:                "items/pkup.wav",
        !          2572:                "models/objects/fire/tris.md2", EF_ROTATE,
        !          2573:                NULL,
        !          2574: /* icon */             "p_torch",
        !          2575: /* pickup */   "torch",
        !          2576: /* width */            2,
        !          2577:                60,
        !          2578:                NULL,
        !          2579:                IT_POWERUP,
        !          2580:                0,
        !          2581:                NULL,
        !          2582:                0,
        !          2583:        },
        !          2584: 
        !          2585: /*QUAKED item_compass (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2586: */
        !          2587:        {
        !          2588:                "item_compass", 
        !          2589:                Pickup_Powerup,
        !          2590:                Use_Compass,
        !          2591:                NULL,
        !          2592:                NULL,
        !          2593:                "items/pkup.wav",
        !          2594:                "models/objects/fire/tris.md2", EF_ROTATE,
        !          2595:                NULL,
        !          2596: /* icon */             "p_compass",
        !          2597: /* pickup */   "compass",
        !          2598: /* width */            2,
        !          2599:                60,
        !          2600:                NULL,
        !          2601:                IT_POWERUP,
        !          2602:                0,
        !          2603:                NULL,
        !          2604:                0,
        !          2605:        },
        !          2606: 
        !          2607: /*QUAKED item_sphere_vengeance (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2608: */
        !          2609:        {
        !          2610:                "item_sphere_vengeance", 
        !          2611:                Pickup_Sphere,
        !          2612:                Use_Vengeance,
        !          2613:                NULL,
        !          2614:                NULL,
        !          2615:                "items/pkup.wav",
        !          2616:                "models/items/vengnce/tris.md2", EF_ROTATE,
        !          2617:                NULL,
        !          2618: /* icon */             "p_vengeance",
        !          2619: /* pickup */   "vengeance sphere",
        !          2620: /* width */            2,
        !          2621:                60,
        !          2622:                NULL,
        !          2623:                IT_POWERUP,
        !          2624:                0,
        !          2625:                NULL,
        !          2626:                0,
        !          2627:                "powerup/vsphere.wav"           //precache
        !          2628:        },
        !          2629: 
        !          2630: /*QUAKED item_sphere_hunter (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2631: */
        !          2632:        {
        !          2633:                "item_sphere_hunter", 
        !          2634:                Pickup_Sphere,
        !          2635:                Use_Hunter,
        !          2636:                NULL,
        !          2637:                NULL,
        !          2638:                "items/pkup.wav",
        !          2639:                "models/items/hunter/tris.md2", EF_ROTATE,
        !          2640:                NULL,
        !          2641: /* icon */             "p_hunter",
        !          2642: /* pickup */   "hunter sphere",
        !          2643: /* width */            2,
        !          2644:                60,
        !          2645:                NULL,
        !          2646:                IT_POWERUP,
        !          2647:                0,
        !          2648:                NULL,
        !          2649:                0,
        !          2650:                "powerup/hsphere.wav"           //precache
        !          2651:        },
        !          2652: 
        !          2653: /*QUAKED item_sphere_defender (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2654: */
        !          2655:        {
        !          2656:                "item_sphere_defender", 
        !          2657:                Pickup_Sphere,
        !          2658:                Use_Defender,
        !          2659:                NULL,
        !          2660:                NULL,
        !          2661:                "items/pkup.wav",
        !          2662:                "models/items/defender/tris.md2", EF_ROTATE,
        !          2663:                NULL,
        !          2664: /* icon */             "p_defender",
        !          2665: /* pickup */   "defender sphere",
        !          2666: /* width */            2,
        !          2667:                60,                                                                                                     // respawn time
        !          2668:                NULL,                                                                                           // ammo type used
        !          2669:                IT_POWERUP,                                                                                     // inventory flags
        !          2670:                0,
        !          2671:                NULL,                                                                                           // info (void *)
        !          2672:                0,                                                                                                      // tag
        !          2673:                "models/proj/laser2/tris.md2 models/items/shell/tris.md2 powerup/dsphere.wav"           // precache
        !          2674:        },
        !          2675: 
        !          2676: /*QUAKED item_doppleganger (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2677: */
        !          2678:        {
        !          2679:                "item_doppleganger",                                                            // classname
        !          2680:                Pickup_Doppleganger,                                                            // pickup function
        !          2681:                Use_Doppleganger,                                                                       // use function
        !          2682:                Drop_General,                                                                           // drop function
        !          2683:                NULL,                                                                                           // weapon think function
        !          2684:                "items/pkup.wav",                                                                       // pick up sound
        !          2685:                "models/items/dopple/tris.md2",                                         // world model
        !          2686:                EF_ROTATE,                                                                                      // world model flags
        !          2687:                NULL,                                                                                           // view model
        !          2688:                "p_doppleganger",                                                                       // icon
        !          2689:                "Doppleganger",                                                                         // name printed when picked up 
        !          2690:                0,                                                                                                      // number of digits for statusbar
        !          2691:                90,                                                                                                     // respawn time
        !          2692:                NULL,                                                                                           // ammo type used 
        !          2693:                IT_POWERUP,                                                                                     // inventory flags
        !          2694:                0,
        !          2695:                NULL,                                                                                           // info (void *)
        !          2696:                0,                                                                                                      // tag
        !          2697:                "models/objects/dopplebase/tris.md2 models/items/spawngro2/tris.md2 models/items/hunter/tris.md2 models/items/vengnce/tris.md2",                // precaches
        !          2698:        },
        !          2699: 
        !          2700:        {
        !          2701: //             "dm_tag_token",                                                                         // classname
        !          2702:                NULL,                                                                                           // classname
        !          2703:                Tag_PickupToken,                                                                        // pickup function
        !          2704:                NULL,                                                                                           // use function
        !          2705:                NULL,                                                                                           // drop function
        !          2706:                NULL,                                                                                           // weapon think function
        !          2707:                "items/pkup.wav",                                                                       // pick up sound
        !          2708:                "models/items/tagtoken/tris.md2",                                       // world model
        !          2709:                EF_ROTATE | EF_TAGTRAIL,                                                        // world model flags
        !          2710:                NULL,                                                                                           // view model
        !          2711:                "i_fixme",                                                                                      // icon
        !          2712:                "Tag Token",                                                                            // name printed when picked up 
        !          2713:                0,                                                                                                      // number of digits for statusbar
        !          2714:                0,                                                                                                      // amount used / contained
        !          2715:                NULL,                                                                                           // ammo type used 
        !          2716:                IT_POWERUP | IT_NOT_GIVEABLE,                                           // inventory flags
        !          2717:                0,
        !          2718:                NULL,                                                                                           // info (void *)
        !          2719:                1,                                                                                                      // tag
        !          2720:                NULL,                                                                                           // precaches
        !          2721:        },
        !          2722: 
        !          2723: // PGM
        !          2724: // ======================================
        !          2725: 
        !          2726: 
        !          2727:        //
        !          2728:        // KEYS
        !          2729:        //
        !          2730: /*QUAKED key_data_cd (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2731: key for computer centers
        !          2732: */
        !          2733:        {
        !          2734:                "key_data_cd",
        !          2735:                Pickup_Key,
        !          2736:                NULL,
        !          2737:                Drop_General,
        !          2738:                NULL,
        !          2739:                "items/pkup.wav",
        !          2740:                "models/items/keys/data_cd/tris.md2", EF_ROTATE,
        !          2741:                NULL,
        !          2742:                "k_datacd",
        !          2743:                "Data CD",
        !          2744:                2,
        !          2745:                0,
        !          2746:                NULL,
        !          2747:                IT_STAY_COOP|IT_KEY,
        !          2748:                0,
        !          2749:                NULL,
        !          2750:                0,
        !          2751: /* precache */ ""
        !          2752:        },
        !          2753: 
        !          2754: /*QUAKED key_power_cube (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH
        !          2755: warehouse circuits
        !          2756: */
        !          2757:        {
        !          2758:                "key_power_cube",
        !          2759:                Pickup_Key,
        !          2760:                NULL,
        !          2761:                Drop_General,
        !          2762:                NULL,
        !          2763:                "items/pkup.wav",
        !          2764:                "models/items/keys/power/tris.md2", EF_ROTATE,
        !          2765:                NULL,
        !          2766:                "k_powercube",
        !          2767:                "Power Cube",
        !          2768:                2,
        !          2769:                0,
        !          2770:                NULL,
        !          2771:                IT_STAY_COOP|IT_KEY,
        !          2772:                0,
        !          2773:                NULL,
        !          2774:                0,
        !          2775: /* precache */ ""
        !          2776:        },
        !          2777: 
        !          2778: /*QUAKED key_pyramid (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2779: key for the entrance of jail3
        !          2780: */
        !          2781:        {
        !          2782:                "key_pyramid",
        !          2783:                Pickup_Key,
        !          2784:                NULL,
        !          2785:                Drop_General,
        !          2786:                NULL,
        !          2787:                "items/pkup.wav",
        !          2788:                "models/items/keys/pyramid/tris.md2", EF_ROTATE,
        !          2789:                NULL,
        !          2790:                "k_pyramid",
        !          2791:                "Pyramid Key",
        !          2792:                2,
        !          2793:                0,
        !          2794:                NULL,
        !          2795:                IT_STAY_COOP|IT_KEY,
        !          2796:                0,
        !          2797:                NULL,
        !          2798:                0,
        !          2799: /* precache */ ""
        !          2800:        },
        !          2801: 
        !          2802: /*QUAKED key_data_spinner (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2803: key for the city computer
        !          2804: */
        !          2805:        {
        !          2806:                "key_data_spinner",
        !          2807:                Pickup_Key,
        !          2808:                NULL,
        !          2809:                Drop_General,
        !          2810:                NULL,
        !          2811:                "items/pkup.wav",
        !          2812:                "models/items/keys/spinner/tris.md2", EF_ROTATE,
        !          2813:                NULL,
        !          2814:                "k_dataspin",
        !          2815:                "Data Spinner",
        !          2816:                2,
        !          2817:                0,
        !          2818:                NULL,
        !          2819:                IT_STAY_COOP|IT_KEY,
        !          2820:                0,
        !          2821:                NULL,
        !          2822:                0,
        !          2823: /* precache */ ""
        !          2824:        },
        !          2825: 
        !          2826: /*QUAKED key_pass (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2827: security pass for the security level
        !          2828: */
        !          2829:        {
        !          2830:                "key_pass",
        !          2831:                Pickup_Key,
        !          2832:                NULL,
        !          2833:                Drop_General,
        !          2834:                NULL,
        !          2835:                "items/pkup.wav",
        !          2836:                "models/items/keys/pass/tris.md2", EF_ROTATE,
        !          2837:                NULL,
        !          2838:                "k_security",
        !          2839:                "Security Pass",
        !          2840:                2,
        !          2841:                0,
        !          2842:                NULL,
        !          2843:                IT_STAY_COOP|IT_KEY,
        !          2844:                0,
        !          2845:                NULL,
        !          2846:                0,
        !          2847: /* precache */ ""
        !          2848:        },
        !          2849: 
        !          2850: /*QUAKED key_blue_key (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2851: normal door key - blue
        !          2852: */
        !          2853:        {
        !          2854:                "key_blue_key",
        !          2855:                Pickup_Key,
        !          2856:                NULL,
        !          2857:                Drop_General,
        !          2858:                NULL,
        !          2859:                "items/pkup.wav",
        !          2860:                "models/items/keys/key/tris.md2", EF_ROTATE,
        !          2861:                NULL,
        !          2862:                "k_bluekey",
        !          2863:                "Blue Key",
        !          2864:                2,
        !          2865:                0,
        !          2866:                NULL,
        !          2867:                IT_STAY_COOP|IT_KEY,
        !          2868:                0,
        !          2869:                NULL,
        !          2870:                0,
        !          2871: /* precache */ ""
        !          2872:        },
        !          2873: 
        !          2874: /*QUAKED key_red_key (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2875: normal door key - red
        !          2876: */
        !          2877:        {
        !          2878:                "key_red_key",
        !          2879:                Pickup_Key,
        !          2880:                NULL,
        !          2881:                Drop_General,
        !          2882:                NULL,
        !          2883:                "items/pkup.wav",
        !          2884:                "models/items/keys/red_key/tris.md2", EF_ROTATE,
        !          2885:                NULL,
        !          2886:                "k_redkey",
        !          2887:                "Red Key",
        !          2888:                2,
        !          2889:                0,
        !          2890:                NULL,
        !          2891:                IT_STAY_COOP|IT_KEY,
        !          2892:                0,
        !          2893:                NULL,
        !          2894:                0,
        !          2895: /* precache */ ""
        !          2896:        },
        !          2897: 
        !          2898: /*QUAKED key_commander_head (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2899: tank commander's head
        !          2900: */
        !          2901:        {
        !          2902:                "key_commander_head",
        !          2903:                Pickup_Key,
        !          2904:                NULL,
        !          2905:                Drop_General,
        !          2906:                NULL,
        !          2907:                "items/pkup.wav",
        !          2908:                "models/monsters/commandr/head/tris.md2", EF_GIB,
        !          2909:                NULL,
        !          2910: /* icon */             "k_comhead",
        !          2911: /* pickup */   "Commander's Head",
        !          2912: /* width */            2,
        !          2913:                0,
        !          2914:                NULL,
        !          2915:                IT_STAY_COOP|IT_KEY,
        !          2916:                0,
        !          2917:                NULL,
        !          2918:                0,
        !          2919: /* precache */ ""
        !          2920:        },
        !          2921: 
        !          2922: /*QUAKED key_airstrike_target (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2923: tank commander's head
        !          2924: */
        !          2925:        {
        !          2926:                "key_airstrike_target",
        !          2927:                Pickup_Key,
        !          2928:                NULL,
        !          2929:                Drop_General,
        !          2930:                NULL,
        !          2931:                "items/pkup.wav",
        !          2932:                "models/items/keys/target/tris.md2", EF_ROTATE,
        !          2933:                NULL,
        !          2934: /* icon */             "i_airstrike",
        !          2935: /* pickup */   "Airstrike Marker",
        !          2936: /* width */            2,
        !          2937:                0,
        !          2938:                NULL,
        !          2939:                IT_STAY_COOP|IT_KEY,
        !          2940:                0,
        !          2941:                NULL,
        !          2942:                0,
        !          2943: /* precache */ ""
        !          2944:        },
        !          2945: 
        !          2946: // ======================================
        !          2947: // PGM
        !          2948: 
        !          2949: /*QUAKED key_nuke_container (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2950: */
        !          2951:        {
        !          2952:                "key_nuke_container",                                                           // classname
        !          2953:                Pickup_Key,                                                                                     // pickup function
        !          2954:                NULL,                                                                                           // use function
        !          2955:                Drop_General,                                                                           // drop function
        !          2956:                NULL,                                                                                           // weapon think function
        !          2957:                "items/pkup.wav",                                                                       // pick up sound
        !          2958:                "models/weapons/g_nuke/tris.md2",                                       // world model
        !          2959:                EF_ROTATE,                                                                                      // world model flags
        !          2960:                NULL,                                                                                           // view model
        !          2961:                "i_fixme",                                                                                      // icon
        !          2962:                "Antimatter Container",                                                         // name printed when picked up 
        !          2963:                2,                                                                                                      // number of digits for statusbar
        !          2964:                0,                                                                                                      // respawn time
        !          2965:                NULL,                                                                                           // ammo type used 
        !          2966:                IT_STAY_COOP|IT_KEY,                                                            // inventory flags
        !          2967:                0,
        !          2968:                NULL,                                                                                           // info (void *)
        !          2969:                0,                                                                                                      // tag
        !          2970:                NULL,                                                                                           // precaches
        !          2971:        },
        !          2972: 
        !          2973: /*QUAKED key_nuke (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          2974: */
        !          2975:        {
        !          2976:                "key_nuke",                                                                                     // classname
        !          2977:                Pickup_Key,                                                                                     // pickup function
        !          2978:                NULL,                                                                                           // use function
        !          2979:                Drop_General,                                                                           // drop function
        !          2980:                NULL,                                                                                           // weapon think function
        !          2981:                "items/pkup.wav",                                                                       // pick up sound
        !          2982:                "models/weapons/g_nuke/tris.md2",                                       // world model
        !          2983:                EF_ROTATE,                                                                                      // world model flags
        !          2984:                NULL,                                                                                           // view model
        !          2985:                "i_fixme",                                                                                      // icon
        !          2986:                "Antimatter Bomb",                                                                      // name printed when picked up 
        !          2987:                2,                                                                                                      // number of digits for statusbar
        !          2988:                0,                                                                                                      // respawn time
        !          2989:                NULL,                                                                                           // ammo type used 
        !          2990:                IT_STAY_COOP|IT_KEY,                                                            // inventory flags
        !          2991:                0,
        !          2992:                NULL,                                                                                           // info (void *)
        !          2993:                0,                                                                                                      // tag
        !          2994:                NULL,                                                                                           // precaches
        !          2995:        },
        !          2996: 
        !          2997: // PGM
        !          2998: // ======================================
        !          2999: 
        !          3000:        {
        !          3001:                NULL,
        !          3002:                Pickup_Health,
        !          3003:                NULL,
        !          3004:                NULL,
        !          3005:                NULL,
        !          3006:                "items/pkup.wav",
        !          3007:                NULL, 0,
        !          3008:                NULL,
        !          3009: /* icon */             "i_health",
        !          3010: /* pickup */   "Health",
        !          3011: /* width */            3,
        !          3012:                0,
        !          3013:                NULL,
        !          3014:                0,
        !          3015:                0,
        !          3016:                NULL,
        !          3017:                0,
        !          3018: /* precache */ "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav"
        !          3019:        },
        !          3020: 
        !          3021:        // end of list marker
        !          3022:        {NULL}
        !          3023: };
        !          3024: 
        !          3025: 
        !          3026: /*QUAKED item_health (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          3027: */
        !          3028: void SP_item_health (edict_t *self)
        !          3029: {
        !          3030:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
        !          3031:        {
        !          3032:                G_FreeEdict (self);
        !          3033:                return;
        !          3034:        }
        !          3035: 
        !          3036:        self->model = "models/items/healing/medium/tris.md2";
        !          3037:        self->count = 10;
        !          3038:        SpawnItem (self, FindItem ("Health"));
        !          3039:        gi.soundindex ("items/n_health.wav");
        !          3040: }
        !          3041: 
        !          3042: /*QUAKED item_health_small (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          3043: */
        !          3044: void SP_item_health_small (edict_t *self)
        !          3045: {
        !          3046:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
        !          3047:        {
        !          3048:                G_FreeEdict (self);
        !          3049:                return;
        !          3050:        }
        !          3051: 
        !          3052:        self->model = "models/items/healing/stimpack/tris.md2";
        !          3053:        self->count = 2;
        !          3054:        SpawnItem (self, FindItem ("Health"));
        !          3055:        self->style = HEALTH_IGNORE_MAX;
        !          3056:        gi.soundindex ("items/s_health.wav");
        !          3057: }
        !          3058: 
        !          3059: /*QUAKED item_health_large (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          3060: */
        !          3061: void SP_item_health_large (edict_t *self)
        !          3062: {
        !          3063:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
        !          3064:        {
        !          3065:                G_FreeEdict (self);
        !          3066:                return;
        !          3067:        }
        !          3068: 
        !          3069:        self->model = "models/items/healing/large/tris.md2";
        !          3070:        self->count = 25;
        !          3071:        SpawnItem (self, FindItem ("Health"));
        !          3072:        gi.soundindex ("items/l_health.wav");
        !          3073: }
        !          3074: 
        !          3075: /*QUAKED item_health_mega (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
        !          3076: */
        !          3077: void SP_item_health_mega (edict_t *self)
        !          3078: {
        !          3079:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
        !          3080:        {
        !          3081:                G_FreeEdict (self);
        !          3082:                return;
        !          3083:        }
        !          3084: 
        !          3085:        self->model = "models/items/mega_h/tris.md2";
        !          3086:        self->count = 100;
        !          3087:        SpawnItem (self, FindItem ("Health"));
        !          3088:        gi.soundindex ("items/m_health.wav");
        !          3089:        self->style = HEALTH_IGNORE_MAX|HEALTH_TIMED;
        !          3090: }
        !          3091: 
        !          3092: 
        !          3093: void InitItems (void)
        !          3094: {
        !          3095:        game.num_items = sizeof(itemlist)/sizeof(itemlist[0]) - 1;
        !          3096: }
        !          3097: 
        !          3098: 
        !          3099: 
        !          3100: /*
        !          3101: ===============
        !          3102: SetItemNames
        !          3103: 
        !          3104: Called by worldspawn
        !          3105: ===============
        !          3106: */
        !          3107: void SetItemNames (void)
        !          3108: {
        !          3109:        int             i;
        !          3110:        gitem_t *it;
        !          3111: 
        !          3112:        for (i=0 ; i<game.num_items ; i++)
        !          3113:        {
        !          3114:                it = &itemlist[i];
        !          3115:                gi.configstring (CS_ITEMS+i, it->pickup_name);
        !          3116:        }
        !          3117: 
        !          3118:        jacket_armor_index = ITEM_INDEX(FindItem("Jacket Armor"));
        !          3119:        combat_armor_index = ITEM_INDEX(FindItem("Combat Armor"));
        !          3120:        body_armor_index   = ITEM_INDEX(FindItem("Body Armor"));
        !          3121:        power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
        !          3122:        power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
        !          3123: }
        !          3124: 
        !          3125: 
        !          3126: //===============
        !          3127: //ROGUE
        !          3128: void SP_xatrix_item (edict_t *self)
        !          3129: {
        !          3130:        gitem_t *item;
        !          3131:        int             i;
        !          3132:        char    *spawnClass;
        !          3133: 
        !          3134:        if(!self->classname)
        !          3135:                return;
        !          3136: 
        !          3137:        if(!strcmp(self->classname, "ammo_magslug"))
        !          3138:                spawnClass = "ammo_flechettes";
        !          3139:        else if(!strcmp(self->classname, "ammo_trap"))
        !          3140:                spawnClass = "weapon_proxlauncher";
        !          3141:        else if(!strcmp(self->classname, "item_quadfire"))
        !          3142:        {
        !          3143:                float   chance;
        !          3144: 
        !          3145:                chance = random();
        !          3146:                if(chance < 0.2)
        !          3147:                        spawnClass = "item_sphere_hunter";
        !          3148:                else if (chance < 0.6)
        !          3149:                        spawnClass = "item_sphere_vengeance";
        !          3150:                else
        !          3151:                        spawnClass = "item_sphere_defender";
        !          3152:        }
        !          3153:        else if(!strcmp(self->classname, "weapon_boomer"))
        !          3154:                spawnClass = "weapon_etf_rifle";
        !          3155:        else if(!strcmp(self->classname, "weapon_phalanx"))
        !          3156:                spawnClass = "weapon_heatbeam";
        !          3157: 
        !          3158: 
        !          3159:        // check item spawn functions
        !          3160:        for (i=0,item=itemlist ; i<game.num_items ; i++,item++)
        !          3161:        {
        !          3162:                if (!item->classname)
        !          3163:                        continue;
        !          3164:                if (!strcmp(item->classname, spawnClass))
        !          3165:                {       // found it
        !          3166:                        SpawnItem (self, item);
        !          3167:                        return;
        !          3168:                }
        !          3169:        }
        !          3170: }
        !          3171: //ROGUE
        !          3172: //===============

unix.superglobalmegacorp.com

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