| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#include "../qcommon/q_shared.h" |
| 26 |
#include "bg_public.h" |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
gitem_t bg_itemlist[] = |
| 45 |
{ |
| 46 |
{ |
| 47 |
NULL, |
| 48 |
NULL, |
| 49 |
{ NULL, |
| 50 |
NULL, |
| 51 |
NULL, NULL} , |
| 52 |
NULL, |
| 53 |
NULL, |
| 54 |
0, |
| 55 |
0, |
| 56 |
0, |
| 57 |
"", |
| 58 |
"" |
| 59 |
}, |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
{ |
| 68 |
"item_armor_shard", |
| 69 |
"sound/misc/ar1_pkup.wav", |
| 70 |
{ "models/powerups/armor/shard.md3", |
| 71 |
"models/powerups/armor/shard_sphere.md3", |
| 72 |
NULL, NULL} , |
| 73 |
"icons/iconr_shard", |
| 74 |
"Armor Shard", |
| 75 |
5, |
| 76 |
IT_ARMOR, |
| 77 |
0, |
| 78 |
"", |
| 79 |
"" |
| 80 |
}, |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
{ |
| 85 |
"item_armor_combat", |
| 86 |
"sound/misc/ar2_pkup.wav", |
| 87 |
{ "models/powerups/armor/armor_yel.md3", |
| 88 |
NULL, NULL, NULL}, |
| 89 |
"icons/iconr_yellow", |
| 90 |
"Armor", |
| 91 |
50, |
| 92 |
IT_ARMOR, |
| 93 |
0, |
| 94 |
"", |
| 95 |
"" |
| 96 |
}, |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
{ |
| 101 |
"item_armor_body", |
| 102 |
"sound/misc/ar2_pkup.wav", |
| 103 |
{ "models/powerups/armor/armor_red.md3", |
| 104 |
NULL, NULL, NULL}, |
| 105 |
"icons/iconr_red", |
| 106 |
"Heavy Armor", |
| 107 |
100, |
| 108 |
IT_ARMOR, |
| 109 |
0, |
| 110 |
"", |
| 111 |
"" |
| 112 |
}, |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
{ |
| 120 |
"item_health_small", |
| 121 |
"sound/items/s_health.wav", |
| 122 |
{ "models/powerups/health/small_cross.md3", |
| 123 |
"models/powerups/health/small_sphere.md3", |
| 124 |
NULL, NULL }, |
| 125 |
"icons/iconh_green", |
| 126 |
"5 Health", |
| 127 |
5, |
| 128 |
IT_HEALTH, |
| 129 |
0, |
| 130 |
"", |
| 131 |
"" |
| 132 |
}, |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
{ |
| 137 |
"item_health", |
| 138 |
"sound/items/n_health.wav", |
| 139 |
{ "models/powerups/health/medium_cross.md3", |
| 140 |
"models/powerups/health/medium_sphere.md3", |
| 141 |
NULL, NULL }, |
| 142 |
"icons/iconh_yellow", |
| 143 |
"25 Health", |
| 144 |
25, |
| 145 |
IT_HEALTH, |
| 146 |
0, |
| 147 |
"", |
| 148 |
"" |
| 149 |
}, |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
{ |
| 154 |
"item_health_large", |
| 155 |
"sound/items/l_health.wav", |
| 156 |
{ "models/powerups/health/large_cross.md3", |
| 157 |
"models/powerups/health/large_sphere.md3", |
| 158 |
NULL, NULL }, |
| 159 |
"icons/iconh_red", |
| 160 |
"50 Health", |
| 161 |
50, |
| 162 |
IT_HEALTH, |
| 163 |
0, |
| 164 |
"", |
| 165 |
"" |
| 166 |
}, |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
{ |
| 171 |
"item_health_mega", |
| 172 |
"sound/items/m_health.wav", |
| 173 |
{ "models/powerups/health/mega_cross.md3", |
| 174 |
"models/powerups/health/mega_sphere.md3", |
| 175 |
NULL, NULL }, |
| 176 |
"icons/iconh_mega", |
| 177 |
"Mega Health", |
| 178 |
100, |
| 179 |
IT_HEALTH, |
| 180 |
0, |
| 181 |
"", |
| 182 |
"" |
| 183 |
}, |
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
{ |
| 193 |
"weapon_gauntlet", |
| 194 |
"sound/misc/w_pkup.wav", |
| 195 |
{ "models/weapons2/gauntlet/gauntlet.md3", |
| 196 |
NULL, NULL, NULL}, |
| 197 |
"icons/iconw_gauntlet", |
| 198 |
"Gauntlet", |
| 199 |
0, |
| 200 |
IT_WEAPON, |
| 201 |
WP_GAUNTLET, |
| 202 |
"", |
| 203 |
"" |
| 204 |
}, |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
{ |
| 209 |
"weapon_shotgun", |
| 210 |
"sound/misc/w_pkup.wav", |
| 211 |
{ "models/weapons2/shotgun/shotgun.md3", |
| 212 |
NULL, NULL, NULL}, |
| 213 |
"icons/iconw_shotgun", |
| 214 |
"Shotgun", |
| 215 |
10, |
| 216 |
IT_WEAPON, |
| 217 |
WP_SHOTGUN, |
| 218 |
"", |
| 219 |
"" |
| 220 |
}, |
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
{ |
| 225 |
"weapon_machinegun", |
| 226 |
"sound/misc/w_pkup.wav", |
| 227 |
{ "models/weapons2/machinegun/machinegun.md3", |
| 228 |
NULL, NULL, NULL}, |
| 229 |
"icons/iconw_machinegun", |
| 230 |
"Machinegun", |
| 231 |
40, |
| 232 |
IT_WEAPON, |
| 233 |
WP_MACHINEGUN, |
| 234 |
"", |
| 235 |
"" |
| 236 |
}, |
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
{ |
| 241 |
"weapon_grenadelauncher", |
| 242 |
"sound/misc/w_pkup.wav", |
| 243 |
{ "models/weapons2/grenadel/grenadel.md3", |
| 244 |
NULL, NULL, NULL}, |
| 245 |
"icons/iconw_grenade", |
| 246 |
"Grenade Launcher", |
| 247 |
10, |
| 248 |
IT_WEAPON, |
| 249 |
WP_GRENADE_LAUNCHER, |
| 250 |
"", |
| 251 |
"sound/weapons/grenade/hgrenb1a.wav sound/weapons/grenade/hgrenb2a.wav" |
| 252 |
}, |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
{ |
| 257 |
"weapon_rocketlauncher", |
| 258 |
"sound/misc/w_pkup.wav", |
| 259 |
{ "models/weapons2/rocketl/rocketl.md3", |
| 260 |
NULL, NULL, NULL}, |
| 261 |
"icons/iconw_rocket", |
| 262 |
"Rocket Launcher", |
| 263 |
10, |
| 264 |
IT_WEAPON, |
| 265 |
WP_ROCKET_LAUNCHER, |
| 266 |
"", |
| 267 |
"" |
| 268 |
}, |
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
{ |
| 273 |
"weapon_lightning", |
| 274 |
"sound/misc/w_pkup.wav", |
| 275 |
{ "models/weapons2/lightning/lightning.md3", |
| 276 |
NULL, NULL, NULL}, |
| 277 |
"icons/iconw_lightning", |
| 278 |
"Lightning Gun", |
| 279 |
100, |
| 280 |
IT_WEAPON, |
| 281 |
WP_LIGHTNING, |
| 282 |
"", |
| 283 |
"" |
| 284 |
}, |
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
{ |
| 289 |
"weapon_railgun", |
| 290 |
"sound/misc/w_pkup.wav", |
| 291 |
{ "models/weapons2/railgun/railgun.md3", |
| 292 |
NULL, NULL, NULL}, |
| 293 |
"icons/iconw_railgun", |
| 294 |
"Railgun", |
| 295 |
10, |
| 296 |
IT_WEAPON, |
| 297 |
WP_RAILGUN, |
| 298 |
"", |
| 299 |
"" |
| 300 |
}, |
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
{ |
| 305 |
"weapon_plasmagun", |
| 306 |
"sound/misc/w_pkup.wav", |
| 307 |
{ "models/weapons2/plasma/plasma.md3", |
| 308 |
NULL, NULL, NULL}, |
| 309 |
"icons/iconw_plasma", |
| 310 |
"Plasma Gun", |
| 311 |
50, |
| 312 |
IT_WEAPON, |
| 313 |
WP_PLASMAGUN, |
| 314 |
"", |
| 315 |
"" |
| 316 |
}, |
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
{ |
| 321 |
"weapon_bfg", |
| 322 |
"sound/misc/w_pkup.wav", |
| 323 |
{ "models/weapons2/bfg/bfg.md3", |
| 324 |
NULL, NULL, NULL}, |
| 325 |
"icons/iconw_bfg", |
| 326 |
"BFG10K", |
| 327 |
20, |
| 328 |
IT_WEAPON, |
| 329 |
WP_BFG, |
| 330 |
"", |
| 331 |
"" |
| 332 |
}, |
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
{ |
| 337 |
"weapon_grapplinghook", |
| 338 |
"sound/misc/w_pkup.wav", |
| 339 |
{ "models/weapons2/grapple/grapple.md3", |
| 340 |
NULL, NULL, NULL}, |
| 341 |
"icons/iconw_grapple", |
| 342 |
"Grappling Hook", |
| 343 |
0, |
| 344 |
IT_WEAPON, |
| 345 |
WP_GRAPPLING_HOOK, |
| 346 |
"", |
| 347 |
"" |
| 348 |
}, |
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
{ |
| 357 |
"ammo_shells", |
| 358 |
"sound/misc/am_pkup.wav", |
| 359 |
{ "models/powerups/ammo/shotgunam.md3", |
| 360 |
NULL, NULL, NULL}, |
| 361 |
"icons/icona_shotgun", |
| 362 |
"Shells", |
| 363 |
10, |
| 364 |
IT_AMMO, |
| 365 |
WP_SHOTGUN, |
| 366 |
"", |
| 367 |
"" |
| 368 |
}, |
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
{ |
| 373 |
"ammo_bullets", |
| 374 |
"sound/misc/am_pkup.wav", |
| 375 |
{ "models/powerups/ammo/machinegunam.md3", |
| 376 |
NULL, NULL, NULL}, |
| 377 |
"icons/icona_machinegun", |
| 378 |
"Bullets", |
| 379 |
50, |
| 380 |
IT_AMMO, |
| 381 |
WP_MACHINEGUN, |
| 382 |
"", |
| 383 |
"" |
| 384 |
}, |
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
{ |
| 389 |
"ammo_grenades", |
| 390 |
"sound/misc/am_pkup.wav", |
| 391 |
{ "models/powerups/ammo/grenadeam.md3", |
| 392 |
NULL, NULL, NULL}, |
| 393 |
"icons/icona_grenade", |
| 394 |
"Grenades", |
| 395 |
5, |
| 396 |
IT_AMMO, |
| 397 |
WP_GRENADE_LAUNCHER, |
| 398 |
"", |
| 399 |
"" |
| 400 |
}, |
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
{ |
| 405 |
"ammo_cells", |
| 406 |
"sound/misc/am_pkup.wav", |
| 407 |
{ "models/powerups/ammo/plasmaam.md3", |
| 408 |
NULL, NULL, NULL}, |
| 409 |
"icons/icona_plasma", |
| 410 |
"Cells", |
| 411 |
30, |
| 412 |
IT_AMMO, |
| 413 |
WP_PLASMAGUN, |
| 414 |
"", |
| 415 |
"" |
| 416 |
}, |
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
{ |
| 421 |
"ammo_lightning", |
| 422 |
"sound/misc/am_pkup.wav", |
| 423 |
{ "models/powerups/ammo/lightningam.md3", |
| 424 |
NULL, NULL, NULL}, |
| 425 |
"icons/icona_lightning", |
| 426 |
"Lightning", |
| 427 |
60, |
| 428 |
IT_AMMO, |
| 429 |
WP_LIGHTNING, |
| 430 |
"", |
| 431 |
"" |
| 432 |
}, |
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
{ |
| 437 |
"ammo_rockets", |
| 438 |
"sound/misc/am_pkup.wav", |
| 439 |
{ "models/powerups/ammo/rocketam.md3", |
| 440 |
NULL, NULL, NULL}, |
| 441 |
"icons/icona_rocket", |
| 442 |
"Rockets", |
| 443 |
5, |
| 444 |
IT_AMMO, |
| 445 |
WP_ROCKET_LAUNCHER, |
| 446 |
"", |
| 447 |
"" |
| 448 |
}, |
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
{ |
| 453 |
"ammo_slugs", |
| 454 |
"sound/misc/am_pkup.wav", |
| 455 |
{ "models/powerups/ammo/railgunam.md3", |
| 456 |
NULL, NULL, NULL}, |
| 457 |
"icons/icona_railgun", |
| 458 |
"Slugs", |
| 459 |
10, |
| 460 |
IT_AMMO, |
| 461 |
WP_RAILGUN, |
| 462 |
"", |
| 463 |
"" |
| 464 |
}, |
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
{ |
| 469 |
"ammo_bfg", |
| 470 |
"sound/misc/am_pkup.wav", |
| 471 |
{ "models/powerups/ammo/bfgam.md3", |
| 472 |
NULL, NULL, NULL}, |
| 473 |
"icons/icona_bfg", |
| 474 |
"Bfg Ammo", |
| 475 |
15, |
| 476 |
IT_AMMO, |
| 477 |
WP_BFG, |
| 478 |
"", |
| 479 |
"" |
| 480 |
}, |
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
{ |
| 488 |
"holdable_teleporter", |
| 489 |
"sound/items/holdable.wav", |
| 490 |
{ "models/powerups/holdable/teleporter.md3", |
| 491 |
NULL, NULL, NULL}, |
| 492 |
"icons/teleporter", |
| 493 |
"Personal Teleporter", |
| 494 |
60, |
| 495 |
IT_HOLDABLE, |
| 496 |
HI_TELEPORTER, |
| 497 |
"", |
| 498 |
"" |
| 499 |
}, |
| 500 |
|
| 501 |
|
| 502 |
{ |
| 503 |
"holdable_medkit", |
| 504 |
"sound/items/holdable.wav", |
| 505 |
{ |
| 506 |
"models/powerups/holdable/medkit.md3", |
| 507 |
"models/powerups/holdable/medkit_sphere.md3", |
| 508 |
NULL, NULL}, |
| 509 |
"icons/medkit", |
| 510 |
"Medkit", |
| 511 |
60, |
| 512 |
IT_HOLDABLE, |
| 513 |
HI_MEDKIT, |
| 514 |
"", |
| 515 |
"sound/items/use_medkit.wav" |
| 516 |
}, |
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
{ |
| 524 |
"item_quad", |
| 525 |
"sound/items/quaddamage.wav", |
| 526 |
{ "models/powerups/instant/quad.md3", |
| 527 |
"models/powerups/instant/quad_ring.md3", |
| 528 |
NULL, NULL }, |
| 529 |
"icons/quad", |
| 530 |
"Quad Damage", |
| 531 |
30, |
| 532 |
IT_POWERUP, |
| 533 |
PW_QUAD, |
| 534 |
"", |
| 535 |
"sound/items/damage2.wav sound/items/damage3.wav" |
| 536 |
}, |
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
{ |
| 541 |
"item_enviro", |
| 542 |
"sound/items/protect.wav", |
| 543 |
{ "models/powerups/instant/enviro.md3", |
| 544 |
"models/powerups/instant/enviro_ring.md3", |
| 545 |
NULL, NULL }, |
| 546 |
"icons/envirosuit", |
| 547 |
"Battle Suit", |
| 548 |
30, |
| 549 |
IT_POWERUP, |
| 550 |
PW_BATTLESUIT, |
| 551 |
"", |
| 552 |
"sound/items/airout.wav sound/items/protect3.wav" |
| 553 |
}, |
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
{ |
| 558 |
"item_haste", |
| 559 |
"sound/items/haste.wav", |
| 560 |
{ "models/powerups/instant/haste.md3", |
| 561 |
"models/powerups/instant/haste_ring.md3", |
| 562 |
NULL, NULL }, |
| 563 |
"icons/haste", |
| 564 |
"Speed", |
| 565 |
30, |
| 566 |
IT_POWERUP, |
| 567 |
PW_HASTE, |
| 568 |
"", |
| 569 |
"" |
| 570 |
}, |
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
{ |
| 575 |
"item_invis", |
| 576 |
"sound/items/invisibility.wav", |
| 577 |
{ "models/powerups/instant/invis.md3", |
| 578 |
"models/powerups/instant/invis_ring.md3", |
| 579 |
NULL, NULL }, |
| 580 |
"icons/invis", |
| 581 |
"Invisibility", |
| 582 |
30, |
| 583 |
IT_POWERUP, |
| 584 |
PW_INVIS, |
| 585 |
"", |
| 586 |
"" |
| 587 |
}, |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
{ |
| 592 |
"item_regen", |
| 593 |
"sound/items/regeneration.wav", |
| 594 |
{ "models/powerups/instant/regen.md3", |
| 595 |
"models/powerups/instant/regen_ring.md3", |
| 596 |
NULL, NULL }, |
| 597 |
"icons/regen", |
| 598 |
"Regeneration", |
| 599 |
30, |
| 600 |
IT_POWERUP, |
| 601 |
PW_REGEN, |
| 602 |
"", |
| 603 |
"sound/items/regen.wav" |
| 604 |
}, |
| 605 |
|
| 606 |
|
| 607 |
|
| 608 |
{ |
| 609 |
"item_flight", |
| 610 |
"sound/items/flight.wav", |
| 611 |
{ "models/powerups/instant/flight.md3", |
| 612 |
"models/powerups/instant/flight_ring.md3", |
| 613 |
NULL, NULL }, |
| 614 |
"icons/flight", |
| 615 |
"Flight", |
| 616 |
60, |
| 617 |
IT_POWERUP, |
| 618 |
PW_FLIGHT, |
| 619 |
"", |
| 620 |
"sound/items/flight.wav" |
| 621 |
}, |
| 622 |
|
| 623 |
|
| 624 |
|
| 625 |
|
| 626 |
{ |
| 627 |
"team_CTF_redflag", |
| 628 |
NULL, |
| 629 |
{ "models/flags/r_flag.md3", |
| 630 |
NULL, NULL, NULL }, |
| 631 |
"icons/iconf_red1", |
| 632 |
"Red Flag", |
| 633 |
0, |
| 634 |
IT_TEAM, |
| 635 |
PW_REDFLAG, |
| 636 |
"", |
| 637 |
"" |
| 638 |
}, |
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
{ |
| 644 |
"team_CTF_blueflag", |
| 645 |
NULL, |
| 646 |
{ "models/flags/b_flag.md3", |
| 647 |
NULL, NULL, NULL }, |
| 648 |
"icons/iconf_blu1", |
| 649 |
"Blue Flag", |
| 650 |
0, |
| 651 |
IT_TEAM, |
| 652 |
PW_BLUEFLAG, |
| 653 |
"", |
| 654 |
"" |
| 655 |
}, |
| 656 |
|
| 657 |
#ifdef MISSIONPACK |
| 658 |
|
| 659 |
|
| 660 |
{ |
| 661 |
"holdable_kamikaze", |
| 662 |
"sound/items/holdable.wav", |
| 663 |
{ "models/powerups/kamikazi.md3", |
| 664 |
NULL, NULL, NULL}, |
| 665 |
"icons/kamikaze", |
| 666 |
"Kamikaze", |
| 667 |
60, |
| 668 |
IT_HOLDABLE, |
| 669 |
HI_KAMIKAZE, |
| 670 |
"", |
| 671 |
"sound/items/kamikazerespawn.wav" |
| 672 |
}, |
| 673 |
|
| 674 |
|
| 675 |
|
| 676 |
{ |
| 677 |
"holdable_portal", |
| 678 |
"sound/items/holdable.wav", |
| 679 |
{ "models/powerups/holdable/porter.md3", |
| 680 |
NULL, NULL, NULL}, |
| 681 |
"icons/portal", |
| 682 |
"Portal", |
| 683 |
60, |
| 684 |
IT_HOLDABLE, |
| 685 |
HI_PORTAL, |
| 686 |
"", |
| 687 |
"" |
| 688 |
}, |
| 689 |
|
| 690 |
|
| 691 |
|
| 692 |
{ |
| 693 |
"holdable_invulnerability", |
| 694 |
"sound/items/holdable.wav", |
| 695 |
{ "models/powerups/holdable/invulnerability.md3", |
| 696 |
NULL, NULL, NULL}, |
| 697 |
"icons/invulnerability", |
| 698 |
"Invulnerability", |
| 699 |
60, |
| 700 |
IT_HOLDABLE, |
| 701 |
HI_INVULNERABILITY, |
| 702 |
"", |
| 703 |
"" |
| 704 |
}, |
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
{ |
| 709 |
"ammo_nails", |
| 710 |
"sound/misc/am_pkup.wav", |
| 711 |
{ "models/powerups/ammo/nailgunam.md3", |
| 712 |
NULL, NULL, NULL}, |
| 713 |
"icons/icona_nailgun", |
| 714 |
"Nails", |
| 715 |
20, |
| 716 |
IT_AMMO, |
| 717 |
WP_NAILGUN, |
| 718 |
"", |
| 719 |
"" |
| 720 |
}, |
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
{ |
| 725 |
"ammo_mines", |
| 726 |
"sound/misc/am_pkup.wav", |
| 727 |
{ "models/powerups/ammo/proxmineam.md3", |
| 728 |
NULL, NULL, NULL}, |
| 729 |
"icons/icona_proxlauncher", |
| 730 |
"Proximity Mines", |
| 731 |
10, |
| 732 |
IT_AMMO, |
| 733 |
WP_PROX_LAUNCHER, |
| 734 |
"", |
| 735 |
"" |
| 736 |
}, |
| 737 |
|
| 738 |
|
| 739 |
|
| 740 |
{ |
| 741 |
"ammo_belt", |
| 742 |
"sound/misc/am_pkup.wav", |
| 743 |
{ "models/powerups/ammo/chaingunam.md3", |
| 744 |
NULL, NULL, NULL}, |
| 745 |
"icons/icona_chaingun", |
| 746 |
"Chaingun Belt", |
| 747 |
100, |
| 748 |
IT_AMMO, |
| 749 |
WP_CHAINGUN, |
| 750 |
"", |
| 751 |
"" |
| 752 |
}, |
| 753 |
|
| 754 |
|
| 755 |
|
| 756 |
|
| 757 |
|
| 758 |
|
| 759 |
{ |
| 760 |
"item_scout", |
| 761 |
"sound/items/scout.wav", |
| 762 |
{ "models/powerups/scout.md3", |
| 763 |
NULL, NULL, NULL }, |
| 764 |
"icons/scout", |
| 765 |
"Scout", |
| 766 |
30, |
| 767 |
IT_PERSISTANT_POWERUP, |
| 768 |
PW_SCOUT, |
| 769 |
"", |
| 770 |
"" |
| 771 |
}, |
| 772 |
|
| 773 |
|
| 774 |
|
| 775 |
{ |
| 776 |
"item_guard", |
| 777 |
"sound/items/guard.wav", |
| 778 |
{ "models/powerups/guard.md3", |
| 779 |
NULL, NULL, NULL }, |
| 780 |
"icons/guard", |
| 781 |
"Guard", |
| 782 |
30, |
| 783 |
IT_PERSISTANT_POWERUP, |
| 784 |
PW_GUARD, |
| 785 |
"", |
| 786 |
"" |
| 787 |
}, |
| 788 |
|
| 789 |
|
| 790 |
|
| 791 |
{ |
| 792 |
"item_doubler", |
| 793 |
"sound/items/doubler.wav", |
| 794 |
{ "models/powerups/doubler.md3", |
| 795 |
NULL, NULL, NULL }, |
| 796 |
"icons/doubler", |
| 797 |
"Doubler", |
| 798 |
30, |
| 799 |
IT_PERSISTANT_POWERUP, |
| 800 |
PW_DOUBLER, |
| 801 |
"", |
| 802 |
"" |
| 803 |
}, |
| 804 |
|
| 805 |
|
| 806 |
|
| 807 |
{ |
| 808 |
"item_ammoregen", |
| 809 |
"sound/items/ammoregen.wav", |
| 810 |
{ "models/powerups/ammo.md3", |
| 811 |
NULL, NULL, NULL }, |
| 812 |
"icons/ammo_regen", |
| 813 |
"Ammo Regen", |
| 814 |
30, |
| 815 |
IT_PERSISTANT_POWERUP, |
| 816 |
PW_AMMOREGEN, |
| 817 |
"", |
| 818 |
"" |
| 819 |
}, |
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
{ |
| 825 |
"team_CTF_neutralflag", |
| 826 |
NULL, |
| 827 |
{ "models/flags/n_flag.md3", |
| 828 |
NULL, NULL, NULL }, |
| 829 |
"icons/iconf_neutral1", |
| 830 |
"Neutral Flag", |
| 831 |
0, |
| 832 |
IT_TEAM, |
| 833 |
PW_NEUTRALFLAG, |
| 834 |
"", |
| 835 |
"" |
| 836 |
}, |
| 837 |
|
| 838 |
{ |
| 839 |
"item_redcube", |
| 840 |
"sound/misc/am_pkup.wav", |
| 841 |
{ "models/powerups/orb/r_orb.md3", |
| 842 |
NULL, NULL, NULL }, |
| 843 |
"icons/iconh_rorb", |
| 844 |
"Red Cube", |
| 845 |
0, |
| 846 |
IT_TEAM, |
| 847 |
0, |
| 848 |
"", |
| 849 |
"" |
| 850 |
}, |
| 851 |
|
| 852 |
{ |
| 853 |
"item_bluecube", |
| 854 |
"sound/misc/am_pkup.wav", |
| 855 |
{ "models/powerups/orb/b_orb.md3", |
| 856 |
NULL, NULL, NULL }, |
| 857 |
"icons/iconh_borb", |
| 858 |
"Blue Cube", |
| 859 |
0, |
| 860 |
IT_TEAM, |
| 861 |
0, |
| 862 |
"", |
| 863 |
"" |
| 864 |
}, |
| 865 |
|
| 866 |
|
| 867 |
{ |
| 868 |
"weapon_nailgun", |
| 869 |
"sound/misc/w_pkup.wav", |
| 870 |
{ "models/weapons/nailgun/nailgun.md3", |
| 871 |
NULL, NULL, NULL}, |
| 872 |
"icons/iconw_nailgun", |
| 873 |
"Nailgun", |
| 874 |
10, |
| 875 |
IT_WEAPON, |
| 876 |
WP_NAILGUN, |
| 877 |
"", |
| 878 |
"" |
| 879 |
}, |
| 880 |
|
| 881 |
|
| 882 |
|
| 883 |
{ |
| 884 |
"weapon_prox_launcher", |
| 885 |
"sound/misc/w_pkup.wav", |
| 886 |
{ "models/weapons/proxmine/proxmine.md3", |
| 887 |
NULL, NULL, NULL}, |
| 888 |
"icons/iconw_proxlauncher", |
| 889 |
"Prox Launcher", |
| 890 |
5, |
| 891 |
IT_WEAPON, |
| 892 |
WP_PROX_LAUNCHER, |
| 893 |
"", |
| 894 |
"sound/weapons/proxmine/wstbtick.wav " |
| 895 |
"sound/weapons/proxmine/wstbactv.wav " |
| 896 |
"sound/weapons/proxmine/wstbimpl.wav " |
| 897 |
"sound/weapons/proxmine/wstbimpm.wav " |
| 898 |
"sound/weapons/proxmine/wstbimpd.wav " |
| 899 |
"sound/weapons/proxmine/wstbactv.wav" |
| 900 |
}, |
| 901 |
|
| 902 |
|
| 903 |
|
| 904 |
{ |
| 905 |
"weapon_chaingun", |
| 906 |
"sound/misc/w_pkup.wav", |
| 907 |
{ "models/weapons/vulcan/vulcan.md3", |
| 908 |
NULL, NULL, NULL}, |
| 909 |
"icons/iconw_chaingun", |
| 910 |
"Chaingun", |
| 911 |
80, |
| 912 |
IT_WEAPON, |
| 913 |
WP_CHAINGUN, |
| 914 |
"", |
| 915 |
"sound/weapons/vulcan/wvulwind.wav" |
| 916 |
}, |
| 917 |
#endif |
| 918 |
|
| 919 |
|
| 920 |
{NULL} |
| 921 |
}; |
| 922 |
|
| 923 |
int bg_numItems = ARRAY_LEN( bg_itemlist ) - 1; |
| 924 |
|
| 925 |
|
| 926 |
|
| 927 |
|
| 928 |
|
| 929 |
|
| 930 |
|
| 931 |
gitem_t *BG_FindItemForPowerup( powerup_t pw ) { |
| 932 |
int i; |
| 933 |
|
| 934 |
for ( i = 0 ; i < bg_numItems ; i++ ) { |
| 935 |
if ( (bg_itemlist[i].giType == IT_POWERUP || |
| 936 |
bg_itemlist[i].giType == IT_TEAM || |
| 937 |
bg_itemlist[i].giType == IT_PERSISTANT_POWERUP) && |
| 938 |
bg_itemlist[i].giTag == pw ) { |
| 939 |
return &bg_itemlist[i]; |
| 940 |
} |
| 941 |
} |
| 942 |
|
| 943 |
return NULL; |
| 944 |
} |
| 945 |
|
| 946 |
|
| 947 |
|
| 948 |
|
| 949 |
|
| 950 |
|
| 951 |
|
| 952 |
gitem_t *BG_FindItemForHoldable( holdable_t pw ) { |
| 953 |
int i; |
| 954 |
|
| 955 |
for ( i = 0 ; i < bg_numItems ; i++ ) { |
| 956 |
if ( bg_itemlist[i].giType == IT_HOLDABLE && bg_itemlist[i].giTag == pw ) { |
| 957 |
return &bg_itemlist[i]; |
| 958 |
} |
| 959 |
} |
| 960 |
|
| 961 |
Com_Error( ERR_DROP, "HoldableItem not found" ); |
| 962 |
|
| 963 |
return NULL; |
| 964 |
} |
| 965 |
|
| 966 |
|
| 967 |
|
| 968 |
|
| 969 |
|
| 970 |
|
| 971 |
|
| 972 |
|
| 973 |
gitem_t *BG_FindItemForWeapon( weapon_t weapon ) { |
| 974 |
gitem_t *it; |
| 975 |
|
| 976 |
for ( it = bg_itemlist + 1 ; it->classname ; it++) { |
| 977 |
if ( it->giType == IT_WEAPON && it->giTag == weapon ) { |
| 978 |
return it; |
| 979 |
} |
| 980 |
} |
| 981 |
|
| 982 |
Com_Error( ERR_DROP, "Couldn't find item for weapon %i", weapon); |
| 983 |
return NULL; |
| 984 |
} |
| 985 |
|
| 986 |
|
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
gitem_t *BG_FindItem( const char *pickupName ) { |
| 993 |
gitem_t *it; |
| 994 |
|
| 995 |
for ( it = bg_itemlist + 1 ; it->classname ; it++ ) { |
| 996 |
if ( !Q_stricmp( it->pickup_name, pickupName ) ) |
| 997 |
return it; |
| 998 |
} |
| 999 |
|
| 1000 |
return NULL; |
| 1001 |
} |
| 1002 |
|
| 1003 |
|
| 1004 |
|
| 1005 |
|
| 1006 |
|
| 1007 |
|
| 1008 |
|
| 1009 |
|
| 1010 |
|
| 1011 |
qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime ) { |
| 1012 |
vec3_t origin; |
| 1013 |
|
| 1014 |
BG_EvaluateTrajectory( &item->pos, atTime, origin ); |
| 1015 |
|
| 1016 |
|
| 1017 |
if ( ps->origin[0] - origin[0] > 44 |
| 1018 |
|| ps->origin[0] - origin[0] < -50 |
| 1019 |
|| ps->origin[1] - origin[1] > 36 |
| 1020 |
|| ps->origin[1] - origin[1] < -36 |
| 1021 |
|| ps->origin[2] - origin[2] > 36 |
| 1022 |
|| ps->origin[2] - origin[2] < -36 ) { |
| 1023 |
return qfalse; |
| 1024 |
} |
| 1025 |
|
| 1026 |
return qtrue; |
| 1027 |
} |
| 1028 |
|
| 1029 |
|
| 1030 |
|
| 1031 |
|
| 1032 |
|
| 1033 |
|
| 1034 |
|
| 1035 |
|
| 1036 |
|
| 1037 |
|
| 1038 |
|
| 1039 |
qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps ) { |
| 1040 |
gitem_t *item; |
| 1041 |
#ifdef MISSIONPACK |
| 1042 |
int upperBound; |
| 1043 |
#endif |
| 1044 |
|
| 1045 |
if ( ent->modelindex < 1 || ent->modelindex >= bg_numItems ) { |
| 1046 |
Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: index out of range" ); |
| 1047 |
} |
| 1048 |
|
| 1049 |
item = &bg_itemlist[ent->modelindex]; |
| 1050 |
|
| 1051 |
switch( item->giType ) { |
| 1052 |
case IT_WEAPON: |
| 1053 |
return qtrue; |
| 1054 |
|
| 1055 |
case IT_AMMO: |
| 1056 |
if ( ps->ammo[ item->giTag ] >= 200 ) { |
| 1057 |
return qfalse; |
| 1058 |
} |
| 1059 |
return qtrue; |
| 1060 |
|
| 1061 |
case IT_ARMOR: |
| 1062 |
#ifdef MISSIONPACK |
| 1063 |
if( bg_itemlist[ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_SCOUT ) { |
| 1064 |
return qfalse; |
| 1065 |
} |
| 1066 |
|
| 1067 |
|
| 1068 |
if( bg_itemlist[ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) { |
| 1069 |
upperBound = ps->stats[STAT_MAX_HEALTH]; |
| 1070 |
} |
| 1071 |
else { |
| 1072 |
upperBound = ps->stats[STAT_MAX_HEALTH] * 2; |
| 1073 |
} |
| 1074 |
|
| 1075 |
if ( ps->stats[STAT_ARMOR] >= upperBound ) { |
| 1076 |
return qfalse; |
| 1077 |
} |
| 1078 |
#else |
| 1079 |
if ( ps->stats[STAT_ARMOR] >= ps->stats[STAT_MAX_HEALTH] * 2 ) { |
| 1080 |
return qfalse; |
| 1081 |
} |
| 1082 |
#endif |
| 1083 |
return qtrue; |
| 1084 |
|
| 1085 |
case IT_HEALTH: |
| 1086 |
|
| 1087 |
|
| 1088 |
#ifdef MISSIONPACK |
| 1089 |
if( bg_itemlist[ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) { |
| 1090 |
} |
| 1091 |
else |
| 1092 |
#endif |
| 1093 |
if ( item->quantity == 5 || item->quantity == 100 ) { |
| 1094 |
if ( ps->stats[STAT_HEALTH] >= ps->stats[STAT_MAX_HEALTH] * 2 ) { |
| 1095 |
return qfalse; |
| 1096 |
} |
| 1097 |
return qtrue; |
| 1098 |
} |
| 1099 |
|
| 1100 |
if ( ps->stats[STAT_HEALTH] >= ps->stats[STAT_MAX_HEALTH] ) { |
| 1101 |
return qfalse; |
| 1102 |
} |
| 1103 |
return qtrue; |
| 1104 |
|
| 1105 |
case IT_POWERUP: |
| 1106 |
return qtrue; |
| 1107 |
|
| 1108 |
#ifdef MISSIONPACK |
| 1109 |
case IT_PERSISTANT_POWERUP: |
| 1110 |
|
| 1111 |
if ( ps->stats[STAT_PERSISTANT_POWERUP] ) { |
| 1112 |
return qfalse; |
| 1113 |
} |
| 1114 |
|
| 1115 |
|
| 1116 |
if( ( ent->generic1 & 2 ) && ( ps->persistant[PERS_TEAM] != TEAM_RED ) ) { |
| 1117 |
return qfalse; |
| 1118 |
} |
| 1119 |
if( ( ent->generic1 & 4 ) && ( ps->persistant[PERS_TEAM] != TEAM_BLUE ) ) { |
| 1120 |
return qfalse; |
| 1121 |
} |
| 1122 |
|
| 1123 |
return qtrue; |
| 1124 |
#endif |
| 1125 |
|
| 1126 |
case IT_TEAM: |
| 1127 |
#ifdef MISSIONPACK |
| 1128 |
if( gametype == GT_1FCTF ) { |
| 1129 |
|
| 1130 |
if( item->giTag == PW_NEUTRALFLAG ) { |
| 1131 |
return qtrue; |
| 1132 |
} |
| 1133 |
if (ps->persistant[PERS_TEAM] == TEAM_RED) { |
| 1134 |
if (item->giTag == PW_BLUEFLAG && ps->powerups[PW_NEUTRALFLAG] ) { |
| 1135 |
return qtrue; |
| 1136 |
} |
| 1137 |
} else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) { |
| 1138 |
if (item->giTag == PW_REDFLAG && ps->powerups[PW_NEUTRALFLAG] ) { |
| 1139 |
return qtrue; |
| 1140 |
} |
| 1141 |
} |
| 1142 |
} |
| 1143 |
#endif |
| 1144 |
if( gametype == GT_CTF ) { |
| 1145 |
|
| 1146 |
|
| 1147 |
|
| 1148 |
if (ps->persistant[PERS_TEAM] == TEAM_RED) { |
| 1149 |
if (item->giTag == PW_BLUEFLAG || |
| 1150 |
(item->giTag == PW_REDFLAG && ent->modelindex2) || |
| 1151 |
(item->giTag == PW_REDFLAG && ps->powerups[PW_BLUEFLAG]) ) |
| 1152 |
return qtrue; |
| 1153 |
} else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) { |
| 1154 |
if (item->giTag == PW_REDFLAG || |
| 1155 |
(item->giTag == PW_BLUEFLAG && ent->modelindex2) || |
| 1156 |
(item->giTag == PW_BLUEFLAG && ps->powerups[PW_REDFLAG]) ) |
| 1157 |
return qtrue; |
| 1158 |
} |
| 1159 |
} |
| 1160 |
|
| 1161 |
#ifdef MISSIONPACK |
| 1162 |
if( gametype == GT_HARVESTER ) { |
| 1163 |
return qtrue; |
| 1164 |
} |
| 1165 |
#endif |
| 1166 |
return qfalse; |
| 1167 |
|
| 1168 |
case IT_HOLDABLE: |
| 1169 |
|
| 1170 |
if ( ps->stats[STAT_HOLDABLE_ITEM] ) { |
| 1171 |
return qfalse; |
| 1172 |
} |
| 1173 |
return qtrue; |
| 1174 |
|
| 1175 |
case IT_BAD: |
| 1176 |
Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" ); |
| 1177 |
default: |
| 1178 |
#ifndef Q3_VM |
| 1179 |
#ifndef NDEBUG |
| 1180 |
Com_Printf("BG_CanItemBeGrabbed: unknown enum %d\n", item->giType ); |
| 1181 |
#endif |
| 1182 |
#endif |
| 1183 |
break; |
| 1184 |
} |
| 1185 |
|
| 1186 |
return qfalse; |
| 1187 |
} |
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 |
void BG_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result ) { |
| 1198 |
float deltaTime; |
| 1199 |
float phase; |
| 1200 |
|
| 1201 |
switch( tr->trType ) { |
| 1202 |
case TR_STATIONARY: |
| 1203 |
case TR_INTERPOLATE: |
| 1204 |
VectorCopy( tr->trBase, result ); |
| 1205 |
break; |
| 1206 |
case TR_LINEAR: |
| 1207 |
deltaTime = ( atTime - tr->trTime ) * 0.001; |
| 1208 |
VectorMA( tr->trBase, deltaTime, tr->trDelta, result ); |
| 1209 |
break; |
| 1210 |
case TR_SINE: |
| 1211 |
deltaTime = ( atTime - tr->trTime ) / (float) tr->trDuration; |
| 1212 |
phase = sin( deltaTime * M_PI * 2 ); |
| 1213 |
VectorMA( tr->trBase, phase, tr->trDelta, result ); |
| 1214 |
break; |
| 1215 |
case TR_LINEAR_STOP: |
| 1216 |
if ( atTime > tr->trTime + tr->trDuration ) { |
| 1217 |
atTime = tr->trTime + tr->trDuration; |
| 1218 |
} |
| 1219 |
deltaTime = ( atTime - tr->trTime ) * 0.001; |
| 1220 |
if ( deltaTime < 0 ) { |
| 1221 |
deltaTime = 0; |
| 1222 |
} |
| 1223 |
VectorMA( tr->trBase, deltaTime, tr->trDelta, result ); |
| 1224 |
break; |
| 1225 |
case TR_GRAVITY: |
| 1226 |
deltaTime = ( atTime - tr->trTime ) * 0.001; |
| 1227 |
VectorMA( tr->trBase, deltaTime, tr->trDelta, result ); |
| 1228 |
result[2] -= 0.5 * DEFAULT_GRAVITY * deltaTime * deltaTime; |
| 1229 |
break; |
| 1230 |
default: |
| 1231 |
Com_Error( ERR_DROP, "BG_EvaluateTrajectory: unknown trType: %i", tr->trType ); |
| 1232 |
break; |
| 1233 |
} |
| 1234 |
} |
| 1235 |
|
| 1236 |
|
| 1237 |
|
| 1238 |
|
| 1239 |
|
| 1240 |
|
| 1241 |
|
| 1242 |
|
| 1243 |
void BG_EvaluateTrajectoryDelta( const trajectory_t *tr, int atTime, vec3_t result ) { |
| 1244 |
float deltaTime; |
| 1245 |
float phase; |
| 1246 |
|
| 1247 |
switch( tr->trType ) { |
| 1248 |
case TR_STATIONARY: |
| 1249 |
case TR_INTERPOLATE: |
| 1250 |
VectorClear( result ); |
| 1251 |
break; |
| 1252 |
case TR_LINEAR: |
| 1253 |
VectorCopy( tr->trDelta, result ); |
| 1254 |
break; |
| 1255 |
case TR_SINE: |
| 1256 |
deltaTime = ( atTime - tr->trTime ) / (float) tr->trDuration; |
| 1257 |
phase = cos( deltaTime * M_PI * 2 ); |
| 1258 |
phase *= 0.5; |
| 1259 |
VectorScale( tr->trDelta, phase, result ); |
| 1260 |
break; |
| 1261 |
case TR_LINEAR_STOP: |
| 1262 |
if ( atTime > tr->trTime + tr->trDuration ) { |
| 1263 |
VectorClear( result ); |
| 1264 |
return; |
| 1265 |
} |
| 1266 |
VectorCopy( tr->trDelta, result ); |
| 1267 |
break; |
| 1268 |
case TR_GRAVITY: |
| 1269 |
deltaTime = ( atTime - tr->trTime ) * 0.001; |
| 1270 |
VectorCopy( tr->trDelta, result ); |
| 1271 |
result[2] -= DEFAULT_GRAVITY * deltaTime; |
| 1272 |
break; |
| 1273 |
default: |
| 1274 |
Com_Error( ERR_DROP, "BG_EvaluateTrajectoryDelta: unknown trType: %i", tr->trType ); |
| 1275 |
break; |
| 1276 |
} |
| 1277 |
} |
| 1278 |
|
| 1279 |
char *eventnames[] = { |
| 1280 |
"EV_NONE", |
| 1281 |
|
| 1282 |
"EV_FOOTSTEP", |
| 1283 |
"EV_FOOTSTEP_METAL", |
| 1284 |
"EV_FOOTSPLASH", |
| 1285 |
"EV_FOOTWADE", |
| 1286 |
"EV_SWIM", |
| 1287 |
|
| 1288 |
"EV_STEP_4", |
| 1289 |
"EV_STEP_8", |
| 1290 |
"EV_STEP_12", |
| 1291 |
"EV_STEP_16", |
| 1292 |
|
| 1293 |
"EV_FALL_SHORT", |
| 1294 |
"EV_FALL_MEDIUM", |
| 1295 |
"EV_FALL_FAR", |
| 1296 |
|
| 1297 |
"EV_JUMP_PAD", |
| 1298 |
|
| 1299 |
"EV_JUMP", |
| 1300 |
"EV_WATER_TOUCH", |
| 1301 |
"EV_WATER_LEAVE", |
| 1302 |
"EV_WATER_UNDER", |
| 1303 |
"EV_WATER_CLEAR", |
| 1304 |
|
| 1305 |
"EV_ITEM_PICKUP", |
| 1306 |
"EV_GLOBAL_ITEM_PICKUP", |
| 1307 |
|
| 1308 |
"EV_NOAMMO", |
| 1309 |
"EV_CHANGE_WEAPON", |
| 1310 |
"EV_FIRE_WEAPON", |
| 1311 |
|
| 1312 |
"EV_USE_ITEM0", |
| 1313 |
"EV_USE_ITEM1", |
| 1314 |
"EV_USE_ITEM2", |
| 1315 |
"EV_USE_ITEM3", |
| 1316 |
"EV_USE_ITEM4", |
| 1317 |
"EV_USE_ITEM5", |
| 1318 |
"EV_USE_ITEM6", |
| 1319 |
"EV_USE_ITEM7", |
| 1320 |
"EV_USE_ITEM8", |
| 1321 |
"EV_USE_ITEM9", |
| 1322 |
"EV_USE_ITEM10", |
| 1323 |
"EV_USE_ITEM11", |
| 1324 |
"EV_USE_ITEM12", |
| 1325 |
"EV_USE_ITEM13", |
| 1326 |
"EV_USE_ITEM14", |
| 1327 |
"EV_USE_ITEM15", |
| 1328 |
|
| 1329 |
"EV_ITEM_RESPAWN", |
| 1330 |
"EV_ITEM_POP", |
| 1331 |
"EV_PLAYER_TELEPORT_IN", |
| 1332 |
"EV_PLAYER_TELEPORT_OUT", |
| 1333 |
|
| 1334 |
"EV_GRENADE_BOUNCE", |
| 1335 |
|
| 1336 |
"EV_GENERAL_SOUND", |
| 1337 |
"EV_GLOBAL_SOUND", |
| 1338 |
"EV_GLOBAL_TEAM_SOUND", |
| 1339 |
|
| 1340 |
"EV_BULLET_HIT_FLESH", |
| 1341 |
"EV_BULLET_HIT_WALL", |
| 1342 |
|
| 1343 |
"EV_MISSILE_HIT", |
| 1344 |
"EV_MISSILE_MISS", |
| 1345 |
"EV_MISSILE_MISS_METAL", |
| 1346 |
"EV_RAILTRAIL", |
| 1347 |
"EV_SHOTGUN", |
| 1348 |
"EV_BULLET", |
| 1349 |
|
| 1350 |
"EV_PAIN", |
| 1351 |
"EV_DEATH1", |
| 1352 |
"EV_DEATH2", |
| 1353 |
"EV_DEATH3", |
| 1354 |
"EV_OBITUARY", |
| 1355 |
|
| 1356 |
"EV_POWERUP_QUAD", |
| 1357 |
"EV_POWERUP_BATTLESUIT", |
| 1358 |
"EV_POWERUP_REGEN", |
| 1359 |
|
| 1360 |
"EV_GIB_PLAYER", |
| 1361 |
"EV_SCOREPLUM", |
| 1362 |
|
| 1363 |
|
| 1364 |
"EV_PROXIMITY_MINE_STICK", |
| 1365 |
"EV_PROXIMITY_MINE_TRIGGER", |
| 1366 |
"EV_KAMIKAZE", |
| 1367 |
"EV_OBELISKEXPLODE", |
| 1368 |
"EV_OBELISKPAIN", |
| 1369 |
"EV_INVUL_IMPACT", |
| 1370 |
"EV_JUICED", |
| 1371 |
"EV_LIGHTNINGBOLT", |
| 1372 |
|
| 1373 |
|
| 1374 |
"EV_DEBUG_LINE", |
| 1375 |
"EV_STOPLOOPINGSOUND", |
| 1376 |
"EV_TAUNT", |
| 1377 |
"EV_TAUNT_YES", |
| 1378 |
"EV_TAUNT_NO", |
| 1379 |
"EV_TAUNT_FOLLOWME", |
| 1380 |
"EV_TAUNT_GETFLAG", |
| 1381 |
"EV_TAUNT_GUARDBASE", |
| 1382 |
"EV_TAUNT_PATROL" |
| 1383 |
|
| 1384 |
}; |
| 1385 |
|
| 1386 |
|
| 1387 |
|
| 1388 |
|
| 1389 |
|
| 1390 |
|
| 1391 |
|
| 1392 |
|
| 1393 |
|
| 1394 |
void trap_Cvar_VariableStringBuffer( const char *var_name, char *buffer, int bufsize ); |
| 1395 |
|
| 1396 |
void BG_AddPredictableEventToPlayerstate( int newEvent, int eventParm, playerState_t *ps ) { |
| 1397 |
|
| 1398 |
#ifdef _DEBUG |
| 1399 |
{ |
| 1400 |
char buf[256]; |
| 1401 |
trap_Cvar_VariableStringBuffer("showevents", buf, sizeof(buf)); |
| 1402 |
if ( atof(buf) != 0 ) { |
| 1403 |
#ifdef QAGAME |
| 1404 |
Com_Printf(" game event svt %5d -> %5d: num = %20s parm %d\n", ps->pmove_framecount, ps->eventSequence, eventnames[newEvent], eventParm); |
| 1405 |
#else |
| 1406 |
Com_Printf("Cgame event svt %5d -> %5d: num = %20s parm %d\n", ps->pmove_framecount, ps->eventSequence, eventnames[newEvent], eventParm); |
| 1407 |
#endif |
| 1408 |
} |
| 1409 |
} |
| 1410 |
#endif |
| 1411 |
ps->events[ps->eventSequence & (MAX_PS_EVENTS-1)] = newEvent; |
| 1412 |
ps->eventParms[ps->eventSequence & (MAX_PS_EVENTS-1)] = eventParm; |
| 1413 |
ps->eventSequence++; |
| 1414 |
} |
| 1415 |
|
| 1416 |
|
| 1417 |
|
| 1418 |
|
| 1419 |
|
| 1420 |
|
| 1421 |
void BG_TouchJumpPad( playerState_t *ps, entityState_t *jumppad ) { |
| 1422 |
vec3_t angles; |
| 1423 |
float p; |
| 1424 |
int effectNum; |
| 1425 |
|
| 1426 |
|
| 1427 |
if ( ps->pm_type != PM_NORMAL ) { |
| 1428 |
return; |
| 1429 |
} |
| 1430 |
|
| 1431 |
|
| 1432 |
if ( ps->powerups[PW_FLIGHT] ) { |
| 1433 |
return; |
| 1434 |
} |
| 1435 |
|
| 1436 |
|
| 1437 |
|
| 1438 |
if ( ps->jumppad_ent != jumppad->number ) { |
| 1439 |
|
| 1440 |
vectoangles( jumppad->origin2, angles); |
| 1441 |
p = fabs( AngleNormalize180( angles[PITCH] ) ); |
| 1442 |
if( p < 45 ) { |
| 1443 |
effectNum = 0; |
| 1444 |
} else { |
| 1445 |
effectNum = 1; |
| 1446 |
} |
| 1447 |
BG_AddPredictableEventToPlayerstate( EV_JUMP_PAD, effectNum, ps ); |
| 1448 |
} |
| 1449 |
|
| 1450 |
ps->jumppad_ent = jumppad->number; |
| 1451 |
ps->jumppad_frame = ps->pmove_framecount; |
| 1452 |
|
| 1453 |
VectorCopy( jumppad->origin2, ps->velocity ); |
| 1454 |
} |
| 1455 |
|
| 1456 |
|
| 1457 |
|
| 1458 |
|
| 1459 |
|
| 1460 |
|
| 1461 |
|
| 1462 |
|
| 1463 |
|
| 1464 |
void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean snap ) { |
| 1465 |
int i; |
| 1466 |
|
| 1467 |
if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ) { |
| 1468 |
s->eType = ET_INVISIBLE; |
| 1469 |
} else if ( ps->stats[STAT_HEALTH] <= GIB_HEALTH ) { |
| 1470 |
s->eType = ET_INVISIBLE; |
| 1471 |
} else { |
| 1472 |
s->eType = ET_PLAYER; |
| 1473 |
} |
| 1474 |
|
| 1475 |
s->number = ps->clientNum; |
| 1476 |
|
| 1477 |
s->pos.trType = TR_INTERPOLATE; |
| 1478 |
VectorCopy( ps->origin, s->pos.trBase ); |
| 1479 |
if ( snap ) { |
| 1480 |
SnapVector( s->pos.trBase ); |
| 1481 |
} |
| 1482 |
|
| 1483 |
VectorCopy( ps->velocity, s->pos.trDelta ); |
| 1484 |
|
| 1485 |
s->apos.trType = TR_INTERPOLATE; |
| 1486 |
VectorCopy( ps->viewangles, s->apos.trBase ); |
| 1487 |
if ( snap ) { |
| 1488 |
SnapVector( s->apos.trBase ); |
| 1489 |
} |
| 1490 |
|
| 1491 |
s->angles2[YAW] = ps->movementDir; |
| 1492 |
s->legsAnim = ps->legsAnim; |
| 1493 |
s->torsoAnim = ps->torsoAnim; |
| 1494 |
s->clientNum = ps->clientNum; |
| 1495 |
|
| 1496 |
s->eFlags = ps->eFlags; |
| 1497 |
if ( ps->stats[STAT_HEALTH] <= 0 ) { |
| 1498 |
s->eFlags |= EF_DEAD; |
| 1499 |
} else { |
| 1500 |
s->eFlags &= ~EF_DEAD; |
| 1501 |
} |
| 1502 |
|
| 1503 |
if ( ps->externalEvent ) { |
| 1504 |
s->event = ps->externalEvent; |
| 1505 |
s->eventParm = ps->externalEventParm; |
| 1506 |
} else if ( ps->entityEventSequence < ps->eventSequence ) { |
| 1507 |
int seq; |
| 1508 |
|
| 1509 |
if ( ps->entityEventSequence < ps->eventSequence - MAX_PS_EVENTS) { |
| 1510 |
ps->entityEventSequence = ps->eventSequence - MAX_PS_EVENTS; |
| 1511 |
} |
| 1512 |
seq = ps->entityEventSequence & (MAX_PS_EVENTS-1); |
| 1513 |
s->event = ps->events[ seq ] | ( ( ps->entityEventSequence & 3 ) << 8 ); |
| 1514 |
s->eventParm = ps->eventParms[ seq ]; |
| 1515 |
ps->entityEventSequence++; |
| 1516 |
} |
| 1517 |
|
| 1518 |
s->weapon = ps->weapon; |
| 1519 |
s->groundEntityNum = ps->groundEntityNum; |
| 1520 |
|
| 1521 |
s->powerups = 0; |
| 1522 |
for ( i = 0 ; i < MAX_POWERUPS ; i++ ) { |
| 1523 |
if ( ps->powerups[ i ] ) { |
| 1524 |
s->powerups |= 1 << i; |
| 1525 |
} |
| 1526 |
} |
| 1527 |
|
| 1528 |
s->loopSound = ps->loopSound; |
| 1529 |
s->generic1 = ps->generic1; |
| 1530 |
} |
| 1531 |
|
| 1532 |
|
| 1533 |
|
| 1534 |
|
| 1535 |
|
| 1536 |
|
| 1537 |
|
| 1538 |
|
| 1539 |
|
| 1540 |
void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s, int time, qboolean snap ) { |
| 1541 |
int i; |
| 1542 |
|
| 1543 |
if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ) { |
| 1544 |
s->eType = ET_INVISIBLE; |
| 1545 |
} else if ( ps->stats[STAT_HEALTH] <= GIB_HEALTH ) { |
| 1546 |
s->eType = ET_INVISIBLE; |
| 1547 |
} else { |
| 1548 |
s->eType = ET_PLAYER; |
| 1549 |
} |
| 1550 |
|
| 1551 |
s->number = ps->clientNum; |
| 1552 |
|
| 1553 |
s->pos.trType = TR_LINEAR_STOP; |
| 1554 |
VectorCopy( ps->origin, s->pos.trBase ); |
| 1555 |
if ( snap ) { |
| 1556 |
SnapVector( s->pos.trBase ); |
| 1557 |
} |
| 1558 |
|
| 1559 |
VectorCopy( ps->velocity, s->pos.trDelta ); |
| 1560 |
|
| 1561 |
s->pos.trTime = time; |
| 1562 |
|
| 1563 |
s->pos.trDuration = 50; |
| 1564 |
|
| 1565 |
s->apos.trType = TR_INTERPOLATE; |
| 1566 |
VectorCopy( ps->viewangles, s->apos.trBase ); |
| 1567 |
if ( snap ) { |
| 1568 |
SnapVector( s->apos.trBase ); |
| 1569 |
} |
| 1570 |
|
| 1571 |
s->angles2[YAW] = ps->movementDir; |
| 1572 |
s->legsAnim = ps->legsAnim; |
| 1573 |
s->torsoAnim = ps->torsoAnim; |
| 1574 |
s->clientNum = ps->clientNum; |
| 1575 |
|
| 1576 |
s->eFlags = ps->eFlags; |
| 1577 |
if ( ps->stats[STAT_HEALTH] <= 0 ) { |
| 1578 |
s->eFlags |= EF_DEAD; |
| 1579 |
} else { |
| 1580 |
s->eFlags &= ~EF_DEAD; |
| 1581 |
} |
| 1582 |
|
| 1583 |
if ( ps->externalEvent ) { |
| 1584 |
s->event = ps->externalEvent; |
| 1585 |
s->eventParm = ps->externalEventParm; |
| 1586 |
} else if ( ps->entityEventSequence < ps->eventSequence ) { |
| 1587 |
int seq; |
| 1588 |
|
| 1589 |
if ( ps->entityEventSequence < ps->eventSequence - MAX_PS_EVENTS) { |
| 1590 |
ps->entityEventSequence = ps->eventSequence - MAX_PS_EVENTS; |
| 1591 |
} |
| 1592 |
seq = ps->entityEventSequence & (MAX_PS_EVENTS-1); |
| 1593 |
s->event = ps->events[ seq ] | ( ( ps->entityEventSequence & 3 ) << 8 ); |
| 1594 |
s->eventParm = ps->eventParms[ seq ]; |
| 1595 |
ps->entityEventSequence++; |
| 1596 |
} |
| 1597 |
|
| 1598 |
s->weapon = ps->weapon; |
| 1599 |
s->groundEntityNum = ps->groundEntityNum; |
| 1600 |
|
| 1601 |
s->powerups = 0; |
| 1602 |
for ( i = 0 ; i < MAX_POWERUPS ; i++ ) { |
| 1603 |
if ( ps->powerups[ i ] ) { |
| 1604 |
s->powerups |= 1 << i; |
| 1605 |
} |
| 1606 |
} |
| 1607 |
|
| 1608 |
s->loopSound = ps->loopSound; |
| 1609 |
s->generic1 = ps->generic1; |
| 1610 |
} |