mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-06 00:08:10 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
@ -12,6 +13,7 @@ public class StatusFieldAbility extends Ability{
|
|||||||
public float duration = 60, reload = 100, range = 20;
|
public float duration = 60, reload = 100, range = 20;
|
||||||
public Effect applyEffect = Fx.none;
|
public Effect applyEffect = Fx.none;
|
||||||
public Effect activeEffect = Fx.overdriveWave;
|
public Effect activeEffect = Fx.overdriveWave;
|
||||||
|
public float effectX, effectY;
|
||||||
public boolean parentizeEffects;
|
public boolean parentizeEffects;
|
||||||
|
|
||||||
protected float timer;
|
protected float timer;
|
||||||
@ -40,7 +42,8 @@ public class StatusFieldAbility extends Ability{
|
|||||||
applyEffect.at(other, parentizeEffects);
|
applyEffect.at(other, parentizeEffects);
|
||||||
});
|
});
|
||||||
|
|
||||||
activeEffect.at(unit, parentizeEffects);
|
float x = unit.x + Angles.trnsx(unit.rotation, effectY, effectX), y = unit.y + Angles.trnsy(unit.rotation, effectY, effectX);
|
||||||
|
activeEffect.at(x, y, unit.rotation, parentizeEffects ? unit : null);
|
||||||
|
|
||||||
timer = 0f;
|
timer = 0f;
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,12 @@ public class TypeIO{
|
|||||||
}else if(object instanceof BuildingBox b){
|
}else if(object instanceof BuildingBox b){
|
||||||
write.b(12);
|
write.b(12);
|
||||||
write.i(b.pos);
|
write.i(b.pos);
|
||||||
|
}else if(object instanceof boolean[] b){
|
||||||
|
write.b(16);
|
||||||
|
write.i(b.length);
|
||||||
|
for(boolean bool : b){
|
||||||
|
write.bool(bool);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new IllegalArgumentException("Unknown object type: " + object.getClass());
|
throw new IllegalArgumentException("Unknown object type: " + object.getClass());
|
||||||
}
|
}
|
||||||
@ -126,6 +132,7 @@ public class TypeIO{
|
|||||||
case 13: return LAccess.all[read.s()];
|
case 13: return LAccess.all[read.s()];
|
||||||
case 14: int blen = read.i(); byte[] bytes = new byte[blen]; read.b(bytes); return bytes;
|
case 14: int blen = read.i(); byte[] bytes = new byte[blen]; read.b(bytes); return bytes;
|
||||||
case 15: return UnitCommand.all[read.b()];
|
case 15: return UnitCommand.all[read.b()];
|
||||||
|
case 16: int boollen = read.i(); boolean[] bools = new boolean[boollen]; for(int i = 0; i < boollen; i ++) bools[i] = read.bool(); return bools;
|
||||||
default: throw new IllegalArgumentException("Unknown object type: " + type);
|
default: throw new IllegalArgumentException("Unknown object type: " + type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user