Added tractor beam turret
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user