Weapon occlusion / Balancing

This commit is contained in:
Anuken
2020-07-17 16:57:27 -04:00
parent 60ce8ca935
commit 521e3c773f
3 changed files with 20 additions and 10 deletions

View File

@@ -672,7 +672,7 @@ public class UnitTypes implements ContentList{
speed = 1.1f; speed = 1.1f;
drag = 0.13f; drag = 0.13f;
hitsize = 9f; hitsize = 9f;
health = 220; health = 280;
accel = 0.4f; accel = 0.4f;
rotateSpeed = 3.3f; rotateSpeed = 3.3f;
immunities = ObjectSet.with(StatusEffects.wet); immunities = ObjectSet.with(StatusEffects.wet);
@@ -717,10 +717,10 @@ public class UnitTypes implements ContentList{
}}; }};
minke = new UnitType("minke"){{ minke = new UnitType("minke"){{
health = 600;
speed = 0.9f; speed = 0.9f;
drag = 0.15f; drag = 0.15f;
hitsize = 11f; hitsize = 11f;
health = 430;
armor = 4f; armor = 4f;
accel = 0.3f; accel = 0.3f;
rotateSpeed = 2.6f; rotateSpeed = 2.6f;
@@ -758,12 +758,13 @@ public class UnitTypes implements ContentList{
}}; }};
bryde = new UnitType("bryde"){{ bryde = new UnitType("bryde"){{
health = 900;
speed = 0.85f; speed = 0.85f;
accel = 0.2f; accel = 0.2f;
rotateSpeed = 1.8f; rotateSpeed = 1.8f;
drag = 0.17f; drag = 0.17f;
hitsize = 14f; hitsize = 14f;
health = 130; armor = 6f;
immunities = ObjectSet.with(StatusEffects.wet); immunities = ObjectSet.with(StatusEffects.wet);
trailLength = 22; trailLength = 22;
@@ -771,18 +772,19 @@ public class UnitTypes implements ContentList{
trailY = -9f; trailY = -9f;
trailScl = 1.5f; trailScl = 1.5f;
abilities.add(new HealFieldAbility(22f, 60f * 5, 70f)); abilities.add(new HealFieldAbility(22f, 60f * 4, 70f), new ShieldFieldAbility(20f, 40f, 60f * 4, 60f));
weapons.add(new Weapon("large-artillery"){{ weapons.add(new Weapon("large-artillery"){{
reload = 60f; reload = 65f;
mirror = false; mirror = false;
x = 0f; x = 0f;
y = -2.5f; y = -3.5f;
rotateSpeed = 1.7f; rotateSpeed = 1.7f;
rotate = true; rotate = true;
shootY = 7f; shootY = 7f;
shake = 5f; shake = 5f;
recoil = 4f; recoil = 4f;
occlusion = 17f;
shots = 1; shots = 1;
inaccuracy = 3f; inaccuracy = 3f;
@@ -799,7 +801,7 @@ public class UnitTypes implements ContentList{
collidesTiles = false; collidesTiles = false;
ammoMultiplier = 4f; ammoMultiplier = 4f;
splashDamageRadius = 60f; splashDamageRadius = 60f;
splashDamage = 75f; splashDamage = 85f;
backColor = Pal.missileYellowBack; backColor = Pal.missileYellowBack;
frontColor = Pal.missileYellow; frontColor = Pal.missileYellow;
trailEffect = Fx.artilleryTrail; trailEffect = Fx.artilleryTrail;
@@ -818,6 +820,8 @@ public class UnitTypes implements ContentList{
x = 8.5f; x = 8.5f;
y = -9f; y = -9f;
occlusion = 6f;
rotateSpeed = 4f; rotateSpeed = 4f;
rotate = true; rotate = true;
shots = 2; shots = 2;

View File

@@ -381,10 +381,14 @@ public class UnitType extends UnlockableContent{
float weaponRotation = rotation + (weapon.rotate ? mount.rotation : 0); float weaponRotation = rotation + (weapon.rotate ? mount.rotation : 0);
float width = weapon.region.getWidth(); float width = weapon.region.getWidth();
float recoil = -((mount.reload) / weapon.reload * weapon.recoil); float recoil = -((mount.reload) / weapon.reload * weapon.recoil);
float wx = unit.x + Angles.trnsx(rotation, weapon.x, weapon.y) + Angles.trnsx(weaponRotation, 0, recoil),
wy = unit.y + Angles.trnsy(rotation, weapon.x, weapon.y) + Angles.trnsy(weaponRotation, 0, recoil);
Draw.rect(weapon.region, if(weapon.occlusion > 0){
unit.x + Angles.trnsx(rotation, weapon.x, weapon.y) + Angles.trnsx(weaponRotation, 0, recoil), Drawf.shadow(wx, wy, weapon.occlusion);
unit.y + Angles.trnsy(rotation, weapon.x, weapon.y) + Angles.trnsy(weaponRotation, 0, recoil), }
Draw.rect(weapon.region, wx, wy,
width * Draw.scl * -Mathf.sign(weapon.flipSprite), width * Draw.scl * -Mathf.sign(weapon.flipSprite),
weapon.region.getHeight() * Draw.scl, weapon.region.getHeight() * Draw.scl,
weaponRotation); weaponRotation);

View File

@@ -43,6 +43,8 @@ public class Weapon{
public float shootX = 0f, shootY = 3f; public float shootX = 0f, shootY = 3f;
/** offsets of weapon position on unit */ /** offsets of weapon position on unit */
public float x = 5f, y = 0f; public float x = 5f, y = 0f;
/** radius of occlusion drawn under the weapon; <0 to diable */
public float occlusion = -1f;
/** fraction of velocity that is random */ /** fraction of velocity that is random */
public float velocityRnd = 0f; public float velocityRnd = 0f;
/** delay in ticks between shots */ /** delay in ticks between shots */