Buff the autarchic gates - they always pulse at a single, fast rate, about
10% faster than a top speed RS engine. This means they're usefully responsive in a gate network environment
This commit is contained in:
parent
78be7c1b7d
commit
ff05f75e12
1 changed files with 2 additions and 23 deletions
|
@ -13,7 +13,6 @@ public class EnergyPulser {
|
|||
private int progressPart = 0;
|
||||
private float pulseSpeed = 0;
|
||||
private int maxHeat = 1000;
|
||||
private int heat = 0;;
|
||||
|
||||
public EnergyPulser(IPowerReceptor receptor) {
|
||||
powerReceptor = receptor;
|
||||
|
@ -23,33 +22,22 @@ public class EnergyPulser {
|
|||
if (powerReceptor == null)
|
||||
return;
|
||||
|
||||
// Set current pulse speed
|
||||
pulseSpeed = getPulseSpeed();
|
||||
|
||||
// Check if we are already running
|
||||
if (progressPart != 0) {
|
||||
|
||||
progress += pulseSpeed;
|
||||
progress += getPulseSpeed();
|
||||
|
||||
if (progress > 0.5 && progressPart == 1) {
|
||||
progressPart = 2;
|
||||
// Give off energy pulse!
|
||||
powerReceptor.getPowerProvider().receiveEnergy(1, ForgeDirection.WEST);
|
||||
|
||||
// Heat up
|
||||
if (heat < maxHeat) {
|
||||
heat++;
|
||||
}
|
||||
|
||||
} else if (progress >= 1) {
|
||||
progress = 0;
|
||||
progressPart = 0;
|
||||
}
|
||||
} else if (isActive) {
|
||||
progressPart = 1;
|
||||
} else {
|
||||
// Cool down when deactivated
|
||||
heat--;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -67,25 +55,16 @@ public class EnergyPulser {
|
|||
}
|
||||
|
||||
private float getPulseSpeed() {
|
||||
if (heat / (double) maxHeat * 100.0 <= 25.0)
|
||||
return 0.01F;
|
||||
else if (heat / (double) maxHeat * 100.0 <= 50.0)
|
||||
return 0.02F;
|
||||
else if (heat / (double) maxHeat * 100.0 <= 75.0)
|
||||
return 0.04F;
|
||||
else
|
||||
return 0.08F;
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setInteger("Heat", heat);
|
||||
nbttagcompound.setBoolean("IsActive", isActive);
|
||||
nbttagcompound.setShort("ProgressPart", (short) progressPart);
|
||||
nbttagcompound.setFloat("Progress", progress);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
heat = nbttagcompound.getInteger("Heat");
|
||||
isActive = nbttagcompound.getBoolean("IsActive");
|
||||
progressPart = nbttagcompound.getShort("ProgressPart");
|
||||
progress = nbttagcompound.getFloat("Progress");
|
||||
|
|
Loading…
Reference in a new issue