Xonotic
|
#include "sv_monsters.qh"
#include <common/constants.qh>
#include <common/deathtypes/all.qh>
#include <common/items/_mod.qh>
#include <common/mapobjects/teleporters.qh>
#include <common/mapobjects/triggers.qh>
#include <common/monsters/all.qh>
#include <common/mutators/mutator/nades/nades.qh>
#include <common/mutators/mutator/status_effects/_mod.qh>
#include <common/physics/movelib.qh>
#include <common/stats.qh>
#include <common/teams.qh>
#include <common/turrets/sv_turrets.qh>
#include <common/turrets/util.qh>
#include <common/util.qh>
#include <common/vehicles/all.qh>
#include <common/weapons/_all.qh>
#include <common/weapons/_mod.qh>
#include <lib/csqcmodel/sv_model.qh>
#include <lib/warpzone/common.qh>
#include <server/campaign.qh>
#include <server/cheats.qh>
#include <server/client.qh>
#include <server/command/_mod.qh>
#include <server/damage.qh>
#include <server/items/items.qh>
#include <server/mutators/_mod.qh>
#include <server/round_handler.qh>
#include <server/steerlib.qh>
#include <server/weapons/_mod.qh>
Go to the source code of this file.
Macros | |
#define | _MSOUND(m) strfree(this.monstersound_##m); |
#define | _MSOUND(m) case #m: return monstersound_##m; |
Variables | |
entity | draggedby |
float | pass_distance |
vector | pos1 |
vector | pos2 |
int | skin_for_monstersound |
#define _MSOUND | ( | m | ) | strfree(this.monstersound_##m); |
#define _MSOUND | ( | m | ) | case #m: return monstersound_##m; |
Definition at line 236 of file sv_monsters.qc.
References ftos(), and strcat().
Referenced by Monster_Sounds_Update().
Definition at line 1133 of file sv_monsters.qc.
References anim_state, animdecide_setimplicitstate(), animdecide_setstate(), ANIMSTATE_DEAD1, ANIMSTATE_DEAD2, ANIMSTATE_DUCK, ANIMSTATE_FROZEN, IS_DEAD, IS_DUCKED, IS_ONGROUND, and random().
Referenced by Monster_Think().
Definition at line 885 of file sv_monsters.qc.
References enemy, Monster_Spawn(), and monsterdef.
Referenced by Monster_Appear_Check().
Definition at line 891 of file sv_monsters.qc.
References FL_MONSTER, flags, func_null(), Monster_Appear(), monsterdef, MONSTERFLAG_APPEAR, nextthink, setthink, spawnflags, and use.
Referenced by Monster_Spawn().
Definition at line 425 of file sv_monsters.qc.
References attack_finished_single, CH_VOICE, MONSTER_ATTACK_MELEE, MONSTER_ATTACK_RANGED, monster_makevectors(), Monster_Sound(), time, vdist, and weaponslot().
Referenced by Monster_Think().
bool Monster_Attack_Leap | ( | entity | this, |
vector | anm, | ||
void(entity this, entity toucher) | touchfunc, | ||
vector | vel, | ||
float | animtime | ||
) |
Definition at line 403 of file sv_monsters.qc.
References anim_finished, animstate_endtime, attack_finished_single, IS_MONSTER, Monster_Attack_Leap_Check(), MONSTER_ATTACK_RANGED, setanim, state, time, UNSET_ONGROUND, and velocity.
Definition at line 381 of file sv_monsters.qc.
References attack_finished_single, enemy, GetResource(), IS_DEAD, IS_MONSTER, IS_ONGROUND, RES_HEALTH, state, time, trace_ent, vector(), and velocity.
Referenced by Monster_Attack_Leap().
bool Monster_Attack_Melee | ( | entity | this, |
entity | targ, | ||
float | damg, | ||
vector | anim, | ||
float | er, | ||
float | animtime, | ||
int | deathtype, | ||
bool | dostop | ||
) |
Definition at line 362 of file sv_monsters.qc.
References anim_finished, animstate_endtime, attack_finished_single, Damage(), DMG_NOWEP, IS_MONSTER, MONSTER_ATTACK_MELEE, MONSTER_SKILLMOD, normalize(), origin, setanim, state, time, trace_ent, v_forward, and view_ofs.
void Monster_CalculateVelocity | ( | entity | this, |
vector | to, | ||
vector | from, | ||
float | turnrate, | ||
float | movespeed | ||
) |
Definition at line 672 of file sv_monsters.qc.
References MOVE_NOMONSTERS, normalize(), origin, to, trace_endpos, trace_fraction, vector(), velocity, and WarpZone_TraceLine().
Referenced by Monster_Move().
Definition at line 177 of file sv_monsters.qc.
References entity(), g_monster_targets, IL_PUSH(), monster_attack, monster_setupcolors(), sprite, team, Team_ColorRGB(), and teamplay.
void Monster_Damage | ( | entity | this, |
entity | inflictor, | ||
entity | attacker, | ||
float | damage, | ||
int | deathtype, | ||
.entity | weaponentity, | ||
vector | hitloc, | ||
vector | force | ||
) |
Definition at line 997 of file sv_monsters.qc.
References ATTEN_NORM, bound(), candrop, CH_PAIN, damageforcescale, enemy, GetResource(), ITEM_DAMAGE_NEEDKILL, Monster_Dead(), Monster_Sound(), monsterdef, MONSTERFLAG_INVINCIBLE, MSG_BROADCAST, MUTATOR_CALLHOOK, nextthink, NULL, oldtarget2, RES_HEALTH, setthink, spawnflags, sprite, SUB_UseTargets(), TakeResource(), target2, time, v, vector(), velocity, and VOL_BASE.
Referenced by Monster_Spawn().
Definition at line 939 of file sv_monsters.qc.
References attack_finished_single, autocvar_g_monsters_score_kill, autocvar_g_monsters_score_spawned, candrop, CH_VOICE, CSQCModel_UnlinkEntity(), DAMAGE_AIM, DEAD_DEAD, deadflag, effects, enemy, FL_FLY, FL_SWIM, flags, func_null(), GameRules_scoring_add, IS_PLAYER, mdl_dead, Monster_Dead_Damage(), Monster_Dead_Think(), monster_dropitem(), monster_lifetime, Monster_Sound(), Monster_Touch(), monsterdef, MONSTERFLAG_RESPAWNED, MONSTERFLAG_SPAWNED, monsters_killed, MOVETYPE_TOSS, nextthink, NULL, origin, randomvec(), set_movetype(), setthink, solid, SOLID_CORPSE, spawnflags, state, takedamage, time, totalspawned, Unfreeze(), velocity, W_ThrowNewWeapon(), weapon, and weaponentities.
Referenced by Monster_Damage().
void Monster_Dead_Damage | ( | entity | this, |
entity | inflictor, | ||
entity | attacker, | ||
float | damage, | ||
int | deathtype, | ||
.entity | weaponentity, | ||
vector | hitloc, | ||
vector | force | ||
) |
Definition at line 920 of file sv_monsters.qc.
References bound(), func_null(), GetResource(), nextthink, RES_HEALTH, setthink, TakeResource(), time, and totalspawned.
Referenced by Monster_Dead().
Definition at line 526 of file sv_monsters.qc.
References angles, DAMAGE_NO, DEAD_RESPAWNING, deadflag, func_null(), max_health, monster_lifetime, Monster_Respawn(), Monster_Respawn_Check(), MONSTER_RESPAWN_DEATHPOINT, MONSTERFLAG_RESPAWNED, nextthink, origin, pos1, pos2, RES_HEALTH, respawntime, setmodel, setorigin(), SetResourceExplicit(), setthink, spawnflags, SUB_SetFade(), takedamage, time, and totalspawned.
Referenced by Monster_Dead_Think().
Definition at line 873 of file sv_monsters.qc.
References Monster_Dead_Fade(), monster_lifetime, nextthink, ticrate, and time.
Referenced by Monster_Dead().
Definition at line 218 of file sv_monsters.qc.
References entity(), Monster_Delay(), Monster_Delay_Action(), new_pure, setthink, and time.
Referenced by Monster_Delay().
Definition at line 197 of file sv_monsters.qc.
References cnt, count, monster_makevectors(), Monster_ValidTarget(), nextthink, owner, setthink, and time.
Referenced by Monster_Delay().
Definition at line 39 of file sv_monsters.qc.
References autocvar_g_monsters_drop_time, candrop, CENTER_OR_VIEWOFS, entity(), Item_SetLoot(), M_ARGV, monster_loot, MUTATOR_CALLHOOK, randomvec(), setorigin(), spawn(), StartItem(), SUB_SetFade(), time, and vector().
Referenced by Monster_Dead().
Definition at line 1207 of file sv_monsters.qc.
References CH_VOICE, enemy, monster_face, Monster_FindTarget(), monster_moveto, Monster_Sound(), WarpZone_RefSys_AddInverse(), WarpZone_RefSys_Copy(), and WarpZone_RefSys_TransformOrigin().
Referenced by Monster_Think().
Definition at line 126 of file sv_monsters.qc.
References CENTER_OR_VIEWOFS, enemy, entity(), g_monster_targets, IL_EACH, MUTATOR_CALLHOOK, NULL, vdist, and vector().
Referenced by Monster_Enemy_Check().
Definition at line 1170 of file sv_monsters.qc.
References bound(), DMG_NOWEP, enemy, frozen_by, FROZEN_TEMP_DYING, FROZEN_TEMP_REVIVING, GetResource(), iceblock, max(), max_health, MONSTERFLAG_INVINCIBLE, NULL, RES_HEALTH, revive_speed, SetResourceExplicit(), spawnflags, sprite, ticrate, and Unfreeze().
Referenced by Monster_Think().
Definition at line 1071 of file sv_monsters.qc.
References GetResource(), GiveResourceWithLimit(), RES_HEALTH, and RES_LIMIT_NONE.
Referenced by Monster_Spawn().
Definition at line 66 of file sv_monsters.qc.
References IS_MONSTER, makevectors, origin, v, v_angle, vectoangles(), vector(), and view_ofs.
Referenced by Monster_Attack_Check(), and Monster_Delay_Action().
Definition at line 490 of file sv_monsters.qc.
References autocvar_g_monsters_miniboss_chance, autocvar_g_monsters_miniboss_healthboost, EF_RED, effects, GiveResource(), MONSTERFLAG_MINIBOSS, MUTATOR_CALLHOOK, random(), RES_HEALTH, spawnflags, and weapon.
Referenced by Monster_Spawn_Setup().
Definition at line 710 of file sv_monsters.qc.
References angles, anim_finished, anim_walk, attack_finished_single, autocvar_g_campaign, autocvar_g_monsters_teams, bound(), campaign_bots_may_start, CH_VOICE, Damage(), DIFF_TEAM, DMG_NOWEP, draggedby, enemy, entity(), find(), FL_FLY, FL_SWIM, flags, goalentity, IS_ONGROUND, last_trace, M_ARGV, MONSTER_ATTACK_MELEE, MONSTER_ATTACK_RANGED, Monster_CalculateVelocity(), monster_face, monster_follow, Monster_Move_Target(), monster_moveto, MONSTER_SKILLMOD, Monster_Sound(), Monster_Touch(), MONSTERFLAG_FLY_VERTICAL, move_movetype, MOVETYPE_BOUNCE, MOVETYPE_WALK, MUTATOR_CALLHOOK, NULL, origin, pain_finished, random(), round_handler_IsActive, round_handler_IsRoundStarted, set_movetype(), setanim, shortangle_f(), spawn_time, spawnflags, state, steerlib_attract2(), steerto, target2, targetname, teamplay, time, vdist, vectoangles(), vector(), velocity, waterlevel, and WATERLEVEL_WETFEET.
Referenced by Monster_Think().
Definition at line 1084 of file sv_monsters.qc.
References anglemods(), angles, anim_walk, attack_finished_single, autocvar_g_campaign, campaign_bots_may_start, CENTER_OR_VIEWOFS, draggedby, IS_MONSTER, IS_ONGROUND, IS_PLAYER, makevectors, MOVE_NORMAL, NULL, pain_finished, round_handler_IsActive, round_handler_IsRoundStarted, setanim, spawn_time, time, trace_ent, trace_fraction, v_forward, vdist, vector(), and velocity.
Definition at line 563 of file sv_monsters.qc.
References angles, DAMAGE_NO, enemy, FL_FLY, FL_NOTARGET, FL_SWIM, flags, GetResource(), IS_DEAD, last_trace, makevectors, monster_follow, MONSTER_MOVE_ENEMY, MONSTER_MOVE_FOLLOW, MONSTER_MOVE_NOMOVE, MONSTER_MOVE_SPAWNLOC, MONSTER_MOVE_WANDER, monster_moveflags, monster_movestate, monster_moveto, MONSTERFLAG_FLY_VERTICAL, MOVE_NOMONSTERS, NULL, origin, pos1, random(), RES_HEALTH, rint(), spawnflags, time, trace_ent, trace_fraction, v_forward, vdist, vector(), wander_delay, wander_distance, WarpZone_RefSys_TransformOrigin(), and WarpZone_TraceLine().
Referenced by Monster_Move().
Definition at line 852 of file sv_monsters.qc.
References iceblock, IS_CLIENT, MAX_WEAPONSLOTS, MUTATOR_CALLHOOK, origin, sprite, and weaponentities.
Referenced by CommonCommand_editmob(), Invasion_CheckWinner(), and Monster_Spawn().
Definition at line 905 of file sv_monsters.qc.
References angles, attack_finished_single, enemy, goalentity, max_health, NULL, origin, pos1, pos2, RES_HEALTH, setorigin(), SetResourceExplicit(), Unfreeze(), and velocity.
Referenced by Monster_Spawn().
Definition at line 522 of file sv_monsters.qc.
References Monster_Spawn(), and monsterdef.
Referenced by Monster_Dead_Fade().
Definition at line 507 of file sv_monsters.qc.
References autocvar_g_monsters_respawn, DEAD_DEAD, deadflag, MONSTERFLAG_NORESPAWN, MUTATOR_CALLHOOK, and spawnflags.
Referenced by Monster_Dead_Fade().
Definition at line 154 of file sv_monsters.qc.
References colormap, IS_PLAYER, monster_skill, MONSTER_SKILL_EASY, MONSTER_SKILL_HARD, MONSTER_SKILL_INSANE, MONSTER_SKILL_MEDIUM, MONSTER_SKILL_NIGHTMARE, realowner, team, and teamplay.
Referenced by invasion_SpawnChosenMonster(), monster_changeteam(), and Monster_Spawn().
void Monster_Sound | ( | entity | this, |
.string | samplefield, | ||
float | sound_delay, | ||
bool | delaytoo, | ||
float | chan | ||
) |
Definition at line 341 of file sv_monsters.qc.
References ATTEN_NORM, autocvar_g_monsters_sounds, GlobalSound_sample(), msound_delay, random(), scale, time, and VOL_BASE.
Referenced by Monster_Attack_Check(), Monster_Damage(), Monster_Dead(), Monster_Enemy_Check(), Monster_Move(), and Monster_Spawn_Setup().
Definition at line 249 of file sv_monsters.qc.
References argv(), fclose(), fgets(), FILE_READ, fopen(), PrecacheGlobalSound(), strcat(), and tokenize_console.
Referenced by Monster_Sounds_Precache().
Definition at line 294 of file sv_monsters.qc.
References ALLMONSTERSOUNDS, GetMonsterSoundSampleField_notFound, and string_null.
Referenced by Monster_Sounds_Load().
Definition at line 287 of file sv_monsters.qc.
References ALLMONSTERSOUNDS.
Referenced by Monster_Sounds_Update().
Definition at line 307 of file sv_monsters.qc.
References argv(), fclose(), fgets(), FILE_READ, fopen(), GetMonsterSoundSampleField_notFound, Monster_Sound_SampleField(), strcat(), strcpy, and tokenize_console.
Referenced by Monster_Sounds_Update().
Definition at line 268 of file sv_monsters.qc.
References Monster_Sound_Precache(), monsterdef, search_begin(), search_end(), search_getfilename(), search_getsize(), and strcat().
Referenced by Monster_Spawn_Setup().
Definition at line 331 of file sv_monsters.qc.
References get_monster_model_datafilename(), model, Monster_Sounds_Clear(), Monster_Sounds_Load(), skin, and skin_for_monstersound.
Referenced by Monster_Spawn_Setup().
Definition at line 1325 of file sv_monsters.qc.
References angles, autocvar_g_fullbrightplayers, autocvar_g_monsters, autocvar_g_monsters_edit, autocvar_g_monsters_quake_resize, autocvar_g_monsters_spawnshieldtime, autocvar_g_monsters_think_delay, autocvar_g_nodepthtestplayers, autocvar_g_playerclip_collisions, bot_attack, bound(), candrop, classname, cvar(), DAMAGE_AIM, damagedbycontents, DEAD_NO, deadflag, DPCONTENTS_BODY, DPCONTENTS_BOTCLIP, DPCONTENTS_MONSTERCLIP, DPCONTENTS_PLAYERCLIP, DPCONTENTS_SOLID, dphitcontentsmask, EF_FULLBRIGHT, EF_NODEPTHTEST, effects, enemy, FL_FLY, FL_MONSTER, FL_SWIM, flags, g_bot_targets, g_damagedbycontents, g_monsters, grab, gravity, IL_PUSH(), iscreature, Monster::m_maxs, Monster::m_mins, maxs, mdl_dead, mins, Monster_Appear_Check(), Monster_Damage(), monster_face, Monster_Heal(), monster_moveto, Monster::monster_name, Monster_Remove(), Monster_Reset(), monster_setupcolors(), MONSTER_SIZE_BROKEN, MONSTER_SIZE_QUAKE, monster_skill, MONSTER_SKILL_EASY, MONSTER_SKILL_HARD, MONSTER_SKILL_MEDIUM, Monster_Spawn_Setup(), Monster_Touch(), MONSTER_TYPE_FLY, MONSTER_TYPE_SWIM, Monster_UpdateModel(), Monster_Use(), monsterdef, MONSTERFLAG_RESPAWNED, MONSTERFLAG_SPAWNED, monsters_total, MONSTERSKILL_NOTEASY, MONSTERSKILL_NOTHARD, MONSTERSKILL_NOTMEDIUM, MOVE_WORLDONLY, MOVETYPE_FLY, MOVETYPE_WALK, netname, Monster::netname, noalign, NULL, oldtarget2, origin, pos1, scale, set_movetype(), setmodel, setorigin(), solid, SOLID_BBOX, spawn_time, Monster::spawnflags, spawnflags, sys_frametime, takedamage, target2, team, teamplay, teleportable, ticrate, time, trace_endpos, use, velocity, and view_ofs.
Referenced by Monster_Appear(), Monster_Respawn(), and spawnmonster().
Definition at line 1260 of file sv_monsters.qc.
References attack_range, autocvar_g_monsters_attack_range, autocvar_g_monsters_damageforcescale, autocvar_g_monsters_healthbars, autocvar_g_monsters_respawn_delay, autocvar_g_monsters_target_range, bound(), CH_VOICE, damageforcescale, EF_DIMLIGHT, effects, entity(), g_monster_targets, GetResource(), IL_PUSH(), IS_PLAYER, max_health, maxs, monster_attack, monster_follow, Monster_Miniboss_Check(), MONSTER_MOVE_WANDER, monster_moveflags, MONSTER_SKILLMOD, Monster_Sound(), Monster_Sounds_Precache(), Monster_Sounds_Update(), Monster_Think(), monsterdef, MONSTERFLAG_INVINCIBLE, MONSTERFLAG_RESPAWNED, MUTATOR_CALLHOOK, nextthink, NULL, pain_finished, random(), RES_HEALTH, respawntime, rint(), SetResourceExplicit(), setthink, skin, spawnflags, sprite, team, Team_ColorRGB(), teamplay, ticrate, time, wander_delay, and wander_distance.
Referenced by Monster_Spawn().
Definition at line 1227 of file sv_monsters.qc.
References Damage(), DMG_NOWEP, enemy, GetResource(), last_enemycheck, max_health, Monster_Anim(), Monster_Attack_Check(), Monster_Enemy_Check(), Monster_Frozen_Think(), monster_lifetime, Monster_Move(), monsterdef, nextthink, RES_HEALTH, setthink, speed, speed2, stopspeed, ticrate, time, and weaponentities.
Referenced by Monster_Spawn_Setup().
Definition at line 479 of file sv_monsters.qc.
References enemy, IS_MONSTER, Monster_ValidTarget(), and NULL.
Referenced by Monster_Dead(), Monster_Move(), and Monster_Spawn().
Definition at line 460 of file sv_monsters.qc.
References monsterdef.
Referenced by Monster_Spawn().
Definition at line 557 of file sv_monsters.qc.
References enemy, and Monster_ValidTarget().
Referenced by Monster_Spawn().
Definition at line 82 of file sv_monsters.qc.
References angles, autocvar_g_monsters_lineofsight, autocvar_g_monsters_target_infront, autocvar_g_monsters_target_infront_range, autocvar_g_monsters_typefrag, checkpvs(), DAMAGE_NO, enemy, FL_NOTARGET, GetResource(), IS_DEAD, IS_OBSERVER, IS_SPEC, IS_VEHICLE, makevectors, MON_FLAG_RANGED, monster_follow, monsterdef, MONSTERFLAG_INFRONT, MOVE_NOMONSTERS, MUTATOR_CALLHOOK, normalize(), origin, PHYS_INPUT_BUTTON_CHAT, RES_HEALTH, SAME_TEAM, spawnflags, time, trace_ent, trace_fraction, v_forward, vector(), and view_ofs.
Referenced by Monster_Delay_Action(), Monster_Touch(), and Monster_Use().
Definition at line 33 of file sv_monsters.qc.
References monsters_killed, and monsters_total.
Referenced by PlayerThink().
void | ( | entity | ) |
entity draggedby |
Definition at line 708 of file sv_monsters.qc.
Referenced by havocbot_ai(), Monster_Move(), and Monster_Move_2D().
float pass_distance |
Definition at line 562 of file sv_monsters.qc.
vector pos1 |
Definition at line 524 of file sv_monsters.qc.
Referenced by Monster_Dead_Fade(), Monster_Move_Target(), Monster_Reset(), and Monster_Spawn().
vector pos2 |
Definition at line 524 of file sv_monsters.qc.
Referenced by Monster_Dead_Fade(), and Monster_Reset().
int skin_for_monstersound |
Definition at line 330 of file sv_monsters.qc.
Referenced by Monster_Sounds_Update().