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 float pl_alpha = (!player.alpha ? 1 : player.alpha);
112 pl_alpha, pl_alpha, -1,
113 (hide ? player :
NULL)
115 player.buff_effect_delay =
time + 1/16;
121 if (!this.
owner.buff_active && !
this.owner.buff_activetime || !
this.owner.buffdef)
126 return CS_CVAR(view).cvar_cl_buffs_autoreplace ==
false || heldbuff != this.
owner.buffdef;
137 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);
138 wp.wp_extra = buff.m_id;
168 setorigin(
this, spot.origin);
170 this.
angles = spot.angles;
184 Send_Effect(EFFECT_ITEM_TELEPORT, oldbufforigin + ((this.
mins + this.
maxs) * 0.5),
'0 0 0', 1);
226 if (
CS_CVAR(
toucher).cvar_cl_buffs_autoreplace && heldbuff != thebuff)
228 int buffid = heldbuff.m_id;
262 if (buff == BUFF_VAMPIRE &&
cvar(
"g_vampire"))
264 return cvar(
strcat(
"g_buffs_", buff.netname));
275 float myseencount = (it.buff_seencount > 0) ? it.buff_seencount : 1;
281 ++newbuff.buff_seencount;
282 ent.buffdef = newbuff;
287 if (!actor.statuseffects)
289 FOREACH(StatusEffects, it.instanceOfBuff, it.m_remove(it, actor, removal_type));
294 if (!actor.statuseffects)
296 FOREACH(StatusEffects, it.instanceOfBuff && it.m_active(it, actor),
return it);
308 this.
color = buff.m_color;
310 this.
skin = buff.m_skin;
337 || !this.
owner.iscreature ||
this.owner.vehicle
384 setorigin(
this, this.
origin);
433 if (!autocvar_g_buffs)
472 this.
skin = buff.m_skin;
477 this.
color = buff.m_color;
499 if (ent.spawnflags & 2)
501 else if (ent.spawnflags & 4)
505 ent.buffdef = replacement;
512 setorigin(ent, old.origin);
513 ent.angles = old.angles;
523 SUPER(
Buff).m_apply(
this, actor, eff_time, eff_flags);
530 int buffid = this.
m_id;
537 Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid);
542 SUPER(
Buff).m_remove(
this, actor, removal_type);
551 float frag_deathtype =
M_ARGV(3,
float);
555 if (frag_deathtype == DEATH_BUFF_INFERNO.m_id
556 || frag_deathtype == DEATH_BUFF_VENGEANCE.m_id)
578 dmgent.enemy = frag_attacker;
581 dmgent.nextthink =
time + 0.1;
595 if (frag_deathtype == DEATH_FIRE.m_id)
597 if (frag_deathtype == DEATH_LAVA.m_id)
627 int buffid = heldbuff.m_id;
630 Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
657 if (autocvar_g_buffs < 0)
683 player.buff_flight_crouchheld =
false;
684 else if (!player.buff_flight_crouchheld)
686 player.buff_flight_crouchheld =
true;
687 player.gravity *= -1;
697 if (autocvar_g_buffs > 0)
703 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_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)
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_CLEAR
Effect is being forcibly removed without calling any additional mechanics.
@ 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_Init(entity this)
void buff_SpawnReplacement(entity ent, entity old)
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 buff_Effect(entity player, entity eff, vector eff_loc, vector eff_vel, int eff_cnt, bool hide)
Spawn effects on a player with a 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
int autocvar_g_buffs_randomize
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
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_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)