Added tractor beam turret

This commit is contained in:
Anuken
2020-07-02 14:02:33 -04:00
parent 0a7e40bd23
commit cecb5cf4b4
45 changed files with 4825 additions and 4509 deletions

View File

@@ -88,7 +88,7 @@ public class Damage{
if(tile != null && !collidedBlocks.contains(tile.pos()) && tile.team() != team && tile.collide(hitter)){
tile.collision(hitter);
collidedBlocks.add(tile.pos());
hitter.type().hit(hitter, tile.x(), tile.y());
hitter.type().hit(hitter, tile.x, tile.y);
}
};

View File

@@ -47,7 +47,7 @@ public class HealBulletType extends BulletType{
super.hit(b);
if(tile.team() == b.team() && !(tile.block() instanceof BuildBlock)){
Fx.healBlockFull.at(tile.x(), tile.y(), tile.block().size, Pal.heal);
Fx.healBlockFull.at(tile.x, tile.y, tile.block().size, Pal.heal);
tile.heal(healPercent / 100f * tile.maxHealth());
}
}

View File

@@ -66,7 +66,7 @@ public class MassDriverBolt extends BulletType{
if(Angles.near(angleTo, baseAngle, 2f)){
intersect = true;
//snap bullet position back; this is used for low-FPS situations
b.set(data.to.x() + Angles.trnsx(baseAngle, hitDst), data.to.y() + Angles.trnsy(baseAngle, hitDst));
b.set(data.to.x + Angles.trnsx(baseAngle, hitDst), data.to.y + Angles.trnsy(baseAngle, hitDst));
}
}

View File

@@ -514,7 +514,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return flow;
}else if(ofract > 0.1f && fract > 0.1f){
//TODO these are incorrect effect positions
float fx = (x + next.x()) / 2f, fy = (y + next.y()) / 2f;
float fx = (x + next.x) / 2f, fy = (y + next.y) / 2f;
Liquid other = next.liquids().current();
if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){

View File

@@ -22,6 +22,10 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
transient float drownTime;
transient float splashTimer;
boolean checkTarget(boolean targetAir, boolean targetGround){
return (isGrounded() && targetGround) || (isFlying() && targetAir);
}
boolean isGrounded(){
return elevation < 0.001f;
}

View File

@@ -82,7 +82,7 @@ abstract class HealthComp implements Entityc{
}
void damageContinuous(float amount){
damage(amount * Time.delta(), hitTime <= -20 + hitDuration);
damage(amount * Time.delta(), hitTime <= -10 + hitDuration);
}
void damageContinuousPierce(float amount){

View File

@@ -1,6 +1,7 @@
package mindustry.entities.comp;
import arc.math.*;
import arc.math.geom.*;
import mindustry.annotations.Annotations.*;
import mindustry.async.PhysicsProcess.*;
import mindustry.gen.*;
@@ -11,6 +12,7 @@ import mindustry.gen.*;
@Component
abstract class PhysicsComp implements Velc, Hitboxc, Flyingc{
@Import float hitSize;
@Import Vec2 vel;
transient PhysicRef physref;
@@ -21,6 +23,10 @@ abstract class PhysicsComp implements Velc, Hitboxc, Flyingc{
void impulse(float x, float y){
float mass = mass();
vel().add(x / mass, y / mass);
vel.add(x / mass, y / mass);
}
void impulse(Vec2 v){
impulse(v.x, v.y);
}
}