set g_balance_falldamage_factor 0.15
set g_balance_falldamage_maxdamage 25
set g_balance_damagepush_speedfactor 0
+set g_balance_contents_damagerate 5
+set g_balance_contents_playerdamage_drowning 5
+set g_balance_contents_playerdamage_lava 10
+set g_balance_contents_playerdamage_slime 5
+set g_balance_contents_projectiledamage 15
// }}}
// {{{ powerups
set g_balance_hagar_primary_damage 37
set g_balance_hagar_primary_edgedamage 15
set g_balance_hagar_primary_force 100
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
set g_balance_hagar_primary_radius 65
set g_balance_hagar_primary_spread 0.010
set g_balance_hagar_primary_speed 3000
set g_balance_hagar_secondary_damage 37
set g_balance_hagar_secondary_edgedamage 15
set g_balance_hagar_secondary_force 100
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
set g_balance_hagar_secondary_radius 65
set g_balance_hagar_secondary_spread 0.015
set g_balance_hagar_secondary_speed 1400
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 15
set g_balance_damagepush_speedfactor 2.5
+set g_balance_contents_damagerate 5
+set g_balance_contents_playerdamage_drowning 5
+set g_balance_contents_playerdamage_lava 10
+set g_balance_contents_playerdamage_slime 5
+set g_balance_contents_projectiledamage 15
// }}}
// {{{ powerups
set g_balance_hagar_primary_damage 14
set g_balance_hagar_primary_edgedamage 6
set g_balance_hagar_primary_force 70
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
set g_balance_hagar_primary_radius 110
set g_balance_hagar_primary_spread 0.1
set g_balance_hagar_primary_speed 1800
set g_balance_hagar_secondary_damage 14 // default for _load: 32
set g_balance_hagar_secondary_edgedamage 6 // default for _load: 10
set g_balance_hagar_secondary_force 70 // default for _load: 160
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
set g_balance_hagar_secondary_radius 125
set g_balance_hagar_secondary_spread 0.15 // default for _load: 0.08
set g_balance_hagar_secondary_speed 1800
set g_balance_falldamage_factor 0.15
set g_balance_falldamage_maxdamage 25
set g_balance_damagepush_speedfactor 0
+set g_balance_contents_damagerate 5
+set g_balance_contents_playerdamage_drowning 5
+set g_balance_contents_playerdamage_lava 10
+set g_balance_contents_playerdamage_slime 5
+set g_balance_contents_projectiledamage 15
// }}}
// {{{ powerups
set g_balance_hagar_primary_damage 43
set g_balance_hagar_primary_edgedamage 15
set g_balance_hagar_primary_force 94
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
set g_balance_hagar_primary_radius 70
set g_balance_hagar_primary_spread 0.010
set g_balance_hagar_primary_speed 3000
set g_balance_hagar_secondary_damage 43
set g_balance_hagar_secondary_edgedamage 15
set g_balance_hagar_secondary_force 100
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
set g_balance_hagar_secondary_radius 70
set g_balance_hagar_secondary_spread 0.015
set g_balance_hagar_secondary_speed 1400
set g_balance_falldamage_factor 0.20
set g_balance_falldamage_maxdamage 40
set g_balance_damagepush_speedfactor 2.5
+set g_balance_contents_damagerate 5
+set g_balance_contents_playerdamage_drowning 5
+set g_balance_contents_playerdamage_lava 10
+set g_balance_contents_playerdamage_slime 5
+set g_balance_contents_projectiledamage 15
// }}}
// {{{ powerups
set g_balance_grapplehook_length_min 50
set g_balance_grapplehook_stretch 50
set g_balance_grapplehook_airfriction 0.2
-set g_balance_grapplehook_health 130
+set g_balance_grapplehook_health 30
// }}}
// {{{ weapon properties
set g_balance_grenadelauncher_primary_refire 0.8
set g_balance_grenadelauncher_primary_animtime 0.3
set g_balance_grenadelauncher_primary_ammo 2
-set g_balance_grenadelauncher_primary_health 0
+set g_balance_grenadelauncher_primary_health 10
set g_balance_grenadelauncher_primary_damageforcescale 0
set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
set g_balance_grenadelauncher_secondary_refire 0.7
set g_balance_grenadelauncher_secondary_animtime 0.3
set g_balance_grenadelauncher_secondary_ammo 2
-set g_balance_grenadelauncher_secondary_health 0
+set g_balance_grenadelauncher_secondary_health 30
set g_balance_grenadelauncher_secondary_damageforcescale 4
set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
set g_balance_hagar_primary_damage 25
set g_balance_hagar_primary_edgedamage 12.5
set g_balance_hagar_primary_force 50
+set g_balance_hagar_primary_health 5
+set g_balance_hagar_primary_damageforcescale 0
set g_balance_hagar_primary_radius 60
set g_balance_hagar_primary_spread 0.04
set g_balance_hagar_primary_speed 2000
set g_balance_hagar_secondary_damage 40
set g_balance_hagar_secondary_edgedamage 20
set g_balance_hagar_secondary_force 50
+set g_balance_hagar_secondary_health 5
+set g_balance_hagar_secondary_damageforcescale 0
set g_balance_hagar_secondary_radius 80
set g_balance_hagar_secondary_spread 0.05
set g_balance_hagar_secondary_speed 2000
set g_balance_rocketlauncher_refire 1.1
set g_balance_rocketlauncher_animtime 0.3
set g_balance_rocketlauncher_ammo 4
-set g_balance_rocketlauncher_health 0 // 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but grenadelauncher still can most the time.
+set g_balance_rocketlauncher_health 30 // 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but grenadelauncher still can most the time.
set g_balance_rocketlauncher_damageforcescale 1 // low damage force scale so that it can still be affected by other hits, but not so much that it does a 90 degree turn
set g_balance_rocketlauncher_detonatedelay 0.05 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
set g_balance_rocketlauncher_guiderate 110 // max degrees per second
set g_balance_falldamage_factor 0.02 // maxspeed = minspeed + maxdamage / factor = 4550
set g_balance_falldamage_maxdamage 75
set g_balance_damagepush_speedfactor 0
+set g_balance_contents_damagerate 5
+set g_balance_contents_playerdamage_drowning 5
+set g_balance_contents_playerdamage_lava 10
+set g_balance_contents_playerdamage_slime 5
+set g_balance_contents_projectiledamage 15
// }}}
// {{{ powerups
set g_balance_powerup_strength_time 30
set g_balance_powerup_strength_selfdamage 1.5
set g_balance_powerup_strength_selfforce 1.5
+
// }}}
// {{{ jetpack/hook
set g_balance_hagar_primary_damage 25
set g_balance_hagar_primary_edgedamage 5
set g_balance_hagar_primary_force 70
+set g_balance_hagar_primary_health 0
+set g_balance_hagar_primary_damageforcescale 0
set g_balance_hagar_primary_radius 60
set g_balance_hagar_primary_spread 0.010
set g_balance_hagar_primary_speed 2500
set g_balance_hagar_secondary_damage 30
set g_balance_hagar_secondary_edgedamage 15
set g_balance_hagar_secondary_force 50
+set g_balance_hagar_secondary_health 0
+set g_balance_hagar_secondary_damageforcescale 0
set g_balance_hagar_secondary_radius 65
set g_balance_hagar_secondary_spread 0.015
set g_balance_hagar_secondary_speed 1400
float autocvar_g_balance_rifle_reload_ammo;
float autocvar_g_balance_rifle_reload_time;
float autocvar_g_balance_cloaked_alpha;
+float autocvar_g_balance_contents_damagerate;
+float autocvar_g_balance_contents_playerdamage_drowning;
+float autocvar_g_balance_contents_playerdamage_lava;
+float autocvar_g_balance_contents_playerdamage_slime;
+float autocvar_g_balance_contents_projectiledamage;
float autocvar_g_balance_crylink_primary_ammo;
float autocvar_g_balance_crylink_primary_animtime;
float autocvar_g_balance_crylink_primary_bouncedamagefactor;
float autocvar_g_balance_hagar_primary_damage;
float autocvar_g_balance_hagar_primary_edgedamage;
float autocvar_g_balance_hagar_primary_force;
+float autocvar_g_balance_hagar_primary_health;
+float autocvar_g_balance_hagar_primary_damageforcescale;
float autocvar_g_balance_hagar_primary_lifetime;
float autocvar_g_balance_hagar_primary_radius;
float autocvar_g_balance_hagar_primary_refire;
float autocvar_g_balance_hagar_secondary_damage;
float autocvar_g_balance_hagar_secondary_edgedamage;
float autocvar_g_balance_hagar_secondary_force;
+float autocvar_g_balance_hagar_secondary_health;
+float autocvar_g_balance_hagar_secondary_damageforcescale;
float autocvar_g_balance_hagar_secondary_lifetime_min;
float autocvar_g_balance_hagar_secondary_lifetime_rand;
float autocvar_g_balance_hagar_secondary_radius;
self.classname = "observer";
self.iscreature = FALSE;
+ self.damagedbycontents = FALSE;
self.health = -666;
self.takedamage = DAMAGE_NO;
self.solid = SOLID_NOT;
self.classname = "player";
self.wasplayer = TRUE;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
self.colormap = oldself.colormap;
self.glowmod = oldself.glowmod;
self.iscreature = oldself.iscreature;
+ self.damagedbycontents = oldself.damagedbycontents;
self.angles = oldself.angles;
self.avelocity = oldself.avelocity;
self.classname = "body";
.float watersound_finished;
.float iscreature;
+.float damagedbycontents;
.vector oldvelocity;
.float pauseregen_finished;
// spread think times so they don't all happen at same time
self.nextthink = self.nextthink + random()*0.5 + 0.1;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
force_retouch = 2; // mainly to detect teleports
}
}
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
force_retouch = 2; // mainly to detect teleports
}
}
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
force_retouch = 2; // mainly to detect teleports
local entity oldself;
local float dm;
oldself = self;
- for(self = world; (self = findfloat(self, iscreature, TRUE)); )
+ for(self = world; (self = findfloat(self, damagedbycontents, TRUE)); )
{
- if (self.movetype == MOVETYPE_NOCLIP)
- continue;
+ if (self.movetype == MOVETYPE_NOCLIP) { continue; }
+
float vehic = (self.vehicle_flags & VHF_ISVEHICLE);
+ float projectile = (self.projectiledeathtype);
+
if (self.waterlevel)
{
if (!(self.flags & FL_INWATER))
self.flags |= FL_INWATER;
self.dmgtime = 0;
}
- if(!vehic) // vehicles don't drown
+
+ if(!vehic && !projectile) // vehicles and projectiles don't drown
{
if (self.waterlevel != WATERLEVEL_SUBMERGED)
{
if (!self.deadflag)
if (self.pain_finished < time)
{
- Damage (self, world, world, 5, DEATH_DROWN, self.origin, '0 0 0');
+ Damage (self, world, world, autocvar_g_balance_contents_playerdamage_drowning, DEATH_DROWN, self.origin, '0 0 0');
self.pain_finished = time + 0.5;
}
}
}
+
if (self.dmgtime < time)
{
- self.dmgtime = time + 0.2;
- if (self.watertype == CONTENT_LAVA)
+ self.dmgtime = time + (1 / min(1, autocvar_g_balance_contents_damagerate));
+
+ if (!projectile)
{
- if (self.watersound_finished < time)
+ if (self.watertype == CONTENT_LAVA)
{
- self.watersound_finished = time + 0.5;
- sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTN_NORM);
+ if (self.watersound_finished < time)
+ {
+ self.watersound_finished = time + 0.5;
+ sound (self, CH_PLAYER, "player/lava.wav", VOL_BASE, ATTN_NORM);
+ }
+ Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
}
- Damage (self, world, world, 6 * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
- }
- else if (self.watertype == CONTENT_SLIME)
- {
- if (self.watersound_finished < time)
+ else if (self.watertype == CONTENT_SLIME)
{
- self.watersound_finished = time + 0.5;
- sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTN_NORM);
+ if (self.watersound_finished < time)
+ {
+ self.watersound_finished = time + 0.5;
+ sound (self, CH_PLAYER, "player/slime.wav", VOL_BASE, ATTN_NORM);
+ }
+ Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
}
- Damage (self, world, world, 2 * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
+ }
+ else if ((self.watertype == CONTENT_LAVA) || (self.watertype == CONTENT_SLIME))
+ {
+ Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
}
}
}
self.dmg = 2;
}
- if(!vehic) // vehicles don't get falling damage
+ if(!vehic && !projectile) // vehicles don't get falling damage
{
// check for falling damage
float velocity_len = vlen(self.velocity);
self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
self.touch = vehicles_touch;
self.event_damage = vehicles_damage;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.movetype = MOVETYPE_WALK;
self.solid = SOLID_SLIDEBOX;
self.takedamage = DAMAGE_AIM;
self.takedamage = DAMAGE_AIM;
self.bot_attack = TRUE;
self.iscreature = TRUE;
+ self.damagedbycontents = TRUE;
self.hud = vhud;
self.vehicle_die = dieproc;
gren.health = autocvar_g_balance_grenadelauncher_primary_health;
gren.damageforcescale = autocvar_g_balance_grenadelauncher_primary_damageforcescale;
gren.event_damage = W_Grenade_Damage;
+ gren.damagedbycontents = TRUE;
W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
gren.angles = vectoangles (gren.velocity);
remove (self);
}
+void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ if (self.health <= 0)
+ return;
+ self.health = self.health - damage;
+ self.angles = vectoangles(self.velocity);
+ if (self.health <= 0)
+ W_PrepareExplosionByDamage(attacker, self.think);
+}
+
void W_Hagar_Touch (void)
{
PROJECTILE_TOUCH;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage;
+
+ missile.takedamage = DAMAGE_YES;
+ missile.health = autocvar_g_balance_hagar_primary_health;
+ missile.damageforcescale = autocvar_g_balance_hagar_primary_damageforcescale;
+ missile.event_damage = W_Hagar_Damage;
+ missile.damagedbycontents = TRUE;
+
missile.touch = W_Hagar_Touch;
missile.use = W_Hagar_Explode;
missile.think = adaptor_think2use_hittype_splash;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
+
+ missile.takedamage = DAMAGE_YES;
+ missile.health = autocvar_g_balance_hagar_secondary_health;
+ missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale;
+ missile.event_damage = W_Hagar_Damage;
+ missile.damagedbycontents = TRUE;
+
missile.touch = W_Hagar_Touch2;
missile.cnt = 0;
missile.use = W_Hagar_Explode2;
missile.classname = "missile";
missile.bot_dodge = TRUE;
missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
+
+ missile.takedamage = DAMAGE_YES;
+ missile.health = autocvar_g_balance_hagar_secondary_health;
+ missile.damageforcescale = autocvar_g_balance_hagar_secondary_damageforcescale;
+ missile.event_damage = W_Hagar_Damage;
+ missile.damagedbycontents = TRUE;
missile.touch = W_Hagar_Touch; // not bouncy
missile.use = W_Hagar_Explode2;
newmine.health = self.health;
newmine.event_damage = self.event_damage;
newmine.spawnshieldtime = self.spawnshieldtime;
+ newmine.damagedbycontents = TRUE;
newmine.movetype = MOVETYPE_NONE; // lock the mine in place
newmine.projectiledeathtype = self.projectiledeathtype;
missile.damageforcescale = autocvar_g_balance_rocketlauncher_damageforcescale;
missile.health = autocvar_g_balance_rocketlauncher_health;
missile.event_damage = W_Rocket_Damage;
+ missile.damagedbycontents = TRUE;
missile.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(missile);
missile.takedamage = DAMAGE_YES;
missile.health = autocvar_g_balance_seeker_missile_health;
missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
+ missile.damagedbycontents = TRUE;
//missile.think = Seeker_Missile_Animate; // csqc projectiles.
if (missile.enemy != world)