underBullet for ducts and related blocks

This commit is contained in:
Anuken
2022-04-11 13:06:39 -04:00
parent 6fe71dfe9c
commit 12eddd131b
10 changed files with 52 additions and 10 deletions

View File

@@ -90,6 +90,8 @@ public class Block extends UnlockableContent implements Senseable{
public boolean solidifes;
/** if true, this counts as a non-solid block to this team. */
public boolean teamPassable;
/** if true, this block cannot be hit by bullets unless explicitly targeted. */
public boolean underBullets;
/** whether this is rotatable */
public boolean rotate;
/** if rotate is true and this is false, the region won't rotate when drawing */

View File

@@ -38,7 +38,7 @@ public class ConstructBlock extends Block{
super("build" + size);
this.size = size;
update = true;
health = 20;
health = 10;
consumesTap = true;
solidifes = true;
inEditor = false;

View File

@@ -501,7 +501,8 @@ public class Turret extends ReloadTurret{
float lifeScl = type.scaleVelocity ? Mathf.clamp(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f;
handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, 1f + Mathf.range(velocityInaccuracy), lifeScl, mover), xOffset, yOffset, angleOffset);
//TODO aimX / aimY for multi shot turrets?
handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, -1f, 1f + Mathf.range(velocityInaccuracy), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, angleOffset);
(shootEffect == Fx.none ? type.shootEffect : shootEffect).at(bulletX, bulletY, rotation, type.hitColor);
(smokeEffect == Fx.none ? type.smokeEffect : smokeEffect).at(bulletX, bulletY, rotation, type.hitColor);

View File

@@ -98,7 +98,7 @@ public class PayloadRouter extends PayloadConveyor{
if(type == LAccess.config){
rotation = (int)p1;
//when manually controlled, routers do not turn automatically for a while, same as turrets
controlTime = Building.timeToUncontrol;
controlTime = 60f * 6f;
}
}