Cleanup of merged PR
This commit is contained in:
@@ -115,13 +115,15 @@ public class Damage{
|
||||
tr.trns(angle, length);
|
||||
Intc2 collider = (cx, cy) -> {
|
||||
Building tile = world.build(cx, cy);
|
||||
if(tile != null && !collidedBlocks.contains(tile.pos()) && tile.team != team && tile.collide(hitter)){
|
||||
boolean collide = tile != null && collidedBlocks.add(tile.pos());
|
||||
|
||||
if(collide && tile.team != team && tile.collide(hitter)){
|
||||
tile.collision(hitter);
|
||||
collidedBlocks.add(tile.pos());
|
||||
hitter.type.hit(hitter, tile.x, tile.y);
|
||||
}
|
||||
//can heal?
|
||||
if(tile != null && !collidedBlocks.contains(tile.pos()) && hitter.type.collides(hitter, tile)){
|
||||
|
||||
//try to heal the tile
|
||||
if(collide && hitter.type.collides(hitter, tile)){
|
||||
hitter.type.hitTile(hitter, tile, 0f);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -37,18 +37,12 @@ public class Lightning{
|
||||
random.setSeed(seed);
|
||||
hit.clear();
|
||||
|
||||
BulletType bulletType;
|
||||
if(hitter != null && hitter.type.lightningHitter != null){
|
||||
bulletType = hitter.type.lightningHitter;
|
||||
}else{
|
||||
bulletType = hitter != null && !hitter.type.collidesAir ? Bullets.damageLightningGround : Bullets.damageLightning;
|
||||
}
|
||||
|
||||
BulletType hitCreate = hitter.type.lightningType;
|
||||
Seq<Vec2> lines = new Seq<>();
|
||||
bhit = false;
|
||||
|
||||
for(int i = 0; i < length / 2; i++){
|
||||
bulletType.create(null, team, x, y, 0f, damage, 1f, 1f, hitter);
|
||||
hitCreate.create(null, team, x, y, 0f, damage, 1f, 1f, hitter);
|
||||
lines.add(new Vec2(x + Mathf.range(3f), y + Mathf.range(3f)));
|
||||
|
||||
if(lines.size > 1){
|
||||
|
||||
@@ -116,8 +116,8 @@ public abstract class BulletType extends Content{
|
||||
public float lightningDamage = -1;
|
||||
public float lightningCone = 360f;
|
||||
public float lightningAngle = 0f;
|
||||
/** The lighting "hitter"; Use when trying to implement special lightning. */
|
||||
public BulletType lightningHitter;
|
||||
/** The bullet created at lightning points. */
|
||||
public BulletType lightningType;
|
||||
|
||||
public float weaveScale = 1f;
|
||||
public float weaveMag = -1f;
|
||||
@@ -257,6 +257,10 @@ public abstract class BulletType extends Content{
|
||||
//pierceBuilding is not enabled by default, because a bullet may want to *not* pierce buildings
|
||||
}
|
||||
|
||||
if(lightningType == null){
|
||||
lightningType = !collidesAir ? Bullets.damageLightningGround : Bullets.damageLightning;
|
||||
}
|
||||
|
||||
if(killShooter && b.owner() instanceof Healthc){
|
||||
((Healthc)b.owner()).kill();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user