From 66b5bf0005a5d6b7cc1595e63c3d28a3d42f796b Mon Sep 17 00:00:00 2001 From: Untrustedlife Date: Sat, 4 May 2019 17:50:09 -0500 Subject: [PATCH] Added new oxytoxy_fluid model, also shooting agents now take sinto account whther you area bacteria or a eukaryote improved material for toxin Fixed material all oxytoxy things now show up under the membrane ice crystals no longer try to play damage sound effect --- materials/oxytoxy.material | 2 +- materials/oxytoxy_fluid.material | 34 +++++++++++++++++++ materials/oxytoxy_gland.material | 2 +- .../MicrobeStage/Biomes.json | 22 ++++++------ scripts/gui/microbe_hud.mjs | 3 +- scripts/microbe_stage/agents.as | 2 +- scripts/microbe_stage/microbe_operations.as | 8 +++-- scripts/microbe_stage/setup.as | 4 +-- 8 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 materials/oxytoxy_fluid.material diff --git a/materials/oxytoxy.material b/materials/oxytoxy.material index e6d827865e4..21c84057ba0 100644 --- a/materials/oxytoxy.material +++ b/materials/oxytoxy.material @@ -9,7 +9,7 @@ material oxytoxy // lighting off scene_blend alpha_blend - depth_write on + depth_write off point_sprites on vertex_program_ref Organelle_VS diff --git a/materials/oxytoxy_fluid.material b/materials/oxytoxy_fluid.material new file mode 100644 index 00000000000..0a9201d397d --- /dev/null +++ b/materials/oxytoxy_fluid.material @@ -0,0 +1,34 @@ +material oxytoxy_fluid +{ + receive_shadows on + + technique + { + pass oxytoxy_fluid + { + //lighting on + scene_blend alpha_blend + depth_write on + + vertex_program_ref Organelle_VS + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto time time_0_2pi 20 + param_named size float 0.05 + param_named maxRot float 15 + } + fragment_program_ref Organelle_PS + { + param_named tex int 0 + param_named_auto organelleColour custom 1 + } + + texture_unit + { + texture oxytoxy_fluid.png gamma + alpha_op_ex modulate src_manual src_texture 1.0 + colour_op_ex modulate src_manual src_texture 1.0 1.0 1.0 + } + } + } +} diff --git a/materials/oxytoxy_gland.material b/materials/oxytoxy_gland.material index 9ec124d054b..3eedac5512f 100644 --- a/materials/oxytoxy_gland.material +++ b/materials/oxytoxy_gland.material @@ -9,7 +9,7 @@ material oxytoxy_gland // lighting off scene_blend alpha_blend - depth_write on + depth_write off point_sprites on vertex_program_ref Organelle_VS diff --git a/scripts/SimulationParameters/MicrobeStage/Biomes.json b/scripts/SimulationParameters/MicrobeStage/Biomes.json index b4852417e5d..951a07d195e 100644 --- a/scripts/SimulationParameters/MicrobeStage/Biomes.json +++ b/scripts/SimulationParameters/MicrobeStage/Biomes.json @@ -29,7 +29,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -157,7 +157,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -313,7 +313,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -440,7 +440,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.000015, "dissolves": false, "radius": 1, @@ -595,7 +595,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -751,7 +751,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -907,7 +907,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -1034,7 +1034,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.0002, "dissolves": false, "radius": 1, @@ -1161,7 +1161,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -1319,7 +1319,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, @@ -1447,7 +1447,7 @@ "chunks":{ "floatingToxin": { "name": "Floating Hazard", - "meshes": ["oxytoxy"], + "meshes": ["oxytoxy_fluid"], "density": 0.00002, "dissolves": false, "radius": 1, diff --git a/scripts/gui/microbe_hud.mjs b/scripts/gui/microbe_hud.mjs index ff29ba110dd..4cdf037fbbb 100644 --- a/scripts/gui/microbe_hud.mjs +++ b/scripts/gui/microbe_hud.mjs @@ -355,8 +355,9 @@ function onExitToMenuClicked() { document.getElementById("extinctionBody").style.display = "none"; document.getElementById("extinctionContainer").style.display = "none"; hideWinText(); + // Gotta reset this - wonOnce=false; + wonOnce = false; Thrive.exitToMenuClicked(); } else { diff --git a/scripts/microbe_stage/agents.as b/scripts/microbe_stage/agents.as index 32dc4c2bd8f..b34a58aef2f 100644 --- a/scripts/microbe_stage/agents.as +++ b/scripts/microbe_stage/agents.as @@ -34,7 +34,7 @@ class OxytoxyEffect : AgentEffect{ const dictionary AGENTS = { - {"oxytoxy", Agent("OxyToxy NT", 1, "oxytoxy.mesh", 0.3, OxytoxyEffect())} + {"oxytoxy", Agent("OxyToxy NT", 1, "oxytoxy_fluid.mesh", 0.3, OxytoxyEffect())} }; diff --git a/scripts/microbe_stage/microbe_operations.as b/scripts/microbe_stage/microbe_operations.as index c3eb65a422a..e4ef6bf3abe 100644 --- a/scripts/microbe_stage/microbe_operations.as +++ b/scripts/microbe_stage/microbe_operations.as @@ -728,10 +728,14 @@ void emitAgent(CellStageWorld@ world, ObjectID microbeEntity, CompoundId compoun auto finalAngle = (angle + microbeAngle) % 360; auto s = sin(finalAngle/180*PI); auto c = cos(finalAngle/180*PI); + //Bacteria need to be able to shoot closer to themselves + auto ourHex = HEX_SIZE; + if (microbeComponent.isBacteria) + ourHex/=2; // Membrane coords to world coords // Plus bunch more space in world coordinates like we added before with maxr but cleaner - auto xnew = -(membraneCoords.x) * c + (membraneCoords.z+maxR*HEX_SIZE) * s; - auto ynew = (membraneCoords.x)* s + (membraneCoords.z+maxR*HEX_SIZE) * c; + auto xnew = -(membraneCoords.x) * c + (membraneCoords.z+maxR*ourHex) * s; + auto ynew = (membraneCoords.x)* s + (membraneCoords.z+maxR*ourHex) * c; // Find the direction the microbe is facing auto vec = ( microbeComponent.facingTargetPoint - cellPosition._Position); auto direction = vec.Normalize(); diff --git a/scripts/microbe_stage/setup.as b/scripts/microbe_stage/setup.as index 233a8b95617..c70f8b58e89 100644 --- a/scripts/microbe_stage/setup.as +++ b/scripts/microbe_stage/setup.as @@ -374,7 +374,7 @@ void cellHitDamageChunk(GameWorld@ world, ObjectID firstEntity, ObjectID secondE disappear=true; } else if (!damage.getDeletes() && !microbeComponent.dead){ - MicrobeOperations::damage(asCellWorld, cellEntity, double(damage.getDamage()), "toxin"); + MicrobeOperations::damage(asCellWorld, cellEntity, double(damage.getDamage()), "chunk"); } } @@ -646,7 +646,7 @@ void createAgentCloud(CellStageWorld@ world, CompoundId compoundId, body.SetVelocity(normalizedDirection * AGENT_EMISSION_VELOCITY); rigidBody.JumpTo(position); auto sceneNode = world.Create_RenderNode(agentEntity); - auto model = world.Create_Model(agentEntity, sceneNode.Node, "oxytoxy.mesh"); + auto model = world.Create_Model(agentEntity, sceneNode.Node, "oxytoxy_fluid.mesh"); // Need to set the tint model.GraphicalObject.setCustomParameter(1, Ogre::Vector4(1, 1, 1, 1));