repel()
{
dist = 250 + randomInt(750);
if(self.rank_power == "stronger powers 15")
dist = dist + (int)((dist / 100) * 15);
else if(self.rank_power == "stronger powers 30" || self.rank_power == "fall damage reduced" || self.rank_power == "bleed to death" || self.rank_power == "spawn with power")
dist = dist + (int)((dist / 100) * 30);
self iprintlnbold("^2Pushed away seekers within ^7" + dist + " ^2units.");
if(dist <= 500)
playfx(level._fx_rpl_s, self.origin);
else if(dist > 500)
playfx(level._fx_rpl_l, self.origin);
self playsound("repel_water");
players = getentarray("player","classname");
for(i=0;i<players.size;i++)
{
if(players[i].pers["team"] == self.pers["team"] || players[i].sessionstate != "playing" || distancesquared(players[i].origin, self.origin) > dist * dist)
continue;
else
{
oldhealth = players[i].health;
oldmaxhealth = players[i].maxhealth;
angles = vectortoangles(self.origin - players[i].origin);
dir = players[i].origin + maps\mp\_utility::vectorScale(anglestoforward(angles), 1);
dmg = dist * 3.5;
for(a=0;a<6;a++)
{
players[i].health += dmg;
players[i] doDamageMod(dmg, dir, "MOD_WATER");
}
if(players[i].health != oldhealth)
players[i].health = oldhealth;
if(players[i].maxhealth != oldmaxhealth)
players[i].maxhealth = oldmaxhealth;
if(dist <= 500)
time = 2.0;
else if(dist > 500)
time = 4.0;
strShocktype = "default_mp";
//strShocktype = "melee";
players[i] viewkick(96, players[i].origin); //Amount should be in the range 0-127, and is normalized "damage". No damage is done.
players[i] shellshock(strShocktype, time);
}
}
if(dist <= 500)
{
scale = 0.2;
duration = 2;
radius = 500;
}
else if(dist > 500)
{
scale = 0.4;
duration = 4;
radius = 800;
}
Earthquake( scale, duration, self.origin, radius);
}