Skip to content

Commit

Permalink
Added new oxytoxy_fluid model, also shooting agents now take sinto ac…
Browse files Browse the repository at this point in the history
…count 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
  • Loading branch information
Untrustedlife authored and hhyyrylainen committed May 9, 2019
1 parent 92a74cb commit 66b5bf0
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 19 deletions.
2 changes: 1 addition & 1 deletion materials/oxytoxy.material
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions materials/oxytoxy_fluid.material
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
2 changes: 1 addition & 1 deletion materials/oxytoxy_gland.material
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions scripts/SimulationParameters/MicrobeStage/Biomes.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -157,7 +157,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -313,7 +313,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -440,7 +440,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.000015,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -595,7 +595,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -751,7 +751,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -907,7 +907,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -1034,7 +1034,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.0002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -1161,7 +1161,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -1319,7 +1319,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down Expand Up @@ -1447,7 +1447,7 @@
"chunks":{
"floatingToxin": {
"name": "Floating Hazard",
"meshes": ["oxytoxy"],
"meshes": ["oxytoxy_fluid"],
"density": 0.00002,
"dissolves": false,
"radius": 1,
Expand Down
3 changes: 2 additions & 1 deletion scripts/gui/microbe_hud.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion scripts/microbe_stage/agents.as
Original file line number Diff line number Diff line change
Expand Up @@ -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())}
};


Expand Down
8 changes: 6 additions & 2 deletions scripts/microbe_stage/microbe_operations.as
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions scripts/microbe_stage/setup.as
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 66b5bf0

Please sign in to comment.