19 if (myowner.alpha <= 0.5 && myowner.alpha != 0 &&
DIFF_TEAM(player, myowner))
25 if (player == myowner)
34 this.
alpha = myowner.alpha;
43 if (player.alpha < 0 || player.buff_model !=
this)
46 player.buff_model =
NULL;
59 this.
color = heldbuff.m_color;
60 this.
glowmod = heldbuff.m_color;
61 this.
skin = heldbuff.m_skin;
67 this.
alpha = player.alpha;
72 if (player.buff_model)
73 delete(player.buff_model);
74 player.buff_model =
NULL;
80 setmodel(player.buff_model, MDL_BUFF);
81 setsize(player.buff_model,
'0 0 -40',
'0 0 40');
82 setattachment(player.buff_model, player,
"");
83 setorigin(player.buff_model,
'0 0 1' * (player.buff_model.maxs.z * 1));
84 player.buff_model.owner = player;
85 player.buff_model.exteriormodeltoclient = player;
86 player.buff_model.scale = 0.7;
88 player.buff_model.light_lev = 200;
90 player.buff_model.nextthink =
time;
108 if (
time >= player.buff_effect_delay)
110 Send_Effect_(eff, player.origin + (player.mins + player.maxs) * 0.5,
'0 0 0', 1);
111 player.buff_effect_delay =
time + 0.05;
118 if (!this.
owner.buff_active && !
this.owner.buff_activetime || !
this.owner.buffdef)
123 return CS_CVAR(view).cvar_cl_buffs_autoreplace ==
false || heldbuff != this.
owner.buffdef;
134 entity wp =
WaypointSprite_Spawn(WP_Buff, 0,
autocvar_g_buffs_waypoint_distance, e,
'0 0 1' * e.maxs.z,
NULL, e.team_forced, e,
buff_waypoint,
true, RADARICON_Buff);
135 wp.wp_extra = buff.m_id;
165 setorigin(
this, spot.origin);
167 this.
angles = spot.angles;
181 Send_Effect(EFFECT_ELECTRO_COMBO, oldbufforigin + ((this.
mins + this.
maxs) * 0.5),
'0 0 0', 1);
224 if (
CS_CVAR(
toucher).cvar_cl_buffs_autoreplace && heldbuff != thebuff)
227 int buffid = heldbuff.m_id;
262 if (buff == BUFF_VAMPIRE &&
cvar(
"g_vampire"))
264 return cvar(
strcat(
"g_buffs_", buff.netname));
274 float myseencount = (it.buff_seencount > 0) ? it.buff_seencount : 1;
280 ++newbuff.buff_seencount;
281 ent.buffdef = newbuff;
286 if (!actor.statuseffects)
288 FOREACH(StatusEffects, it.instanceOfBuff, {
289 it.m_remove(it, actor, removal_type);
295 if (!actor.statuseffects)
297 FOREACH(StatusEffects, it.instanceOfBuff && it.m_active(it, actor), {
311 this.
color = buff.m_color;
313 this.
skin = buff.m_skin;
429 if (!autocvar_g_buffs)
468 this.
skin = buff.m_skin;
473 this.
color = buff.m_color;
496 if (ent.spawnflags & 2)
498 else if (ent.spawnflags & 4)
502 ent.buffdef = replacement;
509 setorigin(ent, old.origin);
510 ent.angles = old.angles;
520 SUPER(
Buff).m_apply(
this, actor, eff_time, eff_flags);
527 int buffid = this.
m_id;
534 Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid);
539 SUPER(
Buff).m_remove(
this, actor, removal_type);
548 float frag_deathtype =
M_ARGV(3,
float);
552 if (frag_deathtype == DEATH_BUFF.m_id)
574 dmgent.enemy = frag_attacker;
577 dmgent.nextthink =
time + 0.1;
591 if (frag_deathtype == DEATH_FIRE.m_id)
593 if (frag_deathtype == DEATH_LAVA.m_id)
623 int buffid = heldbuff.m_id;
626 Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
653 if (autocvar_g_buffs < 0)
679 player.buff_flight_crouchheld =
false;
680 else if (!player.buff_flight_crouchheld)
682 player.buff_flight_crouchheld =
true;
683 player.gravity *= -1;
693 if (autocvar_g_buffs > 0)
699 if (autocvar_g_buffs > 0)
const int CBC_ORDER_FIRST
#define MUTATOR_CALLHOOK(id,...)
#define MUTATOR_HOOKFUNCTION(...)
#define MUTATOR_RETURNVALUE
vector buff_Bash_AttackerCalculateForce(vector frag_force, entity frag_target, entity frag_attacker)
vector buff_Bash_TargetCalculateForce(vector frag_force, entity frag_target, entity frag_attacker)
float bot_pickupbasevalue
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.
const int IT_UNLIMITED_AMMO
#define setmodel(this, m)
#define PHYS_INPUT_BUTTON_CROUCH(s)
const int INITPRIO_FINDTARGET
const float MOVE_NOMONSTERS
const float SOLID_TRIGGER
float DPCONTENTS_DONOTENTER
const float EF_FULLBRIGHT
float DPCONTENTS_PLAYERCLIP
const float PFLAGS_FULLDYNAMIC
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
void buff_Disability_ApplyStunned(entity frag_target, entity frag_attacker)
void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
float buff_Inferno_CalculateTime(float dmg)
float buff_Inferno_CalculateDamage(float frag_damage)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define ITEM_SHOULD_KEEP_POSITION(item)
Returns whether item should keep its position or be dropped to the ground.
#define FOREACH(list, cond, body)
float buff_Jump_ChangeDamage(float frag_damage, float frag_deathtype)
float buff_Luck_CalculateDamage(float frag_damage)
float buff_Medic_CalculateSurviveDamage(float frag_damage, float health)
void set_movetype(entity this, int mt)
@ STATUSEFFECT_REMOVE_NORMAL
Effect is being removed by a function, calls regular removal mechanics.
@ STATUSEFFECT_REMOVE_TIMEOUT
@ STATUSEFFECT_FLAG_ACTIVE
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define METHOD(cname, name, prototype)
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
float buff_Resistance_CalculateDamage(float frag_damage)
#define round_handler_IsActive()
#define round_handler_IsRoundStarted()
void PlayerUseKey(entity this)
#define IS_INDEPENDENT_PLAYER(e)
float generic_pickupevalfunc(entity player, entity item)
#define ITEM_TOUCH_NEEDKILL()
#define ITEM_DAMAGE_NEEDKILL(dt)
entity SelectSpawnPoint(entity this, bool anypoint)
#define sound(e, c, s, v, a)
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
void buff_Think(entity this)
void buffs_BuffModel_Think(entity this)
void buff_Delete(entity this)
void buff_NewType(entity ent)
void buff_Waypoint_Reset(entity this)
void buff_Init(entity this)
void buff_SpawnReplacement(entity ent, entity old)
void buff_Effect(entity player, string eff)
bool buffs_RemovePlayer(entity player)
bool buffs_BuffModel_Customize(entity this, entity client)
entity buff_FirstFromFlags(entity actor)
bool buff_Waypoint_visible_for_player(entity this, entity player, entity view)
float buff_Available(entity buff)
void buffs_DelayedInit(entity this)
void buff_SetCooldown(entity this, float cd)
void buff_RemoveAll(entity actor, int removal_type)
void buff_Init_Compat(entity ent, entity replacement)
void buff_Reset(entity this)
bool buff_Customize(entity this, entity client)
void buffs_BuffModel_Spawn(entity player)
void buff_Respawn(entity this)
void buff_Touch(entity this, entity toucher)
void buffs_BuffModel_Remove(entity player)
void buff_Waypoint_Spawn(entity e)
void buffs_BuffModel_Update(entity this)
float autocvar_g_buffs_cooldown_activate
bool buff_activetime_updated
int autocvar_g_buffs_random_location_attempts
bool autocvar_g_buffs_pickup_anyway
bool autocvar_g_buffs_replace_available
bool autocvar_g_buffs_effects
bool autocvar_g_buffs_randomize
int autocvar_g_buffs_spawn_count
float autocvar_g_buffs_cooldown_respawn
bool autocvar_g_buffs_random_location
float autocvar_g_buffs_pickup_delay
bool autocvar_g_buffs_randomize_teamplay
bool autocvar_g_buffs_replace_powerups
float autocvar_g_buffs_waypoint_distance
bool autocvar_g_buffs_drop
float autocvar_g_buffs_random_lifetime
var void delete_fn(entity e)
#define CENTER_OR_VIEWOFS(ent)
void buff_Vengeance_DelayedDamage(entity this)
float buff_Vengeance_CalculateDamage(float frag_damage)
void WaypointSprite_Kill(entity wp)
void WaypointSprite_UpdateTeamRadar(entity e, entity icon, vector col)
void WaypointSprite_Ping(entity e)
entity WaypointSprite_Spawn(entity spr, float _lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
bool WaypointSprite_visible_for_player(entity this, entity player, entity view)
entity WaypointSprite_getviewentity(entity e)
void WaypointSprite_UpdateBuildFinished(entity e, float f)
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
void InitializeEntity(entity e, void(entity this) func, int order)