|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
#include "selection.qh"#include <common/constants.qh>#include <common/items/item.qh>#include <common/mapobjects/triggers.qh>#include <common/mutators/mutator/waypoints/waypointsprites.qh>#include <common/net_linked.qh>#include <common/replicate.qh>#include <common/state.qh>#include <common/util.qh>#include <common/weapons/_all.qh>#include <common/wepent.qh>#include <server/items/items.qh>#include <server/items/spawning.qh>#include <server/weapons/weaponsystem.qh>Go to the source code of this file.
Functions | |
| bool | client_hasweapon (entity this, Weapon wpn,.entity weaponentity, float andammo, bool complain) |
| REPLICATE_APPLYCHANGE ("cl_weaponpriority", for(int slot=0;slot< MAX_WEAPONSLOTS;++slot) { .entity weaponentity=weaponentities[slot];if(this.(weaponentity) &&(this.(weaponentity).m_weapon !=WEP_Null||slot==0)) this.(weaponentity).m_switchweapon=w_getbestweapon(this, weaponentity);}) | |
| void | Send_WeaponComplain (entity e, float wpn, float type) |
| Switch between weapons. | |
| void | W_CycleWeapon (entity this, string weaponorder, float dir,.entity weaponentity) |
| float | W_GetCycleWeapon (entity this, string weaponorder, float dir, float imp, bool complain, bool skipmissing,.entity weaponentity) |
| void | W_LastWeapon (entity this,.entity weaponentity) |
| Goto previously used if exists and has ammo, (second) best otherwise. | |
| void | W_NextWeapon (entity this, int list,.entity weaponentity) |
| Goto next weapon. | |
| void | W_NextWeaponOnImpulse (entity this, float imp,.entity weaponentity) |
| void | W_PreviousWeapon (entity this, float list,.entity weaponentity) |
| Goto prev weapon. | |
| void | W_SwitchToOtherWeapon (entity this,.entity weaponentity) |
| Perform weapon to attack (weaponstate and attack_finished check is here) | |
| bool | W_SwitchWeapon (entity this, Weapon w,.entity weaponentity) |
| void | W_SwitchWeapon_Force (Player this, Weapon wep,.entity weaponentity) |
| void | W_SwitchWeapon_TryOthers (entity this, Weapon w,.entity weaponentity) |
| void | Weapon_whereis (Weapon this, entity cl) |
| bool client_hasweapon | ( | entity | this, |
| Weapon | wpn, | ||
| .entity | weaponentity, | ||
| float | andammo, | ||
| bool | complain ) |
Definition at line 47 of file selection.qc.
References autocvar_g_showweaponspawns, autocvar_g_weaponswitch_debug, CS(), dual_weapons, entity(), FOREACH, g_mines, hasweapon_complain_spam, IL_EACH, Weapon::impulse, IS_REAL_CLIENT, IT_UNLIMITED_AMMO, items, Weapon::m_id, offhand, OFFHAND_HOOK, play2(), PS, Send_WeaponComplain(), SND, Weapon::spawnflags, sprint(), STAT, time, Weapon_whereis(), Weapons, weaponsInMap, weaponslot(), WEP_FLAG_DUALWIELD, WepSet_FromWeapon, Weapon::wr_checkammo1(), and Weapon::wr_checkammo2().
Referenced by bot_cmd_select_weapon(), GiveItems(), havocbot_chooseweapon(), havocbot_movetogoal(), Item_GiveTo(), NIX_GiveCurrentWeapon(), REGISTER_MUTATOR(), W_LastWeapon(), and W_SwitchWeapon().
| REPLICATE_APPLYCHANGE | ( | "cl_weaponpriority" | , |
| for(int slot=0;slot< MAX_WEAPONSLOTS;++slot) { .entity weaponentity=weaponentities[slot];if(this.(weaponentity) &&(this.(weaponentity).m_weapon !=WEP_Null||slot==0)) this.(weaponentity).m_switchweapon=w_getbestweapon(this, weaponentity);} | ) |
References m_switchweapon, m_weapon, MAX_WEAPONSLOTS, w_getbestweapon, and weaponentities.
Switch between weapons.
Definition at line 18 of file selection.qc.
References entity(), msg_entity, MSG_ONE, WriteByte(), and WriteHeader.
Referenced by client_hasweapon().
Definition at line 295 of file selection.qc.
References dir, entity(), REGISTRY_GET, W_GetCycleWeapon(), W_SwitchWeapon(), weaponorder, and Weapons.
Referenced by for(), W_NextWeapon(), and W_PreviousWeapon().
| float W_GetCycleWeapon | ( | entity | this, |
| string | weaponorder, | ||
| float | dir, | ||
| float | imp, | ||
| bool | complain, | ||
| bool | skipmissing, | ||
| .entity | weaponentity ) |
Definition at line 122 of file selection.qc.
References car(), cdr(), dir, entity(), FOREACH, imp, m_switchweapon, NULL, REGISTRY_GET, selectweapon, stof(), weaponorder, and Weapons.
Referenced by W_CycleWeapon(), and W_NextWeaponOnImpulse().
Goto previously used if exists and has ammo, (second) best otherwise.
Definition at line 332 of file selection.qc.
References client_hasweapon(), cnt, entity(), REGISTRY_GET, W_SwitchToOtherWeapon(), W_SwitchWeapon(), and Weapons.
Referenced by IMPULSE().
Goto next weapon.
Definition at line 310 of file selection.qc.
References CS_CVAR, entity(), W_CycleWeapon(), weaponorder_byid, and weaponorder_byimpulse.
Referenced by IMPULSE(), IMPULSE(), ObserverOrSpectatorThink(), reset_map(), and X().
Definition at line 302 of file selection.qc.
References CS_CVAR, entity(), imp, REGISTRY_GET, W_GetCycleWeapon(), W_SwitchWeapon(), and Weapons.
Referenced by W_SwitchWeapon_TryOthers(), and weapon_group_handle().
Goto prev weapon.
Definition at line 321 of file selection.qc.
References CS_CVAR, entity(), W_CycleWeapon(), weaponorder_byid, and weaponorder_byimpulse.
Perform weapon to attack (weaponstate and attack_finished check is here)
Definition at line 247 of file selection.qc.
References entity(), m_weapon, STAT, w_getbestweapon, W_SwitchWeapon_Force(), and WepSet_FromWeapon.
Referenced by W_Arc_Beam_Think(), W_Hagar_Attack2_Load(), W_LastWeapon(), W_Reload(), and weapon_prepareattack_checkammo().
Definition at line 265 of file selection.qc.
References client_hasweapon(), CS_CVAR, entity(), Weapon::m_id, m_switchweapon, selectweapon, W_SwitchWeapon_Force(), weaponLocked(), and Weapon::wr_reload().
Referenced by GiveBall(), IMPULSE(), MUTATOR_HOOKFUNCTION(), NIX_GiveCurrentWeapon(), W_CycleWeapon(), W_LastWeapon(), W_NextWeaponOnImpulse(), W_SwitchWeapon_TryOthers(), and W_WeaponFrame().
Definition at line 237 of file selection.qc.
References entity(), Weapon::m_id, and TC.
Referenced by GiveItems(), Item_GiveTo(), MUTATOR_HOOKFUNCTION(), TEST(), W_Hagar_Attack_Auto(), W_HLAC_Attack_Frame(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Frame(), W_OverkillHeavyMachineGun_Attack_Auto(), W_OverkillMachineGun_Attack_Auto(), W_Shotgun_Attack3_Frame1(), W_Shotgun_Attack3_Frame2(), W_SwitchToOtherWeapon(), W_SwitchWeapon(), W_ThrowWeapon(), and W_WeaponFrame().
Definition at line 289 of file selection.qc.
References CS_CVAR, entity(), Weapon::impulse, W_NextWeaponOnImpulse(), and W_SwitchWeapon().
Referenced by weapon_byid_handle().
Definition at line 26 of file selection.qc.
References autocvar_g_showweaponspawns, entity(), g_items, IL_EACH, spawnflags, and WEP_FLAG_HIDDEN.
Referenced by client_hasweapon(), and NET_HANDLE().