Added tractor beam turret
This commit is contained in:
@@ -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