X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_damage.qc;h=38284c30decd8a5b3adae3fbebe9039ef7e560ef;hb=db9da9531fa296c4d12bf0fe6117d1bd06270771;hp=92a80969c2fb17a88a7bfd7f43e8a22f98abfc46;hpb=20d1c69e0d40efffc5f53359c0fc78bee971c3a1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 92a80969c..38284c30d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -477,9 +477,9 @@ void Ice_Think(entity this) this.nextthink = time; } -void Freeze (entity targ, float revivespeed, float frozen_type, float show_waypoint) +void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint) { - if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed + if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // TODO: only specified entities can be freezed return; if(STAT(FROZEN, targ)) @@ -524,11 +524,11 @@ void Freeze (entity targ, float revivespeed, float frozen_type, float show_waypo }); // add waypoint - if(show_waypoint) + if(MUTATOR_CALLHOOK(Freeze, targ, revivespeed, frozen_type) || show_waypoint) WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', NULL, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT); } -void Unfreeze (entity targ) +void Unfreeze(entity targ) { if(!STAT(FROZEN, targ)) return; @@ -562,6 +562,8 @@ void Unfreeze (entity targ) if(targ.iceblock) delete(targ.iceblock); targ.iceblock = NULL; + + MUTATOR_CALLHOOK(Unfreeze, targ); } void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) @@ -593,9 +595,9 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d // These are ALWAYS lethal // No damage modification here // Instead, prepare the victim for his death... - SetResourceAmount(targ, RESOURCE_ARMOR, 0); + SetResourceAmountExplicit(targ, RESOURCE_ARMOR, 0); targ.spawnshieldtime = 0; - SetResourceAmount(targ, RESOURCE_HEALTH, 0.9); // this is < 1 + SetResourceAmountExplicit(targ, RESOURCE_HEALTH, 0.9); // this is < 1 targ.flags -= targ.flags & FL_GODMODE; damage = 100000; } @@ -1063,7 +1065,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e bool Heal(entity targ, entity inflictor, float amount, float limit) { - if(game_stopped || (IS_CLIENT(targ) && CS(targ).killcount == FRAGS_SPECTATOR) || STAT(FROZEN, targ)) + if(game_stopped || (IS_CLIENT(targ) && CS(targ).killcount == FRAGS_SPECTATOR) || STAT(FROZEN, targ) || IS_DEAD(targ)) return false; bool healed = false; @@ -1071,6 +1073,7 @@ bool Heal(entity targ, entity inflictor, float amount, float limit) healed = targ.event_heal(targ, inflictor, amount, limit); // TODO: additional handling? what if the healing kills them? should this abort if healing would do so etc // TODO: healing fx! + // TODO: armor healing? return healed; }