New ear damage distance formula. Manual and reality should match this time!

This commit is contained in:
malte0811 2017-10-09 20:26:46 +02:00
parent f33650280e
commit 9f6407e300
3 changed files with 6 additions and 9 deletions

View file

@ -101,8 +101,8 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
private double rcTimeConst;
private double timeFactor;
private double timeFactorBottom;
private final static double CAPACITANCE = 0.000_001_6;
private final static double MAX_VOLTAGE = 250_000;
private final static double CAPACITANCE = 1.6e-6;
private final static double MAX_VOLTAGE = 250e3;
public IWProperties.MarxType type = IWProperties.MarxType.NO_MODEL;
private int stageCount = 0;
@ -343,15 +343,13 @@ public class TileEntityMarx extends TileEntityIWMultiblock implements ITickable,
}
private void handleEntities(double energyStored) {
double damageDistSqu = Math.sqrt(energyStored/50e3);
double tinnitusDistSqu = Math.sqrt(energyStored)/50;
Vec3d v0 = getMiddle();
AxisAlignedBB aabb = new AxisAlignedBB(v0.x, v0.y, v0.z, v0.x, v0.y, v0.z);
aabb = aabb.grow(0, stageCount/2-1,0);
final double sqrtStages = Math.sqrt(stageCount);
aabb = aabb.grow(5*sqrtStages);
aabb = aabb.grow(tinnitusDistSqu);
List<Entity> fools = world.getEntitiesWithinAABB(Entity.class, aabb);
double energyNormed = getNormedEnergy(energyStored);
double damageDistSqu = energyNormed * stageCount;
double tinnitusDistSqu = 5 * energyNormed * stageCount;
damageDistSqu *= damageDistSqu;
tinnitusDistSqu *= tinnitusDistSqu;
if (IWConfig.HVStuff.marxSoundDamage == 2) {

View file

@ -26,7 +26,6 @@ import malte0811.industrialWires.blocks.controlpanel.BlockTypes_Panel;
import malte0811.industrialWires.client.RawQuad;
import malte0811.industrialWires.client.panelmodel.SmartLightingQuadIW;
import malte0811.industrialWires.controlpanel.PropertyComponents.PanelRenderProperties;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.BakedQuad;

View file

@ -137,7 +137,7 @@ ie.manual.entry.industrialwires.marx2="middle" layers. Power (either IF or EU) i
ie.manual.entry.industrialwires.marx3=capacitors and is split equally between the ores to be processed.<br>§lControl signals§r<br>Voltages are represented by 2 signals: The first signal is simply proportional to the voltage to represent. The second signal is proportional to the voltage in the "gap" between 2 values of the first signal, thus allowing more precise control/measurements. Panel components capable of interacting with analog signals usually support this dual-channel setup.
ie.manual.entry.industrialwires.marx4=The charging voltage is controlled by the white and yellow signals. The voltages of the top and bottom capacitor are output to the magenta and pink resp. the orange and lime signals. The light blue signal is a firing control. If it is high the generator will attempt to fire. If the voltage of the bottom capacitor is lower than 125 kV or the total voltage is lower than 30%% of the maximum output voltage the generator will misfire, discharging the capacitors without actually producing lightning.
ie.manual.entry.industrialwires.marx5=§lSafety§r<br>Due to the high voltages and energies involved in firing a Marx generator a safe distance should be maintained to avoid injury or death. Even outside of this area hearing protection (As provided by Immersive Engineering) is obligatory. Formulas to calculate the safe distances can be found in <link;industrialwires.marx;§oAppendix A§r;6>.
ie.manual.entry.industrialwires.marx6=§lAppendix A: Formulas§r<br>Energy stored in a capacitor:<br>E=0.5*C*U^2<br>E: Energy, C: Capacitance, U: Voltage<br>Voltage from redstone signals:<br>U=250/255*(16*a+b)<br>U: Voltage, a: First signal, b: Second signal<br>Safe distance (Physical damage):<br>r=sqrt(e/50,000)<br>r: Safe distance, e: Energy stored<br>Safe distance (Ear damage):<br>r=sqrt(e)/100<br>r: Safe distance, e: Energy stored
ie.manual.entry.industrialwires.marx6=§lAppendix A: Formulas§r<br>Energy stored in a capacitor:<br>E=0.5*C*U^2<br>E: Energy, C: Capacitance, U: Voltage<br>Voltage from redstone signals:<br>U=250/255*(16*a+b)<br>U: Voltage, a: First signal, b: Second signal<br>Safe distance (Physical damage):<br>r=sqrt(e/50,000)<br>r: Safe distance, e: Energy stored<br>Safe distance (Ear damage):<br>r=sqrt(e)/50<br>r: Safe distance, e: Energy stored
ie.manual.entry.industrialwires.marx7=§lAppendix B: Ore Energy Values§r
ie.manual.entry.industrialwires.intro.name=Introduction