|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
#include "weaponsystem.qh"#include <common/animdecide.qh>#include <common/constants.qh>#include <common/items/_mod.qh>#include <common/mapobjects/platforms.qh>#include <common/monsters/_mod.qh>#include <common/mutators/mutator/status_effects/_mod.qh>#include <common/net_linked.qh>#include <common/notifications/all.qh>#include <common/resources/sv_resources.qh>#include <common/state.qh>#include <common/util.qh>#include <common/vehicles/all.qh>#include <common/weapons/_all.qh>#include <common/wepent.qh>#include <lib/csqcmodel/sv_model.qh>#include <server/cheats.qh>#include <server/client.qh>#include <server/command/common.qh>#include <server/damage.qh>#include <server/items/items.qh>#include <server/hook.qh>#include <server/mutators/_mod.qh>#include <server/round_handler.qh>#include <server/weapons/selection.qh>#include <server/world.qh>Go to the source code of this file.
Definition at line 122 of file weaponsystem.qc.
References alpha, colormap, CSQCMODEL_AUTOUPDATE, deadflag, default_player_alpha, default_weapon_alpha, dmg, EF_LOWPRECISION, effects, EFMASK_CHEAP, entity(), gettagindex, glowmod, IS_DEAD, m_weapon, model, nextthink, owner, skin, strcat(), tag_entity, tag_index, time, W_Model(), weaponentity_fld, weaponentity_glowmod(), and weaponname.
Referenced by CL_SpawnWeaponentity().
Definition at line 176 of file weaponsystem.qc.
References CL_ExteriorWeaponentity_Think(), CL_Weaponentity_CustomizeEntityForClient(), CL_Weaponentity_Think(), CSQCMODEL_AUTOINIT, drag_undraggable(), entity(), exteriorweaponentity, setcefc, setmodel, setthink, SOLID_NOT, time, weaponentities, and wepent_link().
Referenced by PutPlayerInServer().
Definition at line 63 of file weaponsystem.qc.
References CL_WeaponEntity_SetModel(), entity(), REGISTRY_GET, spawn, vector, and Weapons.
Referenced by PRECACHE().
Definition at line 56 of file weaponsystem.qc.
References entity(), IS_SPEC, owner, and viewmodelforclient.
Referenced by CL_SpawnWeaponentity().
Definition at line 79 of file weaponsystem.qc.
References alpha, anim_idle, CL_WeaponEntity_SetModel(), deadflag, default_player_alpha, default_weapon_alpha, effects, entity(), frame, game_stopped, hook, IS_DEAD, m_alpha, model, modelindex, nextthink, owner, time, w_deadflag, w_dmg, w_weaponname, weaponchild, weaponentity_fld, and weaponname.
Referenced by CL_SpawnWeaponentity().
Definition at line 660 of file weaponsystem.qc.
References copyentity_qc(), entity(), gettagindex, random(), spawn, and vector.
Definition at line 208 of file weaponsystem.qc.
References entity(), and WS_CLEAR.
Referenced by W_WeaponFrame().
Definition at line 690 of file weaponsystem.qc.
References ammo, Weapon::ammo_type, backtrace, entity(), GetResource(), IT_UNLIMITED_AMMO, M_ARGV, MUTATOR_CALLHOOK, Resource::netname, Weapon::netname, SetResource(), and W_DecreaseAmmo().
Referenced by MUTATOR_HOOKABLE(), W_Crylink_Attack(), W_Crylink_Attack2(), W_DecreaseAmmo(), W_Devastator_Attack(), W_Electro_Attack_Bolt(), W_Electro_Attack_Orb(), W_Hagar_Attack(), W_Hagar_Attack2(), W_Hagar_Attack2_Load(), W_HLAC_Attack(), W_HLAC_Attack2(), W_MachineGun_Attack(), W_MachineGun_Attack_Auto(), W_MineLayer_Attack(), W_Mortar_Attack(), W_Mortar_Attack2(), W_OverkillHeavyMachineGun_Attack_Auto(), W_OverkillMachineGun_Attack_Auto(), W_OverkillNex_Attack(), W_OverkillRocketPropelledChainsaw_Attack(), W_Rifle_FireBullet(), W_Seeker_Fire_Flac(), W_Seeker_Fire_Missile(), W_Seeker_Fire_Tag(), W_Shotgun_Attack(), W_Vaporizer_Attack(), and W_Vortex_Attack().
| void W_DropEvent | ( | .void(Weapon, entity actor,.entity) | event, |
| entity | player, | ||
| int | weapon_type, | ||
| entity | weapon_item, | ||
| .entity | weaponentity ) |
Definition at line 836 of file weaponsystem.qc.
References entity(), REGISTRY_GET, weapon_dropevent_item, and Weapons.
Referenced by Item_GiveTo(), and W_ThrowNewWeapon().
Definition at line 220 of file weaponsystem.qc.
References entity(), w_ready(), weapon_thinkf(), and WS_READY.
Referenced by SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), SOUND(), W_Arc_Attack(), W_Arc_Attack_Bolt(), W_Electro_CheckAttack(), W_Fireball_Attack1_Frame4(), W_Hagar_Attack2_Load_Release(), W_Hagar_Attack_Auto(), W_HLAC_Attack_Frame(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Burst(), W_MachineGun_Attack_Frame(), W_OverkillHeavyMachineGun_Attack_Auto(), W_OverkillMachineGun_Attack_Auto(), w_ready(), W_ReloadedAndReady(), W_Rifle_BulletHail(), W_Shotgun_Attack2(), W_Shotgun_Attack3_Frame1(), W_Shotgun_Attack3_Frame2(), W_WeaponFrame(), and weapon_thinkf().
Definition at line 758 of file weaponsystem.qc.
References _sound, ATTEN_NORM, autocvar_g_weaponswitch_debug, CH_WEAPON_SINGLE, clip_load, entity(), GetResource(), IS_REAL_CLIENT, IT_UNLIMITED_AMMO, LOG_TRACE, m_weapon, MUTATOR_CALLHOOK, old_clip_load, play2(), reload_ammo_amount, SND, Sound_fixpath, sprint(), state, strcat(), strcpy, TC, time, VOL_BASE, W_Reload(), W_ReloadedAndReady(), W_SwitchToOtherWeapon(), weapon_load, weapon_thinkf(), weaponslot(), WEP_FLAG_RELOADABLE, wframe, and WS_READY.
Referenced by MUTATOR_HOOKABLE(), and W_Reload().
Definition at line 725 of file weaponsystem.qc.
References ammo, entity(), GetResource(), IT_UNLIMITED_AMMO, min(), PHYS_INPUT_BUTTON_ATCK, PHYS_INPUT_BUTTON_ATCK2, SetResource(), and w_ready().
Referenced by W_Reload().
Definition at line 436 of file weaponsystem.qc.
References entity(), m_gunalign, MAX_WEAPONSLOTS, W_DualWielding(), W_GunAlign(), and weaponentities.
Referenced by PlayerThink(), and PutPlayerInServer().
Definition at line 460 of file weaponsystem.qc.
References ATTACK_FINISHED, ATTN_NORM, autocvar_g_weaponswitch_debug, bprint(), bulletcounter, CH_WEAPON_SINGLE, clip_load, clip_size, entity(), frametime, GetResource(), INDEPENDENT_ATTACK_FINISHED, IS_PLAYER, LOG_WARNF, m_switchingweapon, m_switchweapon, m_weapon, MAKE_VECTORS, Weapon::mdl, Client::netname, OFFHAND_HOOK, old_clip_load, PHYS_INPUT_BUTTON_ATCK, PHYS_INPUT_BUTTON_ATCK2, PHYS_INPUT_BUTTON_HOOK, PS, sound, Weapon::spawnflags, STAT, state, TC, time, Client::v_angle, v_forward, v_right, v_up, vector, VOL_BASE, w_clear(), w_getbestweapon, w_ready(), W_SwitchWeapon(), W_SwitchWeapon_Force(), W_TICSPERFRAME, weapon_frametime, weapon_load, weapon_nextthink, weapon_thinkf(), weaponentities, weaponLocked(), weaponname, weaponslot(), weaponUseForbidden(), WEP_FLAG_DUALWIELD, WEP_FLAG_RELOADABLE, WEPSET, WepSet_FromWeapon, Weapon::wr_gonethink(), Weapon::wr_setup(), Weapon::wr_think(), WS_CLEAR, WS_DROP, WS_INUSE, WS_RAISE, and WS_READY.
Referenced by PlayerThink(), and PutPlayerInServer().
Definition at line 33 of file weaponsystem.qc.
References autocvar_g_weaponratefactor, entity(), M_ARGV, and MUTATOR_CALLHOOK.
Referenced by W_Arc_Attack_Bolt(), W_Hagar_Attack2_Load(), W_Hagar_Attack2_Load_Release(), W_Hagar_Attack_Auto(), W_HLAC_Attack_Frame(), W_MachineGun_Attack(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Burst(), W_OverkillHeavyMachineGun_Attack_Auto(), W_OverkillMachineGun_Attack_Auto(), W_Seeker_Vollycontroller_Think(), W_Shotgun_Attack2(), W_Shotgun_Melee_Think(), W_Tuba_NoteOn(), weapon_prepareattack_do(), and weapon_thinkf().
Definition at line 45 of file weaponsystem.qc.
References autocvar_g_weaponspeedfactor, entity(), M_ARGV, and MUTATOR_CALLHOOK.
Referenced by bot_aim(), W_CalculateProjectileVelocity(), and W_Devastator_Think().
| bool weapon_prepareattack | ( | Weapon | thiswep, |
| entity | actor, | ||
| .entity | weaponentity, | ||
| bool | secondary, | ||
| float | attacktime ) |
Definition at line 342 of file weaponsystem.qc.
References entity(), weapon_prepareattack_check(), and weapon_prepareattack_do().
Referenced by SOUND(), SOUND(), W_Electro_CheckAttack(), and W_Rifle_BulletHail_Continue().
| bool weapon_prepareattack_check | ( | Weapon | thiswep, |
| entity | actor, | ||
| .entity | weaponentity, | ||
| bool | secondary, | ||
| float | attacktime ) |
Definition at line 273 of file weaponsystem.qc.
References ATTACK_FINISHED, entity(), game_starttime, NULL, time, TIMEOUT_ACTIVE, timeout_status, weapon_prepareattack_checkammo(), and WS_READY.
Referenced by W_Arc_Beam_Think(), W_Hagar_Attack_Auto(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Frame(), and weapon_prepareattack().
| bool weapon_prepareattack_checkammo | ( | Weapon | thiswep, |
| entity | actor, | ||
| bool | secondary, | ||
| .entity | weaponentity ) |
Definition at line 229 of file weaponsystem.qc.
References ammo, ATTEN_NORM, CH_WEAPON_A, entity(), g_mines, IL_EACH, IT_UNLIMITED_AMMO, Weapon::m_id, Send_Notification(), sound, time, VOL_BASE, W_SwitchToOtherWeapon(), WEP_CVAR, Weapon::wr_checkammo1(), and Weapon::wr_checkammo2().
Referenced by weapon_prepareattack_check().
| void weapon_prepareattack_do | ( | entity | actor, |
| .entity | weaponentity, | ||
| bool | secondary, | ||
| float | attacktime ) |
Definition at line 299 of file weaponsystem.qc.
References ATTACK_FINISHED, autocvar_g_weaponswitch_debug_alternate, bulletcounter, entity(), MAX_WEAPONSLOTS, NULL, state, STATUSEFFECT_REMOVE_CLEAR, StatusEffects_active(), StatusEffects_remove(), time, W_DualWielding(), W_WeaponRateFactor(), weapon_frametime, weaponentities, weaponslot(), and WS_INUSE.
Referenced by W_Hagar_Attack2_Load_Release(), and weapon_prepareattack().
| void weapon_thinkf | ( | entity | actor, |
| .entity | weaponentity, | ||
| WFRAME | fr, | ||
| float | t, | ||
| void(Weapon thiswep, entity actor,.entity weaponentity, int fire) | func ) |
| t | defer thinking until time + t |
| func | next think function |
Definition at line 356 of file weaponsystem.qc.
References ANIMACTION_MELEE, ANIMACTION_SHOOT, animdecide_setaction(), autocvar_g_weaponratefactor, backtrace, boolean, entity(), FOREACH_CLIENT, IS_SPEC, m_weapon, NULL, state, time, w_ready(), W_WeaponRateFactor(), weapon_frametime, weapon_nextthink, WEP_TYPE_MELEE_PRI, WEP_TYPE_MELEE_SEC, wframe, wframe_send(), and WS_RAISE.
Referenced by W_Arc_Attack(), W_Arc_Attack_Bolt(), W_Electro_CheckAttack(), W_Fireball_Attack1_Frame0(), W_Fireball_Attack1_Frame1(), W_Fireball_Attack1_Frame2(), W_Fireball_Attack1_Frame3(), W_Fireball_Attack1_Frame4(), W_Hagar_Attack2_Load_Release(), W_Hagar_Attack_Auto(), W_HLAC_Attack_Frame(), W_MachineGun_Attack_Auto(), W_MachineGun_Attack_Burst(), W_MachineGun_Attack_Frame(), W_OverkillHeavyMachineGun_Attack_Auto(), W_OverkillMachineGun_Attack_Auto(), w_ready(), W_Reload(), W_Rifle_BulletHail(), W_Rifle_BulletHail_Continue(), W_Shotgun_Attack2(), W_Shotgun_Attack3_Frame1(), W_Shotgun_Attack3_Frame2(), and W_WeaponFrame().
Definition at line 426 of file weaponsystem.qc.
References entity(), game_starttime, game_stopped, MUTATOR_CALLHOOK, StatusEffects_active(), sv_ready_restart_after_countdown, and time.
Referenced by bumblebee_gunner_frame(), bumblebee_pilot_frame(), CanThrowNade(), FireGrapplingHook(), IMPULSE(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), racer_frame(), raptor_frame(), spiderbot_frame(), spiderbot_rocket_do(), vehicles_touch(), W_SwitchWeapon(), and W_WeaponFrame().
Definition at line 419 of file weaponsystem.qc.
References entity(), MUTATOR_CALLHOOK, round_handler_IsActive, and round_handler_IsRoundStarted.
Referenced by bumblebee_gunner_frame(), bumblebee_pilot_frame(), racer_frame(), raptor_frame(), spiderbot_frame(), spiderbot_rocket_do(), W_Hagar_Attack2_Load(), and W_WeaponFrame().
| bool hook_switchweapon |
Definition at line 458 of file weaponsystem.qc.
| float m_alpha |
Definition at line 74 of file weaponsystem.qc.
| float prevdryfire |
Definition at line 227 of file weaponsystem.qc.
| float prevwarntime |
Definition at line 228 of file weaponsystem.qc.
| float race_penalty |
Definition at line 272 of file weaponsystem.qc.
| float reload_ammo_amount |
Definition at line 721 of file weaponsystem.qc.
Referenced by W_Reload().
| float reload_ammo_min |
Definition at line 721 of file weaponsystem.qc.
| float reload_complain |
Definition at line 722 of file weaponsystem.qc.
| string reload_sound |
Definition at line 723 of file weaponsystem.qc.
| float reload_time |
Definition at line 721 of file weaponsystem.qc.
Referenced by X().
| int state |
Definition at line 29 of file weaponsystem.qc.
| int w_deadflag |
Definition at line 77 of file weaponsystem.qc.
Referenced by CL_Weaponentity_Think().
| int w_dmg |
Definition at line 76 of file weaponsystem.qc.
Referenced by CL_Weaponentity_Think().
| string w_weaponname |
Definition at line 75 of file weaponsystem.qc.
Referenced by CL_Weaponentity_Think().
| float weapon_frametime |
Definition at line 31 of file weaponsystem.qc.
Referenced by W_WeaponFrame(), weapon_prepareattack_do(), and weapon_thinkf().