Tank crush damage tweaks

This commit is contained in:
Anuke
2022-03-04 17:22:22 -05:00
parent 742466c3ee
commit a97192a79d
6 changed files with 11 additions and 10 deletions

View File

@@ -2438,7 +2438,6 @@ public class UnitTypes{
rotateSpeed = 3.5f;
health = 800;
armor = 5f;
areaDamage = 5f;
treadRects = new Rect[]{new Rect(12, 7, 14, 51)};
researchCostMultiplier = 0f;
@@ -2479,7 +2478,6 @@ public class UnitTypes{
rotateSpeed = 2.6f;
health = 2000;
armor = 8f;
areaDamage = 8f;
treadRects = new Rect[]{new Rect(17, 10, 19, 76)};
researchCostMultiplier = 0f;
@@ -2565,7 +2563,7 @@ public class UnitTypes{
speed = 0.63f;
health = 9000;
armor = 20f;
areaDamage = 13f;
crushDamage = 13f / 5f;
treadRects = new Rect[]{new Rect(22, 16, 28, 130)};
weapons.add(new Weapon("vanquish-weapon"){{
@@ -2637,7 +2635,7 @@ public class UnitTypes{
speed = 0.48f;
health = 20000;
armor = 25f;
areaDamage = 30f;
crushDamage = 25f / 5f;
rotateSpeed = 0.8f;
treadRects = new Rect[]{new Rect(27, 152, 56, 73), new Rect(24, 51 - 9, 29, 17), new Rect(59, 18 - 9, 39, 19)};
@@ -3358,7 +3356,7 @@ public class UnitTypes{
drawCell = false;
segments = 4;
drawBody = false;
areaDamage = 2f;
crushDamage = 2f;
segmentScl = 4f;
segmentPhase = 5f;

View File

@@ -88,7 +88,7 @@ abstract class CrawlComp implements Posc, Rotc, Hitboxc, Unitc{
//TODO area damage to units
if(t.build != null && t.build.team != team){
t.build.damage(team, type.areaDamage * Time.delta);
t.build.damage(team, type.crushDamage * Time.delta);
}
if(Mathf.chanceDelta(0.025)){

View File

@@ -63,11 +63,11 @@ abstract class TankComp implements Posc, Flyingc, Hitboxc, Unitc, ElevationMovec
}
//TODO should this apply to the player team(s)? currently PvE due to balancing
if(walked && t != null && t.build != null && t.build.team != team && (state.rules.waves && team == state.rules.waveTeam)
if(type.crushDamage > 0 && walked && t != null && t.build != null && t.build.team != team
//damage radius is 1 tile smaller to prevent it from just touching walls as it passes
&& Math.max(Math.abs(dx), Math.abs(dy)) <= r - 1){
t.build.damage(team, type.areaDamage * Time.delta);
t.build.damage(team, type.crushDamage * Time.delta * t.block().crushDamageMultiplier);
}
}
}

View File

@@ -194,8 +194,8 @@ public class UnitType extends UnlockableContent{
public float segmentScl = 4f, segmentPhase = 5f;
public float segmentRotSpeed = 1f, segmentMaxRot = 30f;
public float crawlSlowdown = 0.5f;
//used for tanks too
public float areaDamage = 0.5f;
/** Damage dealt to blocks under this tank/crawler every frame. */
public float crushDamage = 0f;
public float crawlSlowdownFrac = 0.55f;
public ObjectSet<StatusEffect> immunities = new ObjectSet<>();

View File

@@ -156,6 +156,8 @@ public class Block extends UnlockableContent implements Senseable{
public float clipSize = -1f;
/** When placeRangeCheck is enabled, this is the range checked for enemy blocks. */
public float placeOverlapRange = 50f;
/** Multiplier of damage dealt to this block by tanks. Does not apply to crawlers. */
public float crushDamageMultiplier = 1f;
/** Max of timers used. */
public int timers = 0;
/** Cache layer. Only used for 'cached' rendering. */

View File

@@ -36,6 +36,7 @@ public class Wall extends Block{
buildCostMultiplier = 6f;
canOverdrive = false;
drawDisabled = false;
crushDamageMultiplier = 5f;
//it's a wall of course it's supported everywhere
envEnabled = Env.any;