void Send_KillNotification (string s1, string s2, string s3, float msg, float type)
{
- WriteByte(MSG_ALL, SVC_TEMPENTITY);
- WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY);
- WriteString(MSG_ALL, s1);
- WriteString(MSG_ALL, s2);
- WriteString(MSG_ALL, s3);
- WriteShort(MSG_ALL, msg);
- WriteByte(MSG_ALL, type);
+ WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+ WriteByte(MSG_BROADCAST, TE_CSQC_KILLNOTIFY);
+ WriteString(MSG_BROADCAST, s1);
+ WriteString(MSG_BROADCAST, s2);
+ WriteString(MSG_BROADCAST, s3);
+ WriteShort(MSG_BROADCAST, msg);
+ WriteByte(MSG_BROADCAST, type);
}
// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases)
void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
{
string s, a, msg;
- float w, type;
+ float type;
if (targ.classname == "player")
{
deathtype = KILL_TEAM_BLUE;
}
- Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE);
+ Send_KillNotification(s, msg, "", deathtype, MSG_SUICIDE);
}
else if (attacker.classname == "player")
{
}
}
+void Ice_Think()
+{
+ if(self.owner.health < 1)
+ {
+ remove(self);
+ return;
+ }
+ setorigin(self, self.owner.origin - '0 0 16');
+ self.nextthink = time;
+}
+
+void Freeze (entity targ, float freeze_time)
+{
+ float monster = (targ.flags & FL_MONSTER);
+ float player = (targ.flags & FL_CLIENT);
+
+ if(!player && !monster) // only specified entities can be freezed
+ return;
+
+ if(targ.frozen || targ.freezetag_frozen)
+ return;
+
+ targ.frozen = 1;
+ targ.revive_progress = 0;
+ targ.health = 1;
+ targ.revive_speed = freeze_time;
+
+ entity ice;
+ ice = spawn();
+ ice.owner = targ;
+ ice.classname = "ice";
+ ice.scale = targ.scale;
+ ice.think = Ice_Think;
+ ice.nextthink = time;
+ ice.frame = floor(random() * 21); // ice model has 20 different looking frames
+ setmodel(ice, "models/ice/ice.md3");
+
+ entity oldself;
+ oldself = self;
+ self = ice;
+ Ice_Think();
+ self = oldself;
+
+ RemoveGrapplingHook(targ);
+}
+
+void Unfreeze (entity targ)
+{
+ targ.frozen = 0;
+ targ.revive_progress = 0;
+ targ.health = ((targ.classname == STR_PLAYER) ? autocvar_g_balance_health_start : targ.max_health);
+
+ // remove the ice block
+ entity ice;
+ for(ice = world; (ice = find(ice, classname, "ice")); ) if(ice.owner == targ)
+ {
+ remove(ice);
+ break;
+ }
+}
+
// these are updated by each Damage call for use in button triggering and such
entity damage_targ;
entity damage_inflictor;
attacker.dmg_take += v_x;
attacker.dmg_save += v_y;
attacker.dmg_inflictor = inflictor;
- mirrordamage = 0;
+ mirrordamage = v_z; // = 0, to make fteqcc stfu
mirrorforce = 0;
}
mirrorforce *= g_weaponforcefactor;
}
+ if(targ.frozen && attacker.classname != "monster_spider")
+ {
+ damage = 0;
+ force *= 0.2;
+ }
+
// should this be changed at all? If so, in what way?
frag_attacker = attacker;
frag_target = targ;
else
victim = targ;
- if(victim.classname == "player" || victim.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+ if(victim.classname == "player" || victim.turrcaps_flags & TFL_TURRCAPS_ISTURRET || victim.flags & FL_MONSTER)
{
if(IsDifferentTeam(victim, attacker))
{
if(deathtype & HITTYPE_HEADSHOT)
headshot = 1;
}
- if(g_ca)
- PlayerScore_Add(attacker, SP_SCORE, damage * autocvar_g_ca_damage2score_multiplier);
}
}
else
myblastorigin = WarpZone_TransformOrigin(targ, blastorigin);
// if it's a player, use the view origin as reference
- if (targ.classname == "player")
- center = targ.origin + targ.view_ofs;
- else
- center = targ.origin + (targ.mins + targ.maxs) * 0.5;
+ center = CENTER_OR_VIEWOFS(targ);
force = normalize(center - myblastorigin);
force = force * (finaldmg / coredamage) * forceintensity;
e.fire_endtime = 0;
// ice stops fire
- if(e.freezetag_frozen)
+ if(e.freezetag_frozen || e.frozen)
e.fire_endtime = 0;
t = min(frametime, e.fire_endtime - time);