Implemented GFX for all status effects

This commit is contained in:
Anuken
2018-04-05 22:25:08 -04:00
parent 7cd96e379e
commit 343a94bf05
15 changed files with 156 additions and 47 deletions
@@ -80,6 +80,11 @@ public class Player extends Unit{
return mech.flying;
}
@Override
public float getSize() {
return 8;
}
@Override
public void damage(float amount){
if(debug || mech.flying) return;
@@ -19,21 +19,23 @@ public class StatusController {
}else {
current.getTransition(unit, effect, time, newTime, globalResult);
time = globalResult.time;
if (globalResult.result != current) {
current.onTransition(unit, globalResult.result);
time = globalResult.time;
current = globalResult.result;
}
}
}
public void update(Unit unit){
if(time > 0){
time = Math.max(time - Timers.delta(), 0);
}
time = Math.max(time - Timers.delta(), 0);
current.update(unit, time);
if(time <= 0){
current = StatusEffects.none;
}else{
current.update(unit, time);
}
}
public void set(StatusEffect current, float time){
@@ -12,6 +12,21 @@ public abstract class Unit extends SyncEntity {
public Vector2 velocity = new Vector2();
public float hitTime;
@Override
public void damage(float amount){
super.damage(amount);
hitTime = hitDuration;
}
public void damage(float amount, boolean withEffect){
if(withEffect){
damage(amount);
}else{
super.damage(amount);
}
}
public abstract float getMass();
public abstract boolean isFlying();
public abstract float getSize();
}
@@ -32,6 +32,12 @@ public class BaseUnit extends Unit {
rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed);
}
//TODO
@Override
public float getSize() {
return 8;
}
@Override
public void move(float x, float y){
baseRotation = Mathf.slerpDelta(baseRotation, Mathf.atan2(x, y), type.baseRotateSpeed);
@@ -73,12 +79,6 @@ public class BaseUnit extends Unit {
return other instanceof Bullet && state.teams.areEnemies((((Bullet) other).team), team);
}
@Override
public void damage(float amount){
super.damage(amount);
hitTime = hitDuration;
}
@Override
public void onRemoteShoot(BulletType type, float x, float y, float rotation, short data) {
new Bullet(type, this, x, y, rotation).add().damage = data;