Annotation of quake2/xatrix/g_items.c, revision 1.1.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           Use_Weapon2 (edict_t *ent, gitem_t *inv);
                      7: void           Drop_Weapon (edict_t *ent, gitem_t *inv);
                      8: 
                      9: void Weapon_Blaster (edict_t *ent);
                     10: void Weapon_Shotgun (edict_t *ent);
                     11: void Weapon_SuperShotgun (edict_t *ent);
                     12: void Weapon_Machinegun (edict_t *ent);
                     13: void Weapon_Chaingun (edict_t *ent);
                     14: void Weapon_HyperBlaster (edict_t *ent);
                     15: void Weapon_RocketLauncher (edict_t *ent);
                     16: void Weapon_Grenade (edict_t *ent);
                     17: void Weapon_GrenadeLauncher (edict_t *ent);
                     18: void Weapon_Railgun (edict_t *ent);
                     19: void Weapon_BFG (edict_t *ent);
                     20: // RAFAEL
                     21: void Weapon_Ionripper (edict_t *ent);
                     22: void Weapon_Phalanx (edict_t *ent);
                     23: void Weapon_Trap (edict_t *ent);
                     24: 
                     25: gitem_armor_t jacketarmor_info = { 25,  50, .30, .00, ARMOR_JACKET};
                     26: gitem_armor_t combatarmor_info = { 50, 100, .60, .30, ARMOR_COMBAT};
                     27: gitem_armor_t bodyarmor_info   = {100, 200, .80, .60, ARMOR_BODY};
                     28: 
                     29: static int     jacket_armor_index;
                     30: static int     combat_armor_index;
                     31: static int     body_armor_index;
                     32: static int     power_screen_index;
                     33: static int     power_shield_index;
                     34: 
                     35: #define HEALTH_IGNORE_MAX      1
                     36: #define HEALTH_TIMED           2
                     37: 
                     38: void Use_Quad (edict_t *ent, gitem_t *item);
                     39: // RAFAEL
                     40: void Use_QuadFire (edict_t *ent, gitem_t *item);
                     41: 
                     42: static int     quad_drop_timeout_hack;
                     43: // RAFAEL
                     44: static int     quad_fire_drop_timeout_hack;
                     45: 
                     46: //======================================================================
                     47: 
                     48: /*
                     49: ===============
                     50: GetItemByIndex
                     51: ===============
                     52: */
                     53: gitem_t        *GetItemByIndex (int index)
                     54: {
                     55:        if (index == 0 || index >= game.num_items)
                     56:                return NULL;
                     57: 
                     58:        return &itemlist[index];
                     59: }
                     60: 
                     61: 
                     62: /*
                     63: ===============
                     64: FindItemByClassname
                     65: 
                     66: ===============
                     67: */
                     68: gitem_t        *FindItemByClassname (char *classname)
                     69: {
                     70:        int             i;
                     71:        gitem_t *it;
                     72: 
                     73:        it = itemlist;
                     74:        for (i=0 ; i<game.num_items ; i++, it++)
                     75:        {
                     76:                if (!it->classname)
                     77:                        continue;
                     78:                if (!Q_stricmp(it->classname, classname))
                     79:                        return it;
                     80:        }
                     81: 
                     82:        return NULL;
                     83: }
                     84: 
                     85: /*
                     86: ===============
                     87: FindItem
                     88: 
                     89: ===============
                     90: */
                     91: gitem_t        *FindItem (char *pickup_name)
                     92: {
                     93:        int             i;
                     94:        gitem_t *it;
                     95: 
                     96:        it = itemlist;
                     97:        for (i=0 ; i<game.num_items ; i++, it++)
                     98:        {
                     99:                if (!it->pickup_name)
                    100:                        continue;
                    101:                if (!Q_stricmp(it->pickup_name, pickup_name))
                    102:                        return it;
                    103:        }
                    104: 
                    105:        return NULL;
                    106: }
                    107: 
                    108: //======================================================================
                    109: 
                    110: void DoRespawn (edict_t *ent)
                    111: {
                    112:        if (ent->team)
                    113:        {
                    114:                edict_t *master;
                    115:                int     count;
                    116:                int choice;
                    117: 
                    118:                master = ent->teammaster;
                    119: 
                    120:                for (count = 0, ent = master; ent; ent = ent->chain, count++)
                    121:                        ;
                    122: 
                    123:                choice = rand() % count;
                    124: 
                    125:                for (count = 0, ent = master; count < choice; ent = ent->chain, count++)
                    126:                        ;
                    127:        }
                    128: 
                    129:        ent->svflags &= ~SVF_NOCLIENT;
                    130:        ent->solid = SOLID_TRIGGER;
                    131:        gi.linkentity (ent);
                    132: 
                    133:        // send an effect
                    134:        ent->s.event = EV_ITEM_RESPAWN;
                    135: }
                    136: 
                    137: void SetRespawn (edict_t *ent, float delay)
                    138: {
                    139:        ent->flags |= FL_RESPAWN;
                    140:        ent->svflags |= SVF_NOCLIENT;
                    141:        ent->solid = SOLID_NOT;
                    142:        ent->nextthink = level.time + delay;
                    143:        ent->think = DoRespawn;
                    144:        gi.linkentity (ent);
                    145: }
                    146: 
                    147: 
                    148: //======================================================================
                    149: 
                    150: qboolean Pickup_Powerup (edict_t *ent, edict_t *other)
                    151: {
                    152:        int             quantity;
                    153: 
                    154:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
                    155:        if ((skill->value == 1 && quantity >= 2) || (skill->value >= 2 && quantity >= 1))
                    156:                return false;
                    157: 
                    158:        if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0))
                    159:                return false;
                    160: 
                    161:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
                    162: 
                    163:        if (deathmatch->value)
                    164:        {
                    165:                if (!(ent->spawnflags & DROPPED_ITEM) )
                    166:                        SetRespawn (ent, ent->item->quantity);
                    167:                if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM)))
                    168:                {
                    169:                        if ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM))
                    170:                                quad_drop_timeout_hack = (ent->nextthink - level.time) / FRAMETIME;
                    171:                        ent->item->use (other, ent->item);
                    172:                }
                    173:                // RAFAEL
                    174:                else if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_QuadFire) && (ent->spawnflags & DROPPED_PLAYER_ITEM)))
                    175:                {
                    176:                        if ((ent->item->use == Use_QuadFire) && (ent->spawnflags & DROPPED_PLAYER_ITEM))
                    177:                                quad_fire_drop_timeout_hack = (ent->nextthink - level.time) / FRAMETIME;
                    178:                        ent->item->use (other, ent->item);
                    179:                }
                    180:        }
                    181: 
                    182:        return true;
                    183: }
                    184: 
                    185: void Drop_General (edict_t *ent, gitem_t *item)
                    186: {
                    187:        Drop_Item (ent, item);
                    188:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    189:        ValidateSelectedItem (ent);
                    190: }
                    191: 
                    192: 
                    193: //======================================================================
                    194: 
                    195: qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
                    196: {
                    197:        if (!deathmatch->value)
                    198:                other->max_health += 1;
                    199: 
                    200:        if (other->health < other->max_health)
                    201:                other->health = other->max_health;
                    202: 
                    203:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    204:                SetRespawn (ent, ent->item->quantity);
                    205: 
                    206:        return true;
                    207: }
                    208: 
                    209: qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
                    210: {
                    211:        other->max_health += 2;
                    212: 
                    213:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    214:                SetRespawn (ent, ent->item->quantity);
                    215: 
                    216:        return true;
                    217: }
                    218: 
                    219: qboolean Pickup_Bandolier (edict_t *ent, edict_t *other)
                    220: {
                    221:        gitem_t *item;
                    222:        int             index;
                    223: 
                    224:        if (other->client->pers.max_bullets < 250)
                    225:                other->client->pers.max_bullets = 250;
                    226:        if (other->client->pers.max_shells < 150)
                    227:                other->client->pers.max_shells = 150;
                    228:        if (other->client->pers.max_cells < 250)
                    229:                other->client->pers.max_cells = 250;
                    230:        if (other->client->pers.max_slugs < 75)
                    231:                other->client->pers.max_slugs = 75;
                    232:        // RAFAEL
                    233:        if (other->client->pers.max_magslug < 75)
                    234:                other->client->pers.max_magslug = 75;
                    235: 
                    236:        item = FindItem("Bullets");
                    237:        if (item)
                    238:        {
                    239:                index = ITEM_INDEX(item);
                    240:                other->client->pers.inventory[index] += item->quantity;
                    241:                if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
                    242:                        other->client->pers.inventory[index] = other->client->pers.max_bullets;
                    243:        }
                    244: 
                    245:        item = FindItem("Shells");
                    246:        if (item)
                    247:        {
                    248:                index = ITEM_INDEX(item);
                    249:                other->client->pers.inventory[index] += item->quantity;
                    250:                if (other->client->pers.inventory[index] > other->client->pers.max_shells)
                    251:                        other->client->pers.inventory[index] = other->client->pers.max_shells;
                    252:        }
                    253: 
                    254:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    255:                SetRespawn (ent, ent->item->quantity);
                    256: 
                    257:        return true;
                    258: }
                    259: 
                    260: qboolean Pickup_Pack (edict_t *ent, edict_t *other)
                    261: {
                    262:        gitem_t *item;
                    263:        int             index;
                    264: 
                    265:        if (other->client->pers.max_bullets < 300)
                    266:                other->client->pers.max_bullets = 300;
                    267:        if (other->client->pers.max_shells < 200)
                    268:                other->client->pers.max_shells = 200;
                    269:        if (other->client->pers.max_rockets < 100)
                    270:                other->client->pers.max_rockets = 100;
                    271:        if (other->client->pers.max_grenades < 100)
                    272:                other->client->pers.max_grenades = 100;
                    273:        if (other->client->pers.max_cells < 300)
                    274:                other->client->pers.max_cells = 300;
                    275:        if (other->client->pers.max_slugs < 100)
                    276:                other->client->pers.max_slugs = 100;
                    277:        // RAFAEL
                    278:        if (other->client->pers.max_magslug < 100)
                    279:                other->client->pers.max_magslug = 100;
                    280: 
                    281:        item = FindItem("Bullets");
                    282:        if (item)
                    283:        {
                    284:                index = ITEM_INDEX(item);
                    285:                other->client->pers.inventory[index] += item->quantity;
                    286:                if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
                    287:                        other->client->pers.inventory[index] = other->client->pers.max_bullets;
                    288:        }
                    289: 
                    290:        item = FindItem("Shells");
                    291:        if (item)
                    292:        {
                    293:                index = ITEM_INDEX(item);
                    294:                other->client->pers.inventory[index] += item->quantity;
                    295:                if (other->client->pers.inventory[index] > other->client->pers.max_shells)
                    296:                        other->client->pers.inventory[index] = other->client->pers.max_shells;
                    297:        }
                    298: 
                    299:        item = FindItem("Cells");
                    300:        if (item)
                    301:        {
                    302:                index = ITEM_INDEX(item);
                    303:                other->client->pers.inventory[index] += item->quantity;
                    304:                if (other->client->pers.inventory[index] > other->client->pers.max_cells)
                    305:                        other->client->pers.inventory[index] = other->client->pers.max_cells;
                    306:        }
                    307: 
                    308:        item = FindItem("Grenades");
                    309:        if (item)
                    310:        {
                    311:                index = ITEM_INDEX(item);
                    312:                other->client->pers.inventory[index] += item->quantity;
                    313:                if (other->client->pers.inventory[index] > other->client->pers.max_grenades)
                    314:                        other->client->pers.inventory[index] = other->client->pers.max_grenades;
                    315:        }
                    316: 
                    317:        item = FindItem("Rockets");
                    318:        if (item)
                    319:        {
                    320:                index = ITEM_INDEX(item);
                    321:                other->client->pers.inventory[index] += item->quantity;
                    322:                if (other->client->pers.inventory[index] > other->client->pers.max_rockets)
                    323:                        other->client->pers.inventory[index] = other->client->pers.max_rockets;
                    324:        }
                    325: 
                    326:        item = FindItem("Slugs");
                    327:        if (item)
                    328:        {
                    329:                index = ITEM_INDEX(item);
                    330:                other->client->pers.inventory[index] += item->quantity;
                    331:                if (other->client->pers.inventory[index] > other->client->pers.max_slugs)
                    332:                        other->client->pers.inventory[index] = other->client->pers.max_slugs;
                    333:        }
                    334: 
                    335:        // RAFAEL
                    336:        item = FindItem ("Mag Slug");
                    337:        if (item)
                    338:        {
                    339:                index = ITEM_INDEX(item);
                    340:                other->client->pers.inventory[index] += item->quantity;
                    341:                if (other->client->pers.inventory[index] > other->client->pers.max_magslug)
                    342:                        other->client->pers.inventory[index] = other->client->pers.max_magslug;
                    343:        }
                    344: 
                    345:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    346:                SetRespawn (ent, ent->item->quantity);
                    347: 
                    348:        return true;
                    349: }
                    350: 
                    351: //======================================================================
                    352: 
                    353: void Use_Quad (edict_t *ent, gitem_t *item)
                    354: {
                    355:        int             timeout;
                    356: 
                    357:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    358:        ValidateSelectedItem (ent);
                    359: 
                    360:        if (quad_drop_timeout_hack)
                    361:        {
                    362:                timeout = quad_drop_timeout_hack;
                    363:                quad_drop_timeout_hack = 0;
                    364:        }
                    365:        else
                    366:        {
                    367:                timeout = 300;
                    368:        }
                    369: 
                    370:        if (ent->client->quad_framenum > level.framenum)
                    371:                ent->client->quad_framenum += timeout;
                    372:        else
                    373:                ent->client->quad_framenum = level.framenum + timeout;
                    374: 
                    375:        gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
                    376: }
                    377: 
                    378: 
                    379: // =====================================================================
                    380: 
                    381: // RAFAEL
                    382: void Use_QuadFire (edict_t *ent, gitem_t *item)
                    383: {
                    384:        int             timeout;
                    385: 
                    386:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    387:        ValidateSelectedItem (ent);
                    388: 
                    389:        if (quad_fire_drop_timeout_hack)
                    390:        {
                    391:                timeout = quad_fire_drop_timeout_hack;
                    392:                quad_fire_drop_timeout_hack = 0;
                    393:        }
                    394:        else
                    395:        {
                    396:                timeout = 300;
                    397:        }
                    398: 
                    399:        if (ent->client->quadfire_framenum > level.framenum)
                    400:                ent->client->quadfire_framenum += timeout;
                    401:        else
                    402:                ent->client->quadfire_framenum = level.framenum + timeout;
                    403: 
                    404:        gi.sound(ent, CHAN_ITEM, gi.soundindex("items/quadfire1.wav"), 1, ATTN_NORM, 0);
                    405: }
                    406: 
                    407: 
                    408: //======================================================================
                    409: 
                    410: void Use_Breather (edict_t *ent, gitem_t *item)
                    411: {
                    412:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    413:        ValidateSelectedItem (ent);
                    414: 
                    415:        if (ent->client->breather_framenum > level.framenum)
                    416:                ent->client->breather_framenum += 300;
                    417:        else
                    418:                ent->client->breather_framenum = level.framenum + 300;
                    419: 
                    420: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
                    421: }
                    422: 
                    423: //======================================================================
                    424: 
                    425: void Use_Envirosuit (edict_t *ent, gitem_t *item)
                    426: {
                    427:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    428:        ValidateSelectedItem (ent);
                    429: 
                    430:        if (ent->client->enviro_framenum > level.framenum)
                    431:                ent->client->enviro_framenum += 300;
                    432:        else
                    433:                ent->client->enviro_framenum = level.framenum + 300;
                    434: 
                    435: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
                    436: }
                    437: 
                    438: //======================================================================
                    439: 
                    440: void   Use_Invulnerability (edict_t *ent, gitem_t *item)
                    441: {
                    442:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    443:        ValidateSelectedItem (ent);
                    444: 
                    445:        if (ent->client->invincible_framenum > level.framenum)
                    446:                ent->client->invincible_framenum += 300;
                    447:        else
                    448:                ent->client->invincible_framenum = level.framenum + 300;
                    449: 
                    450:        gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
                    451: }
                    452: 
                    453: //======================================================================
                    454: 
                    455: void   Use_Silencer (edict_t *ent, gitem_t *item)
                    456: {
                    457:        ent->client->pers.inventory[ITEM_INDEX(item)]--;
                    458:        ValidateSelectedItem (ent);
                    459:        ent->client->silencer_shots += 30;
                    460: 
                    461: //     gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
                    462: }
                    463: 
                    464: //======================================================================
                    465: 
                    466: qboolean Pickup_Key (edict_t *ent, edict_t *other)
                    467: {
                    468:        if (coop->value)
                    469:        {
                    470:                if (strcmp(ent->classname, "key_power_cube") == 0)
                    471:                {
                    472:                        if (other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00)>> 8))
                    473:                                return false;
                    474:                        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
                    475:                        other->client->pers.power_cubes |= ((ent->spawnflags & 0x0000ff00) >> 8);
                    476:                }
                    477:                else
                    478:                {
                    479:                        if (other->client->pers.inventory[ITEM_INDEX(ent->item)])
                    480:                                return false;
                    481:                        other->client->pers.inventory[ITEM_INDEX(ent->item)] = 1;
                    482:                }
                    483:                return true;
                    484:        }
                    485:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
                    486:        return true;
                    487: }
                    488: 
                    489: //======================================================================
                    490: 
                    491: qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
                    492: {
                    493:        int                     index;
                    494:        int                     max;
                    495: 
                    496:        if (!ent->client)
                    497:                return false;
                    498: 
                    499:        if (item->tag == AMMO_BULLETS)
                    500:                max = ent->client->pers.max_bullets;
                    501:        else if (item->tag == AMMO_SHELLS)
                    502:                max = ent->client->pers.max_shells;
                    503:        else if (item->tag == AMMO_ROCKETS)
                    504:                max = ent->client->pers.max_rockets;
                    505:        else if (item->tag == AMMO_GRENADES)
                    506:                max = ent->client->pers.max_grenades;
                    507:        else if (item->tag == AMMO_CELLS)
                    508:                max = ent->client->pers.max_cells;
                    509:        else if (item->tag == AMMO_SLUGS)
                    510:                max = ent->client->pers.max_slugs;
                    511:        // RAFAEL
                    512:        else if (item->tag == AMMO_MAGSLUG)
                    513:                max = ent->client->pers.max_magslug;
                    514:        // RAFAEL
                    515:        else if (item->tag == AMMO_TRAP)
                    516:                max = ent->client->pers.max_trap;
                    517:        else
                    518:                return false;
                    519: 
                    520:        index = ITEM_INDEX(item);
                    521: 
                    522:        if (ent->client->pers.inventory[index] == max)
                    523:                return false;
                    524: 
                    525:        ent->client->pers.inventory[index] += count;
                    526: 
                    527:        if (ent->client->pers.inventory[index] > max)
                    528:                ent->client->pers.inventory[index] = max;
                    529: 
                    530:        return true;
                    531: }
                    532: 
                    533: qboolean Pickup_Ammo (edict_t *ent, edict_t *other)
                    534: {
                    535:        int                     oldcount;
                    536:        int                     count;
                    537:        qboolean        weapon;
                    538: 
                    539:        weapon = (ent->item->flags & IT_WEAPON);
                    540:        if ( (weapon) && ( (int)dmflags->value & DF_INFINITE_AMMO ) )
                    541:                count = 1000;
                    542:        else if (ent->count)
                    543:                count = ent->count;
                    544:        else
                    545:                count = ent->item->quantity;
                    546: 
                    547:        oldcount = other->client->pers.inventory[ITEM_INDEX(ent->item)];
                    548: 
                    549:        if (!Add_Ammo (other, ent->item, count))
                    550:                return false;
                    551: 
                    552:        if (weapon && !oldcount)
                    553:        {
                    554:                if (other->client->pers.weapon != ent->item && ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) )
                    555:                        other->client->newweapon = ent->item;
                    556:        }
                    557: 
                    558:        if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)) && (deathmatch->value))
                    559:                SetRespawn (ent, 30);
                    560:        return true;
                    561: }
                    562: 
                    563: void Drop_Ammo (edict_t *ent, gitem_t *item)
                    564: {
                    565:        edict_t *dropped;
                    566:        int             index;
                    567: 
                    568:        index = ITEM_INDEX(item);
                    569:        dropped = Drop_Item (ent, item);
                    570:        if (ent->client->pers.inventory[index] >= item->quantity)
                    571:                dropped->count = item->quantity;
                    572:        else
                    573:                dropped->count = ent->client->pers.inventory[index];
                    574: 
                    575:        if (ent->client->pers.weapon && 
                    576:                ent->client->pers.weapon->tag == AMMO_GRENADES &&
                    577:                item->tag == AMMO_GRENADES &&
                    578:                ent->client->pers.inventory[index] - dropped->count <= 0) {
                    579:                gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n");
                    580:                G_FreeEdict(dropped);
                    581:                return;
                    582:        }
                    583: 
                    584:        ent->client->pers.inventory[index] -= dropped->count;
                    585:        ValidateSelectedItem (ent);
                    586: }
                    587: 
                    588: 
                    589: //======================================================================
                    590: 
                    591: void MegaHealth_think (edict_t *self)
                    592: {
                    593:        if (self->owner->health > self->owner->max_health)
                    594:        {
                    595:                self->nextthink = level.time + 1;
                    596:                self->owner->health -= 1;
                    597:                return;
                    598:        }
                    599: 
                    600:        if (!(self->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    601:                SetRespawn (self, 20);
                    602:        else
                    603:                G_FreeEdict (self);
                    604: }
                    605: 
                    606: qboolean Pickup_Health (edict_t *ent, edict_t *other)
                    607: {
                    608:        if (!(ent->style & HEALTH_IGNORE_MAX))
                    609:                if (other->health >= other->max_health)
                    610:                        return false;
                    611: 
                    612:        other->health += ent->count;
                    613: 
                    614:        if (!(ent->style & HEALTH_IGNORE_MAX))
                    615:        {
                    616:                if (other->health > other->max_health)
                    617:                        other->health = other->max_health;
                    618:        }
                    619: 
                    620:        if (ent->style & HEALTH_TIMED)
                    621:        {
                    622:                ent->think = MegaHealth_think;
                    623:                ent->nextthink = level.time + 5;
                    624:                ent->owner = other;
                    625:                ent->flags |= FL_RESPAWN;
                    626:                ent->svflags |= SVF_NOCLIENT;
                    627:                ent->solid = SOLID_NOT;
                    628:        }
                    629:        else
                    630:        {
                    631:                if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    632:                        SetRespawn (ent, 30);
                    633:        }
                    634: 
                    635:        return true;
                    636: }
                    637: 
                    638: //======================================================================
                    639: 
                    640: int ArmorIndex (edict_t *ent)
                    641: {
                    642:        if (!ent->client)
                    643:                return 0;
                    644: 
                    645:        if (ent->client->pers.inventory[jacket_armor_index] > 0)
                    646:                return jacket_armor_index;
                    647: 
                    648:        if (ent->client->pers.inventory[combat_armor_index] > 0)
                    649:                return combat_armor_index;
                    650: 
                    651:        if (ent->client->pers.inventory[body_armor_index] > 0)
                    652:                return body_armor_index;
                    653: 
                    654:        return 0;
                    655: }
                    656: 
                    657: qboolean Pickup_Armor (edict_t *ent, edict_t *other)
                    658: {
                    659:        int                             old_armor_index;
                    660:        gitem_armor_t   *oldinfo;
                    661:        gitem_armor_t   *newinfo;
                    662:        int                             newcount;
                    663:        float                   salvage;
                    664:        int                             salvagecount;
                    665: 
                    666:        // get info on new armor
                    667:        newinfo = (gitem_armor_t *)ent->item->info;
                    668: 
                    669:        old_armor_index = ArmorIndex (other);
                    670: 
                    671:        // handle armor shards specially
                    672:        if (ent->item->tag == ARMOR_SHARD)
                    673:        {
                    674:                if (!old_armor_index)
                    675:                        other->client->pers.inventory[jacket_armor_index] = 2;
                    676:                else
                    677:                        other->client->pers.inventory[old_armor_index] += 2;
                    678:        }
                    679: 
                    680:        // if player has no armor, just use it
                    681:        else if (!old_armor_index)
                    682:        {
                    683:                other->client->pers.inventory[ITEM_INDEX(ent->item)] = newinfo->base_count;
                    684:        }
                    685: 
                    686:        // use the better armor
                    687:        else
                    688:        {
                    689:                // get info on old armor
                    690:                if (old_armor_index == jacket_armor_index)
                    691:                        oldinfo = &jacketarmor_info;
                    692:                else if (old_armor_index == combat_armor_index)
                    693:                        oldinfo = &combatarmor_info;
                    694:                else // (old_armor_index == body_armor_index)
                    695:                        oldinfo = &bodyarmor_info;
                    696: 
                    697:                if (newinfo->normal_protection > oldinfo->normal_protection)
                    698:                {
                    699:                        // calc new armor values
                    700:                        salvage = oldinfo->normal_protection / newinfo->normal_protection;
                    701:                        salvagecount = salvage * other->client->pers.inventory[old_armor_index];
                    702:                        newcount = newinfo->base_count + salvagecount;
                    703:                        if (newcount > newinfo->max_count)
                    704:                                newcount = newinfo->max_count;
                    705: 
                    706:                        // zero count of old armor so it goes away
                    707:                        other->client->pers.inventory[old_armor_index] = 0;
                    708: 
                    709:                        // change armor to new item with computed value
                    710:                        other->client->pers.inventory[ITEM_INDEX(ent->item)] = newcount;
                    711:                }
                    712:                else
                    713:                {
                    714:                        // calc new armor values
                    715:                        salvage = newinfo->normal_protection / oldinfo->normal_protection;
                    716:                        salvagecount = salvage * newinfo->base_count;
                    717:                        newcount = other->client->pers.inventory[old_armor_index] + salvagecount;
                    718:                        if (newcount > oldinfo->max_count)
                    719:                                newcount = oldinfo->max_count;
                    720: 
                    721:                        // if we're already maxed out then we don't need the new armor
                    722:                        if (other->client->pers.inventory[old_armor_index] >= newcount)
                    723:                                return false;
                    724: 
                    725:                        // update current armor value
                    726:                        other->client->pers.inventory[old_armor_index] = newcount;
                    727:                }
                    728:        }
                    729: 
                    730:        if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
                    731:                SetRespawn (ent, 20);
                    732: 
                    733:        return true;
                    734: }
                    735: 
                    736: //======================================================================
                    737: 
                    738: int PowerArmorType (edict_t *ent)
                    739: {
                    740:        if (!ent->client)
                    741:                return POWER_ARMOR_NONE;
                    742: 
                    743:        if (!(ent->flags & FL_POWER_ARMOR))
                    744:                return POWER_ARMOR_NONE;
                    745: 
                    746:        if (ent->client->pers.inventory[power_shield_index] > 0)
                    747:                return POWER_ARMOR_SHIELD;
                    748: 
                    749:        if (ent->client->pers.inventory[power_screen_index] > 0)
                    750:                return POWER_ARMOR_SCREEN;
                    751: 
                    752:        return POWER_ARMOR_NONE;
                    753: }
                    754: 
                    755: void Use_PowerArmor (edict_t *ent, gitem_t *item)
                    756: {
                    757:        int             index;
                    758: 
                    759:        if (ent->flags & FL_POWER_ARMOR)
                    760:        {
                    761:                ent->flags &= ~FL_POWER_ARMOR;
                    762:                gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
                    763:        }
                    764:        else
                    765:        {
                    766:                index = ITEM_INDEX(FindItem("cells"));
                    767:                if (!ent->client->pers.inventory[index])
                    768:                {
                    769:                        gi.cprintf (ent, PRINT_HIGH, "No cells for power armor.\n");
                    770:                        return;
                    771:                }
                    772:                ent->flags |= FL_POWER_ARMOR;
                    773:                gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);
                    774:        }
                    775: }
                    776: 
                    777: qboolean Pickup_PowerArmor (edict_t *ent, edict_t *other)
                    778: {
                    779:        int             quantity;
                    780: 
                    781:        quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
                    782: 
                    783:        other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
                    784: 
                    785:        if (deathmatch->value)
                    786:        {
                    787:                if (!(ent->spawnflags & DROPPED_ITEM) )
                    788:                        SetRespawn (ent, ent->item->quantity);
                    789:                // auto-use for DM only if we didn't already have one
                    790:                if (!quantity)
                    791:                        ent->item->use (other, ent->item);
                    792:        }
                    793: 
                    794:        return true;
                    795: }
                    796: 
                    797: void Drop_PowerArmor (edict_t *ent, gitem_t *item)
                    798: {
                    799:        if ((ent->flags & FL_POWER_ARMOR) && (ent->client->pers.inventory[ITEM_INDEX(item)] == 1))
                    800:                Use_PowerArmor (ent, item);
                    801:        Drop_General (ent, item);
                    802: }
                    803: 
                    804: //======================================================================
                    805: 
                    806: /*
                    807: ===============
                    808: Touch_Item
                    809: ===============
                    810: */
                    811: void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
                    812: {
                    813:        qboolean        taken;
                    814: 
                    815:        if (!other->client)
                    816:                return;
                    817:        if (other->health < 1)
                    818:                return;         // dead people can't pickup
                    819:        if (!ent->item->pickup)
                    820:                return;         // not a grabbable item?
                    821: 
                    822:        taken = ent->item->pickup(ent, other);
                    823: 
                    824:        if (taken)
                    825:        {
                    826:                // flash the screen
                    827:                other->client->bonus_alpha = 0.25;      
                    828: 
                    829:                // show icon and name on status bar
                    830:                other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon);
                    831:                other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS+ITEM_INDEX(ent->item);
                    832:                other->client->pickup_msg_time = level.time + 3.0;
                    833: 
                    834:                // change selected item
                    835:                if (ent->item->use)
                    836:                        other->client->pers.selected_item = other->client->ps.stats[STAT_SELECTED_ITEM] = ITEM_INDEX(ent->item);
                    837: 
                    838:                if (ent->item->pickup == Pickup_Health)
                    839:                {
                    840:                        if (ent->count == 2)
                    841:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/s_health.wav"), 1, ATTN_NORM, 0);
                    842:                        else if (ent->count == 10)
                    843:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/n_health.wav"), 1, ATTN_NORM, 0);
                    844:                        else if (ent->count == 25)
                    845:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/l_health.wav"), 1, ATTN_NORM, 0);
                    846:                        else // (ent->count == 100)
                    847:                                gi.sound(other, CHAN_ITEM, gi.soundindex("items/m_health.wav"), 1, ATTN_NORM, 0);
                    848:                }
                    849:                else if (ent->item->pickup_sound)
                    850:                {
                    851:                        gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
                    852:                }
                    853:        }
                    854: 
                    855:        if (!(ent->spawnflags & ITEM_TARGETS_USED))
                    856:        {
                    857:                G_UseTargets (ent, other);
                    858:                ent->spawnflags |= ITEM_TARGETS_USED;
                    859:        }
                    860: 
                    861:        if (!taken)
                    862:                return;
                    863: 
                    864:        if (!((coop->value) &&  (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)))
                    865:        {
                    866:                if (ent->flags & FL_RESPAWN)
                    867:                        ent->flags &= ~FL_RESPAWN;
                    868:                else
                    869:                        G_FreeEdict (ent);
                    870:        }
                    871: }
                    872: 
                    873: //======================================================================
                    874: 
                    875: static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
                    876: {
                    877:        if (other == ent->owner)
                    878:                return;
                    879: 
                    880:        Touch_Item (ent, other, plane, surf);
                    881: }
                    882: 
                    883: static void drop_make_touchable (edict_t *ent)
                    884: {
                    885:        ent->touch = Touch_Item;
                    886:        if (deathmatch->value)
                    887:        {
                    888:                ent->nextthink = level.time + 29;
                    889:                ent->think = G_FreeEdict;
                    890:        }
                    891: }
                    892: 
                    893: edict_t *Drop_Item (edict_t *ent, gitem_t *item)
                    894: {
                    895:        edict_t *dropped;
                    896:        vec3_t  forward, right;
                    897:        vec3_t  offset;
                    898: 
                    899:        dropped = G_Spawn();
                    900: 
                    901:        dropped->classname = item->classname;
                    902:        dropped->item = item;
                    903:        dropped->spawnflags = DROPPED_ITEM;
                    904:        dropped->s.effects = item->world_model_flags;
                    905:        dropped->s.renderfx = RF_GLOW;
                    906:        VectorSet (dropped->mins, -15, -15, -15);
                    907:        VectorSet (dropped->maxs, 15, 15, 15);
                    908:        gi.setmodel (dropped, dropped->item->world_model);
                    909:        dropped->solid = SOLID_TRIGGER;
                    910:        dropped->movetype = MOVETYPE_TOSS;  
                    911:        dropped->touch = drop_temp_touch;
                    912:        dropped->owner = ent;
                    913: 
                    914:        if (ent->client)
                    915:        {
                    916:                trace_t trace;
                    917: 
                    918:                AngleVectors (ent->client->v_angle, forward, right, NULL);
                    919:                VectorSet(offset, 24, 0, -16);
                    920:                G_ProjectSource (ent->s.origin, offset, forward, right, dropped->s.origin);
                    921:                trace = gi.trace (ent->s.origin, dropped->mins, dropped->maxs,
                    922:                        dropped->s.origin, ent, CONTENTS_SOLID);
                    923:                VectorCopy (trace.endpos, dropped->s.origin);
                    924:        }
                    925:        else
                    926:        {
                    927:                AngleVectors (ent->s.angles, forward, right, NULL);
                    928:                VectorCopy (ent->s.origin, dropped->s.origin);
                    929:        }
                    930: 
                    931:        VectorScale (forward, 100, dropped->velocity);
                    932:        dropped->velocity[2] = 300;
                    933: 
                    934:        dropped->think = drop_make_touchable;
                    935:        dropped->nextthink = level.time + 1;
                    936: 
                    937:        gi.linkentity (dropped);
                    938: 
                    939:        return dropped;
                    940: }
                    941: 
                    942: void Use_Item (edict_t *ent, edict_t *other, edict_t *activator)
                    943: {
                    944:        ent->svflags &= ~SVF_NOCLIENT;
                    945:        ent->use = NULL;
                    946: 
                    947:        if (ent->spawnflags & ITEM_NO_TOUCH)
                    948:        {
                    949:                ent->solid = SOLID_BBOX;
                    950:                ent->touch = NULL;
                    951:        }
                    952:        else
                    953:        {
                    954:                ent->solid = SOLID_TRIGGER;
                    955:                ent->touch = Touch_Item;
                    956:        }
                    957: 
                    958:        gi.linkentity (ent);
                    959: }
                    960: 
                    961: //======================================================================
                    962: 
                    963: /*
                    964: ================
                    965: droptofloor
                    966: ================
                    967: */
                    968: void droptofloor (edict_t *ent)
                    969: {
                    970:        trace_t         tr;
                    971:        vec3_t          dest;
                    972:        float           *v;
                    973: 
                    974:        v = tv(-15,-15,-15);
                    975:        VectorCopy (v, ent->mins);
                    976:        v = tv(15,15,15);
                    977:        VectorCopy (v, ent->maxs);
                    978: 
                    979:        if (ent->model)
                    980:                gi.setmodel (ent, ent->model);
                    981:        else
                    982:                gi.setmodel (ent, ent->item->world_model);
                    983:        ent->solid = SOLID_TRIGGER;
                    984:        ent->movetype = MOVETYPE_TOSS;  
                    985:        ent->touch = Touch_Item;
                    986: 
                    987:        v = tv(0,0,-128);
                    988:        VectorAdd (ent->s.origin, v, dest);
                    989: 
                    990:        tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID);
                    991:        if (tr.startsolid)
                    992:        {
                    993:                // RAFAEL
                    994:                if (strcmp (ent->classname, "foodcube") == 0)
                    995:                {
                    996:                        VectorCopy (ent->s.origin, tr.endpos);
                    997:                        ent->velocity[2] = 0;
                    998:                }
                    999:                else
                   1000:                {
                   1001:                        gi.dprintf ("droptofloor: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin));
                   1002:                        G_FreeEdict (ent);
                   1003:                        return;
                   1004:                }
                   1005:        }
                   1006: 
                   1007:        VectorCopy (tr.endpos, ent->s.origin);
                   1008: 
                   1009:        if (ent->team)
                   1010:        {
                   1011:                ent->flags &= ~FL_TEAMSLAVE;
                   1012:                ent->chain = ent->teamchain;
                   1013:                ent->teamchain = NULL;
                   1014: 
                   1015:                ent->svflags |= SVF_NOCLIENT;
                   1016:                ent->solid = SOLID_NOT;
                   1017:                if (ent == ent->teammaster)
                   1018:                {
                   1019:                        ent->nextthink = level.time + FRAMETIME;
                   1020:                        ent->think = DoRespawn;
                   1021:                }
                   1022:        }
                   1023: 
                   1024:        if (ent->spawnflags & ITEM_NO_TOUCH)
                   1025:        {
                   1026:                ent->solid = SOLID_BBOX;
                   1027:                ent->touch = NULL;
                   1028:                ent->s.effects &= ~EF_ROTATE;
                   1029:                ent->s.renderfx &= ~RF_GLOW;
                   1030:        }
                   1031: 
                   1032:        if (ent->spawnflags & ITEM_TRIGGER_SPAWN)
                   1033:        {
                   1034:                ent->svflags |= SVF_NOCLIENT;
                   1035:                ent->solid = SOLID_NOT;
                   1036:                ent->use = Use_Item;
                   1037:        }
                   1038: 
                   1039:        gi.linkentity (ent);
                   1040: }
                   1041: 
                   1042: 
                   1043: /*
                   1044: ===============
                   1045: PrecacheItem
                   1046: 
                   1047: Precaches all data needed for a given item.
                   1048: This will be called for each item spawned in a level,
                   1049: and for each item in each client's inventory.
                   1050: ===============
                   1051: */
                   1052: void PrecacheItem (gitem_t *it)
                   1053: {
                   1054:        char    *s, *start;
                   1055:        char    data[MAX_QPATH];
                   1056:        int             len;
                   1057:        gitem_t *ammo;
                   1058: 
                   1059:        if (!it)
                   1060:                return;
                   1061: 
                   1062:        if (it->pickup_sound)
                   1063:                gi.soundindex (it->pickup_sound);
                   1064:        if (it->world_model)
                   1065:                gi.modelindex (it->world_model);
                   1066:        if (it->view_model)
                   1067:                gi.modelindex (it->view_model);
                   1068:        if (it->icon)
                   1069:                gi.imageindex (it->icon);
                   1070: 
                   1071:        // parse everything for its ammo
                   1072:        if (it->ammo && it->ammo[0])
                   1073:        {
                   1074:                ammo = FindItem (it->ammo);
                   1075:                if (ammo != it)
                   1076:                        PrecacheItem (ammo);
                   1077:        }
                   1078: 
                   1079:        // parse the space seperated precache string for other items
                   1080:        s = it->precaches;
                   1081:        if (!s || !s[0])
                   1082:                return;
                   1083: 
                   1084:        while (*s)
                   1085:        {
                   1086:                start = s;
                   1087:                while (*s && *s != ' ')
                   1088:                        s++;
                   1089: 
                   1090:                len = s-start;
                   1091:                if (len >= MAX_QPATH || len < 5)
                   1092:                        gi.error ("PrecacheItem: %s has bad precache string", it->classname);
                   1093:                memcpy (data, start, len);
                   1094:                data[len] = 0;
                   1095:                if (*s)
                   1096:                        s++;
                   1097: 
                   1098:                // determine type based on extension
                   1099:                if (!strcmp(data+len-3, "md2"))
                   1100:                        gi.modelindex (data);
                   1101:                else if (!strcmp(data+len-3, "sp2"))
                   1102:                        gi.modelindex (data);
                   1103:                else if (!strcmp(data+len-3, "wav"))
                   1104:                        gi.soundindex (data);
                   1105:                if (!strcmp(data+len-3, "pcx"))
                   1106:                        gi.imageindex (data);
                   1107:        }
                   1108: }
                   1109: 
                   1110: /*
                   1111: ============
                   1112: SpawnItem
                   1113: 
                   1114: Sets the clipping size and plants the object on the floor.
                   1115: 
                   1116: Items can't be immediately dropped to floor, because they might
                   1117: be on an entity that hasn't spawned yet.
                   1118: ============
                   1119: */
                   1120: void SpawnItem (edict_t *ent, gitem_t *item)
                   1121: {
                   1122:        PrecacheItem (item);
                   1123: 
                   1124:        if (ent->spawnflags)
                   1125:        {
                   1126:                if (strcmp(ent->classname, "key_power_cube") != 0)
                   1127:                {
                   1128:                        ent->spawnflags = 0;
                   1129:                        gi.dprintf("%s at %s has invalid spawnflags set\n", ent->classname, vtos(ent->s.origin));
                   1130:                }
                   1131:        }
                   1132: 
                   1133:        // some items will be prevented in deathmatch
                   1134:        if (deathmatch->value)
                   1135:        {
                   1136:                if ( (int)dmflags->value & DF_NO_ARMOR )
                   1137:                {
                   1138:                        if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor)
                   1139:                        {
                   1140:                                G_FreeEdict (ent);
                   1141:                                return;
                   1142:                        }
                   1143:                }
                   1144:                if ( (int)dmflags->value & DF_NO_ITEMS )
                   1145:                {
                   1146:                        if (item->pickup == Pickup_Powerup)
                   1147:                        {
                   1148:                                G_FreeEdict (ent);
                   1149:                                return;
                   1150:                        }
                   1151:                }
                   1152:                if ( (int)dmflags->value & DF_NO_HEALTH )
                   1153:                {
                   1154:                        if (item->pickup == Pickup_Health || item->pickup == Pickup_Adrenaline || item->pickup == Pickup_AncientHead)
                   1155:                        {
                   1156:                                G_FreeEdict (ent);
                   1157:                                return;
                   1158:                        }
                   1159:                }
                   1160:                if ( (int)dmflags->value & DF_INFINITE_AMMO )
                   1161:                {
                   1162:                        if ( (item->flags == IT_AMMO) || (strcmp(ent->classname, "weapon_bfg") == 0) )
                   1163:                        {
                   1164:                                G_FreeEdict (ent);
                   1165:                                return;
                   1166:                        }
                   1167:                }
                   1168:        }
                   1169: 
                   1170:        if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0))
                   1171:        {
                   1172:                ent->spawnflags |= (1 << (8 + level.power_cubes));
                   1173:                level.power_cubes++;
                   1174:        }
                   1175: 
                   1176:        // don't let them drop items that stay in a coop game
                   1177:        if ((coop->value) && (item->flags & IT_STAY_COOP))
                   1178:        {
                   1179:                item->drop = NULL;
                   1180:        }
                   1181: 
                   1182:        ent->item = item;
                   1183:        ent->nextthink = level.time + 2 * FRAMETIME;    // items start after other solids
                   1184:        ent->think = droptofloor;
                   1185:        ent->s.effects = item->world_model_flags;
                   1186:        ent->s.renderfx = RF_GLOW;
                   1187:        if (ent->model)
                   1188:                gi.modelindex (ent->model);
                   1189: }
                   1190: 
                   1191: //======================================================================
                   1192: 
                   1193: gitem_t        itemlist[] = 
                   1194: {
                   1195:        {
                   1196:                NULL
                   1197:        },      // leave index 0 alone
                   1198: 
                   1199:        //
                   1200:        // ARMOR
                   1201:        //
                   1202: 
                   1203: /*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1204: */
                   1205:        {
                   1206:                "item_armor_body", 
                   1207:                Pickup_Armor,
                   1208:                NULL,
                   1209:                NULL,
                   1210:                NULL,
                   1211:                "misc/ar1_pkup.wav",
                   1212:                "models/items/armor/body/tris.md2", EF_ROTATE,
                   1213:                NULL,
                   1214: /* icon */             "i_bodyarmor",
                   1215: /* pickup */   "Body Armor",
                   1216: /* width */            3,
                   1217:                0,
                   1218:                NULL,
                   1219:                IT_ARMOR,
                   1220:                &bodyarmor_info,
                   1221:                ARMOR_BODY,
                   1222: /* precache */ ""
                   1223:        },
                   1224: 
                   1225: /*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1226: */
                   1227:        {
                   1228:                "item_armor_combat", 
                   1229:                Pickup_Armor,
                   1230:                NULL,
                   1231:                NULL,
                   1232:                NULL,
                   1233:                "misc/ar1_pkup.wav",
                   1234:                "models/items/armor/combat/tris.md2", EF_ROTATE,
                   1235:                NULL,
                   1236: /* icon */             "i_combatarmor",
                   1237: /* pickup */   "Combat Armor",
                   1238: /* width */            3,
                   1239:                0,
                   1240:                NULL,
                   1241:                IT_ARMOR,
                   1242:                &combatarmor_info,
                   1243:                ARMOR_COMBAT,
                   1244: /* precache */ ""
                   1245:        },
                   1246: 
                   1247: /*QUAKED item_armor_jacket (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1248: */
                   1249:        {
                   1250:                "item_armor_jacket", 
                   1251:                Pickup_Armor,
                   1252:                NULL,
                   1253:                NULL,
                   1254:                NULL,
                   1255:                "misc/ar1_pkup.wav",
                   1256:                "models/items/armor/jacket/tris.md2", EF_ROTATE,
                   1257:                NULL,
                   1258: /* icon */             "i_jacketarmor",
                   1259: /* pickup */   "Jacket Armor",
                   1260: /* width */            3,
                   1261:                0,
                   1262:                NULL,
                   1263:                IT_ARMOR,
                   1264:                &jacketarmor_info,
                   1265:                ARMOR_JACKET,
                   1266: /* precache */ ""
                   1267:        },
                   1268: 
                   1269: /*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1270: */
                   1271:        {
                   1272:                "item_armor_shard", 
                   1273:                Pickup_Armor,
                   1274:                NULL,
                   1275:                NULL,
                   1276:                NULL,
                   1277:                "misc/ar2_pkup.wav",
                   1278:                "models/items/armor/shard/tris.md2", EF_ROTATE,
                   1279:                NULL,
                   1280: /* icon */             "i_jacketarmor",
                   1281: /* pickup */   "Armor Shard",
                   1282: /* width */            3,
                   1283:                0,
                   1284:                NULL,
                   1285:                IT_ARMOR,
                   1286:                NULL,
                   1287:                ARMOR_SHARD,
                   1288: /* precache */ ""
                   1289:        },
                   1290: 
                   1291: 
                   1292: /*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1293: */
                   1294:        {
                   1295:                "item_power_screen", 
                   1296:                Pickup_PowerArmor,
                   1297:                Use_PowerArmor,
                   1298:                Drop_PowerArmor,
                   1299:                NULL,
                   1300:                "misc/ar3_pkup.wav",
                   1301:                "models/items/armor/screen/tris.md2", EF_ROTATE,
                   1302:                NULL,
                   1303: /* icon */             "i_powerscreen",
                   1304: /* pickup */   "Power Screen",
                   1305: /* width */            0,
                   1306:                60,
                   1307:                NULL,
                   1308:                IT_ARMOR,
                   1309:                NULL,
                   1310:                0,
                   1311: /* precache */ ""
                   1312:        },
                   1313: 
                   1314: /*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1315: */
                   1316:        {
                   1317:                "item_power_shield",
                   1318:                Pickup_PowerArmor,
                   1319:                Use_PowerArmor,
                   1320:                Drop_PowerArmor,
                   1321:                NULL,
                   1322:                "misc/ar3_pkup.wav",
                   1323:                "models/items/armor/shield/tris.md2", EF_ROTATE,
                   1324:                NULL,
                   1325: /* icon */             "i_powershield",
                   1326: /* pickup */   "Power Shield",
                   1327: /* width */            0,
                   1328:                60,
                   1329:                NULL,
                   1330:                IT_ARMOR,
                   1331:                NULL,
                   1332:                0,
                   1333: /* precache */ "misc/power2.wav misc/power1.wav"
                   1334:        },
                   1335: 
                   1336: 
                   1337:        //
                   1338:        // WEAPONS 
                   1339:        //
                   1340: 
                   1341: /* weapon_blaster (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1342: always owned, never in the world
                   1343: */
                   1344:        {
                   1345:                "weapon_blaster", 
                   1346:                NULL,
                   1347:                Use_Weapon,
                   1348:                NULL,
                   1349:                Weapon_Blaster,
                   1350:                "misc/w_pkup.wav",
                   1351:                NULL, 0,
                   1352:                "models/weapons/v_blast/tris.md2",
                   1353: /* icon */             "w_blaster",
                   1354: /* pickup */   "Blaster",
                   1355:                0,
                   1356:                0,
                   1357:                NULL,
                   1358:                IT_WEAPON|IT_STAY_COOP,
                   1359:                NULL,
                   1360:                0,
                   1361: /* precache */ "weapons/blastf1a.wav misc/lasfly.wav"
                   1362:        },
                   1363: 
                   1364: /*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1365: */
                   1366:        {
                   1367:                "weapon_shotgun", 
                   1368:                Pickup_Weapon,
                   1369:                Use_Weapon,
                   1370:                Drop_Weapon,
                   1371:                Weapon_Shotgun,
                   1372:                "misc/w_pkup.wav",
                   1373:                "models/weapons/g_shotg/tris.md2", EF_ROTATE,
                   1374:                "models/weapons/v_shotg/tris.md2",
                   1375: /* icon */             "w_shotgun",
                   1376: /* pickup */   "Shotgun",
                   1377:                0,
                   1378:                1,
                   1379:                "Shells",
                   1380:                IT_WEAPON|IT_STAY_COOP,
                   1381:                NULL,
                   1382:                0,
                   1383: /* precache */ "weapons/shotgf1b.wav weapons/shotgr1b.wav"
                   1384:        },
                   1385: 
                   1386: /*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1387: */
                   1388:        {
                   1389:                "weapon_supershotgun", 
                   1390:                Pickup_Weapon,
                   1391:                Use_Weapon,
                   1392:                Drop_Weapon,
                   1393:                Weapon_SuperShotgun,
                   1394:                "misc/w_pkup.wav",
                   1395:                "models/weapons/g_shotg2/tris.md2", EF_ROTATE,
                   1396:                "models/weapons/v_shotg2/tris.md2",
                   1397: /* icon */             "w_sshotgun",
                   1398: /* pickup */   "Super Shotgun",
                   1399:                0,
                   1400:                2,
                   1401:                "Shells",
                   1402:                IT_WEAPON|IT_STAY_COOP,
                   1403:                NULL,
                   1404:                0,
                   1405: /* precache */ "weapons/sshotf1b.wav"
                   1406:        },
                   1407: 
                   1408: /*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1409: */
                   1410:        {
                   1411:                "weapon_machinegun", 
                   1412:                Pickup_Weapon,
                   1413:                Use_Weapon,
                   1414:                Drop_Weapon,
                   1415:                Weapon_Machinegun,
                   1416:                "misc/w_pkup.wav",
                   1417:                "models/weapons/g_machn/tris.md2", EF_ROTATE,
                   1418:                "models/weapons/v_machn/tris.md2",
                   1419: /* icon */             "w_machinegun",
                   1420: /* pickup */   "Machinegun",
                   1421:                0,
                   1422:                1,
                   1423:                "Bullets",
                   1424:                IT_WEAPON|IT_STAY_COOP,
                   1425:                NULL,
                   1426:                0,
                   1427: /* precache */ "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav"
                   1428:        },
                   1429: 
                   1430: /*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1431: */
                   1432:        {
                   1433:                "weapon_chaingun", 
                   1434:                Pickup_Weapon,
                   1435:                Use_Weapon,
                   1436:                Drop_Weapon,
                   1437:                Weapon_Chaingun,
                   1438:                "misc/w_pkup.wav",
                   1439:                "models/weapons/g_chain/tris.md2", EF_ROTATE,
                   1440:                "models/weapons/v_chain/tris.md2",
                   1441: /* icon */             "w_chaingun",
                   1442: /* pickup */   "Chaingun",
                   1443:                0,
                   1444:                1,
                   1445:                "Bullets",
                   1446:                IT_WEAPON|IT_STAY_COOP,
                   1447:                NULL,
                   1448:                0,
                   1449: /* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav"
                   1450:        },
                   1451: 
                   1452: /*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1453: */
                   1454:        {
                   1455:                "ammo_grenades",
                   1456:                Pickup_Ammo,
                   1457:                Use_Weapon,
                   1458:                Drop_Ammo,
                   1459:                Weapon_Grenade,
                   1460:                "misc/am_pkup.wav",
                   1461:                "models/items/ammo/grenades/medium/tris.md2", 0,
                   1462:                "models/weapons/v_handgr/tris.md2",
                   1463: /* icon */             "a_grenades",
                   1464: /* pickup */   "Grenades",
                   1465: /* width */            3,
                   1466:                5,
                   1467:                "grenades",
                   1468:                IT_AMMO|IT_WEAPON,
                   1469:                NULL,
                   1470:                AMMO_GRENADES,
                   1471: /* precache */ "weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav "
                   1472:        },
                   1473: 
                   1474: /*QUAKED ammo_trap (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1475: */
                   1476:        {
                   1477:                "ammo_trap",
                   1478:                Pickup_Ammo,
                   1479:                Use_Weapon,
                   1480:                Drop_Ammo,
                   1481:                Weapon_Trap,
                   1482:                "misc/am_pkup.wav",
                   1483:                "models/weapons/g_trap/tris.md2", EF_ROTATE,
                   1484:                "models/weapons/v_trap/tris.md2",
                   1485: /* icon */             "a_trap",
                   1486: /* pickup */   "Trap",
                   1487: /* width */            3,
                   1488:                1,
                   1489:                "trap",
                   1490:                IT_AMMO|IT_WEAPON,
                   1491:                NULL,
                   1492:                AMMO_TRAP,
                   1493: /* precache */ "weapons/trapcock.wav weapons/traploop.wav weapons/trapsuck.wav weapons/trapdown.wav"
                   1494: // "weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav "
                   1495:        },
                   1496: 
                   1497:        
                   1498: /*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1499: */
                   1500:        {
                   1501:                "weapon_grenadelauncher",
                   1502:                Pickup_Weapon,
                   1503:                Use_Weapon,
                   1504:                Drop_Weapon,
                   1505:                Weapon_GrenadeLauncher,
                   1506:                "misc/w_pkup.wav",
                   1507:                "models/weapons/g_launch/tris.md2", EF_ROTATE,
                   1508:                "models/weapons/v_launch/tris.md2",
                   1509: /* icon */             "w_glauncher",
                   1510: /* pickup */   "Grenade Launcher",
                   1511:                0,
                   1512:                1,
                   1513:                "Grenades",
                   1514:                IT_WEAPON|IT_STAY_COOP,
                   1515:                NULL,
                   1516:                0,
                   1517: /* precache */ "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav"
                   1518:        },
                   1519: 
                   1520: /*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1521: */
                   1522:        {
                   1523:                "weapon_rocketlauncher",
                   1524:                Pickup_Weapon,
                   1525:                Use_Weapon,
                   1526:                Drop_Weapon,
                   1527:                Weapon_RocketLauncher,
                   1528:                "misc/w_pkup.wav",
                   1529:                "models/weapons/g_rocket/tris.md2", EF_ROTATE,
                   1530:                "models/weapons/v_rocket/tris.md2",
                   1531: /* icon */             "w_rlauncher",
                   1532: /* pickup */   "Rocket Launcher",
                   1533:                0,
                   1534:                1,
                   1535:                "Rockets",
                   1536:                IT_WEAPON|IT_STAY_COOP,
                   1537:                NULL,
                   1538:                0,
                   1539: /* precache */ "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2"
                   1540:        },
                   1541: 
                   1542: /*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1543: */
                   1544:        {
                   1545:                "weapon_hyperblaster", 
                   1546:                Pickup_Weapon,
                   1547:                // RAFAEL
                   1548:                Use_Weapon2,
                   1549:                Drop_Weapon,
                   1550:                Weapon_HyperBlaster,
                   1551:                "misc/w_pkup.wav",
                   1552:                "models/weapons/g_hyperb/tris.md2", EF_ROTATE,
                   1553:                "models/weapons/v_hyperb/tris.md2",
                   1554: /* icon */             "w_hyperblaster",
                   1555: /* pickup */   "HyperBlaster",
                   1556:                0,
                   1557:                1,
                   1558:                "Cells",
                   1559:                IT_WEAPON|IT_STAY_COOP,
                   1560:                NULL,
                   1561:                0,
                   1562: /* precache */ "weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav"
                   1563:        },
                   1564: 
                   1565: /*QUAKED weapon_boomer (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1566: */
                   1567: 
                   1568:        {
                   1569:                "weapon_boomer",
                   1570:                Pickup_Weapon,
                   1571:                Use_Weapon,
                   1572:                Drop_Weapon,
                   1573:                Weapon_Ionripper,
                   1574:                "misc/w_pkup.wav",
                   1575:                "models/weapons/g_boom/tris.md2", EF_ROTATE,
                   1576:                "models/weapons/v_boomer/tris.md2",
                   1577: /* icon */     "w_ripper",
                   1578: /* pickup */ "Ionripper",
                   1579:                0,
                   1580:                2,
                   1581:                "Cells",
                   1582:                IT_WEAPON,
                   1583:                NULL,
                   1584:                0,
                   1585: /* precache */ "weapons/rg_hum.wav weapons/rippfire.wav"
                   1586:        },
                   1587: // END 14-APR-98
                   1588: 
                   1589: 
                   1590: /*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1591: */
                   1592:        {
                   1593:                "weapon_railgun", 
                   1594:                Pickup_Weapon,
                   1595:                // RAFAEL
                   1596:                Use_Weapon2,
                   1597:                Drop_Weapon,
                   1598:                Weapon_Railgun,
                   1599:                "misc/w_pkup.wav",
                   1600:                "models/weapons/g_rail/tris.md2", EF_ROTATE,
                   1601:                "models/weapons/v_rail/tris.md2",
                   1602: /* icon */             "w_railgun",
                   1603: /* pickup */   "Railgun",
                   1604:                0,
                   1605:                1,
                   1606:                "Slugs",
                   1607:                IT_WEAPON|IT_STAY_COOP,
                   1608:                NULL,
                   1609:                0,
                   1610: /* precache */ "weapons/rg_hum.wav"
                   1611:        },
                   1612: 
                   1613: // RAFAEL 14-APR-98
                   1614: /*QUAKED weapon_phalanx (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1615: */
                   1616: 
                   1617:        {
                   1618:                "weapon_phalanx",
                   1619:                Pickup_Weapon,
                   1620:                Use_Weapon,
                   1621:                Drop_Weapon,
                   1622:                Weapon_Phalanx,
                   1623:                "misc/w_pkup.wav",
                   1624:                "models/weapons/g_shotx/tris.md2", EF_ROTATE,
                   1625:                "models/weapons/v_shotx/tris.md2",
                   1626: /* icon */     "w_phallanx",
                   1627: /* pickup */ "Phalanx",
                   1628:                0,
                   1629:                1,
                   1630:                "Mag Slug",
                   1631:                IT_WEAPON,
                   1632:                NULL,
                   1633:                0,
                   1634: /* precache */ "weapons/plasshot.wav"
                   1635:        },
                   1636: 
                   1637: 
                   1638: 
                   1639: /*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1640: */
                   1641:        {
                   1642:                "weapon_bfg",
                   1643:                Pickup_Weapon,
                   1644:                Use_Weapon,
                   1645:                Drop_Weapon,
                   1646:                Weapon_BFG,
                   1647:                "misc/w_pkup.wav",
                   1648:                "models/weapons/g_bfg/tris.md2", EF_ROTATE,
                   1649:                "models/weapons/v_bfg/tris.md2",
                   1650: /* icon */             "w_bfg",
                   1651: /* pickup */   "BFG10K",
                   1652:                0,
                   1653:                50,
                   1654:                "Cells",
                   1655:                IT_WEAPON|IT_STAY_COOP,
                   1656:                NULL,
                   1657:                0,
                   1658: /* 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"
                   1659:        },
                   1660: 
                   1661:        //
                   1662:        // AMMO ITEMS
                   1663:        //
                   1664: 
                   1665: /*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1666: */
                   1667:        {
                   1668:                "ammo_shells",
                   1669:                Pickup_Ammo,
                   1670:                NULL,
                   1671:                Drop_Ammo,
                   1672:                NULL,
                   1673:                "misc/am_pkup.wav",
                   1674:                "models/items/ammo/shells/medium/tris.md2", 0,
                   1675:                NULL,
                   1676: /* icon */             "a_shells",
                   1677: /* pickup */   "Shells",
                   1678: /* width */            3,
                   1679:                10,
                   1680:                NULL,
                   1681:                IT_AMMO,
                   1682:                NULL,
                   1683:                AMMO_SHELLS,
                   1684: /* precache */ ""
                   1685:        },
                   1686: 
                   1687: /*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1688: */
                   1689:        {
                   1690:                "ammo_bullets",
                   1691:                Pickup_Ammo,
                   1692:                NULL,
                   1693:                Drop_Ammo,
                   1694:                NULL,
                   1695:                "misc/am_pkup.wav",
                   1696:                "models/items/ammo/bullets/medium/tris.md2", 0,
                   1697:                NULL,
                   1698: /* icon */             "a_bullets",
                   1699: /* pickup */   "Bullets",
                   1700: /* width */            3,
                   1701:                50,
                   1702:                NULL,
                   1703:                IT_AMMO,
                   1704:                NULL,
                   1705:                AMMO_BULLETS,
                   1706: /* precache */ ""
                   1707:        },
                   1708: 
                   1709: /*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1710: */
                   1711:        {
                   1712:                "ammo_cells",
                   1713:                Pickup_Ammo,
                   1714:                NULL,
                   1715:                Drop_Ammo,
                   1716:                NULL,
                   1717:                "misc/am_pkup.wav",
                   1718:                "models/items/ammo/cells/medium/tris.md2", 0,
                   1719:                NULL,
                   1720: /* icon */             "a_cells",
                   1721: /* pickup */   "Cells",
                   1722: /* width */            3,
                   1723:                50,
                   1724:                NULL,
                   1725:                IT_AMMO,
                   1726:                NULL,
                   1727:                AMMO_CELLS,
                   1728: /* precache */ ""
                   1729:        },
                   1730: 
                   1731: /*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1732: */
                   1733:        {
                   1734:                "ammo_rockets",
                   1735:                Pickup_Ammo,
                   1736:                NULL,
                   1737:                Drop_Ammo,
                   1738:                NULL,
                   1739:                "misc/am_pkup.wav",
                   1740:                "models/items/ammo/rockets/medium/tris.md2", 0,
                   1741:                NULL,
                   1742: /* icon */             "a_rockets",
                   1743: /* pickup */   "Rockets",
                   1744: /* width */            3,
                   1745:                5,
                   1746:                NULL,
                   1747:                IT_AMMO,
                   1748:                NULL,
                   1749:                AMMO_ROCKETS,
                   1750: /* precache */ ""
                   1751:        },
                   1752: 
                   1753: /*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1754: */
                   1755:        {
                   1756:                "ammo_slugs",
                   1757:                Pickup_Ammo,
                   1758:                NULL,
                   1759:                Drop_Ammo,
                   1760:                NULL,
                   1761:                "misc/am_pkup.wav",
                   1762:                "models/items/ammo/slugs/medium/tris.md2", 0,
                   1763:                NULL,
                   1764: /* icon */             "a_slugs",
                   1765: /* pickup */   "Slugs",
                   1766: /* width */            3,
                   1767:                10,
                   1768:                NULL,
                   1769:                IT_AMMO,
                   1770:                NULL,
                   1771:                AMMO_SLUGS,
                   1772: /* precache */ ""
                   1773:        },
                   1774: 
                   1775: 
                   1776: /*QUAKED ammo_magslug (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1777: */
                   1778:        {
                   1779:                "ammo_magslug",
                   1780:                Pickup_Ammo,
                   1781:                NULL,
                   1782:                Drop_Ammo,
                   1783:                NULL,
                   1784:                "misc/am_pkup.wav",
                   1785:                "models/objects/ammo/tris.md2", 0,
                   1786:                NULL,
                   1787: /* icon */             "a_mslugs",
                   1788: /* pickup */   "Mag Slug",
                   1789: /* width */            3,
                   1790:                10,
                   1791:                NULL,
                   1792:                IT_AMMO,
                   1793:                NULL,
                   1794:                AMMO_MAGSLUG,
                   1795: /* precache */ ""
                   1796:        },
                   1797: 
                   1798:        //
                   1799:        // POWERUP ITEMS
                   1800:        //
                   1801: /*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1802: */
                   1803:        {
                   1804:                "item_quad", 
                   1805:                Pickup_Powerup,
                   1806:                Use_Quad,
                   1807:                Drop_General,
                   1808:                NULL,
                   1809:                "items/pkup.wav",
                   1810:                "models/items/quaddama/tris.md2", EF_ROTATE,
                   1811:                NULL,
                   1812: /* icon */             "p_quad",
                   1813: /* pickup */   "Quad Damage",
                   1814: /* width */            2,
                   1815:                60,
                   1816:                NULL,
                   1817:                IT_POWERUP,
                   1818:                NULL,
                   1819:                0,
                   1820: /* precache */ "items/damage.wav items/damage2.wav items/damage3.wav"
                   1821:        },
                   1822: 
                   1823: /*QUAKED item_quadfire (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1824: */
                   1825:        {
                   1826:                "item_quadfire", 
                   1827:                Pickup_Powerup,
                   1828:                Use_QuadFire,
                   1829:                Drop_General,
                   1830:                NULL,
                   1831:                "items/pkup.wav",
                   1832:                "models/items/quadfire/tris.md2", EF_ROTATE,
                   1833:                NULL,
                   1834: /* icon */             "p_quadfire",
                   1835: 
                   1836: /* pickup */   "DualFire Damage",
                   1837: /* width */            2,
                   1838:                60,
                   1839:                NULL,
                   1840:                IT_POWERUP,
                   1841:                NULL,
                   1842:                0,
                   1843: /* precache */ "items/quadfire1.wav items/quadfire2.wav items/quadfire3.wav"
                   1844:        },
                   1845: 
                   1846:        
                   1847: /*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1848: */
                   1849:        {
                   1850:                "item_invulnerability",
                   1851:                Pickup_Powerup,
                   1852:                Use_Invulnerability,
                   1853:                Drop_General,
                   1854:                NULL,
                   1855:                "items/pkup.wav",
                   1856:                "models/items/invulner/tris.md2", EF_ROTATE,
                   1857:                NULL,
                   1858: /* icon */             "p_invulnerability",
                   1859: /* pickup */   "Invulnerability",
                   1860: /* width */            2,
                   1861:                300,
                   1862:                NULL,
                   1863:                IT_POWERUP,
                   1864:                NULL,
                   1865:                0,
                   1866: /* precache */ "items/protect.wav items/protect2.wav items/protect4.wav"
                   1867:        },
                   1868: 
                   1869: /*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1870: */
                   1871:        {
                   1872:                "item_silencer",
                   1873:                Pickup_Powerup,
                   1874:                Use_Silencer,
                   1875:                Drop_General,
                   1876:                NULL,
                   1877:                "items/pkup.wav",
                   1878:                "models/items/silencer/tris.md2", EF_ROTATE,
                   1879:                NULL,
                   1880: /* icon */             "p_silencer",
                   1881: /* pickup */   "Silencer",
                   1882: /* width */            2,
                   1883:                60,
                   1884:                NULL,
                   1885:                IT_POWERUP,
                   1886:                NULL,
                   1887:                0,
                   1888: /* precache */ ""
                   1889:        },
                   1890: 
                   1891: /*QUAKED item_breather (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1892: */
                   1893:        {
                   1894:                "item_breather",
                   1895:                Pickup_Powerup,
                   1896:                Use_Breather,
                   1897:                Drop_General,
                   1898:                NULL,
                   1899:                "items/pkup.wav",
                   1900:                "models/items/breather/tris.md2", EF_ROTATE,
                   1901:                NULL,
                   1902: /* icon */             "p_rebreather",
                   1903: /* pickup */   "Rebreather",
                   1904: /* width */            2,
                   1905:                60,
                   1906:                NULL,
                   1907:                IT_STAY_COOP|IT_POWERUP,
                   1908:                NULL,
                   1909:                0,
                   1910: /* precache */ "items/airout.wav"
                   1911:        },
                   1912: 
                   1913: /*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1914: */
                   1915:        {
                   1916:                "item_enviro",
                   1917:                Pickup_Powerup,
                   1918:                Use_Envirosuit,
                   1919:                Drop_General,
                   1920:                NULL,
                   1921:                "items/pkup.wav",
                   1922:                "models/items/enviro/tris.md2", EF_ROTATE,
                   1923:                NULL,
                   1924: /* icon */             "p_envirosuit",
                   1925: /* pickup */   "Environment Suit",
                   1926: /* width */            2,
                   1927:                60,
                   1928:                NULL,
                   1929:                IT_STAY_COOP|IT_POWERUP,
                   1930:                NULL,
                   1931:                0,
                   1932: /* precache */ "items/airout.wav"
                   1933:        },
                   1934: 
                   1935: /*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1936: Special item that gives +2 to maximum health
                   1937: */
                   1938:        {
                   1939:                "item_ancient_head",
                   1940:                Pickup_AncientHead,
                   1941:                NULL,
                   1942:                NULL,
                   1943:                NULL,
                   1944:                "items/pkup.wav",
                   1945:                "models/items/c_head/tris.md2", EF_ROTATE,
                   1946:                NULL,
                   1947: /* icon */             "i_fixme",
                   1948: /* pickup */   "Ancient Head",
                   1949: /* width */            2,
                   1950:                60,
                   1951:                NULL,
                   1952:                0,
                   1953:                NULL,
                   1954:                0,
                   1955: /* precache */ ""
                   1956:        },
                   1957: 
                   1958: /*QUAKED item_adrenaline (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1959: gives +1 to maximum health
                   1960: */
                   1961:        {
                   1962:                "item_adrenaline",
                   1963:                Pickup_Adrenaline,
                   1964:                NULL,
                   1965:                NULL,
                   1966:                NULL,
                   1967:                "items/pkup.wav",
                   1968:                "models/items/adrenal/tris.md2", EF_ROTATE,
                   1969:                NULL,
                   1970: /* icon */             "p_adrenaline",
                   1971: /* pickup */   "Adrenaline",
                   1972: /* width */            2,
                   1973:                60,
                   1974:                NULL,
                   1975:                0,
                   1976:                NULL,
                   1977:                0,
                   1978: /* precache */ ""
                   1979:        },
                   1980: 
                   1981: /*QUAKED item_bandolier (.3 .3 1) (-16 -16 -16) (16 16 16)
                   1982: */
                   1983:        {
                   1984:                "item_bandolier",
                   1985:                Pickup_Bandolier,
                   1986:                NULL,
                   1987:                NULL,
                   1988:                NULL,
                   1989:                "items/pkup.wav",
                   1990:                "models/items/band/tris.md2", EF_ROTATE,
                   1991:                NULL,
                   1992: /* icon */             "p_bandolier",
                   1993: /* pickup */   "Bandolier",
                   1994: /* width */            2,
                   1995:                60,
                   1996:                NULL,
                   1997:                0,
                   1998:                NULL,
                   1999:                0,
                   2000: /* precache */ ""
                   2001:        },
                   2002: 
                   2003: /*QUAKED item_pack (.3 .3 1) (-16 -16 -16) (16 16 16)
                   2004: */
                   2005:        {
                   2006:                "item_pack",
                   2007:                Pickup_Pack,
                   2008:                NULL,
                   2009:                NULL,
                   2010:                NULL,
                   2011:                "items/pkup.wav",
                   2012:                "models/items/pack/tris.md2", EF_ROTATE,
                   2013:                NULL,
                   2014: /* icon */             "i_pack",
                   2015: /* pickup */   "Ammo Pack",
                   2016: /* width */            2,
                   2017:                180,
                   2018:                NULL,
                   2019:                0,
                   2020:                NULL,
                   2021:                0,
                   2022: /* precache */ ""
                   2023:        },
                   2024: 
                   2025:        //
                   2026:        // KEYS
                   2027:        //
                   2028: /*QUAKED key_data_cd (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2029: key for computer centers
                   2030: */
                   2031:        {
                   2032:                "key_data_cd",
                   2033:                Pickup_Key,
                   2034:                NULL,
                   2035:                Drop_General,
                   2036:                NULL,
                   2037:                "items/pkup.wav",
                   2038:                "models/items/keys/data_cd/tris.md2", EF_ROTATE,
                   2039:                NULL,
                   2040:                "k_datacd",
                   2041:                "Data CD",
                   2042:                2,
                   2043:                0,
                   2044:                NULL,
                   2045:                IT_STAY_COOP|IT_KEY,
                   2046:                NULL,
                   2047:                0,
                   2048: /* precache */ ""
                   2049:        },
                   2050: 
                   2051: /*QUAKED key_power_cube (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH
                   2052: warehouse circuits
                   2053: */
                   2054:        {
                   2055:                "key_power_cube",
                   2056:                Pickup_Key,
                   2057:                NULL,
                   2058:                Drop_General,
                   2059:                NULL,
                   2060:                "items/pkup.wav",
                   2061:                "models/items/keys/power/tris.md2", EF_ROTATE,
                   2062:                NULL,
                   2063:                "k_powercube",
                   2064:                "Power Cube",
                   2065:                2,
                   2066:                0,
                   2067:                NULL,
                   2068:                IT_STAY_COOP|IT_KEY,
                   2069:                NULL,
                   2070:                0,
                   2071: /* precache */ ""
                   2072:        },
                   2073: 
                   2074: /*QUAKED key_pyramid (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2075: key for the entrance of jail3
                   2076: */
                   2077:        {
                   2078:                "key_pyramid",
                   2079:                Pickup_Key,
                   2080:                NULL,
                   2081:                Drop_General,
                   2082:                NULL,
                   2083:                "items/pkup.wav",
                   2084:                "models/items/keys/pyramid/tris.md2", EF_ROTATE,
                   2085:                NULL,
                   2086:                "k_pyramid",
                   2087:                "Pyramid Key",
                   2088:                2,
                   2089:                0,
                   2090:                NULL,
                   2091:                IT_STAY_COOP|IT_KEY,
                   2092:                NULL,
                   2093:                0,
                   2094: /* precache */ ""
                   2095:        },
                   2096: 
                   2097: /*QUAKED key_data_spinner (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2098: key for the city computer
                   2099: */
                   2100:        {
                   2101:                "key_data_spinner",
                   2102:                Pickup_Key,
                   2103:                NULL,
                   2104:                Drop_General,
                   2105:                NULL,
                   2106:                "items/pkup.wav",
                   2107:                "models/items/keys/spinner/tris.md2", EF_ROTATE,
                   2108:                NULL,
                   2109:                "k_dataspin",
                   2110:                "Data Spinner",
                   2111:                2,
                   2112:                0,
                   2113:                NULL,
                   2114:                IT_STAY_COOP|IT_KEY,
                   2115:                NULL,
                   2116:                0,
                   2117: /* precache */ ""
                   2118:        },
                   2119: 
                   2120: /*QUAKED key_pass (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2121: security pass for the security level
                   2122: */
                   2123:        {
                   2124:                "key_pass",
                   2125:                Pickup_Key,
                   2126:                NULL,
                   2127:                Drop_General,
                   2128:                NULL,
                   2129:                "items/pkup.wav",
                   2130:                "models/items/keys/pass/tris.md2", EF_ROTATE,
                   2131:                NULL,
                   2132:                "k_security",
                   2133:                "Security Pass",
                   2134:                2,
                   2135:                0,
                   2136:                NULL,
                   2137:                IT_STAY_COOP|IT_KEY,
                   2138:                NULL,
                   2139:                0,
                   2140: /* precache */ ""
                   2141:        },
                   2142: 
                   2143: /*QUAKED key_blue_key (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2144: normal door key - blue
                   2145: */
                   2146:        {
                   2147:                "key_blue_key",
                   2148:                Pickup_Key,
                   2149:                NULL,
                   2150:                Drop_General,
                   2151:                NULL,
                   2152:                "items/pkup.wav",
                   2153:                "models/items/keys/key/tris.md2", EF_ROTATE,
                   2154:                NULL,
                   2155:                "k_bluekey",
                   2156:                "Blue Key",
                   2157:                2,
                   2158:                0,
                   2159:                NULL,
                   2160:                IT_STAY_COOP|IT_KEY,
                   2161:                NULL,
                   2162:                0,
                   2163: /* precache */ ""
                   2164:        },
                   2165: 
                   2166: /*QUAKED key_red_key (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2167: normal door key - red
                   2168: */
                   2169:        {
                   2170:                "key_red_key",
                   2171:                Pickup_Key,
                   2172:                NULL,
                   2173:                Drop_General,
                   2174:                NULL,
                   2175:                "items/pkup.wav",
                   2176:                "models/items/keys/red_key/tris.md2", EF_ROTATE,
                   2177:                NULL,
                   2178:                "k_redkey",
                   2179:                "Red Key",
                   2180:                2,
                   2181:                0,
                   2182:                NULL,
                   2183:                IT_STAY_COOP|IT_KEY,
                   2184:                NULL,
                   2185:                0,
                   2186: /* precache */ ""
                   2187:        },
                   2188: 
                   2189: 
                   2190: // RAFAEL
                   2191: /*QUAKED key_green_key (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2192: normal door key - blue
                   2193: */
                   2194:        {
                   2195:                "key_green_key",
                   2196:                Pickup_Key,
                   2197:                NULL,
                   2198:                Drop_General,
                   2199:                NULL,
                   2200:                "items/pkup.wav",
                   2201:                "models/items/keys/green_key/tris.md2", EF_ROTATE,
                   2202:                NULL,
                   2203:                "k_green",
                   2204:                "Green Key",
                   2205:                2,
                   2206:                0,
                   2207:                NULL,
                   2208:                IT_STAY_COOP|IT_KEY,
                   2209:                NULL,
                   2210:                0,
                   2211: /* precache */ ""
                   2212:        },
                   2213: 
                   2214: /*QUAKED key_commander_head (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2215: tank commander's head
                   2216: */
                   2217:        {
                   2218:                "key_commander_head",
                   2219:                Pickup_Key,
                   2220:                NULL,
                   2221:                Drop_General,
                   2222:                NULL,
                   2223:                "items/pkup.wav",
                   2224:                "models/monsters/commandr/head/tris.md2", EF_GIB,
                   2225:                NULL,
                   2226: /* icon */             "k_comhead",
                   2227: /* pickup */   "Commander's Head",
                   2228: /* width */            2,
                   2229:                0,
                   2230:                NULL,
                   2231:                IT_STAY_COOP|IT_KEY,
                   2232:                NULL,
                   2233:                0,
                   2234: /* precache */ ""
                   2235:        },
                   2236: 
                   2237: /*QUAKED key_airstrike_target (0 .5 .8) (-16 -16 -16) (16 16 16)
                   2238: tank commander's head
                   2239: */
                   2240:        {
                   2241:                "key_airstrike_target",
                   2242:                Pickup_Key,
                   2243:                NULL,
                   2244:                Drop_General,
                   2245:                NULL,
                   2246:                "items/pkup.wav",
                   2247:                "models/items/keys/target/tris.md2", EF_ROTATE,
                   2248:                NULL,
                   2249: /* icon */             "i_airstrike",
                   2250: /* pickup */   "Airstrike Marker",
                   2251: /* width */            2,
                   2252:                0,
                   2253:                NULL,
                   2254:                IT_STAY_COOP|IT_KEY,
                   2255:                NULL,
                   2256:                0,
                   2257: /* precache */ ""
                   2258:        },
                   2259: 
                   2260:        {
                   2261:                NULL,
                   2262:                Pickup_Health,
                   2263:                NULL,
                   2264:                NULL,
                   2265:                NULL,
                   2266:                "items/pkup.wav",
                   2267:                NULL, 0,
                   2268:                NULL,
                   2269: /* icon */             "i_health",
                   2270: /* pickup */   "Health",
                   2271: /* width */            3,
                   2272:                0,
                   2273:                NULL,
                   2274:                0,
                   2275:                NULL,
                   2276:                0,
                   2277: /* precache */ "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav"
                   2278:        },
                   2279: 
                   2280:        // end of list marker
                   2281:        {NULL}
                   2282: };
                   2283: 
                   2284: 
                   2285: /*QUAKED item_health (.3 .3 1) (-16 -16 -16) (16 16 16)
                   2286: */
                   2287: void SP_item_health (edict_t *self)
                   2288: {
                   2289:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
                   2290:        {
                   2291:                G_FreeEdict (self);
                   2292:                return;
                   2293:        }
                   2294: 
                   2295:        self->model = "models/items/healing/medium/tris.md2";
                   2296:        self->count = 10;
                   2297:        SpawnItem (self, FindItem ("Health"));
                   2298:        gi.soundindex ("items/n_health.wav");
                   2299: }
                   2300: 
                   2301: /*QUAKED item_health_small (.3 .3 1) (-16 -16 -16) (16 16 16)
                   2302: */
                   2303: void SP_item_health_small (edict_t *self)
                   2304: {
                   2305:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
                   2306:        {
                   2307:                G_FreeEdict (self);
                   2308:                return;
                   2309:        }
                   2310: 
                   2311:        self->model = "models/items/healing/stimpack/tris.md2";
                   2312:        self->count = 2;
                   2313:        SpawnItem (self, FindItem ("Health"));
                   2314:        self->style = HEALTH_IGNORE_MAX;
                   2315:        gi.soundindex ("items/s_health.wav");
                   2316: }
                   2317: 
                   2318: /*QUAKED item_health_large (.3 .3 1) (-16 -16 -16) (16 16 16)
                   2319: */
                   2320: void SP_item_health_large (edict_t *self)
                   2321: {
                   2322:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
                   2323:        {
                   2324:                G_FreeEdict (self);
                   2325:                return;
                   2326:        }
                   2327: 
                   2328:        self->model = "models/items/healing/large/tris.md2";
                   2329:        self->count = 25;
                   2330:        SpawnItem (self, FindItem ("Health"));
                   2331:        gi.soundindex ("items/l_health.wav");
                   2332: }
                   2333: 
                   2334: /*QUAKED item_health_mega (.3 .3 1) (-16 -16 -16) (16 16 16)
                   2335: */
                   2336: void SP_item_health_mega (edict_t *self)
                   2337: {
                   2338:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
                   2339:        {
                   2340:                G_FreeEdict (self);
                   2341:                return;
                   2342:        }
                   2343: 
                   2344:        self->model = "models/items/mega_h/tris.md2";
                   2345:        self->count = 100;
                   2346:        SpawnItem (self, FindItem ("Health"));
                   2347:        gi.soundindex ("items/m_health.wav");
                   2348:        self->style = HEALTH_IGNORE_MAX|HEALTH_TIMED;
                   2349: }
                   2350: 
                   2351: // RAFAEL
                   2352: void SP_item_foodcube (edict_t *self)
                   2353: {
                   2354:        if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
                   2355:        {
                   2356:                G_FreeEdict (self);
                   2357:                return;
                   2358:        }
                   2359: 
                   2360:        self->model = "models/objects/trapfx/tris.md2";
                   2361:        SpawnItem (self, FindItem ("Health"));
                   2362:        self->spawnflags |= DROPPED_ITEM;
                   2363:        self->style = HEALTH_IGNORE_MAX;
                   2364:        gi.soundindex ("items/s_health.wav");
                   2365:        self->classname = "foodcube";
                   2366: }
                   2367: 
                   2368: 
                   2369: void InitItems (void)
                   2370: {
                   2371:        game.num_items = sizeof(itemlist)/sizeof(itemlist[0]) - 1;
                   2372: }
                   2373: 
                   2374: 
                   2375: 
                   2376: /*
                   2377: ===============
                   2378: SetItemNames
                   2379: 
                   2380: Called by worldspawn
                   2381: ===============
                   2382: */
                   2383: void SetItemNames (void)
                   2384: {
                   2385:        int             i;
                   2386:        gitem_t *it;
                   2387: 
                   2388:        for (i=0 ; i<game.num_items ; i++)
                   2389:        {
                   2390:                it = &itemlist[i];
                   2391:                gi.configstring (CS_ITEMS+i, it->pickup_name);
                   2392:        }
                   2393: 
                   2394:        jacket_armor_index = ITEM_INDEX(FindItem("Jacket Armor"));
                   2395:        combat_armor_index = ITEM_INDEX(FindItem("Combat Armor"));
                   2396:        body_armor_index   = ITEM_INDEX(FindItem("Body Armor"));
                   2397:        power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
                   2398:        power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
                   2399: }

unix.superglobalmegacorp.com

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