use of ladysnake.gaspunk.gas.agent.LingeringAgent in project Gaspunk by Ladysnake.
the class GasAgents method createSicknessAgent.
public static IGasAgent createSicknessAgent(String name, Supplier<LingeringAgent> agentSupplier, Supplier<ISickness> sicknessSupplier) {
LingeringAgent agent = name(agentSupplier.get(), name);
ISickness sickness = sicknessSupplier.get();
ResourceLocation id = new ResourceLocation(GasPunk.MOD_ID, name);
sickness.setRegistryName(id);
LINGERING_EFFECTS.put(agent, sickness);
AGENT_MAP.put(id, agent);
return agent;
}
use of ladysnake.gaspunk.gas.agent.LingeringAgent in project Gaspunk by Ladysnake.
the class SicknessTests method testSarinTick2.
@Test
public void testSarinTick2() {
IBreathingHandler breathingHandler = CapabilityBreathing.getHandler(mockedCreeper).get();
final float concentration = 0.5f;
final float time = 5;
for (int i = 0; i < time; i++) {
breathingHandler.setConcentration(ModGases.SARIN_GAS, concentration);
breathingHandler.tick();
}
ISicknessHandler sicknessHandler = CapabilitySickness.getHandler(mockedCreeper).get();
LingeringAgent sarinAgent = (LingeringAgent) GasAgents.NERVE;
SicknessEffect effect = sicknessHandler.getActiveEffect(GasAgents.LINGERING_EFFECTS.get(sarinAgent));
float potency = ModGases.SARIN_GAS.getAgents().get(0).getPotency();
float toxicityPerTick = potency * concentration / 20;
float oracle = toxicityPerTick * time;
assertEquals(oracle, effect.getSeverity(), 1E-8f);
}
Aggregations