Updated Bullet to use floats

This commit is contained in:
Anuken
2018-05-09 09:46:24 -07:00
parent 83d1707b56
commit ce2b73b737
14 changed files with 50 additions and 92 deletions

View File

@@ -107,7 +107,7 @@ public class Bullet extends BulletEntity<BulletType>{
}
@Override
public int getDamage(){
public float getDamage(){
return damage == -1 ? type.damage : damage;
}

View File

@@ -11,8 +11,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public StatusEffect status = StatusEffects.none;
public float statusIntensity = 0.5f;
//TODO use float damage
public BulletType(float speed, int damage){
public BulletType(float speed, float damage){
this.speed = speed;
this.damage = damage;
lifetime = 40f;

View File

@@ -31,7 +31,7 @@ public class Lightning extends TimedEntity implements Poolable{
public Color color = Palette.lancerLaser;
public static void create(Team team, Effect effect, Color color, int damage, float x, float y, float targetAngle, int length){
public static void create(Team team, Effect effect, Color color, float damage, float x, float y, float targetAngle, int length){
Lightning l = Pools.obtain(Lightning.class);
l.x = x;
@@ -68,10 +68,10 @@ public class Lightning extends TimedEntity implements Poolable{
Rectangle hitbox = entity.hitbox.getRect(entity.x, entity.y, range);
if(hitbox.contains(x2, y2) || hitbox.contains(fx, fy)){
int result = damage;
float result = damage;
if(entity.status.current() == StatusEffects.wet)
result = (int)(result * wetDamageMultiplier);
result = (result * wetDamageMultiplier);
entity.damage(result);
Effects.effect(effect, x2, y2, fangle);