g_items.cpp 111 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056
  1. // Copyright (c) ZeniMax Media Inc.
  2. // Licensed under the GNU General Public License 2.0.
  3. #include "g_local.h"
  4. #include "bots/bot_includes.h"
  5. bool Pickup_Weapon(edict_t *ent, edict_t *other);
  6. void Use_Weapon(edict_t *ent, gitem_t *inv);
  7. void Drop_Weapon(edict_t *ent, gitem_t *inv);
  8. void Weapon_Blaster(edict_t *ent);
  9. void Weapon_Shotgun(edict_t *ent);
  10. void Weapon_SuperShotgun(edict_t *ent);
  11. void Weapon_Machinegun(edict_t *ent);
  12. void Weapon_Chaingun(edict_t *ent);
  13. void Weapon_HyperBlaster(edict_t *ent);
  14. void Weapon_RocketLauncher(edict_t *ent);
  15. void Weapon_Grenade(edict_t *ent);
  16. void Weapon_GrenadeLauncher(edict_t *ent);
  17. void Weapon_Railgun(edict_t *ent);
  18. void Weapon_BFG(edict_t *ent);
  19. // RAFAEL
  20. void Weapon_Ionripper(edict_t *ent);
  21. void Weapon_Phalanx(edict_t *ent);
  22. void Weapon_Trap(edict_t *ent);
  23. // RAFAEL
  24. // ROGUE
  25. void Weapon_ChainFist(edict_t *ent);
  26. void Weapon_Disintegrator(edict_t *ent);
  27. void Weapon_ETF_Rifle(edict_t *ent);
  28. void Weapon_Heatbeam(edict_t *ent);
  29. void Weapon_Prox(edict_t *ent);
  30. void Weapon_Tesla(edict_t *ent);
  31. void Weapon_ProxLauncher(edict_t *ent);
  32. // ROGUE
  33. void Weapon_Beta_Disintegrator(edict_t *ent);
  34. void Use_Quad(edict_t *ent, gitem_t *item);
  35. static gtime_t quad_drop_timeout_hack;
  36. // RAFAEL
  37. void Use_QuadFire(edict_t *ent, gitem_t *item);
  38. static gtime_t quad_fire_drop_timeout_hack;
  39. // RAFAEL
  40. //======================================================================
  41. /*
  42. ===============
  43. GetItemByIndex
  44. ===============
  45. */
  46. gitem_t *GetItemByIndex(item_id_t index)
  47. {
  48. if (index <= IT_NULL || index >= IT_TOTAL)
  49. return nullptr;
  50. return &itemlist[index];
  51. }
  52. static gitem_t *ammolist[AMMO_MAX];
  53. gitem_t *GetItemByAmmo(ammo_t ammo)
  54. {
  55. return ammolist[ammo];
  56. }
  57. static gitem_t *poweruplist[POWERUP_MAX];
  58. gitem_t *GetItemByPowerup(powerup_t powerup)
  59. {
  60. return poweruplist[powerup];
  61. }
  62. /*
  63. ===============
  64. FindItemByClassname
  65. ===============
  66. */
  67. gitem_t *FindItemByClassname(const char *classname)
  68. {
  69. int i;
  70. gitem_t *it;
  71. it = itemlist;
  72. for (i = 0; i < IT_TOTAL; i++, it++)
  73. {
  74. if (!it->classname)
  75. continue;
  76. if (!Q_strcasecmp(it->classname, classname))
  77. return it;
  78. }
  79. return nullptr;
  80. }
  81. /*
  82. ===============
  83. FindItem
  84. ===============
  85. */
  86. gitem_t *FindItem(const char *pickup_name)
  87. {
  88. int i;
  89. gitem_t *it;
  90. it = itemlist;
  91. for (i = 0; i < IT_TOTAL; i++, it++)
  92. {
  93. if (!it->use_name)
  94. continue;
  95. if (!Q_strcasecmp(it->use_name, pickup_name))
  96. return it;
  97. }
  98. return nullptr;
  99. }
  100. //======================================================================
  101. THINK(DoRespawn) (edict_t *ent) -> void
  102. {
  103. if (ent->team)
  104. {
  105. edict_t *master;
  106. int count;
  107. int choice;
  108. master = ent->teammaster;
  109. // ZOID
  110. // in ctf, when we are weapons stay, only the master of a team of weapons
  111. // is spawned
  112. if (ctf->integer && g_dm_weapons_stay->integer && master->item && (master->item->flags & IF_WEAPON))
  113. ent = master;
  114. else
  115. {
  116. // ZOID
  117. ent->svflags |= SVF_NOCLIENT;
  118. ent->solid = SOLID_NOT;
  119. gi.linkentity(ent);
  120. for (count = 0, ent = master; ent; ent = ent->chain, count++)
  121. ;
  122. choice = irandom(count);
  123. for (count = 0, ent = master; count < choice; ent = ent->chain, count++)
  124. ;
  125. }
  126. }
  127. ent->svflags &= ~SVF_NOCLIENT;
  128. ent->svflags &= ~SVF_RESPAWNING;
  129. ent->solid = SOLID_TRIGGER;
  130. gi.linkentity(ent);
  131. // send an effect
  132. ent->s.event = EV_ITEM_RESPAWN;
  133. // ROGUE
  134. if (g_dm_random_items->integer)
  135. {
  136. item_id_t new_item = DoRandomRespawn(ent);
  137. // if we've changed entities, then do some sleight of hand.
  138. // otherwise, the old entity will respawn
  139. if (new_item)
  140. {
  141. ent->item = GetItemByIndex(new_item);
  142. ent->classname = ent->item->classname;
  143. ent->s.effects = ent->item->world_model_flags;
  144. gi.setmodel(ent, ent->item->world_model);
  145. }
  146. }
  147. // ROGUE
  148. }
  149. void SetRespawn(edict_t *ent, gtime_t delay, bool hide_self)
  150. {
  151. // already respawning
  152. if (ent->think == DoRespawn && ent->nextthink >= level.time)
  153. return;
  154. ent->flags |= FL_RESPAWN;
  155. if (hide_self)
  156. {
  157. ent->svflags |= ( SVF_NOCLIENT | SVF_RESPAWNING );
  158. ent->solid = SOLID_NOT;
  159. gi.linkentity(ent);
  160. }
  161. ent->nextthink = level.time + delay;
  162. ent->think = DoRespawn;
  163. }
  164. //======================================================================
  165. bool IsInstantItemsEnabled()
  166. {
  167. if (deathmatch->integer && g_dm_instant_items->integer)
  168. {
  169. return true;
  170. }
  171. if (!deathmatch->integer && level.instantitems)
  172. {
  173. return true;
  174. }
  175. return false;
  176. }
  177. bool Pickup_Powerup(edict_t *ent, edict_t *other)
  178. {
  179. int quantity;
  180. quantity = other->client->pers.inventory[ent->item->id];
  181. if ((skill->integer == 0 && quantity >= 3) ||
  182. (skill->integer == 1 && quantity >= 2) ||
  183. (skill->integer >= 2 && quantity >= 1))
  184. return false;
  185. if (coop->integer && !P_UseCoopInstancedItems() && (ent->item->flags & IF_STAY_COOP) && (quantity > 0))
  186. return false;
  187. other->client->pers.inventory[ent->item->id]++;
  188. bool is_dropped_from_death = ent->spawnflags.has(SPAWNFLAG_ITEM_DROPPED_PLAYER) && !ent->spawnflags.has(SPAWNFLAG_ITEM_DROPPED);
  189. if (IsInstantItemsEnabled() ||
  190. ((ent->item->use == Use_Quad) && is_dropped_from_death) ||
  191. ((ent->item->use == Use_QuadFire) && is_dropped_from_death))
  192. {
  193. if ((ent->item->use == Use_Quad) && is_dropped_from_death)
  194. quad_drop_timeout_hack = (ent->nextthink - level.time);
  195. else if ((ent->item->use == Use_QuadFire) && is_dropped_from_death)
  196. quad_fire_drop_timeout_hack = (ent->nextthink - level.time);
  197. if (ent->item->use)
  198. ent->item->use(other, ent->item);
  199. }
  200. if (deathmatch->integer)
  201. {
  202. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED) && !is_dropped_from_death)
  203. SetRespawn(ent, gtime_t::from_sec(ent->item->quantity));
  204. }
  205. return true;
  206. }
  207. bool Pickup_General(edict_t *ent, edict_t *other)
  208. {
  209. if (other->client->pers.inventory[ent->item->id])
  210. return false;
  211. other->client->pers.inventory[ent->item->id]++;
  212. if (deathmatch->integer)
  213. {
  214. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED))
  215. SetRespawn(ent, gtime_t::from_sec(ent->item->quantity));
  216. }
  217. return true;
  218. }
  219. void Drop_General(edict_t *ent, gitem_t *item)
  220. {
  221. edict_t *dropped = Drop_Item(ent, item);
  222. dropped->spawnflags |= SPAWNFLAG_ITEM_DROPPED_PLAYER;
  223. dropped->svflags &= ~SVF_INSTANCED;
  224. ent->client->pers.inventory[item->id]--;
  225. }
  226. //======================================================================
  227. void Use_Adrenaline(edict_t *ent, gitem_t *item)
  228. {
  229. if (!deathmatch->integer)
  230. ent->max_health += 1;
  231. if (ent->health < ent->max_health)
  232. ent->health = ent->max_health;
  233. gi.sound(ent, CHAN_ITEM, gi.soundindex("items/n_health.wav"), 1, ATTN_NORM, 0);
  234. ent->client->pers.inventory[item->id]--;
  235. }
  236. bool Pickup_LegacyHead(edict_t *ent, edict_t *other)
  237. {
  238. other->max_health += 5;
  239. other->health += 5;
  240. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED) && deathmatch->integer)
  241. SetRespawn(ent, gtime_t::from_sec(ent->item->quantity));
  242. return true;
  243. }
  244. void G_CheckPowerArmor(edict_t *ent)
  245. {
  246. bool has_enough_cells;
  247. if (!ent->client->pers.inventory[IT_AMMO_CELLS])
  248. has_enough_cells = false;
  249. else if (ent->client->pers.autoshield >= AUTO_SHIELD_AUTO)
  250. has_enough_cells = (ent->flags & FL_WANTS_POWER_ARMOR) && ent->client->pers.inventory[IT_AMMO_CELLS] > ent->client->pers.autoshield;
  251. else
  252. has_enough_cells = true;
  253. if (ent->flags & FL_POWER_ARMOR)
  254. {
  255. if (!has_enough_cells)
  256. {
  257. // ran out of cells for power armor
  258. ent->flags &= ~FL_POWER_ARMOR;
  259. gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
  260. }
  261. }
  262. else
  263. {
  264. // special case for power armor, for auto-shields
  265. if (ent->client->pers.autoshield != AUTO_SHIELD_MANUAL &&
  266. has_enough_cells && (ent->client->pers.inventory[IT_ITEM_POWER_SCREEN] ||
  267. ent->client->pers.inventory[IT_ITEM_POWER_SHIELD]))
  268. {
  269. ent->flags |= FL_POWER_ARMOR;
  270. gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);
  271. }
  272. }
  273. }
  274. inline bool G_AddAmmoAndCap(edict_t *other, item_id_t item, int32_t max, int32_t quantity)
  275. {
  276. if (other->client->pers.inventory[item] >= max)
  277. return false;
  278. other->client->pers.inventory[item] += quantity;
  279. if (other->client->pers.inventory[item] > max)
  280. other->client->pers.inventory[item] = max;
  281. G_CheckPowerArmor(other);
  282. return true;
  283. }
  284. inline bool G_AddAmmoAndCapQuantity(edict_t *other, ammo_t ammo)
  285. {
  286. gitem_t *item = GetItemByAmmo(ammo);
  287. return G_AddAmmoAndCap(other, item->id, other->client->pers.max_ammo[ammo], item->quantity);
  288. }
  289. inline void G_AdjustAmmoCap(edict_t *other, ammo_t ammo, int16_t new_max)
  290. {
  291. other->client->pers.max_ammo[ammo] = max(other->client->pers.max_ammo[ammo], new_max);
  292. }
  293. bool Pickup_Bandolier(edict_t *ent, edict_t *other)
  294. {
  295. G_AdjustAmmoCap(other, AMMO_BULLETS, 250);
  296. G_AdjustAmmoCap(other, AMMO_SHELLS, 150);
  297. G_AdjustAmmoCap(other, AMMO_CELLS, 250);
  298. G_AdjustAmmoCap(other, AMMO_SLUGS, 75);
  299. G_AdjustAmmoCap(other, AMMO_MAGSLUG, 75);
  300. G_AdjustAmmoCap(other, AMMO_FLECHETTES, 250);
  301. G_AdjustAmmoCap(other, AMMO_DISRUPTOR, 21);
  302. G_AddAmmoAndCapQuantity(other, AMMO_BULLETS);
  303. G_AddAmmoAndCapQuantity(other, AMMO_SHELLS);
  304. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED) && deathmatch->integer)
  305. SetRespawn(ent, gtime_t::from_sec(ent->item->quantity));
  306. return true;
  307. }
  308. bool Pickup_Pack(edict_t *ent, edict_t *other)
  309. {
  310. G_AdjustAmmoCap(other, AMMO_BULLETS, 300);
  311. G_AdjustAmmoCap(other, AMMO_SHELLS, 200);
  312. G_AdjustAmmoCap(other, AMMO_ROCKETS, 100);
  313. G_AdjustAmmoCap(other, AMMO_GRENADES, 100);
  314. G_AdjustAmmoCap(other, AMMO_CELLS, 300);
  315. G_AdjustAmmoCap(other, AMMO_SLUGS, 100);
  316. G_AdjustAmmoCap(other, AMMO_MAGSLUG, 100);
  317. G_AdjustAmmoCap(other, AMMO_FLECHETTES, 300);
  318. G_AdjustAmmoCap(other, AMMO_DISRUPTOR, 30);
  319. G_AddAmmoAndCapQuantity(other, AMMO_BULLETS);
  320. G_AddAmmoAndCapQuantity(other, AMMO_SHELLS);
  321. G_AddAmmoAndCapQuantity(other, AMMO_CELLS);
  322. G_AddAmmoAndCapQuantity(other, AMMO_GRENADES);
  323. G_AddAmmoAndCapQuantity(other, AMMO_ROCKETS);
  324. G_AddAmmoAndCapQuantity(other, AMMO_SLUGS);
  325. // RAFAEL
  326. G_AddAmmoAndCapQuantity(other, AMMO_MAGSLUG);
  327. // RAFAEL
  328. // ROGUE
  329. G_AddAmmoAndCapQuantity(other, AMMO_FLECHETTES);
  330. G_AddAmmoAndCapQuantity(other, AMMO_DISRUPTOR);
  331. // ROGUE
  332. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED) && deathmatch->integer)
  333. SetRespawn(ent, gtime_t::from_sec(ent->item->quantity));
  334. return true;
  335. }
  336. //======================================================================
  337. void Use_Quad(edict_t *ent, gitem_t *item)
  338. {
  339. gtime_t timeout;
  340. ent->client->pers.inventory[item->id]--;
  341. if (quad_drop_timeout_hack)
  342. {
  343. timeout = quad_drop_timeout_hack;
  344. quad_drop_timeout_hack = 0_ms;
  345. }
  346. else
  347. {
  348. timeout = 30_sec;
  349. }
  350. ent->client->quad_time = max(level.time, ent->client->quad_time) + timeout;
  351. gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
  352. }
  353. // =====================================================================
  354. // RAFAEL
  355. void Use_QuadFire(edict_t *ent, gitem_t *item)
  356. {
  357. gtime_t timeout;
  358. ent->client->pers.inventory[item->id]--;
  359. if (quad_fire_drop_timeout_hack)
  360. {
  361. timeout = quad_fire_drop_timeout_hack;
  362. quad_fire_drop_timeout_hack = 0_ms;
  363. }
  364. else
  365. {
  366. timeout = 30_sec;
  367. }
  368. ent->client->quadfire_time = max(level.time, ent->client->quadfire_time) + timeout;
  369. gi.sound(ent, CHAN_ITEM, gi.soundindex("items/quadfire1.wav"), 1, ATTN_NORM, 0);
  370. }
  371. // RAFAEL
  372. //======================================================================
  373. void Use_Breather(edict_t *ent, gitem_t *item)
  374. {
  375. ent->client->pers.inventory[item->id]--;
  376. ent->client->breather_time = max(level.time, ent->client->breather_time) + 30_sec;
  377. // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
  378. }
  379. //======================================================================
  380. void Use_Envirosuit(edict_t *ent, gitem_t *item)
  381. {
  382. ent->client->pers.inventory[item->id]--;
  383. ent->client->enviro_time = max(level.time, ent->client->enviro_time) + 30_sec;
  384. // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
  385. }
  386. //======================================================================
  387. void Use_Invulnerability(edict_t *ent, gitem_t *item)
  388. {
  389. ent->client->pers.inventory[item->id]--;
  390. ent->client->invincible_time = max(level.time, ent->client->invincible_time) + 30_sec;
  391. gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
  392. }
  393. void Use_Invisibility(edict_t *ent, gitem_t *item)
  394. {
  395. ent->client->pers.inventory[item->id]--;
  396. ent->client->invisible_time = max(level.time, ent->client->invisible_time) + 30_sec;
  397. gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
  398. }
  399. //======================================================================
  400. void Use_Silencer(edict_t *ent, gitem_t *item)
  401. {
  402. ent->client->pers.inventory[item->id]--;
  403. ent->client->silencer_shots += 30;
  404. // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
  405. }
  406. //======================================================================
  407. bool Pickup_Key(edict_t *ent, edict_t *other)
  408. {
  409. if (coop->integer)
  410. {
  411. if (ent->item->id == IT_KEY_POWER_CUBE || ent->item->id == IT_KEY_EXPLOSIVE_CHARGES)
  412. {
  413. if (other->client->pers.power_cubes & ((ent->spawnflags & SPAWNFLAG_EDITOR_MASK).value >> 8))
  414. return false;
  415. other->client->pers.inventory[ent->item->id]++;
  416. other->client->pers.power_cubes |= ((ent->spawnflags & SPAWNFLAG_EDITOR_MASK).value >> 8);
  417. }
  418. else
  419. {
  420. if (other->client->pers.inventory[ent->item->id])
  421. return false;
  422. other->client->pers.inventory[ent->item->id] = 1;
  423. }
  424. return true;
  425. }
  426. other->client->pers.inventory[ent->item->id]++;
  427. return true;
  428. }
  429. //======================================================================
  430. bool Add_Ammo(edict_t *ent, gitem_t *item, int count)
  431. {
  432. if (!ent->client || item->tag < AMMO_BULLETS || item->tag >= AMMO_MAX)
  433. return false;
  434. return G_AddAmmoAndCap(ent, item->id, ent->client->pers.max_ammo[item->tag], count);
  435. }
  436. // we just got weapon `item`, check if we should switch to it
  437. void G_CheckAutoSwitch(edict_t *ent, gitem_t *item, bool is_new)
  438. {
  439. // already using or switching to
  440. if (ent->client->pers.weapon == item ||
  441. ent->client->newweapon == item)
  442. return;
  443. // need ammo
  444. else if (item->ammo)
  445. {
  446. int32_t required_ammo = (item->flags & IF_AMMO) ? 1 : item->quantity;
  447. if (ent->client->pers.inventory[item->ammo] < required_ammo)
  448. return;
  449. }
  450. // check autoswitch setting
  451. if (ent->client->pers.autoswitch == auto_switch_t::NEVER)
  452. return;
  453. else if ((item->flags & IF_AMMO) && ent->client->pers.autoswitch == auto_switch_t::ALWAYS_NO_AMMO)
  454. return;
  455. else if (ent->client->pers.autoswitch == auto_switch_t::SMART)
  456. {
  457. bool using_blaster = ent->client->pers.weapon && ent->client->pers.weapon->id == IT_WEAPON_BLASTER;
  458. // smartness algorithm: in DM, we will always switch if we have the blaster out
  459. // otherwise leave our active weapon alone
  460. if (deathmatch->integer && !using_blaster)
  461. return;
  462. // in SP, only switch if it's a new weapon, or we have the blaster out
  463. else if (!deathmatch->integer && !using_blaster && !is_new)
  464. return;
  465. }
  466. // switch!
  467. ent->client->newweapon = item;
  468. }
  469. bool Pickup_Ammo(edict_t *ent, edict_t *other)
  470. {
  471. int oldcount;
  472. int count;
  473. bool weapon;
  474. weapon = (ent->item->flags & IF_WEAPON);
  475. if (weapon && G_CheckInfiniteAmmo(ent->item))
  476. count = 1000;
  477. else if (ent->count)
  478. count = ent->count;
  479. else
  480. count = ent->item->quantity;
  481. oldcount = other->client->pers.inventory[ent->item->id];
  482. if (!Add_Ammo(other, ent->item, count))
  483. return false;
  484. if (weapon)
  485. G_CheckAutoSwitch(other, ent->item, !oldcount);
  486. if (!(ent->spawnflags & (SPAWNFLAG_ITEM_DROPPED | SPAWNFLAG_ITEM_DROPPED_PLAYER)) && deathmatch->integer)
  487. SetRespawn(ent, 30_sec);
  488. return true;
  489. }
  490. void Drop_Ammo(edict_t *ent, gitem_t *item)
  491. {
  492. // [Paril-KEX]
  493. if (G_CheckInfiniteAmmo(item))
  494. return;
  495. item_id_t index = item->id;
  496. edict_t *dropped = Drop_Item(ent, item);
  497. dropped->spawnflags |= SPAWNFLAG_ITEM_DROPPED_PLAYER;
  498. dropped->svflags &= ~SVF_INSTANCED;
  499. if (ent->client->pers.inventory[index] >= item->quantity)
  500. dropped->count = item->quantity;
  501. else
  502. dropped->count = ent->client->pers.inventory[index];
  503. if (ent->client->pers.weapon && ent->client->pers.weapon == item && (item->flags & IF_AMMO) &&
  504. ent->client->pers.inventory[index] - dropped->count <= 0)
  505. {
  506. gi.LocClient_Print(ent, PRINT_HIGH, "$g_cant_drop_weapon");
  507. G_FreeEdict(dropped);
  508. return;
  509. }
  510. ent->client->pers.inventory[index] -= dropped->count;
  511. G_CheckPowerArmor(ent);
  512. }
  513. //======================================================================
  514. THINK(MegaHealth_think) (edict_t *self) -> void
  515. {
  516. if (self->owner->health > self->owner->max_health
  517. //ZOID
  518. && !CTFHasRegeneration(self->owner)
  519. //ZOID
  520. )
  521. {
  522. self->nextthink = level.time + 1_sec;
  523. self->owner->health -= 1;
  524. return;
  525. }
  526. if (!(self->spawnflags & SPAWNFLAG_ITEM_DROPPED) && deathmatch->integer)
  527. SetRespawn(self, 20_sec);
  528. else
  529. G_FreeEdict(self);
  530. }
  531. bool Pickup_Health(edict_t *ent, edict_t *other)
  532. {
  533. int health_flags = (ent->style ? ent->style : ent->item->tag);
  534. if (!(health_flags & HEALTH_IGNORE_MAX))
  535. if (other->health >= other->max_health)
  536. return false;
  537. int count = ent->count ? ent->count : ent->item->quantity;
  538. // ZOID
  539. if (deathmatch->integer && other->health >= 250 && count > 25)
  540. return false;
  541. // ZOID
  542. other->health += count;
  543. //ZOID
  544. if (ctf->integer && other->health > 250 && count > 25)
  545. other->health = 250;
  546. //ZOID
  547. if (!(health_flags & HEALTH_IGNORE_MAX))
  548. {
  549. if (other->health > other->max_health)
  550. other->health = other->max_health;
  551. }
  552. if ((ent->item->tag & HEALTH_TIMED)
  553. //ZOID
  554. && !CTFHasRegeneration(other)
  555. //ZOID
  556. )
  557. {
  558. if (!deathmatch->integer)
  559. {
  560. // mega health doesn't need to be special in SP
  561. // since it never respawns.
  562. other->client->pers.megahealth_time = 5_sec;
  563. }
  564. else
  565. {
  566. ent->think = MegaHealth_think;
  567. ent->nextthink = level.time + 5_sec;
  568. ent->owner = other;
  569. ent->flags |= FL_RESPAWN;
  570. ent->svflags |= SVF_NOCLIENT;
  571. ent->solid = SOLID_NOT;
  572. }
  573. }
  574. else
  575. {
  576. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED) && deathmatch->integer)
  577. SetRespawn(ent, 30_sec);
  578. }
  579. return true;
  580. }
  581. //======================================================================
  582. item_id_t ArmorIndex(edict_t *ent)
  583. {
  584. if (ent->svflags & SVF_MONSTER)
  585. return ent->monsterinfo.armor_type;
  586. if (ent->client)
  587. {
  588. if (ent->client->pers.inventory[IT_ARMOR_JACKET] > 0)
  589. return IT_ARMOR_JACKET;
  590. else if (ent->client->pers.inventory[IT_ARMOR_COMBAT] > 0)
  591. return IT_ARMOR_COMBAT;
  592. else if (ent->client->pers.inventory[IT_ARMOR_BODY] > 0)
  593. return IT_ARMOR_BODY;
  594. }
  595. return IT_NULL;
  596. }
  597. bool Pickup_Armor(edict_t *ent, edict_t *other)
  598. {
  599. item_id_t old_armor_index;
  600. const gitem_armor_t *oldinfo;
  601. const gitem_armor_t *newinfo;
  602. int newcount;
  603. float salvage;
  604. int salvagecount;
  605. // get info on new armor
  606. newinfo = ent->item->armor_info;
  607. old_armor_index = ArmorIndex(other);
  608. // [Paril-KEX] for g_start_items
  609. int32_t base_count = ent->count ? ent->count : newinfo ? newinfo->base_count : 0;
  610. // handle armor shards specially
  611. if (ent->item->id == IT_ARMOR_SHARD)
  612. {
  613. if (!old_armor_index)
  614. other->client->pers.inventory[IT_ARMOR_JACKET] = 2;
  615. else
  616. other->client->pers.inventory[old_armor_index] += 2;
  617. }
  618. // if player has no armor, just use it
  619. else if (!old_armor_index)
  620. {
  621. other->client->pers.inventory[ent->item->id] = base_count;
  622. }
  623. // use the better armor
  624. else
  625. {
  626. // get info on old armor
  627. if (old_armor_index == IT_ARMOR_JACKET)
  628. oldinfo = &jacketarmor_info;
  629. else if (old_armor_index == IT_ARMOR_COMBAT)
  630. oldinfo = &combatarmor_info;
  631. else
  632. oldinfo = &bodyarmor_info;
  633. if (newinfo->normal_protection > oldinfo->normal_protection)
  634. {
  635. // calc new armor values
  636. salvage = oldinfo->normal_protection / newinfo->normal_protection;
  637. salvagecount = (int) (salvage * other->client->pers.inventory[old_armor_index]);
  638. newcount = base_count + salvagecount;
  639. if (newcount > newinfo->max_count)
  640. newcount = newinfo->max_count;
  641. // zero count of old armor so it goes away
  642. other->client->pers.inventory[old_armor_index] = 0;
  643. // change armor to new item with computed value
  644. other->client->pers.inventory[ent->item->id] = newcount;
  645. }
  646. else
  647. {
  648. // calc new armor values
  649. salvage = newinfo->normal_protection / oldinfo->normal_protection;
  650. salvagecount = (int) (salvage * base_count);
  651. newcount = other->client->pers.inventory[old_armor_index] + salvagecount;
  652. if (newcount > oldinfo->max_count)
  653. newcount = oldinfo->max_count;
  654. // if we're already maxed out then we don't need the new armor
  655. if (other->client->pers.inventory[old_armor_index] >= newcount)
  656. return false;
  657. // update current armor value
  658. other->client->pers.inventory[old_armor_index] = newcount;
  659. }
  660. }
  661. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED) && deathmatch->integer)
  662. SetRespawn(ent, 20_sec);
  663. return true;
  664. }
  665. //======================================================================
  666. item_id_t PowerArmorType(edict_t *ent)
  667. {
  668. if (!ent->client)
  669. return IT_NULL;
  670. if (!(ent->flags & FL_POWER_ARMOR))
  671. return IT_NULL;
  672. if (ent->client->pers.inventory[IT_ITEM_POWER_SHIELD] > 0)
  673. return IT_ITEM_POWER_SHIELD;
  674. if (ent->client->pers.inventory[IT_ITEM_POWER_SCREEN] > 0)
  675. return IT_ITEM_POWER_SCREEN;
  676. return IT_NULL;
  677. }
  678. void Use_PowerArmor(edict_t *ent, gitem_t *item)
  679. {
  680. if (ent->flags & FL_POWER_ARMOR)
  681. {
  682. ent->flags &= ~(FL_POWER_ARMOR | FL_WANTS_POWER_ARMOR);
  683. gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
  684. }
  685. else
  686. {
  687. if (!ent->client->pers.inventory[IT_AMMO_CELLS])
  688. {
  689. gi.LocClient_Print(ent, PRINT_HIGH, "$g_no_cells_power_armor");
  690. return;
  691. }
  692. ent->flags |= FL_POWER_ARMOR;
  693. if (ent->client->pers.autoshield != AUTO_SHIELD_MANUAL &&
  694. ent->client->pers.inventory[IT_AMMO_CELLS] > ent->client->pers.autoshield)
  695. ent->flags |= FL_WANTS_POWER_ARMOR;
  696. gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);
  697. }
  698. }
  699. bool Pickup_PowerArmor(edict_t *ent, edict_t *other)
  700. {
  701. int quantity;
  702. quantity = other->client->pers.inventory[ent->item->id];
  703. other->client->pers.inventory[ent->item->id]++;
  704. if (deathmatch->integer)
  705. {
  706. if (!(ent->spawnflags & SPAWNFLAG_ITEM_DROPPED))
  707. SetRespawn(ent, gtime_t::from_sec(ent->item->quantity));
  708. // auto-use for DM only if we didn't already have one
  709. if (!quantity)
  710. G_CheckPowerArmor(other);
  711. }
  712. else
  713. G_CheckPowerArmor(other);
  714. return true;
  715. }
  716. void Drop_PowerArmor(edict_t *ent, gitem_t *item)
  717. {
  718. if ((ent->flags & FL_POWER_ARMOR) && (ent->client->pers.inventory[item->id] == 1))
  719. Use_PowerArmor(ent, item);
  720. Drop_General(ent, item);
  721. }
  722. //======================================================================
  723. bool Entity_IsVisibleToPlayer(edict_t* ent, edict_t* player)
  724. {
  725. return !ent->item_picked_up_by[player->s.number - 1];
  726. }
  727. /*
  728. ===============
  729. Touch_Item
  730. ===============
  731. */
  732. TOUCH(Touch_Item) (edict_t *ent, edict_t *other, const trace_t &tr, bool other_touching_self) -> void
  733. {
  734. bool taken;
  735. if (!other->client)
  736. return;
  737. if (other->health < 1)
  738. return; // dead people can't pickup
  739. if (!ent->item->pickup)
  740. return; // not a grabbable item?
  741. // already got this instanced item
  742. if (coop->integer && P_UseCoopInstancedItems())
  743. {
  744. if (ent->item_picked_up_by[other->s.number - 1])
  745. return;
  746. }
  747. // ZOID
  748. if (CTFMatchSetup())
  749. return; // can't pick stuff up right now
  750. // ZOID
  751. taken = ent->item->pickup(ent, other);
  752. ValidateSelectedItem(other);
  753. if (taken)
  754. {
  755. // flash the screen
  756. other->client->bonus_alpha = 0.25;
  757. // show icon and name on status bar
  758. other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon);
  759. other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ent->item->id;
  760. other->client->pickup_msg_time = level.time + 3_sec;
  761. // change selected item if we still have it
  762. if (ent->item->use && other->client->pers.inventory[ent->item->id])
  763. {
  764. other->client->ps.stats[STAT_SELECTED_ITEM] = other->client->pers.selected_item = ent->item->id;
  765. other->client->ps.stats[STAT_SELECTED_ITEM_NAME] = 0; // don't set name on pickup item since it's already there
  766. }
  767. if (ent->noise_index)
  768. gi.sound(other, CHAN_ITEM, ent->noise_index, 1, ATTN_NORM, 0);
  769. else if (ent->item->pickup_sound)
  770. gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
  771. int32_t player_number = other->s.number - 1;
  772. if (coop->integer && P_UseCoopInstancedItems() && !ent->item_picked_up_by[player_number])
  773. {
  774. ent->item_picked_up_by[player_number] = true;
  775. // [Paril-KEX] this is to fix a coop quirk where items
  776. // that send a message on pick up will only print on the
  777. // player that picked them up, and never anybody else;
  778. // when instanced items are enabled we don't need to limit
  779. // ourselves to this, but it does mean that relays that trigger
  780. // messages won't work, so we'll have to fix those
  781. if (ent->message)
  782. G_PrintActivationMessage(ent, other, false);
  783. }
  784. }
  785. if (!(ent->spawnflags & SPAWNFLAG_ITEM_TARGETS_USED))
  786. {
  787. // [Paril-KEX] see above msg; this also disables the message in DM
  788. // since there's no need to print pickup messages in DM (this wasn't
  789. // even a documented feature, relays were traditionally used for this)
  790. const char *message_backup = nullptr;
  791. if (deathmatch->integer || (coop->integer && P_UseCoopInstancedItems()))
  792. std::swap(message_backup, ent->message);
  793. G_UseTargets(ent, other);
  794. if (deathmatch->integer || (coop->integer && P_UseCoopInstancedItems()))
  795. std::swap(message_backup, ent->message);
  796. ent->spawnflags |= SPAWNFLAG_ITEM_TARGETS_USED;
  797. }
  798. if (taken)
  799. {
  800. bool should_remove = false;
  801. if (coop->integer)
  802. {
  803. // in coop with instanced items, *only* dropped
  804. // player items will ever get deleted permanently.
  805. if (P_UseCoopInstancedItems())
  806. should_remove = ent->spawnflags.has(SPAWNFLAG_ITEM_DROPPED_PLAYER);
  807. // in coop without instanced items, IF_STAY_COOP items remain
  808. // if not dropped
  809. else
  810. should_remove = ent->spawnflags.has(SPAWNFLAG_ITEM_DROPPED | SPAWNFLAG_ITEM_DROPPED_PLAYER) || !(ent->item->flags & IF_STAY_COOP);
  811. }
  812. else
  813. should_remove = !deathmatch->integer || ent->spawnflags.has(SPAWNFLAG_ITEM_DROPPED | SPAWNFLAG_ITEM_DROPPED_PLAYER);
  814. if (should_remove)
  815. {
  816. if (ent->flags & FL_RESPAWN)
  817. ent->flags &= ~FL_RESPAWN;
  818. else
  819. G_FreeEdict(ent);
  820. }
  821. }
  822. }
  823. //======================================================================
  824. TOUCH(drop_temp_touch) (edict_t *ent, edict_t *other, const trace_t &tr, bool other_touching_self) -> void
  825. {
  826. if (other == ent->owner)
  827. return;
  828. Touch_Item(ent, other, tr, other_touching_self);
  829. }
  830. THINK(drop_make_touchable) (edict_t *ent) -> void
  831. {
  832. ent->touch = Touch_Item;
  833. if (deathmatch->integer)
  834. {
  835. ent->nextthink = level.time + 29_sec;
  836. ent->think = G_FreeEdict;
  837. }
  838. }
  839. edict_t *Drop_Item(edict_t *ent, gitem_t *item)
  840. {
  841. edict_t *dropped;
  842. vec3_t forward, right;
  843. vec3_t offset;
  844. dropped = G_Spawn();
  845. dropped->item = item;
  846. dropped->spawnflags = SPAWNFLAG_ITEM_DROPPED;
  847. dropped->classname = item->classname;
  848. dropped->s.effects = item->world_model_flags;
  849. gi.setmodel(dropped, dropped->item->world_model);
  850. dropped->s.renderfx = RF_GLOW | RF_NO_LOD | RF_IR_VISIBLE; // PGM
  851. dropped->mins = { -15, -15, -15 };
  852. dropped->maxs = { 15, 15, 15 };
  853. dropped->solid = SOLID_TRIGGER;
  854. dropped->movetype = MOVETYPE_TOSS;
  855. dropped->touch = drop_temp_touch;
  856. dropped->owner = ent;
  857. if (ent->client)
  858. {
  859. trace_t trace;
  860. AngleVectors(ent->client->v_angle, forward, right, nullptr);
  861. offset = { 24, 0, -16 };
  862. dropped->s.origin = G_ProjectSource(ent->s.origin, offset, forward, right);
  863. trace = gi.trace(ent->s.origin, dropped->mins, dropped->maxs, dropped->s.origin, ent, CONTENTS_SOLID);
  864. dropped->s.origin = trace.endpos;
  865. }
  866. else
  867. {
  868. AngleVectors(ent->s.angles, forward, right, nullptr);
  869. dropped->s.origin = (ent->absmin + ent->absmax) / 2;
  870. }
  871. G_FixStuckObject(dropped, dropped->s.origin);
  872. dropped->velocity = forward * 100;
  873. dropped->velocity[2] = 300;
  874. dropped->think = drop_make_touchable;
  875. dropped->nextthink = level.time + 1_sec;
  876. if (coop->integer && P_UseCoopInstancedItems())
  877. dropped->svflags |= SVF_INSTANCED;
  878. gi.linkentity(dropped);
  879. return dropped;
  880. }
  881. USE(Use_Item) (edict_t *ent, edict_t *other, edict_t *activator) -> void
  882. {
  883. ent->svflags &= ~SVF_NOCLIENT;
  884. ent->use = nullptr;
  885. if (ent->spawnflags.has(SPAWNFLAG_ITEM_NO_TOUCH))
  886. {
  887. ent->solid = SOLID_BBOX;
  888. ent->touch = nullptr;
  889. }
  890. else
  891. {
  892. ent->solid = SOLID_TRIGGER;
  893. ent->touch = Touch_Item;
  894. }
  895. gi.linkentity(ent);
  896. }
  897. //======================================================================
  898. /*
  899. ================
  900. droptofloor
  901. ================
  902. */
  903. THINK(droptofloor) (edict_t *ent) -> void
  904. {
  905. trace_t tr;
  906. vec3_t dest;
  907. // [Paril-KEX] scale foodcube based on how much we ingested
  908. if (strcmp(ent->classname, "item_foodcube") == 0)
  909. {
  910. ent->mins = vec3_t { -8, -8, -8 } * ent->s.scale;
  911. ent->maxs = vec3_t { 8, 8, 8 } * ent->s.scale;
  912. }
  913. else
  914. {
  915. ent->mins = { -15, -15, -15 };
  916. ent->maxs = { 15, 15, 15 };
  917. }
  918. if (ent->model)
  919. gi.setmodel(ent, ent->model);
  920. else
  921. gi.setmodel(ent, ent->item->world_model);
  922. ent->solid = SOLID_TRIGGER;
  923. ent->movetype = MOVETYPE_TOSS;
  924. ent->touch = Touch_Item;
  925. dest = ent->s.origin + vec3_t { 0, 0, -128 };
  926. tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID);
  927. if (tr.startsolid)
  928. {
  929. if (G_FixStuckObject(ent, ent->s.origin) == stuck_result_t::NO_GOOD_POSITION)
  930. {
  931. // RAFAEL
  932. if (strcmp(ent->classname, "item_foodcube") == 0)
  933. ent->velocity[2] = 0;
  934. else
  935. {
  936. // RAFAEL
  937. gi.Com_PrintFmt("{}: droptofloor: startsolid\n", *ent);
  938. G_FreeEdict(ent);
  939. return;
  940. // RAFAEL
  941. }
  942. // RAFAEL
  943. }
  944. }
  945. else
  946. ent->s.origin = tr.endpos;
  947. if (ent->team)
  948. {
  949. ent->flags &= ~FL_TEAMSLAVE;
  950. ent->chain = ent->teamchain;
  951. ent->teamchain = nullptr;
  952. ent->svflags |= SVF_NOCLIENT;
  953. ent->solid = SOLID_NOT;
  954. if (ent == ent->teammaster)
  955. {
  956. ent->nextthink = level.time + 10_hz;
  957. ent->think = DoRespawn;
  958. }
  959. }
  960. if (ent->spawnflags.has(SPAWNFLAG_ITEM_NO_TOUCH))
  961. {
  962. ent->solid = SOLID_BBOX;
  963. ent->touch = nullptr;
  964. ent->s.effects &= ~(EF_ROTATE | EF_BOB);
  965. ent->s.renderfx &= ~RF_GLOW;
  966. }
  967. if (ent->spawnflags.has(SPAWNFLAG_ITEM_TRIGGER_SPAWN))
  968. {
  969. ent->svflags |= SVF_NOCLIENT;
  970. ent->solid = SOLID_NOT;
  971. ent->use = Use_Item;
  972. }
  973. ent->watertype = gi.pointcontents(ent->s.origin);
  974. gi.linkentity(ent);
  975. }
  976. /*
  977. ===============
  978. PrecacheItem
  979. Precaches all data needed for a given item.
  980. This will be called for each item spawned in a level,
  981. and for each item in each client's inventory.
  982. ===============
  983. */
  984. void PrecacheItem(gitem_t *it)
  985. {
  986. const char *s, *start;
  987. char data[MAX_QPATH];
  988. ptrdiff_t len;
  989. gitem_t *ammo;
  990. if (!it)
  991. return;
  992. if (it->pickup_sound)
  993. gi.soundindex(it->pickup_sound);
  994. if (it->world_model)
  995. gi.modelindex(it->world_model);
  996. if (it->view_model)
  997. gi.modelindex(it->view_model);
  998. if (it->icon)
  999. gi.imageindex(it->icon);
  1000. // parse everything for its ammo
  1001. if (it->ammo)
  1002. {
  1003. ammo = GetItemByIndex(it->ammo);
  1004. if (ammo != it)
  1005. PrecacheItem(ammo);
  1006. }
  1007. // parse the space seperated precache string for other items
  1008. s = it->precaches;
  1009. if (!s || !s[0])
  1010. return;
  1011. while (*s)
  1012. {
  1013. start = s;
  1014. while (*s && *s != ' ')
  1015. s++;
  1016. len = s - start;
  1017. if (len >= MAX_QPATH || len < 5)
  1018. gi.Com_ErrorFmt("PrecacheItem: {} has bad precache string", it->classname);
  1019. memcpy(data, start, len);
  1020. data[len] = 0;
  1021. if (*s)
  1022. s++;
  1023. // determine type based on extension
  1024. if (!strcmp(data + len - 3, "md2"))
  1025. gi.modelindex(data);
  1026. else if (!strcmp(data + len - 3, "sp2"))
  1027. gi.modelindex(data);
  1028. else if (!strcmp(data + len - 3, "wav"))
  1029. gi.soundindex(data);
  1030. if (!strcmp(data + len - 3, "pcx"))
  1031. gi.imageindex(data);
  1032. }
  1033. }
  1034. /*
  1035. ============
  1036. SpawnItem
  1037. Sets the clipping size and plants the object on the floor.
  1038. Items can't be immediately dropped to floor, because they might
  1039. be on an entity that hasn't spawned yet.
  1040. ============
  1041. */
  1042. void SpawnItem(edict_t *ent, gitem_t *item)
  1043. {
  1044. // [Sam-KEX]
  1045. // Paril: allow all keys to be trigger_spawn'd (N64 uses this
  1046. // a few different times)
  1047. if (item->flags & IF_KEY)
  1048. {
  1049. if (ent->spawnflags.has(SPAWNFLAG_ITEM_TRIGGER_SPAWN))
  1050. {
  1051. ent->svflags |= SVF_NOCLIENT;
  1052. ent->solid = SOLID_NOT;
  1053. ent->use = Use_Item;
  1054. }
  1055. if (ent->spawnflags.has(SPAWNFLAG_ITEM_NO_TOUCH))
  1056. {
  1057. ent->solid = SOLID_BBOX;
  1058. ent->touch = nullptr;
  1059. ent->s.effects &= ~(EF_ROTATE | EF_BOB);
  1060. ent->s.renderfx &= ~RF_GLOW;
  1061. }
  1062. }
  1063. else if (ent->spawnflags.value >= SPAWNFLAG_ITEM_MAX.value) // PGM
  1064. {
  1065. ent->spawnflags = SPAWNFLAG_NONE;
  1066. gi.Com_PrintFmt("{} has invalid spawnflags set\n", *ent);
  1067. }
  1068. // some items will be prevented in deathmatch
  1069. if (deathmatch->integer)
  1070. {
  1071. // [Kex] In instagib, spawn no pickups!
  1072. if (g_instagib->value)
  1073. {
  1074. if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor ||
  1075. item->pickup == Pickup_Powerup || item->pickup == Pickup_Sphere || item->pickup == Pickup_Doppleganger ||
  1076. (item->flags & IF_HEALTH) || (item->flags & IF_AMMO) || item->pickup == Pickup_Weapon || item->pickup == Pickup_Pack ||
  1077. item->id == IT_ITEM_BANDOLIER || item->id == IT_ITEM_PACK ||
  1078. item->id == IT_AMMO_NUKE)
  1079. {
  1080. G_FreeEdict(ent);
  1081. return;
  1082. }
  1083. }
  1084. if (g_no_armor->integer)
  1085. {
  1086. if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor)
  1087. {
  1088. G_FreeEdict(ent);
  1089. return;
  1090. }
  1091. }
  1092. if (g_no_items->integer)
  1093. {
  1094. if (item->pickup == Pickup_Powerup)
  1095. {
  1096. G_FreeEdict(ent);
  1097. return;
  1098. }
  1099. //=====
  1100. // ROGUE
  1101. if (item->pickup == Pickup_Sphere)
  1102. {
  1103. G_FreeEdict(ent);
  1104. return;
  1105. }
  1106. if (item->pickup == Pickup_Doppleganger)
  1107. {
  1108. G_FreeEdict(ent);
  1109. return;
  1110. }
  1111. // ROGUE
  1112. //=====
  1113. }
  1114. if (g_no_health->integer)
  1115. {
  1116. if (item->flags & IF_HEALTH)
  1117. {
  1118. G_FreeEdict(ent);
  1119. return;
  1120. }
  1121. }
  1122. if (G_CheckInfiniteAmmo(item))
  1123. {
  1124. if (item->flags == IF_AMMO)
  1125. {
  1126. G_FreeEdict(ent);
  1127. return;
  1128. }
  1129. // [Paril-KEX] some item swappage
  1130. // BFG too strong in Infinite Ammo mode
  1131. if (item->id == IT_WEAPON_BFG)
  1132. item = GetItemByIndex(IT_WEAPON_DISRUPTOR);
  1133. }
  1134. //==========
  1135. // ROGUE
  1136. if (g_no_mines->integer)
  1137. {
  1138. if (item->id == IT_WEAPON_PROXLAUNCHER || item->id == IT_AMMO_PROX || item->id == IT_AMMO_TESLA || item->id == IT_AMMO_TRAP)
  1139. {
  1140. G_FreeEdict(ent);
  1141. return;
  1142. }
  1143. }
  1144. if (g_no_nukes->integer)
  1145. {
  1146. if (item->id == IT_AMMO_NUKE)
  1147. {
  1148. G_FreeEdict(ent);
  1149. return;
  1150. }
  1151. }
  1152. if (g_no_spheres->integer)
  1153. {
  1154. if (item->pickup == Pickup_Sphere)
  1155. {
  1156. G_FreeEdict(ent);
  1157. return;
  1158. }
  1159. }
  1160. // ROGUE
  1161. //==========
  1162. }
  1163. //==========
  1164. // ROGUE
  1165. // DM only items
  1166. if (!deathmatch->integer)
  1167. {
  1168. if (item->pickup == Pickup_Doppleganger || item->pickup == Pickup_Nuke)
  1169. {
  1170. gi.Com_PrintFmt("{} spawned in non-DM; freeing...\n", *ent);
  1171. G_FreeEdict(ent);
  1172. return;
  1173. }
  1174. if ((item->use == Use_Vengeance) || (item->use == Use_Hunter))
  1175. {
  1176. gi.Com_PrintFmt("{} spawned in non-DM; freeing...\n", *ent);
  1177. G_FreeEdict(ent);
  1178. return;
  1179. }
  1180. }
  1181. // ROGUE
  1182. //==========
  1183. // [Paril-KEX] power armor breaks infinite ammo
  1184. if (G_CheckInfiniteAmmo(item))
  1185. {
  1186. if (item->id == IT_ITEM_POWER_SHIELD || item->id == IT_ITEM_POWER_SCREEN)
  1187. item = GetItemByIndex(IT_ARMOR_BODY);
  1188. }
  1189. // ZOID
  1190. // Don't spawn the flags unless enabled
  1191. if (!ctf->integer && (item->id == IT_FLAG1 || item->id == IT_FLAG2))
  1192. {
  1193. G_FreeEdict(ent);
  1194. return;
  1195. }
  1196. // ZOID
  1197. // set final classname now
  1198. ent->classname = item->classname;
  1199. PrecacheItem(item);
  1200. if (coop->integer && (item->id == IT_KEY_POWER_CUBE || item->id == IT_KEY_EXPLOSIVE_CHARGES))
  1201. {
  1202. ent->spawnflags.value |= (1 << (8 + level.power_cubes));
  1203. level.power_cubes++;
  1204. }
  1205. // mark all items as instanced
  1206. if (coop->integer)
  1207. {
  1208. if (P_UseCoopInstancedItems())
  1209. ent->svflags |= SVF_INSTANCED;
  1210. }
  1211. ent->item = item;
  1212. ent->nextthink = level.time + 20_hz; // items start after other solids
  1213. ent->think = droptofloor;
  1214. ent->s.effects = item->world_model_flags;
  1215. ent->s.renderfx = RF_GLOW | RF_NO_LOD;
  1216. if (ent->model)
  1217. gi.modelindex(ent->model);
  1218. if (ent->spawnflags.has(SPAWNFLAG_ITEM_TRIGGER_SPAWN))
  1219. SetTriggeredSpawn(ent);
  1220. // ZOID
  1221. // flags are server animated and have special handling
  1222. if (item->id == IT_FLAG1 || item->id == IT_FLAG2)
  1223. {
  1224. ent->think = CTFFlagSetup;
  1225. }
  1226. // ZOID
  1227. }
  1228. void P_ToggleFlashlight(edict_t *ent, bool state)
  1229. {
  1230. if (!!(ent->flags & FL_FLASHLIGHT) == state)
  1231. return;
  1232. ent->flags ^= FL_FLASHLIGHT;
  1233. gi.sound(ent, CHAN_AUTO, gi.soundindex(ent->flags & FL_FLASHLIGHT ? "items/flashlight_on.wav" : "items/flashlight_off.wav"), 1.f, ATTN_STATIC, 0);
  1234. }
  1235. static void Use_Flashlight(edict_t *ent, gitem_t *inv)
  1236. {
  1237. P_ToggleFlashlight(ent, !(ent->flags & FL_FLASHLIGHT));
  1238. }
  1239. constexpr size_t MAX_TEMP_POI_POINTS = 128;
  1240. void Compass_Update(edict_t *ent, bool first)
  1241. {
  1242. vec3_t *&points = level.poi_points[ent->s.number - 1];
  1243. // deleted for some reason
  1244. if (!points)
  1245. return;
  1246. if (!ent->client->help_draw_points)
  1247. return;
  1248. if (ent->client->help_draw_time >= level.time)
  1249. return;
  1250. // don't draw too many points
  1251. float distance = (points[ent->client->help_draw_index] - ent->s.origin).length();
  1252. if (distance > 4096 ||
  1253. !gi.inPHS(ent->s.origin, points[ent->client->help_draw_index], false))
  1254. {
  1255. ent->client->help_draw_points = false;
  1256. return;
  1257. }
  1258. gi.WriteByte(svc_help_path);
  1259. gi.WriteByte(first ? 1 : 0);
  1260. gi.WritePosition(points[ent->client->help_draw_index]);
  1261. if (ent->client->help_draw_index == ent->client->help_draw_count - 1)
  1262. gi.WriteDir((ent->client->help_poi_location - points[ent->client->help_draw_index]).normalized());
  1263. else
  1264. gi.WriteDir((points[ent->client->help_draw_index + 1] - points[ent->client->help_draw_index]).normalized());
  1265. gi.unicast(ent, false);
  1266. P_SendLevelPOI(ent);
  1267. gi.local_sound(ent, points[ent->client->help_draw_index], world, CHAN_AUTO, gi.soundindex("misc/help_marker.wav"), 1.0f, ATTN_NORM, 0.0f, GetUnicastKey());
  1268. // done
  1269. if (ent->client->help_draw_index == ent->client->help_draw_count - 1)
  1270. {
  1271. ent->client->help_draw_points = false;
  1272. return;
  1273. }
  1274. ent->client->help_draw_index++;
  1275. ent->client->help_draw_time = level.time + 200_ms;
  1276. }
  1277. static void Use_Compass(edict_t *ent, gitem_t *inv)
  1278. {
  1279. if (!level.valid_poi)
  1280. {
  1281. gi.LocClient_Print(ent, PRINT_HIGH, "$no_valid_poi");
  1282. return;
  1283. }
  1284. if (level.current_dynamic_poi)
  1285. level.current_dynamic_poi->use(level.current_dynamic_poi, ent, ent);
  1286. ent->client->help_poi_location = level.current_poi;
  1287. ent->client->help_poi_image = level.current_poi_image;
  1288. vec3_t *&points = level.poi_points[ent->s.number - 1];
  1289. if (!points)
  1290. points = (vec3_t *) gi.TagMalloc(sizeof(vec3_t) * (MAX_TEMP_POI_POINTS + 1), TAG_LEVEL);
  1291. PathRequest request;
  1292. request.start = ent->s.origin;
  1293. request.goal = level.current_poi;
  1294. request.moveDist = 64.f;
  1295. request.pathFlags = PathFlags::All;
  1296. request.nodeSearch.ignoreNodeFlags = true;
  1297. request.nodeSearch.minHeight = 128.0f;
  1298. request.nodeSearch.maxHeight = 128.0f;
  1299. request.nodeSearch.radius = 1024.0f;
  1300. request.pathPoints.array = points + 1;
  1301. request.pathPoints.count = MAX_TEMP_POI_POINTS;
  1302. PathInfo info;
  1303. if (gi.GetPathToGoal(request, info))
  1304. {
  1305. // TODO: optimize points?
  1306. ent->client->help_draw_points = true;
  1307. ent->client->help_draw_count = min((size_t)info.numPathPoints, MAX_TEMP_POI_POINTS);
  1308. ent->client->help_draw_index = 1;
  1309. // remove points too close to the player so they don't have to backtrack
  1310. for (int i = 1; i < 1 + ent->client->help_draw_count; i++)
  1311. {
  1312. float distance = (points[i] - ent->s.origin).length();
  1313. if (distance > 192)
  1314. {
  1315. break;
  1316. }
  1317. ent->client->help_draw_index = i;
  1318. }
  1319. // create an extra point in front of us if we're facing away from the first real point
  1320. float d = ((*(points + ent->client->help_draw_index)) - ent->s.origin).normalized().dot(ent->client->v_forward);
  1321. if (d < 0.3f)
  1322. {
  1323. vec3_t p = ent->s.origin + (ent->client->v_forward * 64.f);
  1324. trace_t tr = gi.traceline(ent->s.origin + vec3_t{0.f, 0.f, (float) ent->viewheight}, p, nullptr, MASK_SOLID);
  1325. ent->client->help_draw_index--;
  1326. ent->client->help_draw_count++;
  1327. if (tr.fraction < 1.0f)
  1328. tr.endpos += tr.plane.normal * 8.f;
  1329. *(points + ent->client->help_draw_index) = tr.endpos;
  1330. }
  1331. ent->client->help_draw_time = 0_ms;
  1332. Compass_Update(ent, true);
  1333. }
  1334. else
  1335. {
  1336. P_SendLevelPOI(ent);
  1337. gi.local_sound(ent, CHAN_AUTO, gi.soundindex("misc/help_marker.wav"), 1.f, ATTN_NORM, 0, GetUnicastKey());
  1338. }
  1339. }
  1340. //======================================================================
  1341. // clang-format off
  1342. gitem_t itemlist[] =
  1343. {
  1344. { }, // leave index 0 alone
  1345. //
  1346. // ARMOR
  1347. //
  1348. /*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16)
  1349. -------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
  1350. model="models/items/armor/body/tris.md2"
  1351. */
  1352. {
  1353. /* id */ IT_ARMOR_BODY,
  1354. /* classname */ "item_armor_body",
  1355. /* pickup */ Pickup_Armor,
  1356. /* use */ nullptr,
  1357. /* drop */ nullptr,
  1358. /* weaponthink */ nullptr,
  1359. /* pickup_sound */ "misc/ar3_pkup.wav",
  1360. /* world_model */ "models/items/armor/body/tris.md2",
  1361. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1362. /* view_model */ nullptr,
  1363. /* icon */ "i_bodyarmor",
  1364. /* use_name */ "Body Armor",
  1365. /* pickup_name */ "$item_body_armor",
  1366. /* pickup_name_definite */ "$item_body_armor_def",
  1367. /* quantity */ 0,
  1368. /* ammo */ IT_NULL,
  1369. /* chain */ IT_NULL,
  1370. /* flags */ IF_ARMOR,
  1371. /* vwep_model */ nullptr,
  1372. /* armor_info */ &bodyarmor_info
  1373. },
  1374. /*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16)
  1375. */
  1376. {
  1377. /* id */ IT_ARMOR_COMBAT,
  1378. /* classname */ "item_armor_combat",
  1379. /* pickup */ Pickup_Armor,
  1380. /* use */ nullptr,
  1381. /* drop */ nullptr,
  1382. /* weaponthink */ nullptr,
  1383. /* pickup_sound */ "misc/ar1_pkup.wav",
  1384. /* world_model */ "models/items/armor/combat/tris.md2",
  1385. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1386. /* view_model */ nullptr,
  1387. /* icon */ "i_combatarmor",
  1388. /* use_name */ "Combat Armor",
  1389. /* pickup_name */ "$item_combat_armor",
  1390. /* pickup_name_definite */ "$item_combat_armor_def",
  1391. /* quantity */ 0,
  1392. /* ammo */ IT_NULL,
  1393. /* chain */ IT_NULL,
  1394. /* flags */ IF_ARMOR,
  1395. /* vwep_model */ nullptr,
  1396. /* armor_info */ &combatarmor_info
  1397. },
  1398. /*QUAKED item_armor_jacket (.3 .3 1) (-16 -16 -16) (16 16 16)
  1399. */
  1400. {
  1401. /* id */ IT_ARMOR_JACKET,
  1402. /* classname */ "item_armor_jacket",
  1403. /* pickup */ Pickup_Armor,
  1404. /* use */ nullptr,
  1405. /* drop */ nullptr,
  1406. /* weaponthink */ nullptr,
  1407. /* pickup_sound */ "misc/ar1_pkup.wav",
  1408. /* world_model */ "models/items/armor/jacket/tris.md2",
  1409. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1410. /* view_model */ nullptr,
  1411. /* icon */ "i_jacketarmor",
  1412. /* use_name */ "Jacket Armor",
  1413. /* pickup_name */ "$item_jacket_armor",
  1414. /* pickup_name_definite */ "$item_jacket_armor_def",
  1415. /* quantity */ 0,
  1416. /* ammo */ IT_NULL,
  1417. /* chain */ IT_NULL,
  1418. /* flags */ IF_ARMOR,
  1419. /* vwep_model */ nullptr,
  1420. /* armor_info */ &jacketarmor_info
  1421. },
  1422. /*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16)
  1423. */
  1424. {
  1425. /* id */ IT_ARMOR_SHARD,
  1426. /* classname */ "item_armor_shard",
  1427. /* pickup */ Pickup_Armor,
  1428. /* use */ nullptr,
  1429. /* drop */ nullptr,
  1430. /* weaponthink */ nullptr,
  1431. /* pickup_sound */ "misc/ar2_pkup.wav",
  1432. /* world_model */ "models/items/armor/shard/tris.md2",
  1433. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1434. /* view_model */ nullptr,
  1435. /* icon */ "i_armor_shard",
  1436. /* use_name */ "Armor Shard",
  1437. /* pickup_name */ "$item_armor_shard",
  1438. /* pickup_name_definite */ "$item_armor_shard_def",
  1439. /* quantity */ 0,
  1440. /* ammo */ IT_NULL,
  1441. /* chain */ IT_NULL,
  1442. /* flags */ IF_ARMOR
  1443. },
  1444. /*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16)
  1445. */
  1446. {
  1447. /* id */ IT_ITEM_POWER_SCREEN,
  1448. /* classname */ "item_power_screen",
  1449. /* pickup */ Pickup_PowerArmor,
  1450. /* use */ Use_PowerArmor,
  1451. /* drop */ Drop_PowerArmor,
  1452. /* weaponthink */ nullptr,
  1453. /* pickup_sound */ "misc/ar3_pkup.wav",
  1454. /* world_model */ "models/items/armor/screen/tris.md2",
  1455. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1456. /* view_model */ nullptr,
  1457. /* icon */ "i_powerscreen",
  1458. /* use_name */ "Power Screen",
  1459. /* pickup_name */ "$item_power_screen",
  1460. /* pickup_name_definite */ "$item_power_screen_def",
  1461. /* quantity */ 60,
  1462. /* ammo */ IT_AMMO_CELLS,
  1463. /* chain */ IT_NULL,
  1464. /* flags */ IF_ARMOR | IF_POWERUP_WHEEL | IF_POWERUP_ONOFF,
  1465. /* vwep_model */ nullptr,
  1466. /* armor_info */ nullptr,
  1467. /* tag */ POWERUP_SCREEN,
  1468. /* precaches */ "misc/power2.wav misc/power1.wav"
  1469. },
  1470. /*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16)
  1471. */
  1472. {
  1473. /* id */ IT_ITEM_POWER_SHIELD,
  1474. /* classname */ "item_power_shield",
  1475. /* pickup */ Pickup_PowerArmor,
  1476. /* use */ Use_PowerArmor,
  1477. /* drop */ Drop_PowerArmor,
  1478. /* weaponthink */ nullptr,
  1479. /* pickup_sound */ "misc/ar3_pkup.wav",
  1480. /* world_model */ "models/items/armor/shield/tris.md2",
  1481. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1482. /* view_model */ nullptr,
  1483. /* icon */ "i_powershield",
  1484. /* use_name */ "Power Shield",
  1485. /* pickup_name */ "$item_power_shield",
  1486. /* pickup_name_definite */ "$item_power_shield_def",
  1487. /* quantity */ 60,
  1488. /* ammo */ IT_AMMO_CELLS,
  1489. /* chain */ IT_NULL,
  1490. /* flags */ IF_ARMOR | IF_POWERUP_WHEEL | IF_POWERUP_ONOFF,
  1491. /* vwep_model */ nullptr,
  1492. /* armor_info */ nullptr,
  1493. /* tag */ POWERUP_SHIELD,
  1494. /* precaches */ "misc/power2.wav misc/power1.wav"
  1495. },
  1496. //
  1497. // WEAPONS
  1498. //
  1499. /* weapon_grapple (.3 .3 1) (-16 -16 -16) (16 16 16)
  1500. always owned, never in the world
  1501. */
  1502. {
  1503. /* id */ IT_WEAPON_GRAPPLE,
  1504. /* classname */ "weapon_grapple",
  1505. /* pickup */ nullptr,
  1506. /* use */ Use_Weapon,
  1507. /* drop */ nullptr,
  1508. /* weaponthink */ CTFWeapon_Grapple,
  1509. /* pickup_sound */ nullptr,
  1510. /* world_model */ nullptr,
  1511. /* world_model_flags */ EF_NONE,
  1512. /* view_model */ "models/weapons/grapple/tris.md2",
  1513. /* icon */ "w_grapple",
  1514. /* use_name */ "Grapple",
  1515. /* pickup_name */ "$item_grapple",
  1516. /* pickup_name_definite */ "$item_grapple_def",
  1517. /* quantity */ 0,
  1518. /* ammo */ IT_NULL,
  1519. /* chain */ IT_WEAPON_BLASTER,
  1520. /* flags */ IF_WEAPON | IF_NO_HASTE | IF_POWERUP_WHEEL | IF_NOT_RANDOM,
  1521. /* vwep_model */ "#w_grapple.md2",
  1522. /* armor_info */ nullptr,
  1523. /* tag */ 0,
  1524. /* precaches */ "weapons/grapple/grfire.wav weapons/grapple/grpull.wav weapons/grapple/grhang.wav weapons/grapple/grreset.wav weapons/grapple/grhit.wav weapons/grapple/grfly.wav"
  1525. },
  1526. /* weapon_blaster (.3 .3 1) (-16 -16 -16) (16 16 16)
  1527. always owned, never in the world
  1528. */
  1529. {
  1530. /* id */ IT_WEAPON_BLASTER,
  1531. /* classname */ "weapon_blaster",
  1532. /* pickup */ Pickup_Weapon,
  1533. /* use */ Use_Weapon,
  1534. /* drop */ nullptr,
  1535. /* weaponthink */ Weapon_Blaster,
  1536. /* pickup_sound */ "misc/w_pkup.wav",
  1537. /* world_model */ "models/weapons/g_blast/tris.md2",
  1538. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1539. /* view_model */ "models/weapons/v_blast/tris.md2",
  1540. /* icon */ "w_blaster",
  1541. /* use_name */ "Blaster",
  1542. /* pickup_name */ "$item_blaster",
  1543. /* pickup_name_definite */ "$item_blaster_def",
  1544. /* quantity */ 0,
  1545. /* ammo */ IT_NULL,
  1546. /* chain */ IT_WEAPON_BLASTER,
  1547. /* flags */ IF_WEAPON | IF_STAY_COOP | IF_NOT_RANDOM,
  1548. /* vwep_model */ "#w_blaster.md2",
  1549. /* armor_info */ nullptr,
  1550. /* tag */ 0,
  1551. /* precaches */ "weapons/blastf1a.wav misc/lasfly.wav"
  1552. },
  1553. /*QUAKED weapon_chainfist (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  1554. */
  1555. {
  1556. /* id */ IT_WEAPON_CHAINFIST,
  1557. /* classname */ "weapon_chainfist",
  1558. /* pickup */ Pickup_Weapon,
  1559. /* use */ Use_Weapon,
  1560. /* drop */ Drop_Weapon,
  1561. /* weaponthink */ Weapon_ChainFist,
  1562. /* pickup_sound */ "misc/w_pkup.wav",
  1563. /* world_model */ "models/weapons/g_chainf/tris.md2",
  1564. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1565. /* view_model */ "models/weapons/v_chainf/tris.md2",
  1566. /* icon */ "w_chainfist",
  1567. /* use_name */ "Chainfist",
  1568. /* pickup_name */ "$item_chainfist",
  1569. /* pickup_name_definite */ "$item_chainfist_def",
  1570. /* quantity */ 0,
  1571. /* ammo */ IT_NULL,
  1572. /* chain */ IT_WEAPON_BLASTER,
  1573. /* flags */ IF_WEAPON | IF_STAY_COOP | IF_NO_HASTE,
  1574. /* vwep_model */ "#w_chainfist.md2",
  1575. /* armor_info */ nullptr,
  1576. /* tag */ 0,
  1577. /* precaches */ "weapons/sawidle.wav weapons/sawhit.wav weapons/sawslice.wav",
  1578. },
  1579. /*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16)
  1580. -------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
  1581. model="models/weapons/g_shotg/tris.md2"
  1582. */
  1583. {
  1584. /* id */ IT_WEAPON_SHOTGUN,
  1585. /* classname */ "weapon_shotgun",
  1586. /* pickup */ Pickup_Weapon,
  1587. /* use */ Use_Weapon,
  1588. /* drop */ Drop_Weapon,
  1589. /* weaponthink */ Weapon_Shotgun,
  1590. /* pickup_sound */ "misc/w_pkup.wav",
  1591. /* world_model */ "models/weapons/g_shotg/tris.md2",
  1592. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1593. /* view_model */ "models/weapons/v_shotg/tris.md2",
  1594. /* icon */ "w_shotgun",
  1595. /* use_name */ "Shotgun",
  1596. /* pickup_name */ "$item_shotgun",
  1597. /* pickup_name_definite */ "$item_shotgun_def",
  1598. /* quantity */ 1,
  1599. /* ammo */ IT_AMMO_SHELLS,
  1600. /* chain */ IT_NULL,
  1601. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1602. /* vwep_model */ "#w_shotgun.md2",
  1603. /* armor_info */ nullptr,
  1604. /* tag */ 0,
  1605. /* precaches */ "weapons/shotgf1b.wav weapons/shotgr1b.wav"
  1606. },
  1607. /*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16)
  1608. */
  1609. {
  1610. /* id */ IT_WEAPON_SSHOTGUN,
  1611. /* classname */ "weapon_supershotgun",
  1612. /* pickup */ Pickup_Weapon,
  1613. /* use */ Use_Weapon,
  1614. /* drop */ Drop_Weapon,
  1615. /* weaponthink */ Weapon_SuperShotgun,
  1616. /* pickup_sound */ "misc/w_pkup.wav",
  1617. /* world_model */ "models/weapons/g_shotg2/tris.md2",
  1618. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1619. /* view_model */ "models/weapons/v_shotg2/tris.md2",
  1620. /* icon */ "w_sshotgun",
  1621. /* use_name */ "Super Shotgun",
  1622. /* pickup_name */ "$item_super_shotgun",
  1623. /* pickup_name_definite */ "$item_super_shotgun_def",
  1624. /* quantity */ 2,
  1625. /* ammo */ IT_AMMO_SHELLS,
  1626. /* chain */ IT_NULL,
  1627. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1628. /* vwep_model */ "#w_sshotgun.md2",
  1629. /* armor_info */ nullptr,
  1630. /* tag */ 0,
  1631. /* precaches */ "weapons/sshotf1b.wav",
  1632. /* sort_id */ 0,
  1633. /* quantity_warn */ 10
  1634. },
  1635. /*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16)
  1636. */
  1637. {
  1638. /* id */ IT_WEAPON_MACHINEGUN,
  1639. /* classname */ "weapon_machinegun",
  1640. /* pickup */ Pickup_Weapon,
  1641. /* use */ Use_Weapon,
  1642. /* drop */ Drop_Weapon,
  1643. /* weaponthink */ Weapon_Machinegun,
  1644. /* pickup_sound */ "misc/w_pkup.wav",
  1645. /* world_model */ "models/weapons/g_machn/tris.md2",
  1646. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1647. /* view_model */ "models/weapons/v_machn/tris.md2",
  1648. /* icon */ "w_machinegun",
  1649. /* use_name */ "Machinegun",
  1650. /* pickup_name */ "$item_machinegun",
  1651. /* pickup_name_definite */ "$item_machinegun_def",
  1652. /* quantity */ 1,
  1653. /* ammo */ IT_AMMO_BULLETS,
  1654. /* chain */ IT_WEAPON_MACHINEGUN,
  1655. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1656. /* vwep_model */ "#w_machinegun.md2",
  1657. /* armor_info */ nullptr,
  1658. /* tag */ 0,
  1659. /* precaches */ "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav",
  1660. /* sort_id */ 0,
  1661. /* quantity_warn */ 30
  1662. },
  1663. // ROGUE
  1664. /*QUAKED weapon_etf_rifle (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  1665. */
  1666. {
  1667. /* id */ IT_WEAPON_ETF_RIFLE,
  1668. /* classname */ "weapon_etf_rifle",
  1669. /* pickup */ Pickup_Weapon,
  1670. /* use */ Use_Weapon,
  1671. /* drop */ Drop_Weapon,
  1672. /* weaponthink */ Weapon_ETF_Rifle,
  1673. /* pickup_sound */ "misc/w_pkup.wav",
  1674. /* world_model */ "models/weapons/g_etf_rifle/tris.md2",
  1675. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1676. /* view_model */ "models/weapons/v_etf_rifle/tris.md2",
  1677. /* icon */ "w_etf_rifle",
  1678. /* use_name */ "ETF Rifle",
  1679. /* pickup_name */ "$item_etf_rifle",
  1680. /* pickup_name_definite */ "$item_etf_rifle_def",
  1681. /* quantity */ 1,
  1682. /* ammo */ IT_AMMO_FLECHETTES,
  1683. /* chain */ IT_WEAPON_MACHINEGUN,
  1684. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1685. /* vwep_model */ "#w_etfrifle.md2",
  1686. /* armor_info */ nullptr,
  1687. /* tag */ 0,
  1688. /* precaches */ "weapons/nail1.wav models/proj/flechette/tris.md2",
  1689. /* sort_id */ 0,
  1690. /* quantity_warn */ 30
  1691. },
  1692. // ROGUE
  1693. /*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16)
  1694. */
  1695. {
  1696. /* id */ IT_WEAPON_CHAINGUN,
  1697. /* classname */ "weapon_chaingun",
  1698. /* pickup */ Pickup_Weapon,
  1699. /* use */ Use_Weapon,
  1700. /* drop */ Drop_Weapon,
  1701. /* weaponthink */ Weapon_Chaingun,
  1702. /* pickup_sound */ "misc/w_pkup.wav",
  1703. /* world_model */ "models/weapons/g_chain/tris.md2",
  1704. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1705. /* view_model */ "models/weapons/v_chain/tris.md2",
  1706. /* icon */ "w_chaingun",
  1707. /* use_name */ "Chaingun",
  1708. /* pickup_name */ "$item_chaingun",
  1709. /* pickup_name_definite */ "$item_chaingun_def",
  1710. /* quantity */ 1,
  1711. /* ammo */ IT_AMMO_BULLETS,
  1712. /* chain */ IT_NULL,
  1713. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1714. /* vwep_model */ "#w_chaingun.md2",
  1715. /* armor_info */ nullptr,
  1716. /* tag */ 0,
  1717. /* precaches */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav weapons/chngnd1a.wav",
  1718. /* sort_id */ 0,
  1719. /* quantity_warn */ 60
  1720. },
  1721. /*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16)
  1722. */
  1723. {
  1724. /* id */ IT_AMMO_GRENADES,
  1725. /* classname */ "ammo_grenades",
  1726. /* pickup */ Pickup_Ammo,
  1727. /* use */ Use_Weapon,
  1728. /* drop */ Drop_Ammo,
  1729. /* weaponthink */ Weapon_Grenade,
  1730. /* pickup_sound */ "misc/am_pkup.wav",
  1731. /* world_model */ "models/items/ammo/grenades/medium/tris.md2",
  1732. /* world_model_flags */ EF_NONE,
  1733. /* view_model */ "models/weapons/v_handgr/tris.md2",
  1734. /* icon */ "a_grenades",
  1735. /* use_name */ "Grenades",
  1736. /* pickup_name */ "$item_grenades",
  1737. /* pickup_name_definite */ "$item_grenades_def",
  1738. /* quantity */ 5,
  1739. /* ammo */ IT_AMMO_GRENADES,
  1740. /* chain */ IT_AMMO_GRENADES,
  1741. /* flags */ IF_AMMO | IF_WEAPON,
  1742. /* vwep_model */ "#a_grenades.md2",
  1743. /* armor_info */ nullptr,
  1744. /* tag */ AMMO_GRENADES,
  1745. /* precaches */ "weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav models/objects/grenade3/tris.md2",
  1746. /* sort_id */ 0,
  1747. /* quantity_warn */ 2
  1748. },
  1749. // RAFAEL
  1750. /*QUAKED ammo_trap (.3 .3 1) (-16 -16 -16) (16 16 16)
  1751. */
  1752. {
  1753. /* id */ IT_AMMO_TRAP,
  1754. /* classname */ "ammo_trap",
  1755. /* pickup */ Pickup_Ammo,
  1756. /* use */ Use_Weapon,
  1757. /* drop */ Drop_Ammo,
  1758. /* weaponthink */ Weapon_Trap,
  1759. /* pickup_sound */ "misc/am_pkup.wav",
  1760. /* world_model */ "models/weapons/g_trap/tris.md2",
  1761. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1762. /* view_model */ "models/weapons/v_trap/tris.md2",
  1763. /* icon */ "a_trap",
  1764. /* use_name */ "Trap",
  1765. /* pickup_name */ "$item_trap",
  1766. /* pickup_name_definite */ "$item_trap_def",
  1767. /* quantity */ 1,
  1768. /* ammo */ IT_AMMO_TRAP,
  1769. /* chain */ IT_AMMO_GRENADES,
  1770. /* flags */ IF_AMMO | IF_WEAPON | IF_NO_INFINITE_AMMO,
  1771. /* vwep_model */ "#a_trap.md2",
  1772. /* armor_info */ nullptr,
  1773. /* tag */ AMMO_TRAP,
  1774. /* precaches */ "misc/fhit3.wav weapons/trapcock.wav weapons/traploop.wav weapons/trapsuck.wav weapons/trapdown.wav items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav models/weapons/z_trap/tris.md2",
  1775. /* sort_id */ 0,
  1776. /* quantity_warn */ 1
  1777. },
  1778. // RAFAEL
  1779. /*QUAKED ammo_tesla (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  1780. */
  1781. {
  1782. /* id */ IT_AMMO_TESLA,
  1783. /* classname */ "ammo_tesla",
  1784. /* pickup */ Pickup_Ammo,
  1785. /* use */ Use_Weapon,
  1786. /* drop */ Drop_Ammo,
  1787. /* weaponthink */ Weapon_Tesla,
  1788. /* pickup_sound */ "misc/am_pkup.wav",
  1789. /* world_model */ "models/ammo/am_tesl/tris.md2",
  1790. /* world_model_flags */ EF_NONE,
  1791. /* view_model */ "models/weapons/v_tesla/tris.md2",
  1792. /* icon */ "a_tesla",
  1793. /* use_name */ "Tesla",
  1794. /* pickup_name */ "$item_tesla",
  1795. /* pickup_name_definite */ "$item_tesla_def",
  1796. /* quantity */ 3,
  1797. /* ammo */ IT_AMMO_TESLA,
  1798. /* chain */ IT_AMMO_GRENADES,
  1799. /* flags */ IF_AMMO | IF_WEAPON | IF_NO_INFINITE_AMMO,
  1800. /* vwep_model */ "#a_tesla.md2",
  1801. /* armor_info */ nullptr,
  1802. /* tag */ AMMO_TESLA,
  1803. /* precaches */ "weapons/teslaopen.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav models/weapons/g_tesla/tris.md2",
  1804. /* sort_id */ 0,
  1805. /* quantity_warn */ 1
  1806. },
  1807. /*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16)
  1808. -------- MODEL FOR RADIANT ONLY - DO NOT SET THIS AS A KEY --------
  1809. model="models/weapons/g_launch/tris.md2"
  1810. */
  1811. {
  1812. /* id */ IT_WEAPON_GLAUNCHER,
  1813. /* classname */ "weapon_grenadelauncher",
  1814. /* pickup */ Pickup_Weapon,
  1815. /* use */ Use_Weapon,
  1816. /* drop */ Drop_Weapon,
  1817. /* weaponthink */ Weapon_GrenadeLauncher,
  1818. /* pickup_sound */ "misc/w_pkup.wav",
  1819. /* world_model */ "models/weapons/g_launch/tris.md2",
  1820. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1821. /* view_model */ "models/weapons/v_launch/tris.md2",
  1822. /* icon */ "w_glauncher",
  1823. /* use_name */ "Grenade Launcher",
  1824. /* pickup_name */ "$item_grenade_launcher",
  1825. /* pickup_name_definite */ "$item_grenade_launcher_def",
  1826. /* quantity */ 1,
  1827. /* ammo */ IT_AMMO_GRENADES,
  1828. /* chain */ IT_WEAPON_GLAUNCHER,
  1829. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1830. /* vwep_model */ "#w_glauncher.md2",
  1831. /* armor_info */ nullptr,
  1832. /* tag */ 0,
  1833. /* precaches */ "models/objects/grenade4/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav"
  1834. },
  1835. // ROGUE
  1836. /*QUAKED weapon_proxlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  1837. */
  1838. {
  1839. /* id */ IT_WEAPON_PROXLAUNCHER,
  1840. /* classname */ "weapon_proxlauncher",
  1841. /* pickup */ Pickup_Weapon,
  1842. /* use */ Use_Weapon,
  1843. /* drop */ Drop_Weapon,
  1844. /* weaponthink */ Weapon_ProxLauncher,
  1845. /* pickup_sound */ "misc/w_pkup.wav",
  1846. /* world_model */ "models/weapons/g_plaunch/tris.md2",
  1847. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1848. /* view_model */ "models/weapons/v_plaunch/tris.md2",
  1849. /* icon */ "w_proxlaunch",
  1850. /* use_name */ "Prox Launcher",
  1851. /* pickup_name */ "$item_prox_launcher",
  1852. /* pickup_name_definite */ "$item_prox_launcher_def",
  1853. /* quantity */ 1,
  1854. /* ammo */ IT_AMMO_PROX,
  1855. /* chain */ IT_WEAPON_GLAUNCHER,
  1856. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1857. /* vwep_model */ "#w_plauncher.md2",
  1858. /* armor_info */ nullptr,
  1859. /* tag */ AMMO_PROX,
  1860. /* precaches */ "weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav weapons/proxwarn.wav weapons/proxopen.wav",
  1861. },
  1862. // ROGUE
  1863. /*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16)
  1864. */
  1865. {
  1866. /* id */ IT_WEAPON_RLAUNCHER,
  1867. /* classname */ "weapon_rocketlauncher",
  1868. /* pickup */ Pickup_Weapon,
  1869. /* use */ Use_Weapon,
  1870. /* drop */ Drop_Weapon,
  1871. /* weaponthink */ Weapon_RocketLauncher,
  1872. /* pickup_sound */ "misc/w_pkup.wav",
  1873. /* world_model */ "models/weapons/g_rocket/tris.md2",
  1874. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1875. /* view_model */ "models/weapons/v_rocket/tris.md2",
  1876. /* icon */ "w_rlauncher",
  1877. /* use_name */ "Rocket Launcher",
  1878. /* pickup_name */ "$item_rocket_launcher",
  1879. /* pickup_name_definite */ "$item_rocket_launcher_def",
  1880. /* quantity */ 1,
  1881. /* ammo */ IT_AMMO_ROCKETS,
  1882. /* chain */ IT_NULL,
  1883. /* flags */ IF_WEAPON|IF_STAY_COOP,
  1884. /* vwep_model */ "#w_rlauncher.md2",
  1885. /* armor_info */ nullptr,
  1886. /* tag */ 0,
  1887. /* precaches */ "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2"
  1888. },
  1889. /*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16)
  1890. */
  1891. {
  1892. /* id */ IT_WEAPON_HYPERBLASTER,
  1893. /* classname */ "weapon_hyperblaster",
  1894. /* pickup */ Pickup_Weapon,
  1895. /* use */ Use_Weapon,
  1896. /* drop */ Drop_Weapon,
  1897. /* weaponthink */ Weapon_HyperBlaster,
  1898. /* pickup_sound */ "misc/w_pkup.wav",
  1899. /* world_model */ "models/weapons/g_hyperb/tris.md2",
  1900. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1901. /* view_model */ "models/weapons/v_hyperb/tris.md2",
  1902. /* icon */ "w_hyperblaster",
  1903. /* use_name */ "HyperBlaster",
  1904. /* pickup_name */ "$item_hyperblaster",
  1905. /* pickup_name_definite */ "$item_hyperblaster_def",
  1906. /* quantity */ 1,
  1907. /* ammo */ IT_AMMO_CELLS,
  1908. /* chain */ IT_WEAPON_HYPERBLASTER,
  1909. /* flags */ IF_WEAPON|IF_STAY_COOP,
  1910. /* vwep_model */ "#w_hyperblaster.md2",
  1911. /* armor_info */ nullptr,
  1912. /* tag */ 0,
  1913. /* precaches */ "weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav",
  1914. /* sort_id */ 0,
  1915. /* quantity_warn */ 30
  1916. },
  1917. // RAFAEL
  1918. /*QUAKED weapon_boomer (.3 .3 1) (-16 -16 -16) (16 16 16)
  1919. */
  1920. {
  1921. /* id */ IT_WEAPON_IONRIPPER,
  1922. /* classname */ "weapon_boomer",
  1923. /* pickup */ Pickup_Weapon,
  1924. /* use */ Use_Weapon,
  1925. /* drop */ Drop_Weapon,
  1926. /* weaponthink */ Weapon_Ionripper,
  1927. /* pickup_sound */ "misc/w_pkup.wav",
  1928. /* world_model */ "models/weapons/g_boom/tris.md2",
  1929. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1930. /* view_model */ "models/weapons/v_boomer/tris.md2",
  1931. /* icon */ "w_ripper",
  1932. /* use_name */ "Ionripper",
  1933. /* pickup_name */ "$item_ionripper",
  1934. /* pickup_name_definite */ "$item_ionripper_def",
  1935. /* quantity */ 2,
  1936. /* ammo */ IT_AMMO_CELLS,
  1937. /* chain */ IT_WEAPON_HYPERBLASTER,
  1938. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1939. /* vwep_model */ "#w_ripper.md2",
  1940. /* armor_info */ nullptr,
  1941. /* tag */ 0,
  1942. /* precaches */ "weapons/rippfire.wav models/objects/boomrang/tris.md2 misc/lasfly.wav",
  1943. /* sort_id */ 0,
  1944. /* quantity_warn */ 30
  1945. },
  1946. // RAFAEL
  1947. // ROGUE
  1948. /*QUAKED weapon_plasmabeam (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  1949. */
  1950. {
  1951. /* id */ IT_WEAPON_PLASMABEAM,
  1952. /* classname */ "weapon_plasmabeam",
  1953. /* pickup */ Pickup_Weapon,
  1954. /* use */ Use_Weapon,
  1955. /* drop */ Drop_Weapon,
  1956. /* weaponthink */ Weapon_Heatbeam,
  1957. /* pickup_sound */ "misc/w_pkup.wav",
  1958. /* world_model */ "models/weapons/g_beamer/tris.md2",
  1959. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1960. /* view_model */ "models/weapons/v_beamer/tris.md2",
  1961. /* icon */ "w_heatbeam",
  1962. /* use_name */ "Plasma Beam",
  1963. /* pickup_name */ "$item_plasma_beam",
  1964. /* pickup_name_definite */ "$item_plasma_beam_def",
  1965. /* quantity */ 2,
  1966. /* ammo */ IT_AMMO_CELLS,
  1967. /* chain */ IT_WEAPON_HYPERBLASTER,
  1968. /* flags */ IF_WEAPON | IF_STAY_COOP,
  1969. /* vwep_model */ "#w_plasma.md2",
  1970. /* armor_info */ nullptr,
  1971. /* tag */ 0,
  1972. /* precaches */ "weapons/bfg__l1a.wav",
  1973. /* sort_id */ 0,
  1974. /* quantity_warn */ 50
  1975. },
  1976. //rogue
  1977. /*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16)
  1978. */
  1979. {
  1980. /* id */ IT_WEAPON_RAILGUN,
  1981. /* classname */ "weapon_railgun",
  1982. /* pickup */ Pickup_Weapon,
  1983. /* use */ Use_Weapon,
  1984. /* drop */ Drop_Weapon,
  1985. /* weaponthink */ Weapon_Railgun,
  1986. /* pickup_sound */ "misc/w_pkup.wav",
  1987. /* world_model */ "models/weapons/g_rail/tris.md2",
  1988. /* world_model_flags */ EF_ROTATE | EF_BOB,
  1989. /* view_model */ "models/weapons/v_rail/tris.md2",
  1990. /* icon */ "w_railgun",
  1991. /* use_name */ "Railgun",
  1992. /* pickup_name */ "$item_railgun",
  1993. /* pickup_name_definite */ "$item_railgun_def",
  1994. /* quantity */ 1,
  1995. /* ammo */ IT_AMMO_SLUGS,
  1996. /* chain */ IT_WEAPON_RAILGUN,
  1997. /* flags */ IF_WEAPON|IF_STAY_COOP,
  1998. /* vwep_model */ "#w_railgun.md2",
  1999. /* armor_info */ nullptr,
  2000. /* tag */ 0,
  2001. /* precaches */ "weapons/rg_hum.wav"
  2002. },
  2003. // RAFAEL 14-APR-98
  2004. /*QUAKED weapon_phalanx (.3 .3 1) (-16 -16 -16) (16 16 16)
  2005. */
  2006. {
  2007. /* id */ IT_WEAPON_PHALANX,
  2008. /* classname */ "weapon_phalanx",
  2009. /* pickup */ Pickup_Weapon,
  2010. /* use */ Use_Weapon,
  2011. /* drop */ Drop_Weapon,
  2012. /* weaponthink */ Weapon_Phalanx,
  2013. /* pickup_sound */ "misc/w_pkup.wav",
  2014. /* world_model */ "models/weapons/g_shotx/tris.md2",
  2015. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2016. /* view_model */ "models/weapons/v_shotx/tris.md2",
  2017. /* icon */ "w_phallanx",
  2018. /* use_name */ "Phalanx",
  2019. /* pickup_name */ "$item_phalanx",
  2020. /* pickup_name_definite */ "$item_phalanx_def",
  2021. /* quantity */ 1,
  2022. /* ammo */ IT_AMMO_MAGSLUG,
  2023. /* chain */ IT_WEAPON_RAILGUN,
  2024. /* flags */ IF_WEAPON | IF_STAY_COOP,
  2025. /* vwep_model */ "#w_phalanx.md2",
  2026. /* armor_info */ nullptr,
  2027. /* tag */ 0,
  2028. /* precaches */ "weapons/plasshot.wav sprites/s_photon.sp2 weapons/rockfly.wav"
  2029. },
  2030. // RAFAEL
  2031. /*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16)
  2032. */
  2033. {
  2034. /* id */ IT_WEAPON_BFG,
  2035. /* classname */ "weapon_bfg",
  2036. /* pickup */ Pickup_Weapon,
  2037. /* use */ Use_Weapon,
  2038. /* drop */ Drop_Weapon,
  2039. /* weaponthink */ Weapon_BFG,
  2040. /* pickup_sound */ "misc/w_pkup.wav",
  2041. /* world_model */ "models/weapons/g_bfg/tris.md2",
  2042. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2043. /* view_model */ "models/weapons/v_bfg/tris.md2",
  2044. /* icon */ "w_bfg",
  2045. /* use_name */ "BFG10K",
  2046. /* pickup_name */ "$item_bfg10k",
  2047. /* pickup_name_definite */ "$item_bfg10k_def",
  2048. /* quantity */ 50,
  2049. /* ammo */ IT_AMMO_CELLS,
  2050. /* chain */ IT_WEAPON_BFG,
  2051. /* flags */ IF_WEAPON|IF_STAY_COOP,
  2052. /* vwep_model */ "#w_bfg.md2",
  2053. /* armor_info */ nullptr,
  2054. /* tag */ 0,
  2055. /* precaches */ "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",
  2056. /* sort_id */ 0,
  2057. /* quantity_warn */ 50
  2058. },
  2059. // =========================
  2060. // ROGUE WEAPONS
  2061. /*QUAKED weapon_disintegrator (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2062. */
  2063. {
  2064. /* id */ IT_WEAPON_DISRUPTOR,
  2065. /* classname */ "weapon_disintegrator",
  2066. /* pickup */ Pickup_Weapon,
  2067. /* use */ Use_Weapon,
  2068. /* drop */ Drop_Weapon,
  2069. /* weaponthink */ Weapon_Disintegrator,
  2070. /* pickup_sound */ "misc/w_pkup.wav",
  2071. /* world_model */ "models/weapons/g_dist/tris.md2",
  2072. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2073. /* view_model */ "models/weapons/v_dist/tris.md2",
  2074. /* icon */ "w_disintegrator",
  2075. /* use_name */ "Disruptor",
  2076. /* pickup_name */ "$item_disruptor",
  2077. /* pickup_name_definite */ "$item_disruptor_def",
  2078. /* quantity */ 1,
  2079. /* ammo */ IT_AMMO_ROUNDS,
  2080. /* chain */ IT_WEAPON_BFG,
  2081. /* flags */ IF_WEAPON | IF_STAY_COOP,
  2082. /* vwep_model */ "#w_disrupt.md2",
  2083. /* armor_info */ nullptr,
  2084. /* tag */ 0,
  2085. /* precaches */ "models/proj/disintegrator/tris.md2 weapons/disrupt.wav weapons/disint2.wav weapons/disrupthit.wav",
  2086. },
  2087. // ROGUE WEAPONS
  2088. // =========================
  2089. #if 0 // sorry little guy
  2090. {
  2091. /* id */ IT_WEAPON_DISINTEGRATOR,
  2092. /* classname */ "weapon_beta_disintegrator",
  2093. /* pickup */ Pickup_Weapon,
  2094. /* use */ Use_Weapon,
  2095. /* drop */ Drop_Weapon,
  2096. /* weaponthink */ Weapon_Beta_Disintegrator,
  2097. /* pickup_sound */ "misc/w_pkup.wav",
  2098. /* world_model */ "models/weapons/g_disint/tris.md2",
  2099. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2100. /* view_model */ "models/weapons/v_disint/tris.md2",
  2101. /* icon */ "w_bfg",
  2102. /* use_name */ "Disintegrator",
  2103. /* pickup_name */ "$item_disintegrator",
  2104. /* pickup_name_definite */ "$item_disintegrator_def",
  2105. /* quantity */ 1,
  2106. /* ammo */ IT_AMMO_ROUNDS,
  2107. /* chain */ IT_WEAPON_BFG,
  2108. /* flags */ IF_WEAPON | IF_STAY_COOP,
  2109. /* vwep_model */ "#w_bfg.md2",
  2110. /* armor_info */ nullptr,
  2111. /* tag */ 0,
  2112. /* precaches */ "",
  2113. },
  2114. #endif
  2115. //
  2116. // AMMO ITEMS
  2117. //
  2118. /*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16)
  2119. */
  2120. {
  2121. /* id */ IT_AMMO_SHELLS,
  2122. /* classname */ "ammo_shells",
  2123. /* pickup */ Pickup_Ammo,
  2124. /* use */ nullptr,
  2125. /* drop */ Drop_Ammo,
  2126. /* weaponthink */ nullptr,
  2127. /* pickup_sound */ "misc/am_pkup.wav",
  2128. /* world_model */ "models/items/ammo/shells/medium/tris.md2",
  2129. /* world_model_flags */ EF_NONE,
  2130. /* view_model */ nullptr,
  2131. /* icon */ "a_shells",
  2132. /* use_name */ "Shells",
  2133. /* pickup_name */ "$item_shells",
  2134. /* pickup_name_definite */ "$item_shells_def",
  2135. /* quantity */ 10,
  2136. /* ammo */ IT_NULL,
  2137. /* chain */ IT_NULL,
  2138. /* flags */ IF_AMMO,
  2139. /* vwep_model */ nullptr,
  2140. /* armor_info */ nullptr,
  2141. /* tag */ AMMO_SHELLS
  2142. },
  2143. /*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16)
  2144. */
  2145. {
  2146. /* id */ IT_AMMO_BULLETS,
  2147. /* classname */ "ammo_bullets",
  2148. /* pickup */ Pickup_Ammo,
  2149. /* use */ nullptr,
  2150. /* drop */ Drop_Ammo,
  2151. /* weaponthink */ nullptr,
  2152. /* pickup_sound */ "misc/am_pkup.wav",
  2153. /* world_model */ "models/items/ammo/bullets/medium/tris.md2",
  2154. /* world_model_flags */ EF_NONE,
  2155. /* view_model */ nullptr,
  2156. /* icon */ "a_bullets",
  2157. /* use_name */ "Bullets",
  2158. /* pickup_name */ "$item_bullets",
  2159. /* pickup_name_definite */ "$item_bullets_def",
  2160. /* quantity */ 50,
  2161. /* ammo */ IT_NULL,
  2162. /* chain */ IT_NULL,
  2163. /* flags */ IF_AMMO,
  2164. /* vwep_model */ nullptr,
  2165. /* armor_info */ nullptr,
  2166. /* tag */ AMMO_BULLETS
  2167. },
  2168. /*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16)
  2169. */
  2170. {
  2171. /* id */ IT_AMMO_CELLS,
  2172. /* classname */ "ammo_cells",
  2173. /* pickup */ Pickup_Ammo,
  2174. /* use */ nullptr,
  2175. /* drop */ Drop_Ammo,
  2176. /* weaponthink */ nullptr,
  2177. /* pickup_sound */ "misc/am_pkup.wav",
  2178. /* world_model */ "models/items/ammo/cells/medium/tris.md2",
  2179. /* world_model_flags */ EF_NONE,
  2180. /* view_model */ nullptr,
  2181. /* icon */ "a_cells",
  2182. /* use_name */ "Cells",
  2183. /* pickup_name */ "$item_cells",
  2184. /* pickup_name_definite */ "$item_cells_def",
  2185. /* quantity */ 50,
  2186. /* ammo */ IT_NULL,
  2187. /* chain */ IT_NULL,
  2188. /* flags */ IF_AMMO,
  2189. /* vwep_model */ nullptr,
  2190. /* armor_info */ nullptr,
  2191. /* tag */ AMMO_CELLS
  2192. },
  2193. /*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16)
  2194. model="models/items/ammo/rockets/medium/tris.md2"
  2195. */
  2196. {
  2197. /* id */ IT_AMMO_ROCKETS,
  2198. /* classname */ "ammo_rockets",
  2199. /* pickup */ Pickup_Ammo,
  2200. /* use */ nullptr,
  2201. /* drop */ Drop_Ammo,
  2202. /* weaponthink */ nullptr,
  2203. /* pickup_sound */ "misc/am_pkup.wav",
  2204. /* world_model */ "models/items/ammo/rockets/medium/tris.md2",
  2205. /* world_model_flags */ EF_NONE,
  2206. /* view_model */ nullptr,
  2207. /* icon */ "a_rockets",
  2208. /* use_name */ "Rockets",
  2209. /* pickup_name */ "$item_rockets",
  2210. /* pickup_name_definite */ "$item_rockets_def",
  2211. /* quantity */ 5,
  2212. /* ammo */ IT_NULL,
  2213. /* chain */ IT_NULL,
  2214. /* flags */ IF_AMMO,
  2215. /* vwep_model */ nullptr,
  2216. /* armor_info */ nullptr,
  2217. /* tag */ AMMO_ROCKETS
  2218. },
  2219. /*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16)
  2220. */
  2221. {
  2222. /* id */ IT_AMMO_SLUGS,
  2223. /* classname */ "ammo_slugs",
  2224. /* pickup */ Pickup_Ammo,
  2225. /* use */ nullptr,
  2226. /* drop */ Drop_Ammo,
  2227. /* weaponthink */ nullptr,
  2228. /* pickup_sound */ "misc/am_pkup.wav",
  2229. /* world_model */ "models/items/ammo/slugs/medium/tris.md2",
  2230. /* world_model_flags */ EF_NONE,
  2231. /* view_model */ nullptr,
  2232. /* icon */ "a_slugs",
  2233. /* use_name */ "Slugs",
  2234. /* pickup_name */ "$item_slugs",
  2235. /* pickup_name_definite */ "$item_slugs_def",
  2236. /* quantity */ 10,
  2237. /* ammo */ IT_NULL,
  2238. /* chain */ IT_NULL,
  2239. /* flags */ IF_AMMO,
  2240. /* vwep_model */ nullptr,
  2241. /* armor_info */ nullptr,
  2242. /* tag */ AMMO_SLUGS
  2243. },
  2244. // RAFAEL
  2245. /*QUAKED ammo_magslug (.3 .3 1) (-16 -16 -16) (16 16 16)
  2246. */
  2247. {
  2248. /* id */ IT_AMMO_MAGSLUG,
  2249. /* classname */ "ammo_magslug",
  2250. /* pickup */ Pickup_Ammo,
  2251. /* use */ nullptr,
  2252. /* drop */ Drop_Ammo,
  2253. /* weaponthink */ nullptr,
  2254. /* pickup_sound */ "misc/am_pkup.wav",
  2255. /* world_model */ "models/objects/ammo/tris.md2",
  2256. /* world_model_flags */ EF_NONE,
  2257. /* view_model */ nullptr,
  2258. /* icon */ "a_mslugs",
  2259. /* use_name */ "Mag Slug",
  2260. /* pickup_name */ "$item_mag_slug",
  2261. /* pickup_name_definite */ "$item_mag_slug_def",
  2262. /* quantity */ 10,
  2263. /* ammo */ IT_NULL,
  2264. /* chain */ IT_NULL,
  2265. /* flags */ IF_AMMO,
  2266. /* vwep_model */ nullptr,
  2267. /* armor_info */ nullptr,
  2268. /* tag */ AMMO_MAGSLUG
  2269. },
  2270. // RAFAEL
  2271. // =======================================
  2272. // ROGUE AMMO
  2273. /*QUAKED ammo_flechettes (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2274. */
  2275. {
  2276. /* id */ IT_AMMO_FLECHETTES,
  2277. /* classname */ "ammo_flechettes",
  2278. /* pickup */ Pickup_Ammo,
  2279. /* use */ nullptr,
  2280. /* drop */ Drop_Ammo,
  2281. /* weaponthink */ nullptr,
  2282. /* pickup_sound */ "misc/am_pkup.wav",
  2283. /* world_model */ "models/ammo/am_flechette/tris.md2",
  2284. /* world_model_flags */ EF_NONE,
  2285. /* view_model */ nullptr,
  2286. /* icon */ "a_flechettes",
  2287. /* use_name */ "Flechettes",
  2288. /* pickup_name */ "$item_flechettes",
  2289. /* pickup_name_definite */ "$item_flechettes_def",
  2290. /* quantity */ 50,
  2291. /* ammo */ IT_NULL,
  2292. /* chain */ IT_NULL,
  2293. /* flags */ IF_AMMO,
  2294. /* vwep_model */ nullptr,
  2295. /* armor_info */ nullptr,
  2296. /* tag */ AMMO_FLECHETTES
  2297. },
  2298. /*QUAKED ammo_prox (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2299. */
  2300. {
  2301. /* id */ IT_AMMO_PROX,
  2302. /* classname */ "ammo_prox",
  2303. /* pickup */ Pickup_Ammo,
  2304. /* use */ nullptr,
  2305. /* drop */ Drop_Ammo,
  2306. /* weaponthink */ nullptr,
  2307. /* pickup_sound */ "misc/am_pkup.wav",
  2308. /* world_model */ "models/ammo/am_prox/tris.md2",
  2309. /* world_model_flags */ EF_NONE,
  2310. /* view_model */ nullptr,
  2311. /* icon */ "a_prox",
  2312. /* use_name */ "Prox",
  2313. /* pickup_name */ "$item_prox",
  2314. /* pickup_name_definite */ "$item_prox_def",
  2315. /* quantity */ 5,
  2316. /* ammo */ IT_NULL,
  2317. /* chain */ IT_NULL,
  2318. /* flags */ IF_AMMO,
  2319. /* vwep_model */ nullptr,
  2320. /* armor_info */ nullptr,
  2321. /* tag */ AMMO_PROX,
  2322. /* precaches */ "models/weapons/g_prox/tris.md2 weapons/proxwarn.wav"
  2323. },
  2324. /*QUAKED ammo_nuke (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2325. */
  2326. {
  2327. /* id */ IT_AMMO_NUKE,
  2328. /* classname */ "ammo_nuke",
  2329. /* pickup */ Pickup_Nuke,
  2330. /* use */ Use_Nuke,
  2331. /* drop */ Drop_Ammo,
  2332. /* weaponthink */ nullptr,
  2333. /* pickup_sound */ "misc/am_pkup.wav",
  2334. /* world_model */ "models/weapons/g_nuke/tris.md2",
  2335. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2336. /* view_model */ nullptr,
  2337. /* icon */ "p_nuke",
  2338. /* use_name */ "A-M Bomb",
  2339. /* pickup_name */ "$item_am_bomb",
  2340. /* pickup_name_definite */ "$item_am_bomb_def",
  2341. /* quantity */ 300,
  2342. /* ammo */ IT_AMMO_NUKE,
  2343. /* chain */ IT_NULL,
  2344. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2345. /* vwep_model */ nullptr,
  2346. /* armor_info */ nullptr,
  2347. /* tag */ POWERUP_AM_BOMB,
  2348. /* precaches */ "weapons/nukewarn2.wav world/rumble.wav"
  2349. },
  2350. /*QUAKED ammo_disruptor (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2351. */
  2352. {
  2353. /* id */ IT_AMMO_ROUNDS,
  2354. /* classname */ "ammo_disruptor",
  2355. /* pickup */ Pickup_Ammo,
  2356. /* use */ nullptr,
  2357. /* drop */ Drop_Ammo,
  2358. /* weaponthink */ nullptr,
  2359. /* pickup_sound */ "misc/am_pkup.wav",
  2360. /* world_model */ "models/ammo/am_disr/tris.md2",
  2361. /* world_model_flags */ EF_NONE,
  2362. /* view_model */ nullptr,
  2363. /* icon */ "a_disruptor",
  2364. /* use_name */ "Rounds",
  2365. /* pickup_name */ "$item_rounds",
  2366. /* pickup_name_definite */ "$item_rounds_def",
  2367. /* quantity */ 3,
  2368. /* ammo */ IT_NULL,
  2369. /* chain */ IT_NULL,
  2370. /* flags */ IF_AMMO,
  2371. /* vwep_model */ nullptr,
  2372. /* armor_info */ nullptr,
  2373. /* tag */ AMMO_DISRUPTOR
  2374. },
  2375. // ROGUE AMMO
  2376. // =======================================
  2377. //
  2378. // POWERUP ITEMS
  2379. //
  2380. /*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16)
  2381. */
  2382. {
  2383. /* id */ IT_ITEM_QUAD,
  2384. /* classname */ "item_quad",
  2385. /* pickup */ Pickup_Powerup,
  2386. /* use */ Use_Quad,
  2387. /* drop */ Drop_General,
  2388. /* weaponthink */ nullptr,
  2389. /* pickup_sound */ "items/pkup.wav",
  2390. /* world_model */ "models/items/quaddama/tris.md2",
  2391. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2392. /* view_model */ nullptr,
  2393. /* icon */ "p_quad",
  2394. /* use_name */ "Quad Damage",
  2395. /* pickup_name */ "$item_quad_damage",
  2396. /* pickup_name_definite */ "$item_quad_damage_def",
  2397. /* quantity */ 60,
  2398. /* ammo */ IT_NULL,
  2399. /* chain */ IT_NULL,
  2400. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2401. /* vwep_model */ nullptr,
  2402. /* armor_info */ nullptr,
  2403. /* tag */ POWERUP_QUAD,
  2404. /* precaches */ "items/damage.wav items/damage2.wav items/damage3.wav ctf/tech2x.wav"
  2405. },
  2406. // RAFAEL
  2407. /*QUAKED item_quadfire (.3 .3 1) (-16 -16 -16) (16 16 16)
  2408. */
  2409. {
  2410. /* id */ IT_ITEM_QUADFIRE,
  2411. /* classname */ "item_quadfire",
  2412. /* pickup */ Pickup_Powerup,
  2413. /* use */ Use_QuadFire,
  2414. /* drop */ Drop_General,
  2415. /* weaponthink */ nullptr,
  2416. /* pickup_sound */ "items/pkup.wav",
  2417. /* world_model */ "models/items/quadfire/tris.md2",
  2418. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2419. /* view_model */ nullptr,
  2420. /* icon */ "p_quadfire",
  2421. /* use_name */ "DualFire Damage",
  2422. /* pickup_name */ "$item_dualfire_damage",
  2423. /* pickup_name_definite */ "$item_dualfire_damage_def",
  2424. /* quantity */ 60,
  2425. /* ammo */ IT_NULL,
  2426. /* chain */ IT_NULL,
  2427. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2428. /* vwep_model */ nullptr,
  2429. /* armor_info */ nullptr,
  2430. /* tag */ POWERUP_QUADFIRE,
  2431. /* precaches */ "items/quadfire1.wav items/quadfire2.wav items/quadfire3.wav"
  2432. },
  2433. // RAFAEL
  2434. /*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16)
  2435. */
  2436. {
  2437. /* id */ IT_ITEM_INVULNERABILITY,
  2438. /* classname */ "item_invulnerability",
  2439. /* pickup */ Pickup_Powerup,
  2440. /* use */ Use_Invulnerability,
  2441. /* drop */ Drop_General,
  2442. /* weaponthink */ nullptr,
  2443. /* pickup_sound */ "items/pkup.wav",
  2444. /* world_model */ "models/items/invulner/tris.md2",
  2445. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2446. /* view_model */ nullptr,
  2447. /* icon */ "p_invulnerability",
  2448. /* use_name */ "Invulnerability",
  2449. /* pickup_name */ "$item_invulnerability",
  2450. /* pickup_name_definite */ "$item_invulnerability_def",
  2451. /* quantity */ 300,
  2452. /* ammo */ IT_NULL,
  2453. /* chain */ IT_NULL,
  2454. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2455. /* vwep_model */ nullptr,
  2456. /* armor_info */ nullptr,
  2457. /* tag */ POWERUP_INVULNERABILITY,
  2458. /* precaches */ "items/protect.wav items/protect2.wav items/protect4.wav"
  2459. },
  2460. /*QUAKED item_invisibility (.3 .3 1) (-16 -16 -16) (16 16 16)
  2461. */
  2462. {
  2463. /* id */ IT_ITEM_INVISIBILITY,
  2464. /* classname */ "item_invisibility",
  2465. /* pickup */ Pickup_Powerup,
  2466. /* use */ Use_Invisibility,
  2467. /* drop */ Drop_General,
  2468. /* weaponthink */ nullptr,
  2469. /* pickup_sound */ "items/pkup.wav",
  2470. /* world_model */ "models/items/cloaker/tris.md2",
  2471. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2472. /* view_model */ nullptr,
  2473. /* icon */ "p_cloaker",
  2474. /* use_name */ "Invisibility",
  2475. /* pickup_name */ "$item_invisibility",
  2476. /* pickup_name_definite */ "$item_invisibility_def",
  2477. /* quantity */ 300,
  2478. /* ammo */ IT_NULL,
  2479. /* chain */ IT_NULL,
  2480. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2481. /* vwep_model */ nullptr,
  2482. /* armor_info */ nullptr,
  2483. /* tag */ POWERUP_INVISIBILITY,
  2484. },
  2485. /*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16)
  2486. model="models/items/silencer/tris.md2"
  2487. */
  2488. {
  2489. /* id */ IT_ITEM_SILENCER,
  2490. /* classname */ "item_silencer",
  2491. /* pickup */ Pickup_Powerup,
  2492. /* use */ Use_Silencer,
  2493. /* drop */ Drop_General,
  2494. /* weaponthink */ nullptr,
  2495. /* pickup_sound */ "items/pkup.wav",
  2496. /* world_model */ "models/items/silencer/tris.md2",
  2497. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2498. /* view_model */ nullptr,
  2499. /* icon */ "p_silencer",
  2500. /* use_name */ "Silencer",
  2501. /* pickup_name */ "$item_silencer",
  2502. /* pickup_name_definite */ "$item_silencer_def",
  2503. /* quantity */ 60,
  2504. /* ammo */ IT_NULL,
  2505. /* chain */ IT_NULL,
  2506. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2507. /* vwep_model */ nullptr,
  2508. /* armor_info */ nullptr,
  2509. /* tag */ POWERUP_SILENCER,
  2510. },
  2511. /*QUAKED item_breather (.3 .3 1) (-16 -16 -16) (16 16 16)
  2512. */
  2513. {
  2514. /* id */ IT_ITEM_REBREATHER,
  2515. /* classname */ "item_breather",
  2516. /* pickup */ Pickup_Powerup,
  2517. /* use */ Use_Breather,
  2518. /* drop */ Drop_General,
  2519. /* weaponthink */ nullptr,
  2520. /* pickup_sound */ "items/pkup.wav",
  2521. /* world_model */ "models/items/breather/tris.md2",
  2522. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2523. /* view_model */ nullptr,
  2524. /* icon */ "p_rebreather",
  2525. /* use_name */ "Rebreather",
  2526. /* pickup_name */ "$item_rebreather",
  2527. /* pickup_name_definite */ "$item_rebreather_def",
  2528. /* quantity */ 60,
  2529. /* ammo */ IT_NULL,
  2530. /* chain */ IT_NULL,
  2531. /* flags */ IF_STAY_COOP|IF_POWERUP | IF_POWERUP_WHEEL,
  2532. /* vwep_model */ nullptr,
  2533. /* armor_info */ nullptr,
  2534. /* tag */ POWERUP_REBREATHER,
  2535. /* precaches */ "items/airout.wav"
  2536. },
  2537. /*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16)
  2538. */
  2539. {
  2540. /* id */ IT_ITEM_ENVIROSUIT,
  2541. /* classname */ "item_enviro",
  2542. /* pickup */ Pickup_Powerup,
  2543. /* use */ Use_Envirosuit,
  2544. /* drop */ Drop_General,
  2545. /* weaponthink */ nullptr,
  2546. /* pickup_sound */ "items/pkup.wav",
  2547. /* world_model */ "models/items/enviro/tris.md2",
  2548. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2549. /* view_model */ nullptr,
  2550. /* icon */ "p_envirosuit",
  2551. /* use_name */ "Environment Suit",
  2552. /* pickup_name */ "$item_environment_suit",
  2553. /* pickup_name_definite */ "$item_environment_suit_def",
  2554. /* quantity */ 60,
  2555. /* ammo */ IT_NULL,
  2556. /* chain */ IT_NULL,
  2557. /* flags */ IF_STAY_COOP|IF_POWERUP | IF_POWERUP_WHEEL,
  2558. /* vwep_model */ nullptr,
  2559. /* armor_info */ nullptr,
  2560. /* tag */ POWERUP_ENVIROSUIT,
  2561. /* precaches */ "items/airout.wav"
  2562. },
  2563. /*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16)
  2564. Special item that gives +2 to maximum health
  2565. model="models/items/c_head/tris.md2"
  2566. */
  2567. {
  2568. /* id */ IT_ITEM_ANCIENT_HEAD,
  2569. /* classname */ "item_ancient_head",
  2570. /* pickup */ Pickup_LegacyHead,
  2571. /* use */ nullptr,
  2572. /* drop */ nullptr,
  2573. /* weaponthink */ nullptr,
  2574. /* pickup_sound */ "items/pkup.wav",
  2575. /* world_model */ "models/items/c_head/tris.md2",
  2576. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2577. /* view_model */ nullptr,
  2578. /* icon */ "i_fixme",
  2579. /* use_name */ "Ancient Head",
  2580. /* pickup_name */ "$item_ancient_head",
  2581. /* pickup_name_definite */ "$item_ancient_head_def",
  2582. /* quantity */ 60,
  2583. /* ammo */ IT_NULL,
  2584. /* chain */ IT_NULL,
  2585. /* flags */ IF_HEALTH | IF_NOT_RANDOM,
  2586. },
  2587. /*QUAKED item_legacy_head (.3 .3 1) (-16 -16 -16) (16 16 16)
  2588. Special item that gives +5 to maximum health
  2589. model="models/items/legacyhead/tris.md2"
  2590. */
  2591. {
  2592. /* id */ IT_ITEM_LEGACY_HEAD,
  2593. /* classname */ "item_legacy_head",
  2594. /* pickup */ Pickup_LegacyHead,
  2595. /* use */ nullptr,
  2596. /* drop */ nullptr,
  2597. /* weaponthink */ nullptr,
  2598. /* pickup_sound */ "items/pkup.wav",
  2599. /* world_model */ "models/items/legacyhead/tris.md2",
  2600. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2601. /* view_model */ nullptr,
  2602. /* icon */ "i_fixme",
  2603. /* use_name */ "Legacy Head",
  2604. /* pickup_name */ "$item_legacy_head",
  2605. /* pickup_name_definite */ "$item_legacy_head_def",
  2606. /* quantity */ 60,
  2607. /* ammo */ IT_NULL,
  2608. /* chain */ IT_NULL,
  2609. /* flags */ IF_HEALTH | IF_NOT_RANDOM,
  2610. },
  2611. /*QUAKED item_adrenaline (.3 .3 1) (-16 -16 -16) (16 16 16)
  2612. gives +1 to maximum health
  2613. */
  2614. {
  2615. /* id */ IT_ITEM_ADRENALINE,
  2616. /* classname */ "item_adrenaline",
  2617. /* pickup */ Pickup_Powerup,
  2618. /* use */ Use_Adrenaline,
  2619. /* drop */ Drop_General,
  2620. /* weaponthink */ nullptr,
  2621. /* pickup_sound */ "items/pkup.wav",
  2622. /* world_model */ "models/items/adrenal/tris.md2",
  2623. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2624. /* view_model */ nullptr,
  2625. /* icon */ "p_adrenaline",
  2626. /* use_name */ "Adrenaline",
  2627. /* pickup_name */ "$item_adrenaline",
  2628. /* pickup_name_definite */ "$item_adrenaline_def",
  2629. /* quantity */ 60,
  2630. /* ammo */ IT_NULL,
  2631. /* chain */ IT_NULL,
  2632. /* flags */ IF_HEALTH | IF_POWERUP_WHEEL,
  2633. /* vwep_model */ nullptr,
  2634. /* armor_info */ nullptr,
  2635. /* tag */ POWERUP_ADRENALINE,
  2636. /* precache */ "items/n_health.wav"
  2637. },
  2638. /*QUAKED item_bandolier (.3 .3 1) (-16 -16 -16) (16 16 16)
  2639. */
  2640. {
  2641. /* id */ IT_ITEM_BANDOLIER,
  2642. /* classname */ "item_bandolier",
  2643. /* pickup */ Pickup_Bandolier,
  2644. /* use */ nullptr,
  2645. /* drop */ nullptr,
  2646. /* weaponthink */ nullptr,
  2647. /* pickup_sound */ "items/pkup.wav",
  2648. /* world_model */ "models/items/band/tris.md2",
  2649. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2650. /* view_model */ nullptr,
  2651. /* icon */ "p_bandolier",
  2652. /* use_name */ "Bandolier",
  2653. /* pickup_name */ "$item_bandolier",
  2654. /* pickup_name_definite */ "$item_bandolier_def",
  2655. /* quantity */ 60,
  2656. /* ammo */ IT_NULL,
  2657. /* chain */ IT_NULL,
  2658. /* flags */ IF_POWERUP
  2659. },
  2660. /*QUAKED item_pack (.3 .3 1) (-16 -16 -16) (16 16 16)
  2661. */
  2662. {
  2663. /* id */ IT_ITEM_PACK,
  2664. /* classname */ "item_pack",
  2665. /* pickup */ Pickup_Pack,
  2666. /* use */ nullptr,
  2667. /* drop */ nullptr,
  2668. /* weaponthink */ nullptr,
  2669. /* pickup_sound */ "items/pkup.wav",
  2670. /* world_model */ "models/items/pack/tris.md2",
  2671. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2672. /* view_model */ nullptr,
  2673. /* icon */ "i_pack",
  2674. /* use_name */ "Ammo Pack",
  2675. /* pickup_name */ "$item_ammo_pack",
  2676. /* pickup_name_definite */ "$item_ammo_pack_def",
  2677. /* quantity */ 180,
  2678. /* ammo */ IT_NULL,
  2679. /* chain */ IT_NULL,
  2680. /* flags */ IF_POWERUP
  2681. },
  2682. // ======================================
  2683. // PGM
  2684. /*QUAKED item_ir_goggles (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2685. gives +1 to maximum health
  2686. */
  2687. {
  2688. /* id */ IT_ITEM_IR_GOGGLES,
  2689. /* classname */ "item_ir_goggles",
  2690. /* pickup */ Pickup_Powerup,
  2691. /* use */ Use_IR,
  2692. /* drop */ Drop_General,
  2693. /* weaponthink */ nullptr,
  2694. /* pickup_sound */ "items/pkup.wav",
  2695. /* world_model */ "models/items/goggles/tris.md2",
  2696. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2697. /* view_model */ nullptr,
  2698. /* icon */ "p_ir",
  2699. /* use_name */ "IR Goggles",
  2700. /* pickup_name */ "$item_ir_goggles",
  2701. /* pickup_name_definite */ "$item_ir_goggles_def",
  2702. /* quantity */ 60,
  2703. /* ammo */ IT_NULL,
  2704. /* chain */ IT_NULL,
  2705. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2706. /* vwep_model */ nullptr,
  2707. /* armor_info */ nullptr,
  2708. /* tag */ POWERUP_IR_GOGGLES,
  2709. /* precaches */ "misc/ir_start.wav"
  2710. },
  2711. /*QUAKED item_double (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2712. */
  2713. {
  2714. /* id */ IT_ITEM_DOUBLE,
  2715. /* classname */ "item_double",
  2716. /* pickup */ Pickup_Powerup,
  2717. /* use */ Use_Double,
  2718. /* drop */ Drop_General,
  2719. /* weaponthink */ nullptr,
  2720. /* pickup_sound */ "items/pkup.wav",
  2721. /* world_model */ "models/items/ddamage/tris.md2",
  2722. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2723. /* view_model */ nullptr,
  2724. /* icon */ "p_double",
  2725. /* use_name */ "Double Damage",
  2726. /* pickup_name */ "$item_double_damage",
  2727. /* pickup_name_definite */ "$item_double_damage_def",
  2728. /* quantity */ 60,
  2729. /* ammo */ IT_NULL,
  2730. /* chain */ IT_NULL,
  2731. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2732. /* vwep_model */ nullptr,
  2733. /* armor_info */ nullptr,
  2734. /* tag */ POWERUP_DOUBLE,
  2735. /* precaches */ "misc/ddamage1.wav misc/ddamage2.wav misc/ddamage3.wav ctf/tech2x.wav"
  2736. },
  2737. /*QUAKED item_sphere_vengeance (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2738. */
  2739. {
  2740. /* id */ IT_ITEM_SPHERE_VENGEANCE,
  2741. /* classname */ "item_sphere_vengeance",
  2742. /* pickup */ Pickup_Sphere,
  2743. /* use */ Use_Vengeance,
  2744. /* drop */ nullptr,
  2745. /* weaponthink */ nullptr,
  2746. /* pickup_sound */ "items/pkup.wav",
  2747. /* world_model */ "models/items/vengnce/tris.md2",
  2748. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2749. /* view_model */ nullptr,
  2750. /* icon */ "p_vengeance",
  2751. /* use_name */ "vengeance sphere",
  2752. /* pickup_name */ "$item_vengeance_sphere",
  2753. /* pickup_name_definite */ "$item_vengeance_sphere_def",
  2754. /* quantity */ 60,
  2755. /* ammo */ IT_NULL,
  2756. /* chain */ IT_NULL,
  2757. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2758. /* vwep_model */ nullptr,
  2759. /* armor_info */ nullptr,
  2760. /* tag */ POWERUP_SPHERE_VENGEANCE,
  2761. /* precaches */ "spheres/v_idle.wav"
  2762. },
  2763. /*QUAKED item_sphere_hunter (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2764. */
  2765. {
  2766. /* id */ IT_ITEM_SPHERE_HUNTER,
  2767. /* classname */ "item_sphere_hunter",
  2768. /* pickup */ Pickup_Sphere,
  2769. /* use */ Use_Hunter,
  2770. /* drop */ nullptr,
  2771. /* weaponthink */ nullptr,
  2772. /* pickup_sound */ "items/pkup.wav",
  2773. /* world_model */ "models/items/hunter/tris.md2",
  2774. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2775. /* view_model */ nullptr,
  2776. /* icon */ "p_hunter",
  2777. /* use_name */ "hunter sphere",
  2778. /* pickup_name */ "$item_hunter_sphere",
  2779. /* pickup_name_definite */ "$item_hunter_sphere_def",
  2780. /* quantity */ 120,
  2781. /* ammo */ IT_NULL,
  2782. /* chain */ IT_NULL,
  2783. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2784. /* vwep_model */ nullptr,
  2785. /* armor_info */ nullptr,
  2786. /* tag */ POWERUP_SPHERE_HUNTER,
  2787. /* precaches */ "spheres/h_idle.wav spheres/h_active.wav spheres/h_lurk.wav"
  2788. },
  2789. /*QUAKED item_sphere_defender (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2790. */
  2791. {
  2792. /* id */ IT_ITEM_SPHERE_DEFENDER,
  2793. /* classname */ "item_sphere_defender",
  2794. /* pickup */ Pickup_Sphere,
  2795. /* use */ Use_Defender,
  2796. /* drop */ nullptr,
  2797. /* weaponthink */ nullptr,
  2798. /* pickup_sound */ "items/pkup.wav",
  2799. /* world_model */ "models/items/defender/tris.md2",
  2800. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2801. /* view_model */ nullptr,
  2802. /* icon */ "p_defender",
  2803. /* use_name */ "defender sphere",
  2804. /* pickup_name */ "$item_defender_sphere",
  2805. /* pickup_name_definite */ "$item_defender_sphere_def",
  2806. /* quantity */ 60,
  2807. /* ammo */ IT_NULL,
  2808. /* chain */ IT_NULL,
  2809. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2810. /* vwep_model */ nullptr,
  2811. /* armor_info */ nullptr,
  2812. /* tag */ POWERUP_SPHERE_DEFENDER,
  2813. /* precaches */ "models/objects/laser/tris.md2 models/items/shell/tris.md2 spheres/d_idle.wav"
  2814. },
  2815. /*QUAKED item_doppleganger (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  2816. */
  2817. {
  2818. /* id */ IT_ITEM_DOPPELGANGER,
  2819. /* classname */ "item_doppleganger",
  2820. /* pickup */ Pickup_Doppleganger,
  2821. /* use */ Use_Doppleganger,
  2822. /* drop */ Drop_General,
  2823. /* weaponthink */ nullptr,
  2824. /* pickup_sound */ "items/pkup.wav",
  2825. /* world_model */ "models/items/dopple/tris.md2",
  2826. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2827. /* view_model */ nullptr,
  2828. /* icon */ "p_doppleganger",
  2829. /* use_name */ "Doppelganger",
  2830. /* pickup_name */ "$item_doppleganger",
  2831. /* pickup_name_definite */ "$item_doppleganger_def",
  2832. /* quantity */ 90,
  2833. /* ammo */ IT_NULL,
  2834. /* chain */ IT_NULL,
  2835. /* flags */ IF_POWERUP | IF_POWERUP_WHEEL,
  2836. /* vwep_model */ nullptr,
  2837. /* armor_info */ nullptr,
  2838. /* tag */ POWERUP_DOPPELGANGER,
  2839. /* precaches */ "models/objects/dopplebase/tris.md2 models/items/spawngro3/tris.md2 medic_commander/monsterspawn1.wav models/items/hunter/tris.md2 models/items/vengnce/tris.md2",
  2840. },
  2841. {
  2842. /* id */ IT_ITEM_TAG_TOKEN,
  2843. /* classname */ nullptr,
  2844. /* pickup */ Tag_PickupToken,
  2845. /* use */ nullptr,
  2846. /* drop */ nullptr,
  2847. /* weaponthink */ nullptr,
  2848. /* pickup_sound */ "items/pkup.wav",
  2849. /* world_model */ "models/items/tagtoken/tris.md2",
  2850. /* world_model_flags */ EF_ROTATE | EF_BOB | EF_TAGTRAIL,
  2851. /* view_model */ nullptr,
  2852. /* icon */ "i_tagtoken",
  2853. /* use_name */ "Tag Token",
  2854. /* pickup_name */ "$item_tag_token",
  2855. /* pickup_name_definite */ "$item_tag_token_def",
  2856. /* quantity */ 0,
  2857. /* ammo */ IT_NULL,
  2858. /* chain */ IT_NULL,
  2859. /* flags */ IF_POWERUP | IF_NOT_GIVEABLE
  2860. },
  2861. // PGM
  2862. // ======================================
  2863. //
  2864. // KEYS
  2865. //
  2866. /*QUAKED key_data_cd (0 .5 .8) (-16 -16 -16) (16 16 16)
  2867. key for computer centers
  2868. */
  2869. {
  2870. /* id */ IT_KEY_DATA_CD,
  2871. /* classname */ "key_data_cd",
  2872. /* pickup */ Pickup_Key,
  2873. /* use */ nullptr,
  2874. /* drop */ Drop_General,
  2875. /* weaponthink */ nullptr,
  2876. /* pickup_sound */ "items/pkup.wav",
  2877. /* world_model */ "models/items/keys/data_cd/tris.md2",
  2878. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2879. /* view_model */ nullptr,
  2880. /* icon */ "k_datacd",
  2881. /* use_name */ "Data CD",
  2882. /* pickup_name */ "$item_data_cd",
  2883. /* pickup_name_definite */ "$item_data_cd_def",
  2884. /* quantity */ 0,
  2885. /* ammo */ IT_NULL,
  2886. /* chain */ IT_NULL,
  2887. /* flags */ IF_STAY_COOP|IF_KEY
  2888. },
  2889. /*QUAKED key_power_cube (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH
  2890. warehouse circuits
  2891. */
  2892. {
  2893. /* id */ IT_KEY_POWER_CUBE,
  2894. /* classname */ "key_power_cube",
  2895. /* pickup */ Pickup_Key,
  2896. /* use */ nullptr,
  2897. /* drop */ Drop_General,
  2898. /* weaponthink */ nullptr,
  2899. /* pickup_sound */ "items/pkup.wav",
  2900. /* world_model */ "models/items/keys/power/tris.md2",
  2901. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2902. /* view_model */ nullptr,
  2903. /* icon */ "k_powercube",
  2904. /* use_name */ "Power Cube",
  2905. /* pickup_name */ "$item_power_cube",
  2906. /* pickup_name_definite */ "$item_power_cube_def",
  2907. /* quantity */ 0,
  2908. /* ammo */ IT_NULL,
  2909. /* chain */ IT_NULL,
  2910. /* flags */ IF_STAY_COOP|IF_KEY
  2911. },
  2912. /*QUAKED key_explosive_charges (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH
  2913. warehouse circuits
  2914. */
  2915. {
  2916. /* id */ IT_KEY_EXPLOSIVE_CHARGES,
  2917. /* classname */ "key_explosive_charges",
  2918. /* pickup */ Pickup_Key,
  2919. /* use */ nullptr,
  2920. /* drop */ Drop_General,
  2921. /* weaponthink */ nullptr,
  2922. /* pickup_sound */ "items/pkup.wav",
  2923. /* world_model */ "models/items/n64/charge/tris.md2",
  2924. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2925. /* view_model */ nullptr,
  2926. /* icon */ "n64/i_charges",
  2927. /* use_name */ "Explosive Charges",
  2928. /* pickup_name */ "$item_explosive_charges",
  2929. /* pickup_name_definite */ "$item_explosive_charges_def",
  2930. /* quantity */ 0,
  2931. /* ammo */ IT_NULL,
  2932. /* chain */ IT_NULL,
  2933. /* flags */ IF_STAY_COOP|IF_KEY
  2934. },
  2935. /*QUAKED key_yellow_key (0 .5 .8) (-16 -16 -16) (16 16 16)
  2936. normal door key - yellow
  2937. [Sam-KEX] New key type for Q2 N64
  2938. */
  2939. {
  2940. /* id */ IT_KEY_YELLOW,
  2941. /* classname */ "key_yellow_key",
  2942. /* pickup */ Pickup_Key,
  2943. /* use */ nullptr,
  2944. /* drop */ Drop_General,
  2945. /* weaponthink */ nullptr,
  2946. /* pickup_sound */ "items/pkup.wav",
  2947. /* world_model */ "models/items/n64/yellow_key/tris.md2",
  2948. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2949. /* view_model */ nullptr,
  2950. /* icon */ "n64/i_yellow_key",
  2951. /* use_name */ "Yellow Key",
  2952. /* pickup_name */ "$item_yellow_key",
  2953. /* pickup_name_definite */ "$item_yellow_key_def",
  2954. /* quantity */ 0,
  2955. /* ammo */ IT_NULL,
  2956. /* chain */ IT_NULL,
  2957. /* flags */ IF_STAY_COOP | IF_KEY
  2958. },
  2959. /*QUAKED key_power_core (0 .5 .8) (-16 -16 -16) (16 16 16)
  2960. key for N64
  2961. */
  2962. {
  2963. /* id */ IT_KEY_POWER_CORE,
  2964. /* classname */ "key_power_core",
  2965. /* pickup */ Pickup_Key,
  2966. /* use */ nullptr,
  2967. /* drop */ Drop_General,
  2968. /* weaponthink */ nullptr,
  2969. /* pickup_sound */ "items/pkup.wav",
  2970. /* world_model */ "models/items/n64/power_core/tris.md2",
  2971. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2972. /* view_model */ nullptr,
  2973. /* icon */ "k_pyramid",
  2974. /* use_name */ "Power Core",
  2975. /* pickup_name */ "$item_power_core",
  2976. /* pickup_name_definite */ "$item_power_core_def",
  2977. /* quantity */ 0,
  2978. /* ammo */ IT_NULL,
  2979. /* chain */ IT_NULL,
  2980. /* flags */ IF_STAY_COOP|IF_KEY
  2981. },
  2982. /*QUAKED key_pyramid (0 .5 .8) (-16 -16 -16) (16 16 16)
  2983. key for the entrance of jail3
  2984. */
  2985. {
  2986. /* id */ IT_KEY_PYRAMID,
  2987. /* classname */ "key_pyramid",
  2988. /* pickup */ Pickup_Key,
  2989. /* use */ nullptr,
  2990. /* drop */ Drop_General,
  2991. /* weaponthink */ nullptr,
  2992. /* pickup_sound */ "items/pkup.wav",
  2993. /* world_model */ "models/items/keys/pyramid/tris.md2",
  2994. /* world_model_flags */ EF_ROTATE | EF_BOB,
  2995. /* view_model */ nullptr,
  2996. /* icon */ "k_pyramid",
  2997. /* use_name */ "Pyramid Key",
  2998. /* pickup_name */ "$item_pyramid_key",
  2999. /* pickup_name_definite */ "$item_pyramid_key_def",
  3000. /* quantity */ 0,
  3001. /* ammo */ IT_NULL,
  3002. /* chain */ IT_NULL,
  3003. /* flags */ IF_STAY_COOP|IF_KEY
  3004. },
  3005. /*QUAKED key_data_spinner (0 .5 .8) (-16 -16 -16) (16 16 16)
  3006. key for the city computer
  3007. model="models/items/keys/spinner/tris.md2"
  3008. */
  3009. {
  3010. /* id */ IT_KEY_DATA_SPINNER,
  3011. /* classname */ "key_data_spinner",
  3012. /* pickup */ Pickup_Key,
  3013. /* use */ nullptr,
  3014. /* drop */ Drop_General,
  3015. /* weaponthink */ nullptr,
  3016. /* pickup_sound */ "items/pkup.wav",
  3017. /* world_model */ "models/items/keys/spinner/tris.md2",
  3018. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3019. /* view_model */ nullptr,
  3020. /* icon */ "k_dataspin",
  3021. /* use_name */ "Data Spinner",
  3022. /* pickup_name */ "$item_data_spinner",
  3023. /* pickup_name_definite */ "$item_data_spinner_def",
  3024. /* quantity */ 0,
  3025. /* ammo */ IT_NULL,
  3026. /* chain */ IT_NULL,
  3027. /* flags */ IF_STAY_COOP|IF_KEY
  3028. },
  3029. /*QUAKED key_pass (0 .5 .8) (-16 -16 -16) (16 16 16)
  3030. security pass for the security level
  3031. model="models/items/keys/pass/tris.md2"
  3032. */
  3033. {
  3034. /* id */ IT_KEY_PASS,
  3035. /* classname */ "key_pass",
  3036. /* pickup */ Pickup_Key,
  3037. /* use */ nullptr,
  3038. /* drop */ Drop_General,
  3039. /* weaponthink */ nullptr,
  3040. /* pickup_sound */ "items/pkup.wav",
  3041. /* world_model */ "models/items/keys/pass/tris.md2",
  3042. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3043. /* view_model */ nullptr,
  3044. /* icon */ "k_security",
  3045. /* use_name */ "Security Pass",
  3046. /* pickup_name */ "$item_security_pass",
  3047. /* pickup_name_definite */ "$item_security_pass_def",
  3048. /* quantity */ 0,
  3049. /* ammo */ IT_NULL,
  3050. /* chain */ IT_NULL,
  3051. /* flags */ IF_STAY_COOP|IF_KEY
  3052. },
  3053. /*QUAKED key_blue_key (0 .5 .8) (-16 -16 -16) (16 16 16)
  3054. normal door key - blue
  3055. */
  3056. {
  3057. /* id */ IT_KEY_BLUE_KEY,
  3058. /* classname */ "key_blue_key",
  3059. /* pickup */ Pickup_Key,
  3060. /* use */ nullptr,
  3061. /* drop */ Drop_General,
  3062. /* weaponthink */ nullptr,
  3063. /* pickup_sound */ "items/pkup.wav",
  3064. /* world_model */ "models/items/keys/key/tris.md2",
  3065. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3066. /* view_model */ nullptr,
  3067. /* icon */ "k_bluekey",
  3068. /* use_name */ "Blue Key",
  3069. /* pickup_name */ "$item_blue_key",
  3070. /* pickup_name_definite */ "$item_blue_key_def",
  3071. /* quantity */ 0,
  3072. /* ammo */ IT_NULL,
  3073. /* chain */ IT_NULL,
  3074. /* flags */ IF_STAY_COOP|IF_KEY
  3075. },
  3076. /*QUAKED key_red_key (0 .5 .8) (-16 -16 -16) (16 16 16)
  3077. normal door key - red
  3078. */
  3079. {
  3080. /* id */ IT_KEY_RED_KEY,
  3081. /* classname */ "key_red_key",
  3082. /* pickup */ Pickup_Key,
  3083. /* use */ nullptr,
  3084. /* drop */ Drop_General,
  3085. /* weaponthink */ nullptr,
  3086. /* pickup_sound */ "items/pkup.wav",
  3087. /* world_model */ "models/items/keys/red_key/tris.md2",
  3088. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3089. /* view_model */ nullptr,
  3090. /* icon */ "k_redkey",
  3091. /* use_name */ "Red Key",
  3092. /* pickup_name */ "$item_red_key",
  3093. /* pickup_name_definite */ "$item_red_key_def",
  3094. /* quantity */ 0,
  3095. /* ammo */ IT_NULL,
  3096. /* chain */ IT_NULL,
  3097. /* flags */ IF_STAY_COOP|IF_KEY
  3098. },
  3099. // RAFAEL
  3100. /*QUAKED key_green_key (0 .5 .8) (-16 -16 -16) (16 16 16)
  3101. normal door key - blue
  3102. */
  3103. {
  3104. /* id */ IT_KEY_GREEN_KEY,
  3105. /* classname */ "key_green_key",
  3106. /* pickup */ Pickup_Key,
  3107. /* use */ nullptr,
  3108. /* drop */ Drop_General,
  3109. /* weaponthink */ nullptr,
  3110. /* pickup_sound */ "items/pkup.wav",
  3111. /* world_model */ "models/items/keys/green_key/tris.md2",
  3112. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3113. /* view_model */ nullptr,
  3114. /* icon */ "k_green",
  3115. /* use_name */ "Green Key",
  3116. /* pickup_name */ "$item_green_key",
  3117. /* pickup_name_definite */ "$item_green_key_def",
  3118. /* quantity */ 0,
  3119. /* ammo */ IT_NULL,
  3120. /* chain */ IT_NULL,
  3121. /* flags */ IF_STAY_COOP|IF_KEY
  3122. },
  3123. // RAFAEL
  3124. /*QUAKED key_commander_head (0 .5 .8) (-16 -16 -16) (16 16 16)
  3125. tank commander's head
  3126. */
  3127. {
  3128. /* id */ IT_KEY_COMMANDER_HEAD,
  3129. /* classname */ "key_commander_head",
  3130. /* pickup */ Pickup_Key,
  3131. /* use */ nullptr,
  3132. /* drop */ Drop_General,
  3133. /* weaponthink */ nullptr,
  3134. /* pickup_sound */ "items/pkup.wav",
  3135. /* world_model */ "models/monsters/commandr/head/tris.md2",
  3136. /* world_model_flags */ EF_GIB,
  3137. /* view_model */ nullptr,
  3138. /* icon */ "k_comhead",
  3139. /* use_name */ "Commander's Head",
  3140. /* pickup_name */ "$item_commanders_head",
  3141. /* pickup_name_definite */ "$item_commanders_head_def",
  3142. /* quantity */ 0,
  3143. /* ammo */ IT_NULL,
  3144. /* chain */ IT_NULL,
  3145. /* flags */ IF_STAY_COOP|IF_KEY
  3146. },
  3147. /*QUAKED key_airstrike_target (0 .5 .8) (-16 -16 -16) (16 16 16)
  3148. */
  3149. {
  3150. /* id */ IT_KEY_AIRSTRIKE,
  3151. /* classname */ "key_airstrike_target",
  3152. /* pickup */ Pickup_Key,
  3153. /* use */ nullptr,
  3154. /* drop */ Drop_General,
  3155. /* weaponthink */ nullptr,
  3156. /* pickup_sound */ "items/pkup.wav",
  3157. /* world_model */ "models/items/keys/target/tris.md2",
  3158. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3159. /* view_model */ nullptr,
  3160. /* icon */ "i_airstrike",
  3161. /* use_name */ "Airstrike Marker",
  3162. /* pickup_name */ "$item_airstrike_marker",
  3163. /* pickup_name_definite */ "$item_airstrike_marker_def",
  3164. /* quantity */ 0,
  3165. /* ammo */ IT_NULL,
  3166. /* chain */ IT_NULL,
  3167. /* flags */ IF_STAY_COOP|IF_KEY
  3168. },
  3169. // ======================================
  3170. // PGM
  3171. /*QUAKED key_nuke_container (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  3172. */
  3173. {
  3174. /* id */ IT_KEY_NUKE_CONTAINER,
  3175. /* classname */ "key_nuke_container",
  3176. /* pickup */ Pickup_Key,
  3177. /* use */ nullptr,
  3178. /* drop */ Drop_General,
  3179. /* weaponthink */ nullptr,
  3180. /* pickup_sound */ "items/pkup.wav",
  3181. /* world_model */ "models/weapons/g_nuke/tris.md2",
  3182. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3183. /* view_model */ nullptr,
  3184. /* icon */ "i_contain",
  3185. /* use_name */ "Antimatter Pod",
  3186. /* pickup_name */ "$item_antimatter_pod",
  3187. /* pickup_name_definite */ "$item_antimatter_pod_def",
  3188. /* quantity */ 0,
  3189. /* ammo */ IT_NULL,
  3190. /* chain */ IT_NULL,
  3191. /* flags */ IF_STAY_COOP|IF_KEY,
  3192. },
  3193. /*QUAKED key_nuke (.3 .3 1) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN
  3194. */
  3195. {
  3196. /* id */ IT_KEY_NUKE,
  3197. /* classname */ "key_nuke",
  3198. /* pickup */ Pickup_Key,
  3199. /* use */ nullptr,
  3200. /* drop */ Drop_General,
  3201. /* weaponthink */ nullptr,
  3202. /* pickup_sound */ "items/pkup.wav",
  3203. /* world_model */ "models/weapons/g_nuke/tris.md2",
  3204. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3205. /* view_model */ nullptr,
  3206. /* icon */ "i_nuke",
  3207. /* use_name */ "Antimatter Bomb",
  3208. /* pickup_name */ "$item_antimatter_bomb",
  3209. /* pickup_name_definite */ "$item_antimatter_bomb_def",
  3210. /* quantity */ 0,
  3211. /* ammo */ IT_NULL,
  3212. /* chain */ IT_NULL,
  3213. /* flags */ IF_STAY_COOP|IF_KEY,
  3214. },
  3215. // PGM
  3216. //
  3217. // PGM
  3218. // ======================================
  3219. /*QUAKED item_health_small (.3 .3 1) (-16 -16 -16) (16 16 16)
  3220. model="models/items/healing/stimpack/tris.md2"
  3221. */
  3222. // Paril: split the healths up so they are always valid classnames
  3223. {
  3224. /* id */ IT_HEALTH_SMALL,
  3225. /* classname */ "item_health_small",
  3226. /* pickup */ Pickup_Health,
  3227. /* use */ nullptr,
  3228. /* drop */ nullptr,
  3229. /* weaponthink */ nullptr,
  3230. /* pickup_sound */ "items/s_health.wav",
  3231. /* world_model */ "models/items/healing/stimpack/tris.md2",
  3232. /* world_model_flags */ EF_NONE,
  3233. /* view_model */ nullptr,
  3234. /* icon */ "i_health",
  3235. /* use_name */ "Health",
  3236. /* pickup_name */ "$item_stimpack",
  3237. /* pickup_name_definite */ "$item_stimpack_def",
  3238. /* quantity */ 2,
  3239. /* ammo */ IT_NULL,
  3240. /* chain */ IT_NULL,
  3241. /* flags */ IF_HEALTH,
  3242. /* vwep_model */ nullptr,
  3243. /* armor_info */ nullptr,
  3244. /* tag */ HEALTH_IGNORE_MAX
  3245. },
  3246. /*QUAKED item_health (.3 .3 1) (-16 -16 -16) (16 16 16)
  3247. model="models/items/healing/medium/tris.md2"
  3248. */
  3249. {
  3250. /* id */ IT_HEALTH_MEDIUM,
  3251. /* classname */ "item_health",
  3252. /* pickup */ Pickup_Health,
  3253. /* use */ nullptr,
  3254. /* drop */ nullptr,
  3255. /* weaponthink */ nullptr,
  3256. /* pickup_sound */ "items/n_health.wav",
  3257. /* world_model */ "models/items/healing/medium/tris.md2",
  3258. /* world_model_flags */ EF_NONE,
  3259. /* view_model */ nullptr,
  3260. /* icon */ "i_health",
  3261. /* use_name */ "Health",
  3262. /* pickup_name */ "$item_small_medkit",
  3263. /* pickup_name_definite */ "$item_small_medkit_def",
  3264. /* quantity */ 10,
  3265. /* ammo */ IT_NULL,
  3266. /* chain */ IT_NULL,
  3267. /* flags */ IF_HEALTH
  3268. },
  3269. /*QUAKED item_health_large (.3 .3 1) (-16 -16 -16) (16 16 16)
  3270. model="models/items/healing/large/tris.md2"
  3271. */
  3272. {
  3273. /* id */ IT_HEALTH_LARGE,
  3274. /* classname */ "item_health_large",
  3275. /* pickup */ Pickup_Health,
  3276. /* use */ nullptr,
  3277. /* drop */ nullptr,
  3278. /* weaponthink */ nullptr,
  3279. /* pickup_sound */ "items/l_health.wav",
  3280. /* world_model */ "models/items/healing/large/tris.md2",
  3281. /* world_model_flags */ EF_NONE,
  3282. /* view_model */ nullptr,
  3283. /* icon */ "i_health",
  3284. /* use_name */ "Health",
  3285. /* pickup_name */ "$item_large_medkit",
  3286. /* pickup_name_definite */ "$item_large_medkit",
  3287. /* quantity */ 25,
  3288. /* ammo */ IT_NULL,
  3289. /* chain */ IT_NULL,
  3290. /* flags */ IF_HEALTH
  3291. },
  3292. /*QUAKED item_health_mega (.3 .3 1) (-16 -16 -16) (16 16 16)
  3293. model="models/items/mega_h/tris.md2"
  3294. */
  3295. {
  3296. /* id */ IT_HEALTH_MEGA,
  3297. /* classname */ "item_health_mega",
  3298. /* pickup */ Pickup_Health,
  3299. /* use */ nullptr,
  3300. /* drop */ nullptr,
  3301. /* weaponthink */ nullptr,
  3302. /* pickup_sound */ "items/m_health.wav",
  3303. /* world_model */ "models/items/mega_h/tris.md2",
  3304. /* world_model_flags */ EF_NONE,
  3305. /* view_model */ nullptr,
  3306. /* icon */ "p_megahealth",
  3307. /* use_name */ "Health",
  3308. /* pickup_name */ "$item_mega_health",
  3309. /* pickup_name_definite */ "$item_mega_health_def",
  3310. /* quantity */ 100,
  3311. /* ammo */ IT_NULL,
  3312. /* chain */ IT_NULL,
  3313. /* flags */ IF_HEALTH,
  3314. /* vwep_model */ nullptr,
  3315. /* armor_info */ nullptr,
  3316. /* tag */ HEALTH_IGNORE_MAX | HEALTH_TIMED
  3317. },
  3318. //ZOID
  3319. /*QUAKED item_flag_team1 (1 0.2 0) (-16 -16 -24) (16 16 32)
  3320. */
  3321. {
  3322. /* id */ IT_FLAG1,
  3323. /* classname */ "item_flag_team1",
  3324. /* pickup */ CTFPickup_Flag,
  3325. /* use */ nullptr,
  3326. /* drop */ CTFDrop_Flag, //Should this be null if we don't want players to drop it manually?
  3327. /* weaponthink */ nullptr,
  3328. /* pickup_sound */ "ctf/flagtk.wav",
  3329. /* world_model */ "players/male/flag1.md2",
  3330. /* world_model_flags */ EF_FLAG1,
  3331. /* view_model */ nullptr,
  3332. /* icon */ "i_ctf1",
  3333. /* use_name */ "Red Flag",
  3334. /* pickup_name */ "$item_red_flag",
  3335. /* pickup_name_definite */ "$item_red_flag_def",
  3336. /* quantity */ 0,
  3337. /* ammo */ IT_NULL,
  3338. /* chain */ IT_NULL,
  3339. /* flags */ IF_NONE,
  3340. /* vwep_model */ nullptr,
  3341. /* armor_info */ nullptr,
  3342. /* tag */ 0,
  3343. /* precaches */ "ctf/flagcap.wav"
  3344. },
  3345. /*QUAKED item_flag_team2 (1 0.2 0) (-16 -16 -24) (16 16 32)
  3346. */
  3347. {
  3348. /* id */ IT_FLAG2,
  3349. /* classname */ "item_flag_team2",
  3350. /* pickup */ CTFPickup_Flag,
  3351. /* use */ nullptr,
  3352. /* drop */ CTFDrop_Flag,
  3353. /* weaponthink */ nullptr,
  3354. /* pickup_sound */ "ctf/flagtk.wav",
  3355. /* world_model */ "players/male/flag2.md2",
  3356. /* world_model_flags */ EF_FLAG2,
  3357. /* view_model */ nullptr,
  3358. /* icon */ "i_ctf2",
  3359. /* use_name */ "Blue Flag",
  3360. /* pickup_name */ "$item_blue_flag",
  3361. /* pickup_name_definite */ "$item_blue_flag_def",
  3362. /* quantity */ 0,
  3363. /* ammo */ IT_NULL,
  3364. /* chain */ IT_NULL,
  3365. /* flags */ IF_NONE,
  3366. /* vwep_model */ nullptr,
  3367. /* armor_info */ nullptr,
  3368. /* tag */ 0,
  3369. /* precaches */ "ctf/flagcap.wav"
  3370. },
  3371. /* Resistance Tech */
  3372. {
  3373. /* id */ IT_TECH_RESISTANCE,
  3374. /* classname */ "item_tech1",
  3375. /* pickup */ CTFPickup_Tech,
  3376. /* use */ nullptr,
  3377. /* drop */ CTFDrop_Tech,
  3378. /* weaponthink */ nullptr,
  3379. /* pickup_sound */ "items/pkup.wav",
  3380. /* world_model */ "models/ctf/resistance/tris.md2",
  3381. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3382. /* view_model */ nullptr,
  3383. /* icon */ "tech1",
  3384. /* use_name */ "Disruptor Shield",
  3385. /* pickup_name */ "$item_disruptor_shield",
  3386. /* pickup_name_definite */ "$item_disruptor_shield_def",
  3387. /* quantity */ 0,
  3388. /* ammo */ IT_NULL,
  3389. /* chain */ IT_NULL,
  3390. /* flags */ IF_TECH | IF_POWERUP_WHEEL,
  3391. /* vwep_model */ nullptr,
  3392. /* armor_info */ nullptr,
  3393. /* tag */ POWERUP_TECH1,
  3394. /* precaches */ "ctf/tech1.wav"
  3395. },
  3396. /* Strength Tech */
  3397. {
  3398. /* id */ IT_TECH_STRENGTH,
  3399. /* classname */ "item_tech2",
  3400. /* pickup */ CTFPickup_Tech,
  3401. /* use */ nullptr,
  3402. /* drop */ CTFDrop_Tech,
  3403. /* weaponthink */ nullptr,
  3404. /* pickup_sound */ "items/pkup.wav",
  3405. /* world_model */ "models/ctf/strength/tris.md2",
  3406. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3407. /* view_model */ nullptr,
  3408. /* icon */ "tech2",
  3409. /* use_name */ "Power Amplifier",
  3410. /* pickup_name */ "$item_power_amplifier",
  3411. /* pickup_name_definite */ "$item_power_amplifier_def",
  3412. /* quantity */ 0,
  3413. /* ammo */ IT_NULL,
  3414. /* chain */ IT_NULL,
  3415. /* flags */ IF_TECH | IF_POWERUP_WHEEL,
  3416. /* vwep_model */ nullptr,
  3417. /* armor_info */ nullptr,
  3418. /* tag */ POWERUP_TECH2,
  3419. /* precaches */ "ctf/tech2.wav ctf/tech2x.wav"
  3420. },
  3421. /* Haste Tech */
  3422. {
  3423. /* id */ IT_TECH_HASTE,
  3424. /* classname */ "item_tech3",
  3425. /* pickup */ CTFPickup_Tech,
  3426. /* use */ nullptr,
  3427. /* drop */ CTFDrop_Tech,
  3428. /* weaponthink */ nullptr,
  3429. /* pickup_sound */ "items/pkup.wav",
  3430. /* world_model */ "models/ctf/haste/tris.md2",
  3431. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3432. /* view_model */ nullptr,
  3433. /* icon */ "tech3",
  3434. /* use_name */ "Time Accel",
  3435. /* pickup_name */ "$item_time_accel",
  3436. /* pickup_name_definite */ "$item_time_accel_def",
  3437. /* quantity */ 0,
  3438. /* ammo */ IT_NULL,
  3439. /* chain */ IT_NULL,
  3440. /* flags */ IF_TECH | IF_POWERUP_WHEEL,
  3441. /* vwep_model */ nullptr,
  3442. /* armor_info */ nullptr,
  3443. /* tag */ POWERUP_TECH3,
  3444. /* precaches */ "ctf/tech3.wav"
  3445. },
  3446. /* Regeneration Tech */
  3447. {
  3448. /* id */ IT_TECH_REGENERATION,
  3449. /* classname */ "item_tech4",
  3450. /* pickup */ CTFPickup_Tech,
  3451. /* use */ nullptr,
  3452. /* drop */ CTFDrop_Tech,
  3453. /* weaponthink */ nullptr,
  3454. /* pickup_sound */ "items/pkup.wav",
  3455. /* world_model */ "models/ctf/regeneration/tris.md2",
  3456. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3457. /* view_model */ nullptr,
  3458. /* icon */ "tech4",
  3459. /* use_name */ "AutoDoc",
  3460. /* pickup_name */ "$item_autodoc",
  3461. /* pickup_name_definite */ "$item_autodoc_def",
  3462. /* quantity */ 0,
  3463. /* ammo */ IT_NULL,
  3464. /* chain */ IT_NULL,
  3465. /* flags */ IF_TECH | IF_POWERUP_WHEEL,
  3466. /* vwep_model */ nullptr,
  3467. /* armor_info */ nullptr,
  3468. /* tag */ POWERUP_TECH4,
  3469. /* precaches */ "ctf/tech4.wav"
  3470. },
  3471. {
  3472. /* id */ IT_ITEM_FLASHLIGHT,
  3473. /* classname */ "item_flashlight",
  3474. /* pickup */ Pickup_General,
  3475. /* use */ Use_Flashlight,
  3476. /* drop */ nullptr,
  3477. /* weaponthink */ nullptr,
  3478. /* pickup_sound */ "items/pkup.wav",
  3479. /* world_model */ "models/items/flashlight/tris.md2",
  3480. /* world_model_flags */ EF_ROTATE | EF_BOB,
  3481. /* view_model */ nullptr,
  3482. /* icon */ "p_torch",
  3483. /* use_name */ "Flashlight",
  3484. /* pickup_name */ "$item_flashlight",
  3485. /* pickup_name_definite */ "$item_flashlight_def",
  3486. /* quantity */ 0,
  3487. /* ammo */ IT_NULL,
  3488. /* chain */ IT_NULL,
  3489. /* flags */ IF_STAY_COOP | IF_POWERUP_WHEEL | IF_POWERUP_ONOFF | IF_NOT_RANDOM,
  3490. /* vwep_model */ nullptr,
  3491. /* armor_info */ nullptr,
  3492. /* tag */ POWERUP_FLASHLIGHT,
  3493. /* precaches */ "items/flashlight_on.wav items/flashlight_off.wav",
  3494. /* sort_id */ -1
  3495. },
  3496. {
  3497. /* id */ IT_ITEM_COMPASS,
  3498. /* classname */ "item_compass",
  3499. /* pickup */ nullptr,
  3500. /* use */ Use_Compass,
  3501. /* drop */ nullptr,
  3502. /* weaponthink */ nullptr,
  3503. /* pickup_sound */ nullptr,
  3504. /* world_model */ nullptr,
  3505. /* world_model_flags */ EF_NONE,
  3506. /* view_model */ nullptr,
  3507. /* icon */ "p_compass",
  3508. /* use_name */ "Compass",
  3509. /* pickup_name */ "$item_compass",
  3510. /* pickup_name_definite */ "$item_compass_def",
  3511. /* quantity */ 0,
  3512. /* ammo */ IT_NULL,
  3513. /* chain */ IT_NULL,
  3514. /* flags */ IF_STAY_COOP | IF_POWERUP_WHEEL | IF_POWERUP_ONOFF,
  3515. /* vwep_model */ nullptr,
  3516. /* armor_info */ nullptr,
  3517. /* tag */ POWERUP_COMPASS,
  3518. /* precaches */ "misc/help_marker.wav",
  3519. /* sort_id */ -2
  3520. }
  3521. };
  3522. // clang-format on
  3523. void InitItems()
  3524. {
  3525. // validate item integrity
  3526. for (item_id_t i = IT_NULL; i < IT_TOTAL; i = static_cast<item_id_t>(i + 1))
  3527. if (itemlist[i].id != i)
  3528. gi.Com_ErrorFmt("Item {} has wrong enum ID {} (should be {})", itemlist[i].pickup_name, (int32_t) itemlist[i].id, (int32_t) i);
  3529. // set up weapon chains
  3530. for (item_id_t i = IT_NULL; i < IT_TOTAL; i = static_cast<item_id_t>(i + 1))
  3531. {
  3532. if (!itemlist[i].chain)
  3533. continue;
  3534. gitem_t *item = &itemlist[i];
  3535. // already initialized
  3536. if (item->chain_next)
  3537. continue;
  3538. gitem_t *chain_item = &itemlist[item->chain];
  3539. if (!chain_item)
  3540. gi.Com_ErrorFmt("Invalid item chain {} for {}", (int32_t) item->chain, item->pickup_name);
  3541. // set up initial chain
  3542. if (!chain_item->chain_next)
  3543. chain_item->chain_next = chain_item;
  3544. // if we're not the first in chain, add us now
  3545. if (chain_item != item)
  3546. {
  3547. gitem_t *c;
  3548. // end of chain is one whose chain_next points to chain_item
  3549. for (c = chain_item; c->chain_next != chain_item; c = c->chain_next)
  3550. continue;
  3551. // splice us in
  3552. item->chain_next = chain_item;
  3553. c->chain_next = item;
  3554. }
  3555. }
  3556. // set up ammo
  3557. for (auto &it : itemlist)
  3558. {
  3559. if ((it.flags & IF_AMMO) && it.tag >= AMMO_BULLETS && it.tag < AMMO_MAX)
  3560. ammolist[it.tag] = &it;
  3561. else if ((it.flags & IF_POWERUP_WHEEL) && !(it.flags & IF_WEAPON) && it.tag >= POWERUP_SCREEN && it.tag < POWERUP_MAX)
  3562. poweruplist[it.tag] = &it;
  3563. }
  3564. // in coop or DM with Weapons' Stay, remove drop ptr
  3565. for (auto &it : itemlist)
  3566. {
  3567. if (coop->integer)
  3568. {
  3569. if (!P_UseCoopInstancedItems() && (it.flags & IF_STAY_COOP))
  3570. it.drop = nullptr;
  3571. }
  3572. }
  3573. }
  3574. // [Paril-KEX]
  3575. inline bool G_CanDropItem(const gitem_t &item)
  3576. {
  3577. if (!item.drop)
  3578. return false;
  3579. else if ((item.flags & IF_WEAPON) && !(item.flags & IF_AMMO) && deathmatch->integer && g_dm_weapons_stay->integer)
  3580. return false;
  3581. return true;
  3582. }
  3583. /*
  3584. ===============
  3585. SetItemNames
  3586. Called by worldspawn
  3587. ===============
  3588. */
  3589. void SetItemNames()
  3590. {
  3591. for (item_id_t i = IT_NULL; i < IT_TOTAL; i = static_cast<item_id_t>(i + 1))
  3592. gi.configstring(CS_ITEMS + i, itemlist[i].pickup_name);
  3593. // [Paril-KEX] set ammo wheel indices first
  3594. int32_t cs_index = 0;
  3595. for (item_id_t i = IT_NULL; i < IT_TOTAL; i = static_cast<item_id_t>(i + 1))
  3596. {
  3597. if (!(itemlist[i].flags & IF_AMMO))
  3598. continue;
  3599. if (cs_index >= MAX_WHEEL_ITEMS)
  3600. gi.Com_Error("out of wheel indices");
  3601. gi.configstring(CS_WHEEL_AMMO + cs_index, G_Fmt("{}|{}", (int32_t) i, gi.imageindex(itemlist[i].icon)).data());
  3602. itemlist[i].ammo_wheel_index = cs_index;
  3603. cs_index++;
  3604. }
  3605. // set weapon wheel indices
  3606. cs_index = 0;
  3607. for (item_id_t i = IT_NULL; i < IT_TOTAL; i = static_cast<item_id_t>(i + 1))
  3608. {
  3609. if (!(itemlist[i].flags & IF_WEAPON))
  3610. continue;
  3611. if (cs_index >= MAX_WHEEL_ITEMS)
  3612. gi.Com_Error("out of wheel indices");
  3613. int32_t min_ammo = (itemlist[i].flags & IF_AMMO) ? 1 : itemlist[i].quantity;
  3614. gi.configstring(CS_WHEEL_WEAPONS + cs_index, G_Fmt("{}|{}|{}|{}|{}|{}|{}|{}",
  3615. (int32_t) i,
  3616. gi.imageindex(itemlist[i].icon),
  3617. itemlist[i].ammo ? GetItemByIndex(itemlist[i].ammo)->ammo_wheel_index : -1,
  3618. min_ammo,
  3619. (itemlist[i].flags & IF_POWERUP_WHEEL) ? 1 : 0,
  3620. itemlist[i].sort_id,
  3621. itemlist[i].quantity_warn,
  3622. G_CanDropItem(itemlist[i]) ? 1 : 0
  3623. ).data());
  3624. itemlist[i].weapon_wheel_index = cs_index;
  3625. cs_index++;
  3626. }
  3627. // set powerup wheel indices
  3628. cs_index = 0;
  3629. for (item_id_t i = IT_NULL; i < IT_TOTAL; i = static_cast<item_id_t>(i + 1))
  3630. {
  3631. if (!(itemlist[i].flags & IF_POWERUP_WHEEL) || (itemlist[i].flags & IF_WEAPON))
  3632. continue;
  3633. if (cs_index >= MAX_WHEEL_ITEMS)
  3634. gi.Com_Error("out of wheel indices");
  3635. gi.configstring(CS_WHEEL_POWERUPS + cs_index, G_Fmt("{}|{}|{}|{}|{}|{}",
  3636. (int32_t) i,
  3637. gi.imageindex(itemlist[i].icon),
  3638. (itemlist[i].flags & IF_POWERUP_ONOFF) ? 1 : 0,
  3639. itemlist[i].sort_id,
  3640. G_CanDropItem(itemlist[i]) ? 1 : 0,
  3641. itemlist[i].ammo ? GetItemByIndex(itemlist[i].ammo)->ammo_wheel_index : -1
  3642. ).data());
  3643. itemlist[i].powerup_wheel_index = cs_index;
  3644. cs_index++;
  3645. }
  3646. }