29 #include "../idlib/precompiled.h"
81 const idEventDef EV_Player_GiveInventoryItem(
"giveInventoryItem",
"s" );
82 const idEventDef EV_Player_RemoveInventoryItem(
"removeInventoryItem",
"s" );
83 const idEventDef EV_Player_GetIdealWeapon(
"getIdealWeapon",
NULL,
's' );
84 const idEventDef EV_Player_SetPowerupTime(
"setPowerupTime",
"dd" );
85 const idEventDef EV_Player_IsPowerupActive(
"isPowerupActive",
"d",
'd' );
86 const idEventDef EV_Player_WeaponAvailable(
"weaponAvailable",
"s",
'd');
87 const idEventDef EV_Player_StartWarp(
"startWarp" );
88 const idEventDef EV_Player_StopHelltime(
"stopHelltime",
"d" );
89 const idEventDef EV_Player_ToggleBloom(
"toggleBloom",
"d" );
90 const idEventDef EV_Player_SetBloomParms(
"setBloomParms",
"ff" );
112 EVENT( EV_Player_GiveInventoryItem, idPlayer::Event_GiveInventoryItem )
113 EVENT( EV_Player_RemoveInventoryItem,
idPlayer::Event_RemoveInventoryItem )
114 EVENT( EV_Player_GetIdealWeapon,
idPlayer::Event_GetIdealWeapon )
115 EVENT( EV_Player_WeaponAvailable,
idPlayer::Event_WeaponAvailable )
116 EVENT( EV_Player_SetPowerupTime,
idPlayer::Event_SetPowerupTime )
117 EVENT( EV_Player_IsPowerupActive,
idPlayer::Event_IsPowerupActive )
119 EVENT( EV_Player_StopHelltime,
idPlayer::Event_StopHelltime )
121 EVENT( EV_Player_SetBloomParms,
idPlayer::Event_SetBloomParms )
136 idVec3 idPlayer::colorBarTable[ 5 ] = {
225 case INVULNERABILITY:
272 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
288 for( i = 0; i <
items.
Num(); i++ ) {
302 dict.
SetInt(
"items", num );
305 for ( i = 0; i < 4; i++ ) {
317 for ( i = 0; i <
pdas.
Num(); i++ ) {
342 sprintf( key,
"levelTrigger_Level_%i", i );
344 sprintf( key,
"levelTrigger_Trigger_%i", i );
376 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
391 num = dict.
GetInt(
"items" );
393 for( i = 0; i <
num; i++ ) {
396 sprintf( itemname,
"item_%i ", i );
400 key.
Strip( itemname );
407 for ( i = 0; i < 4; i++ ) {
419 num = dict.
GetInt(
"pdas" );
421 for ( i = 0; i <
num; i++ ) {
422 sprintf( itemname,
"pda_%i", i );
427 num = dict.
GetInt(
"videos" );
429 for ( i = 0; i <
num; i++ ) {
430 sprintf( itemname,
"video_%i", i );
435 num = dict.
GetInt(
"emails" );
437 for ( i = 0; i <
num; i++ ) {
438 sprintf( itemname,
"email_%i", i );
449 Give( owner, dict,
"weapon", dict.
GetString(
"weapon_nightmare" ),
NULL, false );
455 num = dict.
GetInt(
"levelTriggers" );
456 for ( i = 0; i <
num; i++ ) {
457 sprintf( itemname,
"levelTrigger_Level_%i", i );
460 sprintf( itemname,
"levelTrigger_Trigger_%i", i );
486 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
497 for( i = 0; i <
items.
Num(); i++ ) {
514 for( i = 0; i <
pdas.
Num(); i++ ) {
563 for(i = 0; i < AMMO_NUMTYPES; i++) {
565 savefile->
WriteInt(rechargeAmmo[i].rechargeTime);
590 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
601 for( i = 0; i <
num; i++ ) {
622 for( i = 0; i <
num; i++ ) {
630 for ( i = 0; i <
num; i++ ) {
638 for( i = 0; i <
num; i++ ) {
646 for( i = 0; i <
num; i++ ) {
656 for( i = 0; i <
num; i++ ) {
666 for( i = 0; i <
num; i++ ) {
677 for ( i = 0; i <
num; i++ ) {
691 for(i = 0; i < AMMO_NUMTYPES; i++) {
693 savefile->
ReadInt(rechargeAmmo[i].rechargeTime);
697 strcpy(rechargeAmmo[i].ammoName, name);
737 const char *weapon_classname;
739 weapon_classname = spawnArgs.
GetString(
va(
"def_weapon%d", i ) );
740 if ( !weapon_classname ) {
762 gameLocal.
Error(
"Unknown weapon in decl '%s'", weapon_classname );
764 if ( ammoRequired ) {
765 *ammoRequired = decl->
dict.
GetInt(
"ammoRequired" );
780 if ( ( num == 0 ) || (
pickupItemNames[ num - 1 ].name.Icmp( name ) != 0 ) ) {
795 msg.
Init( msgBuf,
sizeof( msgBuf ) );
822 if ( !
idStr::Icmp( statname,
"ammo_bloodstone" ) ) {
828 ammo[
i ] += atoi( value );
831 if(
ammo[ i ] >= max) {
836 ammo[
i ] += atoi( value );
837 if(
ammo[ i ] > max) {
847 if (
ammo[ i ] >= max ) {
850 amount = atoi( value );
853 if ( ( max > 0 ) && (
ammo[ i ] > max ) ) {
867 amount = atoi( value );
878 idStr temp = statname;
879 i = atoi(temp.
Mid(7, 2));
886 clip[
i ] = atoi( value );
890 }
else if ( !
idStr::Icmp( statname,
"invulnerability" ) ) {
892 }
else if ( !
idStr::Icmp( statname,
"helltime" ) ) {
894 }
else if ( !
idStr::Icmp( statname,
"envirosuit" ) ) {
897 }
else if ( !
idStr::Icmp( statname,
"berserk" ) ) {
902 }
else if ( !
idStr::Icmp( statname,
"berserk" ) ) {
909 for( pos = value; pos !=
NULL; pos =
end ) {
910 end = strchr( pos,
',' );
918 idStr weaponName( pos, 0, len );
922 if ( weaponName == spawnArgs.
GetString(
va(
"def_weapon%d", i ) ) ) {
927 if ( i >= MAX_WEAPONS ) {
948 if ( owner->
GetUserInfo()->
GetBool(
"ui_autoSwitch" ) && idealWeapon && i != owner->weapon_bloodstone_active1 && i != owner->weapon_bloodstone_active2 && i != owner->weapon_bloodstone_active3) {
969 gameLocal.
Warning(
"Unknown stat '%s' added to player's inventory", statname );
984 assert( weapon_index != -1 || weapon_classname );
985 if ( weapon_index == -1 ) {
986 for( weapon_index = 0; weapon_index <
MAX_WEAPONS; weapon_index++ ) {
991 if ( weapon_index >= MAX_WEAPONS ) {
994 }
else if ( !weapon_classname ) {
995 weapon_classname = spawnArgs.
GetString(
va(
"def_weapon%d", weapon_index ) );
997 weapons &= ( 0xffffffff ^ ( 1 << weapon_index ) );
1000 clip[ weapon_index ] = -1;
1011 if ( ( type == 0 ) || !amount ) {
1017 if (
ammo[ type ] < 0 ) {
1036 int ammoCount =
HasAmmo( ammo_i, ammoRequired );
1037 if(includeClip && owner) {
1042 return HasAmmo( ammo_i, ammoRequired );
1053 bool idInventory::HasEmptyClipCannotRefill(
const char *weapon_classname,
idPlayer* owner) {
1062 gameLocal.
Error(
"Unknown weapon in decl '%s'", weapon_classname );
1064 int minclip = decl->
dict.
GetInt(
"minclipsize");
1070 int ammoRequired = decl->
dict.
GetInt(
"ammoRequired" );
1071 int ammoCount =
HasAmmo( ammo_i, ammoRequired );
1072 if(ammoCount < minclip) {
1085 if ( !
HasAmmo( type, amount ) ) {
1090 if (
ammo[ type ] >= 0 ) {
1124 void idInventory::InitRechargeAmmo(
idPlayer *owner) {
1126 memset (rechargeAmmo, 0,
sizeof(rechargeAmmo));
1133 rechargeAmmo[ammoType].ammo = (atof(kv->
GetValue().
c_str())*1000);
1134 strcpy(rechargeAmmo[ammoType].ammoName, ammoname);
1145 void idInventory::RechargeAmmo(
idPlayer *owner) {
1147 for(
int i = 0; i < AMMO_NUMTYPES; i++) {
1148 if(rechargeAmmo[i].
ammo > 0) {
1149 if(!rechargeAmmo[i].rechargeTime) {
1154 if(elapsed >= rechargeAmmo[i].
ammo) {
1155 int intervals = (
gameLocal.
time - rechargeAmmo[
i].rechargeTime)/rechargeAmmo[i].ammo;
1156 ammo[
i] += intervals;
1164 rechargeAmmo[
i].rechargeTime += intervals*rechargeAmmo[
i].ammo;
1175 bool idInventory::CanGive(
idPlayer *owner,
const idDict &spawnArgs,
const char *statname,
const char *value,
int *idealWeapon ) {
1177 if ( !
idStr::Icmp( statname,
"ammo_bloodstone" ) ) {
1186 if(
ammo[ i ] >= max) {
1232 mountedObject =
NULL;
1233 enviroSuitLight =
NULL;
1261 carryingFlag =
false;
1301 weapon_bloodstone = -1;
1302 weapon_bloodstone_active1 = -1;
1303 weapon_bloodstone_active2 = -1;
1304 weapon_bloodstone_active3 = -1;
1305 harvest_lock =
false;
1308 lastHudPowerup = -1;
1309 hudPowerupDuration = 0;
1458 weap = spawnArgs.
GetString(
va(
"def_weapon%d", w ) );
1459 if ( weap && *weap ) {
1489 weapon_bloodstone =
SlotForWeapon(
"weapon_bloodstone_passive" );
1490 weapon_bloodstone_active1 =
SlotForWeapon(
"weapon_bloodstone_active1" );
1491 weapon_bloodstone_active2 =
SlotForWeapon(
"weapon_bloodstone_active2" );
1492 weapon_bloodstone_active3 =
SlotForWeapon(
"weapon_bloodstone_active3" );
1493 harvest_lock =
false;
1520 mountedObject =
NULL;
1521 if( enviroSuitLight.IsValid() ) {
1522 enviroSuitLight.GetEntity()->PostEventMS( &
EV_Remove, 0 );
1524 enviroSuitLight =
NULL;
1525 healthRecharge =
false;
1526 lastHealthRechargeTime = 0;
1527 rechargeSpeed = 500;
1528 new_g_damageScale = 1.f;
1529 bloomEnabled =
false;
1531 bloomIntensity = -0.01f;
1534 lastHudPowerup = -1;
1535 hudPowerupDuration = 0;
1614 if ( value && ( *value != 0 ) ) {
1631 }
else if ( spawnArgs.
GetString(
"spawn_skin",
NULL, &value ) ) {
1637 value = spawnArgs.
GetString(
"bone_hips",
"" );
1640 gameLocal.
Error(
"Joint '%s' not found for 'bone_hips' on '%s'", value, name.c_str() );
1643 value = spawnArgs.
GetString(
"bone_chest",
"" );
1646 gameLocal.
Error(
"Joint '%s' not found for 'bone_chest' on '%s'", value, name.c_str() );
1649 value = spawnArgs.
GetString(
"bone_head",
"" );
1652 gameLocal.
Error(
"Joint '%s' not found for 'bone_head' on '%s'", value, name.c_str() );
1727 gameLocal.
Error(
"entityNum > MAX_CLIENTS for player. Player may only be spawned with a client." );
1756 }
else if ( spawnArgs.
GetString(
"hud",
"", temp ) ) {
1770 if ( spawnArgs.
GetString(
"cursor",
"", temp ) ) {
1852 if ( weapon_bloodstone > 0 && (
inventory.
weapons & ( 1 << weapon_bloodstone ) ) ) {
1902 new_g_damageScale = 1.0f;
1909 new_g_damageScale = 1.0f;
1914 #ifndef ID_DEMO_BUILD
1928 WeaponToggle_t newToggle;
1935 src.
LoadMemory(toggleData, toggleData.Length(),
"toggleData");
1941 newToggle.toggleList.Append(index);
1946 weaponToggles.Set(newToggle.name, newToggle);
1954 if(!WeaponAvailable(
"weapon_bloodstone_passive")) {
1957 if(!WeaponAvailable(
"weapon_bloodstone_active1")) {
1960 if(!WeaponAvailable(
"weapon_bloodstone_active2")) {
1963 if(!WeaponAvailable(
"weapon_bloodstone_active3")) {
1968 bloomEnabled =
false;
1970 bloomIntensity = -0.01f;
1985 if ( enviroSuitLight.IsValid() ) {
1986 enviroSuitLight.GetEntity()->ProcessEvent( &
EV_Remove );
2035 savefile->
WriteInt( weapon_bloodstone );
2036 savefile->
WriteInt( weapon_bloodstone_active1 );
2037 savefile->
WriteInt( weapon_bloodstone_active2 );
2038 savefile->
WriteInt( weapon_bloodstone_active3 );
2041 savefile->
WriteInt( lastHudPowerup );
2042 savefile->
WriteInt( hudPowerupDuration );
2218 savefile->
WriteInt(weaponToggles.Num());
2219 for(i = 0; i < weaponToggles.Num(); i++) {
2220 WeaponToggle_t* weaponToggle = weaponToggles.GetIndex(i);
2222 savefile->
WriteInt(weaponToggle->toggleList.Num());
2223 for(
int j = 0;
j < weaponToggle->toggleList.Num();
j++) {
2224 savefile->
WriteInt(weaponToggle->toggleList[
j]);
2228 enviroSuitLight.Save( savefile );
2230 savefile->
WriteInt( lastHealthRechargeTime );
2231 savefile->
WriteInt( rechargeSpeed );
2294 savefile->
ReadInt( weapon_bloodstone );
2295 savefile->
ReadInt( weapon_bloodstone_active1 );
2296 savefile->
ReadInt( weapon_bloodstone_active2 );
2297 savefile->
ReadInt( weapon_bloodstone_active3 );
2299 savefile->
ReadBool( harvest_lock );
2300 savefile->
ReadInt( hudPowerup );
2301 savefile->
ReadInt( lastHudPowerup );
2302 savefile->
ReadInt( hudPowerupDuration );
2373 for( i = 0; i <
num; i++ ) {
2383 savefile->
ReadInt( stepUpTime );
2395 savefile->
ReadInt( idealWeapon );
2502 int weaponToggleCount;
2503 savefile->
ReadInt(weaponToggleCount);
2504 for(i = 0; i < weaponToggleCount; i++) {
2505 WeaponToggle_t newToggle;
2506 memset(&newToggle, 0,
sizeof(newToggle));
2510 strcpy(newToggle.name, name.
c_str());
2513 savefile->
ReadInt(indexCount);
2514 for(
int j = 0;
j < indexCount;
j++) {
2517 newToggle.toggleList.Append(temp);
2519 weaponToggles.Set(newToggle.name, newToggle);
2521 savefile->
ReadObject(reinterpret_cast<idClass *&>(mountedObject));
2522 enviroSuitLight.Restore( savefile );
2523 savefile->
ReadBool( healthRecharge );
2524 savefile->
ReadInt( lastHealthRechargeTime );
2525 savefile->
ReadInt( rechargeSpeed );
2526 savefile->
ReadFloat( new_g_damageScale );
2528 savefile->
ReadBool( bloomEnabled );
2631 spawnArgs.
Set(
"spawn_skin", skin );
2698 spec_origin = spawn_origin;
2799 idealWeapon = spawnArgs.
GetInt(
"current_weapon",
"1" );
2823 baseSkinName =
"skins/characters/player/marine_mp_blue";
2825 baseSkinName =
"skins/characters/player/marine_mp_red";
2876 int i, balanceTeam, teamCount[2];
2879 teamCount[ 0 ] = teamCount[ 1 ] = 0;
2882 if ( ent && ent->
IsType( idPlayer::Type ) ) {
2887 if ( teamCount[ 0 ] < teamCount[ 1 ] ) {
2889 }
else if ( teamCount[ 0 ] > teamCount[ 1 ] ) {
2892 if ( balanceTeam != -1 &&
team != balanceTeam ) {
2919 modifiedInfo =
false;
2925 userInfo->
Set(
"ui_spectate",
"Spectate" );
2926 modifiedInfo |=
true;
2928 if ( spec != wantSpectate && !spec ) {
2932 wantSpectate = spec;
2935 if ( canModify && spec ) {
2936 userInfo->
Set(
"ui_spectate",
"Play" );
2937 modifiedInfo |=
true;
2942 wantSpectate =
false;
2961 userInfo->
SetBool(
"ui_chat",
false );
2962 modifiedInfo |=
true;
2965 return modifiedInfo;
2997 _hud->
SetStateString(
"player_totalammo",
va(
"%i", ammoamount - inclip ) );
3003 _hud->
SetStateString(
"player_allammo",
va(
"%i/%i", inclip, ammoamount ) );
3005 _hud->
SetStateString(
"player_allammo",
va(
"%i/%i", inclip, ammoamount - inclip ) );
3009 _hud->
SetStateBool(
"player_ammo_empty", ( ammoamount == 0 ) );
3045 int staminapercentage;
3051 if ( !max_stamina ) {
3053 staminapercentage = 100.0f;
3059 _hud->
SetStateInt(
"player_stamina", staminapercentage );
3063 _hud->
SetStateInt(
"player_nostamina", ( max_stamina == 0 ) ? 1 : 0 );
3143 const char *weapnum =
va(
"def_weapon%d", i );
3144 const char *hudWeap =
va(
"weapon%d", i );
3147 const char *weap = spawnArgs.
GetString( weapnum );
3148 if ( weap && *weap ) {
3151 if ( idealWeapon == i ) {
3157 if ( flashWeapon ) {
3305 forwardspeed = velocity *
viewAxis[ 0 ];
3306 sidespeed = velocity * viewAxis[ 1 ];
3393 if(idealWeapon == weapon_bloodstone) {
3436 weap = spawnArgs.
GetString(
va(
"def_weapon%d", w ) );
3462 amount = atoi( value );
3473 }
else if ( !
idStr::Icmp( statname,
"stamina" ) ) {
3482 }
else if ( !
idStr::Icmp( statname,
"heartRate" ) ) {
3497 }
else if ( !
idStr::Icmp( statname,
"enviroTime" ) ) {
3504 bool ret =
inventory.
Give(
this, spawnArgs, statname, value, &idealWeapon,
true );
3505 if(!
idStr::Icmp( statname,
"ammo_bloodstone" ) ) {
3519 harvest_lock =
false;
3524 return inventory.
Give(
this, spawnArgs, statname, value, &idealWeapon,
true );
3676 msg.
Init( msgBuf,
sizeof( msgBuf ) );
3695 if ( spawnArgs.
GetString(
"snd_berserk_third",
"", &sound ) ) {
3724 spawnArgs.
GetString(
"skin_invisibility",
"", &skin );
3749 if ( spawnArgs.
GetString(
"snd_megahealth",
"", &sound ) ) {
3760 if ( spawnArgs.
GetString(
"snd_helltime_start",
"", &sound ) ) {
3763 if ( spawnArgs.
GetString(
"snd_helltime_loop",
"", &sound ) ) {
3788 enviroSuitLight = eLight;
3793 hudPowerup = ENVIROTIME;
3795 hudPowerupDuration = 60000;
3798 case INVULNERABILITY: {
3831 gameLocal.
Warning(
"Player given power up %i\n which is out of range", powerup );
3847 msg.
Init( msgBuf,
sizeof( msgBuf ) );
3863 StopHealthRecharge();
3889 if ( enviroSuitLight.IsValid() ) {
3890 enviroSuitLight.GetEntity()->PostEventMS( &
EV_Remove, 0 );
3892 enviroSuitLight =
NULL;
3895 case INVULNERABILITY: {
3923 if ( enviroSuitLight.IsValid() ) {
3929 idVec3 enviroAngleOffset = lightDef->
GetVector(
"enviro_angle_offset" );
3934 lightAng.
pitch += enviroAngleOffset.
x;
3935 lightAng.
yaw += enviroAngleOffset.
y;
3936 lightAng.
roll += enviroAngleOffset.
z;
3938 enviroSuitLight.GetEntity()->GetPhysics()->SetOrigin( lightOrg );
3939 enviroSuitLight.GetEntity()->GetPhysics()->SetAxis( lightAng.
ToMat3() );
3940 enviroSuitLight.GetEntity()->UpdateVisuals();
3941 enviroSuitLight.GetEntity()->Present();
3978 #ifndef ID_DEMO_BUILD
4014 if ( enviroSuitLight.IsValid() ) {
4015 enviroSuitLight.GetEntity()->PostEventMS( &
EV_Remove, 0 );
4032 const char* itemName = item->
GetString(
"inv_name" );
4036 info.
name = itemName;
4045 #ifdef _D3XP //Added to support powercells
4048 int powerCellCount = 0;
4051 if(item->
GetInt(
"inv_powercell")) {
4062 #ifdef _D3XP //BSM: Implementing this defined function for scripted give inventory items
4071 args.
Set(
"classname", name );
4072 args.
Set(
"owner", this->name.c_str() );
4123 for (
int i = 0; i <
c; i++ ) {
4143 if ( videoName ==
NULL || *videoName ==
'\0' ) {
4180 if ( emailName ==
NULL || *emailName ==
'\0' ) {
4207 if ( pdaName ==
NULL || *pdaName ==
'\0' ) {
4208 pdaName =
"personal";
4232 hud->
SetStateString(
"pda_security", ( sec && *sec ) ?
"1" :
"0" );
4259 if ( iname && *iname ) {
4292 #ifdef _D3XP //Added to support powercells
4295 int powerCellCount = 0;
4298 if(item->
GetInt(
"inv_powercell")) {
4317 args.
Set(
"classname", itemname );
4318 args.
Set(
"owner", name.c_str() );
4334 const char *weap = spawnArgs.
GetString(
va(
"def_weapon%d", i ) );
4378 weap = spawnArgs.
GetString(
va(
"def_weapon%d", w ) );
4386 if ( !spawnArgs.
GetBool(
va(
"weapon%d_best", w ) ) ) {
4394 if(
inventory.HasEmptyClipCannotRefill(weap,
this)) {
4432 if ( w >= MAX_WEAPONS ) {
4435 weap = spawnArgs.
GetString(
va(
"def_weapon%d", w ) );
4436 if ( !spawnArgs.
GetBool(
va(
"weapon%d_cycle", w ) ) ) {
4489 w = MAX_WEAPONS - 1;
4491 weap = spawnArgs.
GetString(
va(
"def_weapon%d", w ) );
4492 if ( !spawnArgs.
GetBool(
va(
"weapon%d_cycle", w ) ) ) {
4529 if ( ( num < 0 ) || ( num >= MAX_WEAPONS ) ) {
4547 weap = spawnArgs.
GetString(
va(
"def_weapon%d", num ) );
4555 WeaponToggle_t* weaponToggle;
4556 if(weaponToggles.Get(
va(
"weapontoggle%d", num), &weaponToggle)) {
4558 int weaponToggleIndex = 0;
4561 int currentIndex = -1;
4562 for(
int i = 0; i < weaponToggle->toggleList.Num(); i++) {
4563 if(weaponToggle->toggleList[i] == idealWeapon) {
4568 if(currentIndex == -1) {
4570 weaponToggleIndex = 0;
4573 weaponToggleIndex = currentIndex;
4574 weaponToggleIndex++;
4575 if(weaponToggleIndex >= weaponToggle->toggleList.Num()) {
4576 weaponToggleIndex = 0;
4580 for(
int i = 0; i < weaponToggle->toggleList.Num(); i++) {
4583 if(
inventory.
weapons & ( 1 << weaponToggle->toggleList[weaponToggleIndex])) {
4587 weaponToggleIndex++;
4588 if(weaponToggleIndex >= weaponToggle->toggleList.Num()) {
4589 weaponToggleIndex = 0;
4593 num = weaponToggle->toggleList[weaponToggleIndex];
4632 int inclip, ammoavailable;
4654 ammoavailable += inclip;
4662 if ( ( ammoavailable != -1 ) && ( ammoavailable < 0 ) ) {
4663 common->
DPrintf(
"idPlayer::DropWeapon: bad ammo setup\n" );
4682 inclipKey.
Insert(
"inclip_", 4 );
4714 if ( newweap == -1 ) {
4721 const char *weapon_classname = spawnArgs.
GetString(
va(
"def_weapon%d", newweap ) );
4722 assert( weapon_classname );
4727 ammoavailable += inclip;
4730 if ( ( ammoavailable != -1 ) && ( ammoavailable < 0 ) ) {
4732 common->
DPrintf(
"idPlayer::StealWeapon: bad ammo setup\n" );
4739 ammoavailable = atoi( keypair->
GetValue() );
4750 Give(
"weapon", weapon_classname );
4752 idealWeapon = newweap;
4821 assert( idealWeapon >= 0 );
4822 assert( idealWeapon < MAX_WEAPONS );
4954 const char *command =
NULL;
4955 bool updateVisuals =
false;
4999 if ( idealWeapon != -1 ) {
5113 if ( !player || ( player->
spectating && player !=
this ) ) {
5134 if ( token ==
";" ) {
5138 if ( token.
Icmp(
"addhealth" ) == 0 ) {
5139 if ( entityGui &&
health < 100 ) {
5155 if ( token.
Icmp(
"ready" ) == 0 ) {
5160 if ( token.
Icmp(
"updatepda" ) == 0 ) {
5165 if ( token.
Icmp(
"updatepda2" ) == 0 ) {
5170 if ( token.
Icmp(
"stoppdavideo" ) == 0 ) {
5177 if ( token.
Icmp(
"close" ) == 0 ) {
5183 if ( token.
Icmp(
"playpdavideo" ) == 0 ) {
5188 for (
int i = 0; i <
c; i++ ) {
5202 if ( token.
Icmp(
"playpdaaudio" ) == 0 ) {
5214 if ( token.
Icmp(
"stoppdaaudio" ) == 0 ) {
5266 if ( locationEntity ) {
5300 int listedClipModels;
5310 const char *command;
5355 if (
MPAim != iclient ) {
5369 for ( i = 0; i < listedClipModels; i++ ) {
5370 clip = clipModelList[
i ];
5378 if ( ent->
IsType( idAFAttachment::Type ) ) {
5380 if ( body && body->
IsType( idAI::Type ) && (
static_cast<idAI *
>( body )->GetTalkState() >=
TALK_OK ) ) {
5393 if ( ent->
IsType( idAI::Type ) ) {
5394 if ( static_cast<idAI *>( ent )->GetTalkState() >=
TALK_OK ) {
5407 if ( ent->
IsType( idAFEntity_Vehicle::Type ) ) {
5432 if ( !focusGUIrenderEntity ) {
5436 if ( pt.
guiId == 1 ) {
5437 ui = focusGUIrenderEntity->
gui[ 0 ];
5438 }
else if ( pt.
guiId == 2 ) {
5439 ui = focusGUIrenderEntity->
gui[ 1 ];
5441 ui = focusGUIrenderEntity->
gui[ 2 ];
5452 if ( oldFocus != ent ) {
5459 const char *iname = item->
GetString(
"inv_name" );
5460 const char *iicon = item->
GetString(
"inv_icon" );
5461 const char *itext = item->
GetString(
"inv_text" );
5481 #ifdef _D3XP //BSM: Added for powercells
5482 int powerCellCount = 0;
5485 if(item->
GetInt(
"inv_powercell")) {
5526 }
else if ( oldFocus && oldUI ) {
5565 idVec3 gravityVector, gravityNormal;
5567 float hardDelta, fatalDelta;
5586 if ( ( oldVelocity * -gravityNormal ) >= 0.0f ) {
5612 dist = ( origin - oldOrigin ) * -gravityNormal;
5613 vel = oldVelocity * -gravityNormal;
5614 acc = -gravityVector.
Length();
5620 den = b * b - 4.0f * a *
c;
5626 delta = vel + t * acc;
5627 delta = delta * delta * 0.0001;
5637 if ( delta < 1.0f ) {
5650 if ( delta > fatalDelta ) {
5658 }
else if ( delta > hardDelta ) {
5666 }
else if ( delta > 30 ) {
5674 }
else if ( delta > 7 ) {
5678 }
else if ( delta > 3 ) {
5691 idVec3 vel, gravityDir, velocity;
5705 vel = velocity - ( velocity * gravityDir ) * gravityDir;
5748 delta = velocity * viewaxis[0];
5751 delta = velocity * viewaxis[1];
5756 speed = xyspeed > 200 ? xyspeed : 200;
5779 if ( deltaTime < STEPUP_TIME ) {
5794 if ( deltaTime < STEPUP_TIME ) {
5825 for(
int i = 0; i < 3; i++ ) {
5870 for ( i = 0; i < 3; i++ ) {
5892 }
else if ( mountedObject ) {
5893 int yaw_min, yaw_max, varc;
5895 mountedObject->GetAngleRestrictions( yaw_min, yaw_max, varc );
5897 if ( yaw_min < yaw_max ) {
5980 rate += ( diff < 5000 ) ? ( diff < 2500 ) ? ( diff < 1000 ) ? 15 : 10 : 5 : 0;
6011 pct *= ((
float)dmgVol - (
float)zeroVol);
6012 }
else if (
health <= 0 ) {
6016 }
else if (pct < 0.0f) {
6019 pct *= ((
float)deathVol - (
float)zeroVol);
6022 pct += (
float)zeroVol;
6024 if ( pct != zeroVol ) {
6028 memset( &parms, 0,
sizeof( parms ) );
6048 bool newAirless =
false;
6059 areaNum = pvsAreas[0];
6086 int dmgTiming = 1000 * ((damageDef) ? damageDef->
GetFloat(
"delay",
"3.0" ) : 3.0f );
6114 void idPlayer::UpdatePowerupHud() {
6120 if(lastHudPowerup != hudPowerup) {
6122 if(hudPowerup == -1) {
6134 lastHudPowerup = hudPowerup;
6137 if(hudPowerup != -1) {
6143 hud->
SetStateInt(
"player_powerup", 100 * filledbar / hudPowerupDuration );
6144 hud->
SetStateInt(
"player_poweruptime", remaining / 1000 );
6160 for ( i = 0; i <
c; i++ ) {
6162 if ( email ==
NULL ) {
6163 work =
va(
"-\tEmail %d not found\t-", i );
6176 for ( i = 0; i <
c; i++ ) {
6178 if ( audio ==
NULL ) {
6179 work =
va(
"Audio Log %d not found", i );
6188 for ( i = 0; i <
c; i++ ) {
6190 if ( video ==
NULL ) {
6244 if ( currentPDA == -1 ) {
6248 if ( updatePDASel ) {
6254 if ( currentPDA > 0 ) {
6259 if ( currentPDA < 128 ) {
6280 if ( pda ==
NULL ) {
6299 if ( j == currentPDA || (currentPDA == 0 && security && *security ) ) {
6300 if ( *security ==
'\0' ) {
6306 if ( j == currentPDA ) {
6345 if ( updatePDASel ) {
6374 if ( numEmails > 0 ) {
6377 if ( sel >= 0 && sel < numEmails ) {
6418 for ( j = 0; j <
c; j++ ) {
6420 if ( !item->
GetBool(
"inv_pda" ) ) {
6421 const char *iname = item->
GetString(
"inv_name" );
6422 const char *iicon = item->
GetString(
"inv_icon" );
6423 const char *itext = item->
GetString(
"inv_text" );
6435 const char *weapnum =
va(
"def_weapon%d", j );
6436 const char *hudWeap =
va(
"weapon%d", j );
6439 const char *weap = spawnArgs.
GetString( weapnum );
6440 if ( weap && *weap ) {
6496 msg.
Init( msgBuf,
sizeof( msgBuf ) );
6571 if ( ent && ent->
IsType( idAFEntity_Vehicle::Type ) ) {
6591 msg.
Init( msgBuf,
sizeof( msgBuf ) );
6652 if ( enviroSuitLight.IsValid() ) {
6653 enviroSuitLight.GetEntity()->PostEventMS( &
EV_Remove, 0 );
6654 enviroSuitLight =
NULL;
6663 idVec3 enviroAngleOffset = lightDef->
GetVector(
"enviro_angle_offset" );
6666 enviroSuitLight =
static_cast<idLight *
>(temp);
6673 lightAng.
pitch += enviroAngleOffset.
x;
6674 lightAng.
yaw += enviroAngleOffset.
y;
6675 lightAng.
roll += enviroAngleOffset.
z;
6677 enviroSuitLight.GetEntity()->GetPhysics()->SetOrigin( lightOrg );
6678 enviroSuitLight.GetEntity()->GetPhysics()->SetAxis( lightAng.
ToMat3() );
6680 enviroSuitLight.GetEntity()->UpdateVisuals();
6681 enviroSuitLight.GetEntity()->Present();
6865 if ( diff < 0.1f ) {
6897 if ( frac > 0.0f ) {
6899 forwardBlend = 1.0f - frac;
6903 forwardBlend = 1.0f + frac;
6993 if ( aas !=
NULL ) {
7033 }
else if (
health <= 0 ) {
7040 }
else if ( mountedObject ) {
7051 }
else if (
health <= 0 ) {
7068 newEyeOffset = 0.0f;
7069 }
else if (
health <= 0 ) {
7074 newEyeOffset = 0.0f;
7101 if ( groundEnt && groundEnt->
IsType( idAI::Type ) ) {
7121 acc->
dir[0] = acc->
dir[1] = 0;
7128 if ( old_rung != new_rung ) {
7167 for ( i = 0; i <
count, i <
c; i++ ) {
7235 if ( state_hitch ) {
7316 if ( mountedObject ) {
7338 acc->
dir[1] = acc->
dir[2] = 0;
7346 acc->
dir[0] = acc->
dir[2] = 0;
7366 if ( gui && gui !=
focusUI ) {
7394 float scale = new_g_damageScale;
7399 if ( scale < 1.0f ) {
7402 if ( scale > 1.0f ) {
7406 new_g_damageScale =
scale;
7443 }
else if (
health > 0 ) {
7463 if ( enviroSuitLight.IsValid() ) {
7469 idVec3 enviroAngleOffset = lightDef->
GetVector(
"enviro_angle_offset" );
7474 lightAng.
pitch += enviroAngleOffset.
x;
7475 lightAng.
yaw += enviroAngleOffset.
y;
7476 lightAng.
roll += enviroAngleOffset.
z;
7478 enviroSuitLight.GetEntity()->GetPhysics()->SetOrigin( lightOrg );
7479 enviroSuitLight.GetEntity()->GetPhysics()->SetAxis( lightAng.
ToMat3() );
7480 enviroSuitLight.GetEntity()->UpdateVisuals();
7481 enviroSuitLight.GetEntity()->Present();
7489 headRenderEnt =
NULL;
7492 if ( headRenderEnt ) {
7502 if ( headRenderEnt ) {
7507 if ( headRenderEnt ) {
7513 if ( headRenderEnt ) {
7547 if(healthRecharge) {
7549 if(elapsed >= rechargeSpeed) {
7550 int intervals = (
gameLocal.
time - lastHealthRechargeTime)/rechargeSpeed;
7551 Give(
"health",
va(
"%d", intervals));
7552 lastHealthRechargeTime += intervals*rechargeSpeed;
7567 void idPlayer::StartHealthRecharge(
int speed) {
7569 healthRecharge =
true;
7570 rechargeSpeed = speed;
7578 void idPlayer::StopHealthRecharge() {
7579 healthRecharge =
false;
7587 idStr idPlayer::GetCurrentWeapon() {
7603 bool idPlayer::CanGive(
const char *statname,
const char *value ) {
7613 }
else if ( !
idStr::Icmp( statname,
"stamina" ) ) {
7619 }
else if ( !
idStr::Icmp( statname,
"heartRate" ) ) {
7628 return inventory.CanGive(
this, spawnArgs, statname, value, &idealWeapon );
7641 void idPlayer::StopHelltime(
bool quick ) {
7673 void idPlayer::Event_ToggleBloom(
int on ) {
7675 bloomEnabled =
true;
7678 bloomEnabled =
false;
7687 void idPlayer::Event_SetBloomParms(
float speed,
float intensity ) {
7689 bloomIntensity = intensity;
7697 void idPlayer::PlayHelltimeStopSound() {
7700 if ( spawnArgs.
GetString(
"snd_helltime_stop",
"", &sound ) ) {
7713 const char *command;
7731 if ( attacker && attacker !=
this ) {
7733 }
else if ( inflictor && inflictor !=
this ) {
7751 }
else if (
health > 0 ) {
7758 if ( delayRespawn ) {
7760 int delay = spawnArgs.
GetFloat(
"respawn_delay" );
7810 delay = spawnArgs.
GetFloat(
"respawn_delay" );
7822 weapon.GetEntity()->OwnerDied();
7843 if ( attacker->
IsType( idPlayer::Type ) ) {
7844 killer =
static_cast<idPlayer*
>(attacker);
7878 headPos = offset + origin;
7881 chestPos = offset + origin;
7894 if ( damage && ( victim !=
this ) && ( victim->
IsType( idActor::Type ) || victim->
IsType( idDamagable::Type ) ) ) {
7899 if ( victim->
IsType( idPlayer::Type ) ) {
7900 victimPlayer =
static_cast<idPlayer*
>(victim);
7926 damageDef->
GetInt(
"damage",
"20", damage );
7954 if ( attacker ==
this ) {
7957 damage *= damageDef->
GetFloat(
"selfDamageScale",
"0.5" );
7959 damage *= damageDef->
GetFloat(
"selfDamageScale",
"1" );
7964 if ( !damageDef->
GetBool(
"noGod" ) ) {
7981 if ( !damageDef->
GetBool(
"noArmor" ) ) {
7982 float armor_protection;
7986 armorSave = ceil( damage * armor_protection );
7993 }
else if ( armorSave >= damage ) {
7994 armorSave = damage - 1;
7997 damage -= armorSave;
8006 && !damageDef->
GetBool(
"noTeam" )
8034 const char *damageDefName,
const float damageScale,
const int location ) {
8040 idVec3 localDamageVector;
8041 float attackerPushScale;
8043 SetTimeState ts( timeGroup );
8062 if ( attacker->
IsType( idAI::Type ) ) {
8080 if ( damageDef->
dict.
GetBool(
"ignore_player" ) ) {
8084 CalcDamagePoints( inflictor, attacker, &damageDef->
dict, damageScale, location, &damage, &armorSave );
8087 damageDef->
dict.
GetInt(
"knockback",
"20", knockback );
8103 if ( attacker ==
this ) {
8104 damageDef->
dict.
GetFloat(
"attackerPushScale",
"0", attackerPushScale );
8106 attackerPushScale = 1.0f;
8131 }
else if ( damageDef->
dict.
GetBool(
"no_air" ) ) {
8132 if ( !armorSave && health > 0 ) {
8139 entityNumber, health, damage, armorSave );
8160 float scale = new_g_damageScale;
8168 new_g_damageScale =
scale;
8175 if ( scale > 0.0f ) {
8187 if ( health <= 0 ) {
8189 if ( health < -999 ) {
8196 Killed( inflictor, attacker, damage, dir, location );
8203 AI_PAIN =
Pain( inflictor, attacker, damage, dir, location );
8232 if ( weapon.GetEntity() ) {
8233 weapon.GetEntity()->LowerWeapon();
8306 if ( fov < 90.0f ) {
8308 }
else if ( fov > 110.0f ) {
8343 }
else if ( fov > 179 ) {
8370 int weaponAngleOffsetAverages;
8371 float weaponAngleOffsetScale, weaponAngleOffsetMax;
8373 weapon.GetEntity()->GetWeaponAngleOffsets( &weaponAngleOffsetAverages, &weaponAngleOffsetScale, &weaponAngleOffsetMax );
8378 for (
int j = 1 ; j < weaponAngleOffsetAverages ; j++ ) {
8383 if ( delta[1] > 180 ) {
8385 }
else if ( delta[1] < -180 ) {
8389 av += delta * ( 1.0f / weaponAngleOffsetAverages );
8392 a = ( av - current ) * weaponAngleOffsetScale;
8394 for (
int i = 0 ; i < 3 ; i++ ) {
8395 if ( a[i] < -weaponAngleOffsetMax ) {
8396 a[
i] = -weaponAngleOffsetMax;
8397 }
else if ( a[i] > weaponAngleOffsetMax ) {
8398 a[
i] = weaponAngleOffsetMax;
8416 float weaponOffsetTime, weaponOffsetScale;
8420 weapon.GetEntity()->GetWeaponTimeOffsets( &weaponOffsetTime, &weaponOffsetScale );
8431 if ( t >= weaponOffsetTime ) {
8435 f = t / weaponOffsetTime;
8436 f = ( cos( f * 2.0f *
idMath::PI ) - 1.0f ) * 0.5f;
8437 ofs += f * weaponOffsetScale * acc->
dir;
8465 origin = viewOrigin + ( gunpos + gunOfs ) * viewAxis;
8499 scale = xyspeed + 40.0f;
8501 angles.
roll += fracsin;
8502 angles.
yaw += fracsin;
8503 angles.
pitch += fracsin;
8519 float forwardScale, sideScale;
8529 angles.
pitch = 0.0f;
8532 if ( angles.
pitch > 45.0f ) {
8533 angles.
pitch = 45.0f;
8541 angles.
pitch *= 0.5f;
8555 view.
z += ( 1.0f - trace.
fraction ) * 32.0f;
8566 focusDist =
idMath::Sqrt( focusPoint[0] * focusPoint[0] + focusPoint[1] * focusPoint[1] );
8567 if ( focusDist < 1.0f ) {
8571 angles.
pitch = -
RAD2DEG( atan2( focusPoint.
z, focusDist ) );
8572 angles.
yaw -= angle;
8605 if ( health <= 0 ) {
8637 ang.
yaw += viewAxis[ 0 ].ToYaw();
8824 if (
MPAim != -1 ) {
8864 if ( ent->
IsType( idProjectile::Type ) ) {
8870 weapon.GetEntity()->EnterCinematic();
8875 weapon.GetEntity()->ExitCinematic();
8891 if ( mtr && *mtr ) {
8894 if ( skinname && *skinname ) {
8902 if ( radius > 0.0f ) {
8980 if ( weapon.GetEntity() ) {
8981 weapon.GetEntity()->ExitCinematic();
8993 if ( weapon.GetEntity() ) {
8994 weapon.GetEntity()->EnterCinematic();
9004 void idPlayer::Event_GiveInventoryItem(
const char* name ) {
9013 void idPlayer::Event_RemoveInventoryItem(
const char* name ) {
9022 void idPlayer::Event_GetIdealWeapon(
void ) {
9025 if ( idealWeapon >= 0 ) {
9026 weapon = spawnArgs.
GetString(
va(
"def_weapon%d", idealWeapon ) );
9038 void idPlayer::Event_SetPowerupTime(
int powerup,
int time ) {
9051 void idPlayer::Event_IsPowerupActive(
int powerup ) {
9060 void idPlayer::Event_StartWarp() {
9069 void idPlayer::Event_StopHelltime(
int mode ) {
9071 StopHelltime(
true );
9074 StopHelltime(
false );
9083 void idPlayer::Event_WeaponAvailable(
const char* name ) {
9088 bool idPlayer::WeaponAvailable(
const char* name ) {
9091 const char *weap = spawnArgs.
GetString(
va(
"def_weapon%d", i ) );
9128 weapon = spawnArgs.
GetString(
va(
"def_weapon%d", pw) );
9151 weapon.GetEntity()->HideWeapon();
9158 const char *weap = spawnArgs.
GetString(
va(
"def_weapon%d", i ) );
9166 if ( weaponNum < 0 ) {
9167 gameLocal.
Warning(
"%s is not carrying weapon '%s'", name.c_str(), weaponName );
9172 idealWeapon = weaponNum;
9227 common->
DPrintf(
"Event_ExitTeleporter player %d while not being teleported\n", entityNumber );
9286 if ( mountedObject ) {
9371 headRenderEnt =
NULL;
9374 if ( headRenderEnt ) {
9384 if ( headRenderEnt ) {
9389 if ( headRenderEnt ) {
9395 if ( headRenderEnt ) {
9404 if ( enviroSuitLight.IsValid() ) {
9410 idVec3 enviroAngleOffset = lightDef->
GetVector(
"enviro_angle_offset" );
9415 lightAng.
pitch += enviroAngleOffset.
x;
9416 lightAng.
yaw += enviroAngleOffset.
y;
9417 lightAng.
roll += enviroAngleOffset.
z;
9419 enviroSuitLight.GetEntity()->GetPhysics()->SetOrigin( lightOrg );
9420 enviroSuitLight.GetEntity()->GetPhysics()->SetAxis( lightAng.
ToMat3() );
9421 enviroSuitLight.GetEntity()->UpdateVisuals();
9422 enviroSuitLight.GetEntity()->Present();
9512 memset( &view, 0,
sizeof( view ) );
9539 msg.
WriteBits( weapon.GetSpawnId(), 32 );
9550 msg.
WriteBits( enviroSuitLight.GetSpawnId(), 32 );
9560 int i, oldHealth, newIdealWeapon, weaponSpawnId;
9561 bool newHitToggle, stateHitch;
9583 weaponSpawnId = msg.
ReadBits( 32 );
9585 newHitToggle = msg.
ReadBits( 1 ) != 0;
9590 carryingFlag = msg.
ReadBits( 1 ) != 0;
9594 enviroSpawnId = msg.
ReadBits( 32 );
9595 enviroSuitLight.SetSpawnId( enviroSpawnId );
9600 if ( weapon.SetSpawnId( weaponSpawnId ) ) {
9601 if ( weapon.GetEntity() ) {
9603 weapon.GetEntity()->SetOwner(
this );
9609 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
9614 if ( oldHealth > 0 && health <= 0 ) {
9631 if ( !stateHitch ) {
9634 if ( weapon.GetEntity() ) {
9635 weapon.GetEntity()->OwnerDied();
9637 }
else if ( oldHealth <= 0 && health > 0 ) {
9644 }
else if ( health < oldHealth && health > 0 ) {
9673 if ( idealWeapon != newIdealWeapon ) {
9677 idealWeapon = newIdealWeapon;
9708 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
9734 for( i = 0; i < AMMO_NUMTYPES; i++ ) {
9795 case EVENT_PICKUPNAME: {
9803 bool spectate = ( msg.
ReadBits( 1 ) != 0 );
9831 weap = weapon.GetEntity();
9846 weap = weapon.GetEntity();
9960 if ( weap && *weap ) {
9980 if ( levelName && *levelName && triggerName && *triggerName ) {
10081 void idPlayer::DropFlag(
void ) {
10087 idItemTeam * item =
static_cast<idItemTeam*
>(entity);
10089 if ( item->carried && !item->dropped ) {
10090 item->Drop( health <= 0 );
10091 carryingFlag =
false;
10097 void idPlayer::ReturnFlag() {
10104 idItemTeam * item =
static_cast<idItemTeam*
>(entity);
10106 if ( item->carried && !item->dropped ) {
10108 carryingFlag =
false;
virtual const idVec3 & GetOrigin(int id=0) const =0
void Spectate(bool spectate)
const idEventDef EV_ActivateTargets("activateTargets","e")
void FreeSoundEmitter(bool immediate)
idCVar pm_thirdPersonDeath("pm_thirdPersonDeath","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_BOOL,"enables third person view when player dies")
idScriptBool AI_TURN_LEFT
idPhysics_Player physicsObj
void TeleportDeath(int killer)
int ClipModelsTouchingBounds(const idBounds &bounds, int contentMask, idClipModel **clipModelList, int maxCount) const
idCVar g_gun_x("g_gunX","0", CVAR_GAME|CVAR_FLOAT,"")
const idVec3 & GetGravity(void) const
idEntity * GetEntity(void) const
bool TouchTriggers(void) const
virtual void SetSecurity(const char *sec) const
renderEntity_t renderEntity
bool TracePoint(trace_t &results, const idVec3 &start, const idVec3 &end, int contentMask, const idEntity *passEntity)
void SetClipModel(idClipModel *model, float density, int id=0, bool freeOld=true)
const char * GetPost() const
idInterpolate< float > centerView
idCVar pm_jumpheight("pm_jumpheight","48", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"approximate hieght the player can jump")
float GetFloat(const char *key, const char *defaultString="0") const
const idEventDef EV_Player_GetPreviousWeapon("getPreviousWeapon", NULL, 's')
bool IsGametypeTeamBased(void)
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
static const int NUM_LOGGED_ACCELS
GLsizei const GLfloat * value
int ReadShort(void) const
const int LOWHEALTH_HEARTRATE_ADJ
idCVar pm_usecylinder("pm_usecylinder","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_BOOL,"use a cylinder approximation instead of a bounding box for player collision detection")
void WriteString(const char *string)
virtual void UpdatePlayerIcons(void)
int GetInt(const char *key, const char *defaultString="0") const
void WeaponFireFeedback(const idDict *weaponDef)
bool PostEventSec(const idEventDef *ev, float time)
void WriteBindToSnapshot(idBitMsgDelta &msg) const
idCVar g_fov("g_fov","90", CVAR_GAME|CVAR_INTEGER|CVAR_NOCHEAT,"")
const char * GetFrom() const
virtual void SetEnviroSuit(bool active)=0
assert(prefInfo.fullscreenBtn)
const char * GetPdaName() const
void SetOwner(idPlayer *owner)
void Restore(idRestoreGame *savefile)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
virtual guiPoint_t GuiTrace(qhandle_t entityHandle, const idVec3 start, const idVec3 end) const =0
virtual void StateChanged(int time, bool redraw=false)=0
const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
virtual const idVec3 & GetGravityNormal(void) const =0
void Restore(idRestoreGame *savefile)
idCVar pm_deadviewheight("pm_deadviewheight","10", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"height of player's view while dead")
virtual idThread * ConstructScriptObject(void)
int Cmp(const char *text) const
idCVarSystem * cvarSystem
void SetInfluenceLevel(int level)
virtual const int GetNumVideos() const
void TalkTo(idActor *actor)
bool IsActiveAF(void) const
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
const int MAX_GLOBAL_SHADER_PARMS
idLinkList< idActor > enemyNode
idNetworkSystem * networkSystem
idCVar g_damageScale("g_damageScale","1", CVAR_GAME|CVAR_FLOAT|CVAR_ARCHIVE,"scale final damage on player by this factor")
void ReadMaterial(const idMaterial *&material)
void WriteObject(const idClass *obj)
idVec3 GetCenter(void) const
const int LADDER_RUNG_DISTANCE
void SavePersistantInfo(void)
bool GetFloorPos(float max_dist, idVec3 &floorpos) const
const char * GetWave() const
idCVar pm_thirdPersonRange("pm_thirdPersonRange","80", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"camera distance from player in 3rd person")
idCVar pm_runbob("pm_runbob","0.4", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"bob faster when running")
void Printf(const char *fmt,...) const id_attribute((format(printf
const int RAGDOLL_DEATH_TIME
idCVar pm_bobroll("pm_bobroll","0.002", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"")
idScriptBool AI_SOFTLANDING
virtual void SetStateString(const char *varName, const char *value)=0
int GetDamageForLocation(int damage, int location)
idCVar g_useDynamicProtection("g_useDynamicProtection","1", CVAR_GAME|CVAR_BOOL|CVAR_ARCHIVE,"scale damage and armor dynamically to keep the player alive more often")
struct idEntity::entityFlags_s fl
void FreeCurrentPVS(pvsHandle_t handle) const
virtual void virtual void virtual const idLangDict * GetLanguageDict(void)=0
loggedAccel_t loggedAccel[NUM_LOGGED_ACCELS]
const char * GetPreview() const
idScriptBool AI_ATTACK_HELD
virtual int GetModelDefHandle(void)
type * GetEntity(void) const
const int MAX_EVENT_PARAM_SIZE
idCVar pm_runroll("pm_runroll","0.005", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"")
waterLevel_t GetWaterLevel(void) const
const int HEALTHPULSE_TIME
idCVar pm_crouchspeed("pm_crouchspeed","80", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"speed the player can move while crouched")
void SetAASLocation(void)
float GetFloat(void) const
bool GiveItem(idItem *item)
const idStr & GetKey(void) const
virtual void ClientPredictionThink(void)
const int GetNumStages(void) const
void SetPlayerEntity(class idPlayer *playerEnt)
void SetNum(int newnum, bool resize=true)
void Translate(const idVec3 &translation)
void ReadDict(idDict *dict)
bool SetSyncedAnimWeight(int num, float weight)
const char * ToString(int precision=2) const
void SetMass(float mass, int id=-1)
const idEventDef EV_Activate("activate","e")
static void CacheWeapon(const char *weaponName)
idEntity * GetBindMaster(void) const
void Event_GetCurrentWeapon(void)
const idEventDef EV_Player_DisableWeapon("disableWeapon")
void SwitchToTeam(int clientNum, int oldteam, int newteam)
const int LAND_RETURN_TIME
const idEventDef EV_Player_EnableWeapon("enableWeapon")
const int HEALTH_PER_DOSE
void WriteSkin(const idDeclSkin *skin)
GLenum GLenum GLenum GLenum GLenum scale
idMat3 Transpose(void) const
void SetSpectateOrigin(void)
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
void SetPushVelocity(const idVec3 &pushVelocity)
idCVar g_showPlayerShadow("g_showPlayerShadow","0", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"enables shadow of player model")
idScriptObject scriptObject
bool IsType(const idTypeInfo &c) const
void DropWeapon(bool died)
virtual void GetAIAimTargets(const idVec3 &lastSightPos, idVec3 &headPos, idVec3 &chestPos)
void SetCombatModel(void)
int ClientRemapDecl(declType_t type, int index)
idCVar g_showHud("g_showHud","1", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"")
virtual int GetCVarInteger(const char *name) const =0
void SetAngles(const idAngles &ang)
idEntity * FindEntity(const char *name) const
const idEventDef EV_Player_SelectWeapon("selectWeapon","s")
idLinkList< idActor > enemyList
idEntity * influenceEntity
const idKeyValue * MatchPrefix(const char *prefix, const idKeyValue *lastMatch=NULL) const
idVec3 GetEyePosition(void) const
void AdjustBodyAngles(void)
void GetPersistantData(idDict &dict)
int deathClearContentsTime
virtual void DamageFeedback(idEntity *victim, idEntity *inflictor, int &damage)
idAngles AngleOffset(void) const
float PowerUpModifier(int type)
static idVec3 colorBarTable[5]
bool ProcessEvent(const idEventDef *ev)
bool RespondsTo(const idEventDef &ev) const
void WriteBits(int value, int numBits)
const idEventDef EV_Player_ExitTeleporter("exitTeleporter")
void SetGranularity(int newgranularity)
idList< float > damageScale
void AddPickupName(const char *name, const char *icon, idPlayer *owner)
void UpdatePDAInfo(bool updatePDASel)
static float ClampFloat(float min, float max, float value)
float NormalizeFast(void)
static float AngleDelta(float angle1, float angle2)
const idVec3 & GetPushedLinearVelocity(const int id=0) const
jointHandle_t GetJointHandle(const char *name) const
ammo_t AmmoIndexForAmmoClass(const char *ammo_classname) const
void SetEyeHeight(float height)
int suppressShadowInViewID
void RemoveWeapon(const char *weap)
unsigned int lastSnapshotSequence
int GetBaseHeartRate(void)
const idEventDef EV_Player_GetWeaponEntity("getWeaponEntity", NULL, 'e')
const char * GetName(void) const
idInterpolate< float > heartInfo
void ReadJoint(jointHandle_t &value)
void ReadBool(bool &value)
idAngles ang_zero(0.0f, 0.0f, 0.0f)
const char * GetLocation(void) const
void Save(idSaveGame *savefile) const
void GivePDA(const char *pdaName, idDict *item)
END_CLASS const int MAX_RESPAWN_TIME
void WriteStaticObject(const idClass &obj)
static float Sqrt(float x)
void SetInfluenceFov(float fov)
const char * GetFullName() const
virtual void HandleNamedEvent(const char *eventName)=0
idCVar pm_walkspeed("pm_walkspeed","140", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"speed the player can move while walking")
idAngles & Normalize180(void)
idList< idLevelTriggerInfo > levelTriggers
virtual void SetLinearVelocity(const idVec3 &newLinearVelocity, int id=0)=0
virtual void SetCVarString(const char *name, const char *value, int flags=0)=0
virtual bool ClientReceiveEvent(int event, int time, const idBitMsg &msg)
int GetNextClientNum(int current) const
idCVar g_healthTakeLimit("g_healthTakeLimit","25", CVAR_GAME|CVAR_INTEGER|CVAR_ARCHIVE,"how low can health get taken in nightmare mode")
GLuint GLuint GLsizei GLenum type
idEntityPtr< idProjectile > soulCubeProjectile
int ReadString(char *buffer, int bufferSize) const
static void ReturnVector(idVec3 const &vec)
void EnterCinematic(void)
void SetInfluenceView(const char *mtr, const char *skinname, float radius, idEntity *ent)
idEntityPtr< idEntity > teleportEntity
int GetNumContacts(void) const
void Event_SelectWeapon(const char *weaponName)
virtual void ResetTime(int time)
bool UserInfoChanged(bool canModify)
void UpdateViewAngles(void)
virtual void SetStateInt(const char *varName, const int value)=0
virtual int PointReachableAreaNum(const idVec3 &origin, const idBounds &bounds, const int areaFlags) const =0
float GetStepUp(void) const
float GetDuration(void) const
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
void WriteString(const char *s, int maxLength=-1, bool make7Bit=true)
void SetPlayerInput(const usercmd_t &cmd, const idAngles &newViewAngles)
virtual void LinkCombat(void)
void BobCycle(const idVec3 &pushVelocity)
int WeaponIndexForAmmoClass(const idDict &spawnArgs, const char *ammo_classname) const
void Set(const char *key, const char *value)
void OffsetThirdPersonView(float angle, float range, float height, bool clip)
bool ShowCrosshair(void) const
int ReadBits(int numBits) const
const contactInfo_t & GetContact(int num) const
virtual void DrawPlayerIcons(void)
void CopyJointsFromBodyToHead(void)
static int ClampInt(int min, int max, int value)
void UpdateConditions(void)
static const char * GetAmmoPickupNameForNum(ammo_t ammonum)
void WriteDir(const idVec3 &dir, int numBits)
idCVar pm_spectatebbox("pm_spectatebbox","32", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"size of the spectator bounding box")
idUserInterfaceManager * uiManager
void UpdateObjectiveInfo(void)
bool IsReloading(void) const
idBounds boundingBoxes[MAX_AAS_BOUNDING_BOXES]
void ReadUsercmd(usercmd_t &usercmd)
virtual void DamageFeedback(idEntity *victim, idEntity *inflictor, int &damage)
idCVar g_viewNodalZ("g_viewNodalZ","0", CVAR_GAME|CVAR_FLOAT,"")
void RouteGuiMouse(idUserInterface *gui)
bool HasJumped(void) const
idMat3 ShakeAxis(void) const
void Event_StopAudioLog(void)
int Cmpn(const char *text, int n) const
void SetLastHitTime(int time)
idList< idObjectiveInfo > objectiveNames
const idDeclSkin * powerUpSkin
void ToggleScoreboard(void)
void WriteVec3(const idVec3 &vec)
bool HasChanged(void) const
void SetDebugLevel(bool set)
idScriptBool AI_TURN_RIGHT
virtual void ClearJointMods(void)
idMultiplayerGame::gameState_t GetGameState(void) const
idCVar pm_runspeed("pm_runspeed","220", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"speed the player can move while running")
idCVar pm_minviewpitch("pm_minviewpitch","-89", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"amount player's view can look up (negative values are up)")
const idVec3 & GetOrigin(int id=0) const
static void SinCos(float a, float &s, float &c)
idCVar pm_runpitch("pm_runpitch","0.002", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"")
void SetDeltaViewAngles(const idAngles &delta)
void Copy(const idDict &other)
void SetAnimState(int channel, const char *name, int blendFrames)
idCVar g_showEnemies("g_showEnemies","0", CVAR_GAME|CVAR_BOOL,"draws boxes around monsters that have targeted the the player")
virtual const char * HandleEvent(const sysEvent_t *event, int time, bool *updateVisuals=NULL)=0
int Icmp(const char *text) const
const idVec2 & ToVec2(void) const
idSoundWorld * gameSoundWorld
void PlayerDeath(idPlayer *dead, idPlayer *killer, bool telefrag)
virtual bool IsInteractive() const =0
bool Give(const char *statname, const char *value)
void WriteMaterial(const idMaterial *material)
const type & GetEndValue(void) const
#define EVENT(event, function)
void RemoveInventoryItem(idDict *item)
virtual void SetStateBool(const char *varName, const bool value)=0
void SetContents(int contents, int id=-1)
void Init(byte *data, int length)
const char * GetMapName(void) const
void SetJointAxis(jointHandle_t jointnum, jointModTransform_t transform_type, const idMat3 &mat)
virtual const idDeclAudio * GetAudioByIndex(int index) const
void WriteJoint(const jointHandle_t value)
const int LAND_DEFLECT_TIME
idCVar g_armorProtectionMP("g_armorProtectionMP","0.6", CVAR_GAME|CVAR_FLOAT|CVAR_ARCHIVE,"armor takes this percentage of damage in mp")
void WriteBool(const bool value)
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needUnique=false, bool forceUnique=false)=0
idLocationEntity * LocationForPoint(const idVec3 &point)
idCVar g_skill("g_skill","1", CVAR_GAME|CVAR_INTEGER,"")
virtual void FreeModelDef(void)
virtual bool ClientReceiveEvent(int event, int time, const idBitMsg &msg)
const idEventDef EV_Player_LevelTrigger("levelTrigger")
virtual void HidePlayerIcons(void)
virtual void WriteToSnapshot(idBitMsgDelta &msg) const
void CalculateViewWeaponPos(idVec3 &origin, idMat3 &axis)
void Flash(idVec4 color, int time)
const float MIN_BOB_SPEED
#define STRTABLE_ID_LENGTH
void WriteUsercmd(const usercmd_t &usercmd)
idCVar g_gun_z("g_gunZ","0", CVAR_GAME|CVAR_FLOAT,"")
bool IsHidden(void) const
virtual void SetStateFloat(const char *varName, const float value)=0
idEntity * SpawnEntityType(const idTypeInfo &classdef, const idDict *args=NULL, bool bIsClientReadSnapshot=false)
void Event_GetWeaponEntity(void)
void UpdatePowerUps(void)
void void void Warning(const char *fmt,...) const id_attribute((format(printf
int Icmpn(const char *text, int n) const
void SetCurrentHeartRate(void)
void DrawHUD(idUserInterface *hud)
idCVar pm_airTics("pm_air","1800", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_INTEGER,"how long in milliseconds the player can go without air before he starts taking damage")
virtual bool GetPhysicsToSoundTransform(idVec3 &origin, idMat3 &axis)
virtual void Killed(idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location)
bool IsWorldModelReady(void)
idAFEntity_Vehicle * focusVehicle
pvsHandle_t SetupCurrentPVS(const idVec3 &source, const pvsType_t type=PVS_NORMAL) const
idCVar pm_stepsize("pm_stepsize","16", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"maximum height the player can step up without jumping")
virtual const idBounds & GetBounds(int id=-1) const =0
void StartFxOnBone(const char *fx, const char *bone)
int suppressShadowInLightID
bool StartSoundShader(const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
void GetPhysicsToVisualTransform(idVec3 &origin, idMat3 &axis) const
void KillBox(idEntity *ent, bool catch_teleport=false)
class idPlayerView playerView
void ClearAllJoints(void)
bool AddPoint(const idVec3 &v)
idUserInterface * focusUI
static ammo_t GetAmmoNumForName(const char *ammoname)
int ServerRemapDecl(int clientNum, declType_t type, int index)
virtual void ReadFromSnapshot(const idBitMsgDelta &msg)
void GiveHealthPool(float amt)
bool GivePowerUp(int powerup, int time)
void CalcDamagePoints(idEntity *inflictor, idEntity *attacker, const idDict *damageDef, const float damageScale, const int location, int *health, int *armor)
idScriptBool AI_STRAFE_LEFT
void SetSelf(idEntity *e)
idCVar pm_normalheight("pm_normalheight","74", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"height of player's bounding box while standing")
void SetLinearVelocity(const idVec3 &newLinearVelocity, int id=0)
bool UseAmmo(ammo_t type, int amount)
GLuint GLuint GLsizei count
void NextBestWeapon(void)
void ShutdownThreads(void)
idCVar pm_maxviewpitch("pm_maxviewpitch","89", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"amount player's view can look down")
void SetMaxStepHeight(const float newMaxStepHeight)
idAAS * GetAAS(int num) const
void SetClipModelAxis(void)
const char * GetID() const
void RemoveOriginOffset(bool remove)
idEntityPtr< idAFAttachment > head
float CalcFov(bool honorZoom)
idCVar pm_modelView("pm_modelView","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_INTEGER,"draws camera from POV of player model (1 = always, 2 = when dead)", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
idPhysics * GetPhysics(void) const
bool IsInGame(int clientNum)
void UpdateHudWeapon(bool flashWeapon=true)
void SetSoulCubeProjectile(idProjectile *projectile)
const float THIRD_PERSON_FOCUS_DISTANCE
void SetSkin(const idDeclSkin *skin)
idCVar pm_thirdPersonClip("pm_thirdPersonClip","1", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_BOOL,"clip third person view into world space")
virtual bool HandleSingleGuiCommand(idEntity *entityGui, idLexer *src)
const char * GetString(const char *key, const char *defaultString="") const
GLubyte GLubyte GLubyte GLubyte w
void Restore(idRestoreGame *savefile)
bool SpawnEntityDef(const idDict &args, idEntity **ent=NULL, bool setDefaults=true)
void ReadFloat(float &value)
void AddChatLine(const char *fmt,...) id_attribute((format(printf
idCVar pm_bobup("pm_bobup","0.005", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"")
idUserInterface * ActiveGui(void)
idStr & StripFileExtension(void)
idVec3 ToForward(void) const
void WriteDeltaFloat(float oldValue, float newValue)
virtual const idDeclVideo * GetVideoByIndex(int index) const
idCVar net_clientSelfSmoothing("net_clientSelfSmoothing","0.6", CVAR_GAME|CVAR_FLOAT,"smooth self position if network causes prediction error.", 0.0f, 0.95f)
virtual bool Collide(const trace_t &collision, const idVec3 &velocity)
virtual void AddEmail(const char *name, bool unique=true) const
bool OnLadder(void) const
const shaderStage_t * GetStage(const int index) const
bool StartSound(const char *soundName, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
void GiveVideo(const char *videoName, idDict *item)
static int FtoiFast(float f)
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
void CastVote(int clientNum, bool vote)
const int UCF_IMPULSE_SEQUENCE
idSoundEmitter * referenceSound
bool OnLadder(void) const
idCVar g_debugDamage("g_debugDamage","0", CVAR_GAME|CVAR_BOOL,"")
virtual renderEntity_t * GetRenderEntity(void)
void SetPhysics(idPhysics *phys)
virtual bool GetPhysicsToSoundTransform(idVec3 &origin, idMat3 &axis)
virtual void Damage(idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location)
void SetStartTime(float time)
bool smoothedOriginUpdated
int powerupEndTime[MAX_POWERUPS]
void WriteFloat(const float value)
bool IsDone(float time) const
const char * GetBody() const
static float Fabs(float f)
idCamera * GetCamera(void) const
const idVec3 & GetGravityNormal(void) const
void UpdateSkinSetup(bool restart)
bool HandleGuiCommands(idEntity *entityGui, const char *cmds)
const char * AmmoPickupNameForIndex(ammo_t ammonum) const
bool GetBool(const char *key, const char *defaultString="0") const
idCVar g_showviewpos("g_showviewpos","0", CVAR_GAME|CVAR_BOOL,"")
idVec3 firstPersonViewOrigin
virtual const int GetNumAudios() const
void CrashLand(const idVec3 &oldOrigin, const idVec3 &oldVelocity)
const int WEAPON_SWITCH_DELAY
virtual const char * GetCVarString(const char *name) const =0
ammo_t GetAmmoType(void) const
const idVec3 & GetLinearVelocity(int id=0) const
void CalculateRenderView(void)
idAnimBlend * CurrentAnim(int channelNum)
idCVar pm_spectatespeed("pm_spectatespeed","450", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"speed the player can move while spectating")
const idDeclSkin * customSkin
void DamageImpulse(idVec3 localKickDir, const idDict *damageDef)
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
const idMaterial * globalMaterial
const int WEAPON_DROP_TIME
void SetInteger(const int value)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void SetStartValue(const type &startValue)
renderView_t * GetRenderView(void)
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
int AmmoAvailable(void) const
int GetInteger(void) const
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
void Event_DisableWeapon(void)
const int SHADERPARM_TIME_OF_DEATH
virtual void Redraw(int time)=0
void ServerSendEvent(int eventId, const idBitMsg *msg, bool saveEvent, int excludeClient) const
float GetStartTime(void) const
virtual void SetOrigin(const idVec3 &newOrigin, int id=-1)=0
void CancelEvents(const idEventDef *ev)
idCVar pm_normalviewheight("pm_normalviewheight","68", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"height of player's view while standing")
virtual void Teleport(const idVec3 &origin, const idAngles &angles, idEntity *destination)
idCVar g_viewNodalX("g_viewNodalX","0", CVAR_GAME|CVAR_FLOAT,"")
idCVar g_armorProtection("g_armorProtection","0.3", CVAR_GAME|CVAR_FLOAT|CVAR_ARCHIVE,"armor takes this percentage of damage")
const idDeclSkin * influenceSkin
bool PowerUpActive(int powerup) const
const idVec3 & GetGravity(void) const
idCVar pm_crouchbob("pm_crouchbob","0.5", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"bob much faster when crouched")
static int FindText(const char *str, const char *text, bool casesensitive=true, int start=0, int end=-1)
virtual bool GetPhysicsToVisualTransform(idVec3 &origin, idMat3 &axis)
const int GetSurfaceFlags(void) const
void GiveEmail(const char *emailName)
const char * GetString(const char *str) const
idCVar g_mpWeaponAngleScale("g_mpWeaponAngleScale","0", CVAR_GAME|CVAR_FLOAT,"Control the weapon sway in MP")
void SetupWeaponEntity(void)
bool CanShowWeaponViewmodel(void) const
void ReadUserInterface(idUserInterface *&ui)
idVec3 GunAcceleratingOffset(void)
virtual const char * Activate(bool activate, int time)=0
const idStr & GetValue(void) const
float shaderParms[MAX_GLOBAL_SHADER_PARMS]
float ReadDeltaFloat(float oldValue) const
virtual const idMat3 & GetAxis(int id=0) const =0
void Event_LevelTrigger(void)
void Insert(const char a, int index)
void DeleteContents(bool clear)
idCVar g_debugMove("g_debugMove","0", CVAR_GAME|CVAR_BOOL,"")
void UpdateHudStats(idUserInterface *hud)
virtual idAnimator * GetAnimator(void)
idCVar g_testDeath("g_testDeath","0", CVAR_GAME|CVAR_BOOL,"")
void RestoreInventory(idPlayer *owner, const idDict &dict)
void LookAtKiller(idEntity *inflictor, idEntity *attacker)
const char * Right(int len, idStr &result) const
int Find(const char c, int start=0, int end=-1) const
virtual void ModifySound(const s_channelType channel, const soundShaderParms_t *parms)=0
void Update(idPlayer *player)
bool SelectEntity(const idVec3 &origin, const idVec3 &dir, const idEntity *skip)
const char * GetDate() const
#define MASK_SHOT_RENDERMODEL
idLinkList< idEntity > spawnNode
void SpawnToPoint(const idVec3 &spawn_origin, const idAngles &spawn_angles)
gameState_t GameState(void) const
idStr & RemoveColors(void)
const char * GetIcon() const
const char * GetWave() const
const idMaterial * influenceMaterial
void SetBool(const char *key, bool val)
const idEventDef EV_Player_HideTip("hideTip")
const int SHADERPARM_TIMEOFFSET
void Event_GetPreviousWeapon(void)
void UnreadToken(const idToken *token)
void SetViewAngles(const idAngles &angles)
idList< idItemInfo > pickupItemNames
void Init(const float startTime, const float duration, const type &startValue, const type &endValue)
void RestorePersistantInfo(void)
void PerformImpulse(int impulse)
const idKeyValue * FindKey(const char *key) const
GLubyte GLubyte GLubyte a
idScriptBool AI_WEAPON_FIRED
void ClientSendEvent(int eventId, const idBitMsg *msg) const
idCVar g_healthTakeAmt("g_healthTakeAmt","5", CVAR_GAME|CVAR_INTEGER|CVAR_ARCHIVE,"how much health to take in nightmare mode")
int LoadMemory(const char *ptr, int length, const char *name, int startLine=1)
virtual const idDict & State() const =0
const char * GetInfo() const
idBounds Expand(const float d) const
idScriptBool AI_STRAFE_RIGHT
static int BitsForInteger(int i)
const idEventDef EV_Player_GetViewAngles("getViewAngles", NULL, 'v')
idLinkList< idEntity > spawnedEntities
type GetCurrentValue(float time) const
bool GiveInventoryItem(idDict *item)
const idVec3 & PlayerGetOrigin(void) const
idAngles loggedViewAngles[NUM_LOGGED_VIEW_ANGLES]
virtual const int GetNumEmails() const
GLenum GLsizei GLsizei height
const char * ToString(int precision=2) const
idMat3 firstPersonViewAxis
void WriteInt(const int value)
void SetCombatContents(bool enable)
idCVar g_healthTakeTime("g_healthTakeTime","5", CVAR_GAME|CVAR_INTEGER|CVAR_ARCHIVE,"how often to take health in nightmare mode")
void LinkScriptVariables(void)
void ProjectVector(const idVec3 &src, idVec3 &dst) const
float EyeHeight(void) const
idCVar pm_noclipspeed("pm_noclipspeed","200", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"speed the player can move while in noclip")
idDeclManager * declManager
const idMaterial * GetGlobalMaterial()
const char * GetSecurity() const
void WriteMat3(const idMat3 &mat)
void WritePlayerStateToSnapshot(idBitMsgDelta &msg) const
const idEventDef EV_Player_OpenPDA("openPDA")
idCVar pm_bboxwidth("pm_bboxwidth","32", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"x/y size of player's bounding box")
void ReadMat3(idMat3 &mat)
idEntity * entities[MAX_GENTITIES]
idDict userInfo[MAX_CLIENTS]
const int ZEROSTAMINA_HEARTRATE
void WriteDict(const idDict *dict)
bool IsLoaded(void) const
virtual const idDeclEmail * GetEmailByIndex(int index) const
bool Give(idPlayer *owner, const idDict &spawnArgs, const char *statname, const char *value, int *idealWeapon, bool updateHud)
void UpdateDeltaViewAngles(const idAngles &angles)
void Event_GetViewAngles(void)
idPlayer * GetClientByNum(int current) const
const type & GetStartValue(void) const
void GetWeaponDef(const char *objectname, int ammoinclip)
idEntity * DropItem(const idVec3 &velocity, int activateDelay, int removeDelay, bool died)
void CalcFov(float base_fov, float &fov_x, float &fov_y) const
void UpdateHudAmmo(idUserInterface *hud)
idCVar pm_walkbob("pm_walkbob","0.3", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"bob slowly when walking")
const char * Icon(void) const
void LinkTo(idScriptObject &obj, const char *name)
virtual sysEvent_t GenerateMouseButtonEvent(int button, bool down)=0
void ReadStaticObject(idClass &obj)
void WeaponFireFeedback(const idDict *weaponDef)
idCVar pm_staminarate("pm_staminarate","0.75", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"rate that player regains stamina. divide pm_stamina by this value to determine how long it takes to fully recharge.")
int Append(const type &obj)
LPCSTR GetString(LPCSTR psPrompt)
const idEventDef EV_Player_StopAudioLog("stopAudioLog")
void Fade(idVec4 color, int time)
void SetInt(const char *key, int val)
int SlotForWeapon(const char *weaponName)
const int MAX_INVENTORY_ITEMS
void GiveSecurity(const char *security)
float globalShaderParms[MAX_GLOBAL_SHADER_PARMS]
bool TraceBounds(trace_t &results, const idVec3 &start, const idVec3 &end, const idBounds &bounds, int contentMask, const idEntity *passEntity)
renderView_t * renderView
void WeaponLoweringCallback(void)
const char * Mid(int start, int len, idStr &result) const
void SetLevelTrigger(const char *levelName, const char *triggerName)
idCVar pm_staminathreshold("pm_staminathreshold","45", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"when stamina drops below this value, player gradually slows to a walk")
static void ReturnString(const char *text)
const char * GetPreview() const
void UpdateAnimState(void)
void WriteAngles(const idAngles &angles)
idEntity * GetGroundEntity(void) const
void ToggleSpectate(void)
void SetClipMask(int mask, int id=-1)
int HasAmmo(ammo_t type, int amount)
void WeaponRisingCallback(void)
int AddUnique(const type &obj)
virtual void RemoveDecals(qhandle_t entityHandle)=0
void Event_StopFxFov(void)
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
void SetGravity(const idVec3 &newGravity)
virtual void RemoveAddedEmailsAndVideos() const
idCVar g_dragEntity("g_dragEntity","0", CVAR_GAME|CVAR_BOOL,"allows dragging physics objects around by placing the crosshair over them and holding the fire button")
const idDeclPDA * GetPDA(void) const
void SetWaitState(const char *_waitstate)
idCVar net_clientPredictGUI("net_clientPredictGUI","1", CVAR_GAME|CVAR_BOOL,"test guis in networking without prediction")
idAngles GunTurningOffset(void)
int AddGuiPDAData(const declType_t dataType, const char *listName, const idDeclPDA *src, idUserInterface *gui)
void Event_ExitTeleporter(void)
bool IsGametypeFlagBased(void)
idEditEntities * editEntities
#define AREA_REACHABLE_WALK
void GetAttributes(idDict &attributes)
bool RemoveIndex(int index)
idMat3 ToMat3(void) const
virtual bool Pain(idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location)
virtual const idAASSettings * GetSettings(void) const =0
bool IsCrouching(void) const
virtual const idBounds & GetAbsBounds(int id=-1) const =0
void UpdateDeathSkin(bool state_hitch)
void ShowObjective(const char *obj)
void GivePowerUp(idPlayer *player, int powerup, int msec)
void StartFxFov(float duration)
void SetSpeed(const float newWalkSpeed, const float newCrouchSpeed)
void StealWeapon(idPlayer *player)
void Restore(idRestoreGame *savefile)
void Signal(signalNum_t signalnum)
usercmd_t usercmds[MAX_CLIENTS]
void ReadPlayerStateFromSnapshot(const idBitMsgDelta &msg)
idCVar pm_thirdPerson("pm_thirdPerson","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_BOOL,"enables third person view")
static float AngleNormalize180(float angle)
bool GetJointWorldTransform(jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis)
idDict * GetUserInfo(void)
idCVar pm_thirdPersonAngle("pm_thirdPersonAngle","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)")
const char * GetTitle() const
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
const char * GetSubject() const
void AdjustHeartRate(int target, float timeInSecs, float delay, bool force)
void SpectateFreeFly(bool force)
idList< aasLocation_t > aasLocation
idInterpolate< float > zoomFov
const idEventDef EV_Player_GetButtons("getButtons", NULL, 'd')
const function_t * GetScriptFunction(const char *funcname)
idDict * FindInventoryItem(const char *name)
virtual bool AreasAreConnected(int areaNum1, int areaNum2, portalConnection_t connection)=0
void AddProjectileHits(int count)
void UpdateAnimation(void)
void Save(idSaveGame *savefile) const
void ReadVec3(idVec3 &vec)
int suppressSurfaceInViewID
float DefaultFov(void) const
static void ReturnEntity(idEntity *ent)
class idUserInterface * gui[MAX_RENDERENTITY_GUI]
float LengthFast(void) const
const char * c_str(void) const
void SetEndValue(const type &endValue)
virtual void Restart(void)
int AmmoInClip(void) const
void ClearPushedVelocity(void)
void Event_GetButtons(void)
void ReadAngles(idAngles &angles)
void RestorePhysics(idPhysics *phys)
const idDeclVideo * GetVideo(int index)
const idEventDef EV_SpectatorTouch("spectatorTouch","et")
idCVar g_gun_y("g_gunY","0", CVAR_GAME|CVAR_FLOAT,"")
void BecomeActive(int flags)
static const char * GetAmmoNameForNum(ammo_t ammonum)
idCVar g_stopTime("g_stopTime","0", CVAR_GAME|CVAR_BOOL,"")
const idEventDef EV_Player_StopFxFov("stopFxFov")
idCVar g_editEntityMode("g_editEntityMode","0", CVAR_GAME|CVAR_INTEGER,"0 = off\n""1 = lights\n""2 = sounds\n""3 = articulated figures\n""4 = particle systems\n""5 = monsters\n""6 = entity names\n""7 = entity models", 0, 7, idCmdSystem::ArgCompletion_Integer< 0, 7 >)
void ServerSpectate(bool spectate)
idAngles ToAngles(void) const
const int ANIMCHANNEL_TORSO
const idKeyValue * GetKeyVal(int index) const
idScriptBool AI_HARDLANDING
const idEventDef EV_Remove("<immediateremove>", NULL)
const char * GetVideoName() const
const int ASYNC_PLAYER_INV_CLIP_BITS
const int * GetPVSAreas(void)
virtual void Present(void)
float ReadFloat(void) const
#define MASK_SHOT_BOUNDINGBOX
const idEventDef EV_Gibbed("<gibbed>")
const idEventDef EV_StartSoundShader("startSoundShader","sd", 'f')
void ReadFromSnapshot(const idBitMsgDelta &msg)
virtual sysEvent_t GenerateMouseMoveEvent(int deltax, int deltay)=0
void Draw(idPlayer *player, jointHandle_t joint)
idDict persistentPlayerInfo[MAX_CLIENTS]
void SetMovementType(const pmtype_t type)
virtual const idDeclSkin * FindSkin(const char *name, bool makeDefault=true)=0
bool HasGroundContacts(void) const
const idMat3 & GetGravityAxis(void) const
void Save(idSaveGame *savefile) const
const int ANIMCHANNEL_LEGS
const char * GetAudioName() const
int MaxAmmoForAmmoClass(idPlayer *owner, const char *ammo_classname) const
void WriteToSnapshot(idBitMsgDelta &msg) const
void Lerp(const idVec3 &v1, const idVec3 &v2, const float l)
idCVar pm_thirdPersonHeight("pm_thirdPersonHeight","0", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"height of camera from normal view height in 3rd person")
void PresentWeapon(bool showViewModel)
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
void SetPrivateCameraView(idCamera *camView)
virtual void Restart(void)
void Drop(const idDict &spawnArgs, const char *weapon_classname, int weapon_index)
idCVar pm_bobpitch("pm_bobpitch","0.002", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"")
const int ASYNC_PLAYER_INV_AMMO_BITS
const idDeclEntityDef * FindEntityDef(const char *name, bool makeDefault=true) const
idRenderWorld * gameRenderWorld
void GetViewPos(idVec3 &origin, idMat3 &axis) const
virtual void GetAASLocation(idAAS *aas, idVec3 &pos, int &areaNum) const
char * va(const char *fmt,...)
virtual int PointInArea(const idVec3 &point) const =0
void ReadBindFromSnapshot(const idBitMsgDelta &msg)
static idEntityFx * StartFx(const char *fx, const idVec3 *useOrigin, const idMat3 *useAxis, idEntity *ent, bool bind)
void WriteBits(int value, int numBits)
void UpdateSpectating(void)
void SelectWeapon(int num, bool force)
void SetOrigin(const idVec3 &org)
bool PostEventMS(const idEventDef *ev, int time)
virtual void DPrintf(const char *fmt,...) id_attribute((format(printf
const char * GetInfo() const
idUserInterface * objectiveSystem
const idEventDef EV_Player_GetCurrentWeapon("getCurrentWeapon", NULL, 's')
virtual void Error(const char *fmt,...) id_attribute((format(printf
idVec3 ReadDir(int numBits) const
void HideWorldModel(void)
virtual void SetModel(const char *modelname)
void CompleteObjective(const char *title)
void ShowTip(const char *title, const char *tip, bool autoHide)
idCVar pm_crouchrate("pm_crouchrate","0.87", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"time it takes for player's view to change from standing to crouching")
void Event_EnableWeapon(void)
void ClearFrags(int clientNum)
idCVar g_balanceTDM("g_balanceTDM","1", CVAR_GAME|CVAR_BOOL,"maintain even teams")
void CalculateFirstPersonView(void)
virtual void GetViewParms(renderView_t *view)=0
void Kill(bool delayRespawn, bool nodamage)
virtual bool ServerReceiveEvent(int event, int time, const idBitMsg &msg)
void ToVectors(idVec3 *forward, idVec3 *right=NULL, idVec3 *up=NULL) const
void CalculateShake(void)
void SpawnFromSpawnSpot(void)
const idEventDef EV_Touch("<touch>","et")
void SetMaxJumpHeight(const float newMaxJumpHeight)
void SetFloat(const float value)
void InitAASLocation(void)
bool IsActive(void) const
void SetDuration(float duration)
int GetNumKeyVals(void) const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
const char * GetRoq() const
const int DYING_HEARTRATE
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void ReadString(idStr &string)
void GiveObjective(const char *title, const char *text, const char *screenshot)
void UpdateDamageEffects(void)
void SetKnockBack(const int knockBackTime)
static void ReturnInt(int value)
int ReadToken(idToken *token)
void EnterCinematic(void)
int ReadBits(int numBits) const
idCamera * privateCameraView
const idEventDef EV_Player_GetMove("getMove", NULL, 'v')
idCVar g_knockback("g_knockback","1000", CVAR_GAME|CVAR_INTEGER,"")
int sprintf(idStr &string, const char *fmt,...)
idEntityPtr< idWeapon > weapon
bool HasSteppedUp(void) const
idCVar g_showProjectilePct("g_showProjectilePct","0", CVAR_GAME|CVAR_ARCHIVE|CVAR_BOOL,"enables display of player hit percentage")
const idEventDef EV_Player_InPDA("inPDA", NULL, 'd')
idCVar pm_crouchviewheight("pm_crouchviewheight","32", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"height of player's view while crouched")
struct renderView_s renderView_t
void PrepareForRestart(void)
virtual int ServerGetClientTimeSinceLastPacket(int clientNum)
void ShowWorldModel(void)
void ActivateTargets(idEntity *activator) const
void Save(idSaveGame *savefile) const
bool Remove(const type &obj)
void StopSound(const s_channelType channel, bool broadcast)
float LengthSqr(void) const
idEntity * SelectInitialSpawnPoint(idPlayer *player)
void SetState(const function_t *newState)
void WriteUserInterface(const idUserInterface *ui, bool unique)
bool IsHolstered(void) const
void EvaluateControls(void)
void ReadSkin(const idDeclSkin *&skin)
void UpdateLocation(void)
void ReadObject(idClass *&obj)
int ReadShort(void) const
void SelectInitialSpawnPoint(idVec3 &origin, idAngles &angles)
ammo_t AmmoIndexForWeaponClass(const char *weapon_classname, int *ammoRequired)
virtual bool ServerReceiveEvent(int event, int time, const idBitMsg &msg)
static const int NUM_LOGGED_VIEW_ANGLES
idCVar pm_stamina("pm_stamina","24", CVAR_GAME|CVAR_NETWORKSYNC|CVAR_FLOAT,"length of time player can run")
void AddProjectilesFired(int count)