51 if (!actor.target_range)
76 if (key_pressed && !player.OffhandMageTeleport_key_pressed)
78 player.OffhandMageTeleport_key_pressed = key_pressed;
141 DEATH_MONSTER_MAGE.m_id,
188 missile.owner = missile.realowner =
this;
190 missile.ltime =
time + 7;
191 missile.nextthink =
time;
198 setsize(missile,
'0 0 0',
'0 0 0');
199 missile.velocity =
dir * 400;
200 missile.avelocity =
'300 300 300';
201 missile.enemy = this.
enemy;
222 bool was_healed = (head !=
NULL);
223 for (; head; head = head.chain)
240 fx = EFFECT_AMMO_REGEN;
246 fx = EFFECT_ARMOR_REPAIR;
251 float pl_alpha = (!head.alpha ? 1 : head.alpha);
266 setanim(
this, this.anim_melee,
true,
true,
true);
283 DEATH_MONSTER_MAGE.m_id,
289 setanim(
this, this.anim_duckjump,
true,
true,
true);
310 this.
angles =
'0 1 0' * a.y;
333 setorigin(
this, newpos);
350 setanim(
this, this.anim_shoot,
true,
true,
true);
362 Weapon wep = WEP_MAGE_SPIKE;
364 wep.
wr_think(wep, actor, weaponentity, 2);
374 actor.OffhandMageTeleport_key_pressed = 0;
380 setanim(actor, actor.anim_shoot,
true,
true,
true);
382 actor.anim_finished =
time + 1;
384 Weapon wep = WEP_MAGE_SPIKE;
385 wep.
wr_think(wep, actor, weaponentity, 1);
407 bool should_heal = (head !=
NULL);
411 &&
time >= actor.attack_finished_single[0]
416 && actor.enemy &&
time >= actor.mage_shield_delay
432 setanim(actor, ((
random() > 0.5) ? actor.anim_die2 : actor.anim_die1),
false,
true,
true);
441 actor.anim_idle =
animfixfps(actor,
'0 1 1', none);
442 actor.anim_walk =
animfixfps(actor,
'1 1 1', none);
443 actor.anim_run =
animfixfps(actor,
'1 1 1', none);
444 actor.anim_shoot =
animfixfps(actor,
'2 1 5', none);
445 actor.anim_duckjump =
animfixfps(actor,
'4 1 5', none);
446 actor.anim_melee =
animfixfps(actor,
'5 1 5', none);
450 actor.anim_pain1 =
animfixfps(actor,
'6 1 2', none);
451 actor.anim_pain2 =
animfixfps(actor,
'7 1 2', none);
453 actor.anim_die1 =
animfixfps(actor,
'9 1 0.5', none);
454 actor.anim_die2 =
animfixfps(actor,
'10 1 0.5', none);
482 PAR(_(
"Wielding nanotechnology as if it were sorcery, the Mage employs a range of unique abilities of its own creation in combat."));
483 PAR(_(
"As a primary attack, the Mage throws a homing electric sphere towards the player. "
484 "This sphere will track its target at high speed, exploding on impact or if it does not reach its target in time."));
485 PAR(_(
"When threatened, the Mage may deploy an energy shield to protect itself from damage briefly. "
486 "Enemies approaching too closely during this time may be pushed away with explosive force!"));
487 PAR(_(
"Defensively the Mage is capable of healing itself and nearby allies, with some variants also providing armor and ammunition."));
488 PAR(_(
"The Mage may sometimes appear to blink out of existence as it teleports behind its target for a sneak attack."));
IntrusiveList g_bot_dodge
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool OffhandMageTeleport_key_pressed
virtual void offhand_think()
virtual void offhand_think()
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
virtual void wr_think()
(SERVER) logic to run every frame
int autocvar_g_pickup_rockets_max
int autocvar_g_pickup_shells_max
int autocvar_g_pickup_cells_max
int autocvar_g_pickup_nails_max
const float MOVE_NOMONSTERS
float DPCONTENTS_DONOTENTER
float DPCONTENTS_PLAYERCLIP
void UpdateCSQCProjectile(entity e)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
bool Heal(entity targ, entity inflictor, float amount, float limit)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
const int HITTYPE_SPLASH
automatically set by RadiusDamage
void Send_Effect_Core(entity eff, vector eff_loc, vector eff_vel, int eff_cnt, vector eff_col_min, vector eff_col_max, float eff_alpha_min, float eff_alpha_max, float eff_alpha_fade, entity ignore)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
void WarpZone_RefSys_Copy(entity me, entity from)
Copies the warpzone reference of from onto me.
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
void M_Mage_Defend_Shield(entity this)
void M_Mage_Defend_Heal(entity this)
float autocvar_g_monster_mage_attack_push_force
float autocvar_g_monster_mage_shield_time
float autocvar_g_monster_mage_attack_spike_chance
float autocvar_g_monster_mage_attack_push_radius
float autocvar_g_monster_mage_heal_delay
float autocvar_g_monster_mage_attack_spike_delay
float autocvar_g_monster_mage_attack_teleport_random
string autocvar_g_monster_mage_loot
float autocvar_g_monster_mage_attack_spike_smart_mindist
float autocvar_g_monster_mage_speed_run
float autocvar_g_monster_mage_speed_stop
float autocvar_g_monster_mage_attack_spike_radius
void M_Mage_Attack_Spike_Think(entity this)
float autocvar_g_monster_mage_attack_spike_smart_trace_min
void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity)
float autocvar_g_monster_mage_heal_minhealth
float autocvar_g_monster_mage_attack_spike_smart
float autocvar_g_monster_mage_attack_spike_accel
float autocvar_g_monster_mage_attack_spike_smart_trace_max
float autocvar_g_monster_mage_health
float autocvar_g_monster_mage_attack_spike_decel
float autocvar_g_monster_mage_heal_range
float autocvar_g_monster_mage_attack_spike_turnrate
float autocvar_g_monster_mage_shield_delay
float autocvar_g_monster_mage_attack_spike_damage
void M_Mage_Attack_Teleport(entity this, entity targ)
float autocvar_g_monster_mage_speed_walk
float autocvar_g_monster_mage_attack_spike_speed_max
void M_Mage_Attack_Push(entity this)
float autocvar_g_monster_mage_attack_push_delay
float autocvar_g_monster_mage_attack_push_damage
float autocvar_g_monster_mage_shield_blockpercent
OffhandMageTeleport OFFHAND_MAGE_TELEPORT
bool M_Mage_Attack(int attack_type, entity actor, entity targ,.entity weaponentity)
bool M_Mage_Defend_Heal_Check(entity this, entity targ)
void M_Mage_Attack_Spike(entity this, vector dir)
float autocvar_g_monster_mage_attack_teleport_random_range
float autocvar_g_monster_mage_heal_allies
float autocvar_g_monster_mage_attack_teleport_delay
float autocvar_g_monster_mage_damageforcescale
bool M_Mage_Defend_Heal_cond(entity e)
void M_Mage_Attack_Spike_Touch(entity this, entity toucher)
bool M_Mage_Defend_Heal_cond_checkvalid
float autocvar_g_monster_mage_attack_teleport_chance
float autocvar_g_monster_mage_attack_push_chance
vector animfixfps(entity e, vector a, vector b)
void set_movetype(entity this, int mt)
const int MOVETYPE_FLYMISSILE
#define METHOD(cname, name, prototype)
const int PROJECTILE_MAGE_SPIKE
float W_SeekOutEnemy(entity this, float speed_decel, float speed_accel, float speed_max, float turn_rate, bool smart, float smart_mindist, float smart_trace_min, float smart_trace_max)
Automatically guides a projectile towards its enemy.
#define PROJECTILE_TOUCH(e, t)
IntrusiveList g_projectiles
#define sound(e, c, s, v, a)
string W_Sound(string w_snd)
#define SOUND(name, path)
#define STATIC_INIT(func)
during worldspawn
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
bool Monster_Spawn(entity this, bool check_appear, Monster mon)
Setup the basic required properties for a monster.
entity Monster_FindTarget(entity this)
void monster_makevectors(entity this, entity targ)
float anim_finished
will be phased out when we have proper animations system
entity monster_follow
monster follow target
float autocvar_g_monsters_target_range
const int MONSTER_ATTACK_MELEE
const int MONSTERFLAG_INVINCIBLE
monster doesn't take damage (may be used for map objects & temporary monsters)
const int MONSTER_ATTACK_RANGED
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
float autocvar_g_balance_health_regenstable
int autocvar_g_balance_armor_regenstable
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
#define CENTER_OR_VIEWOFS(ent)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
void WaypointSprite_UpdateHealth(entity e, float f)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
float attack_finished_single[MAX_WEAPONSLOTS]
bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos)