diff --git a/src/lua/LuaElements.cpp b/src/lua/LuaElements.cpp index b4023251e..4b215ed2e 100644 --- a/src/lua/LuaElements.cpp +++ b/src/lua/LuaElements.cpp @@ -856,7 +856,7 @@ void LuaElements::Open(lua_State *L) LCONST(TYPE_GAS); LCONST(TYPE_ENERGY); LCONST(PROP_CONDUCTS); - LCONST(PROP_BLACK); + LCONST(PROP_PHOTPASS); LCONST(PROP_NEUTPENETRATE); LCONST(PROP_NEUTABSORB); LCONST(PROP_NEUTPASS); diff --git a/src/simulation/ElementDefs.h b/src/simulation/ElementDefs.h index 285119e7d..3f16befde 100644 --- a/src/simulation/ElementDefs.h +++ b/src/simulation/ElementDefs.h @@ -17,7 +17,7 @@ constexpr auto TYPE_GAS = UINT32_C(0x00000008); //8 Gases (Includes p constexpr auto TYPE_ENERGY = UINT32_C(0x00000010); //16 Energy (Thunder, Light, Neutrons etc.) constexpr auto STATE_FLAGS = UINT32_C(0x0000001F); constexpr auto PROP_CONDUCTS = UINT32_C(0x00000020); //32 Conducts electricity -constexpr auto PROP_BLACK = UINT32_C(0x00000040); //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better) +constexpr auto PROP_PHOTPASS = UINT32_C(0x00000040); //64 Photons pass through (may refract as in glass) constexpr auto PROP_NEUTPENETRATE = UINT32_C(0x00000080); //128 Penetrated by neutrons constexpr auto PROP_NEUTABSORB = UINT32_C(0x00000100); //256 Absorbs neutrons, reflect is default constexpr auto PROP_NEUTPASS = UINT32_C(0x00000200); //512 Neutrons pass through, such as with glass diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index 4406f580e..cce75a52b 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -186,16 +186,14 @@ void SimulationData::init_can_move() if (elements[movingType].Properties & TYPE_PART) can_move[movingType][PT_SAWD] = 0; } - //a list of lots of things PHOT can move through - // TODO: replace with property + for (destinationType = 0; destinationType < PT_NUM; destinationType++) { - if (destinationType == PT_GLAS || destinationType == PT_PHOT || destinationType == PT_FILT || destinationType == PT_INVIS - || destinationType == PT_CLNE || destinationType == PT_PCLN || destinationType == PT_BCLN || destinationType == PT_PBCN - || destinationType == PT_WATR || destinationType == PT_DSTW || destinationType == PT_SLTW || destinationType == PT_GLOW - || destinationType == PT_ISOZ || destinationType == PT_ISZS || destinationType == PT_QRTZ || destinationType == PT_PQRT - || destinationType == PT_H2 || destinationType == PT_BGLA || destinationType == PT_C5 || destinationType == PT_RSST) + //a list of lots of things PHOT can move through + if (elements[destinationType].Properties & PROP_PHOTPASS) can_move[PT_PHOT][destinationType] = 2; + + //Things PROT and GRVT cannot move through if (destinationType != PT_DMND && destinationType != PT_INSL && destinationType != PT_VOID && destinationType != PT_PVOD && destinationType != PT_VIBR && destinationType != PT_BVBR && destinationType != PT_PRTI && destinationType != PT_PRTO) { can_move[PT_PROT][destinationType] = 2; diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index 78be0805d..ae6f3f602 100644 --- a/src/simulation/elements/BCLN.cpp +++ b/src/simulation/elements/BCLN.cpp @@ -31,7 +31,7 @@ void Element::Element_BCLN() HeatConduct = 251; Description = "Breakable Clone."; - Properties = TYPE_SOLID | PROP_LIFE_DEC | PROP_LIFE_KILL_DEC | PROP_NOCTYPEDRAW; + Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_LIFE_DEC | PROP_LIFE_KILL_DEC | PROP_NOCTYPEDRAW; CarriesTypeIn = 1U << FIELD_CTYPE; LowPressure = IPL; diff --git a/src/simulation/elements/BGLA.cpp b/src/simulation/elements/BGLA.cpp index 9b02e3da6..a2f5c81d8 100644 --- a/src/simulation/elements/BGLA.cpp +++ b/src/simulation/elements/BGLA.cpp @@ -29,7 +29,7 @@ void Element::Element_BGLA() HeatConduct = 150; Description = "Broken Glass, heavy particles formed when glass breaks under pressure. Meltable. Bagels."; - Properties = TYPE_PART | PROP_NEUTPASS | PROP_HOT_GLOW; + Properties = TYPE_PART | PROP_NEUTPASS | PROP_PHOTPASS | PROP_HOT_GLOW; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/C5.cpp b/src/simulation/elements/C5.cpp index 963245bfc..5c8345193 100644 --- a/src/simulation/elements/C5.cpp +++ b/src/simulation/elements/C5.cpp @@ -32,7 +32,7 @@ void Element::Element_C5() HeatConduct = 88; Description = "Cold explosive, set off by anything cold."; - Properties = TYPE_SOLID | PROP_NEUTPENETRATE | PROP_LIFE_DEC; + Properties = TYPE_SOLID | PROP_NEUTPENETRATE | PROP_PHOTPASS | PROP_LIFE_DEC; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/CLNE.cpp b/src/simulation/elements/CLNE.cpp index c3b910b8c..631e5d577 100644 --- a/src/simulation/elements/CLNE.cpp +++ b/src/simulation/elements/CLNE.cpp @@ -31,7 +31,7 @@ void Element::Element_CLNE() HeatConduct = 251; Description = "Clone. Duplicates any particles it touches."; - Properties = TYPE_SOLID | PROP_NOCTYPEDRAW; + Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_NOCTYPEDRAW; CarriesTypeIn = 1U << FIELD_CTYPE; LowPressure = IPL; diff --git a/src/simulation/elements/DSTW.cpp b/src/simulation/elements/DSTW.cpp index 6d097c327..7d04bc3df 100644 --- a/src/simulation/elements/DSTW.cpp +++ b/src/simulation/elements/DSTW.cpp @@ -33,7 +33,7 @@ void Element::Element_DSTW() LatentHeat = 7500; Description = "Distilled water, does not conduct electricity."; - Properties = TYPE_LIQUID|PROP_NEUTPASS; + Properties = TYPE_LIQUID | PROP_NEUTPASS | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp index f471a40ff..880d58554 100644 --- a/src/simulation/elements/FILT.cpp +++ b/src/simulation/elements/FILT.cpp @@ -33,7 +33,7 @@ void Element::Element_FILT() HeatConduct = 251; Description = "Filter for photons, changes the color."; - Properties = TYPE_SOLID | PROP_NOAMBHEAT | PROP_LIFE_DEC; + Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_NOAMBHEAT | PROP_LIFE_DEC; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/GLAS.cpp b/src/simulation/elements/GLAS.cpp index 3034d94da..1cd5c7293 100644 --- a/src/simulation/elements/GLAS.cpp +++ b/src/simulation/elements/GLAS.cpp @@ -32,7 +32,7 @@ void Element::Element_GLAS() HeatConduct = 150; Description = "Glass. Meltable. Shatters under pressure, and refracts photons."; - Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE; + Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_PHOTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/GLOW.cpp b/src/simulation/elements/GLOW.cpp index c621e142d..69e16545a 100644 --- a/src/simulation/elements/GLOW.cpp +++ b/src/simulation/elements/GLOW.cpp @@ -33,7 +33,7 @@ void Element::Element_GLOW() HeatConduct = 44; Description = "Glow, Glows under pressure."; - Properties = TYPE_LIQUID | PROP_LIFE_DEC; + Properties = TYPE_LIQUID | PROP_PHOTPASS | PROP_LIFE_DEC; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp index c7cedc4c6..428a1242d 100644 --- a/src/simulation/elements/H2.cpp +++ b/src/simulation/elements/H2.cpp @@ -31,7 +31,7 @@ void Element::Element_H2() HeatConduct = 251; Description = "Hydrogen. Combusts with OXYG to make WATR. Undergoes fusion at high temperature and pressure."; - Properties = TYPE_GAS; + Properties = TYPE_GAS | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/INVIS.cpp b/src/simulation/elements/INVIS.cpp index 8966ab860..e8efcde90 100644 --- a/src/simulation/elements/INVIS.cpp +++ b/src/simulation/elements/INVIS.cpp @@ -32,7 +32,7 @@ void Element::Element_INVIS() HeatConduct = 164; Description = "Invisible to particles while under pressure."; - Properties = TYPE_SOLID | PROP_NEUTPASS; + Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/ISOZ.cpp b/src/simulation/elements/ISOZ.cpp index 62c0cfc45..8c0faaad5 100644 --- a/src/simulation/elements/ISOZ.cpp +++ b/src/simulation/elements/ISOZ.cpp @@ -32,7 +32,7 @@ void Element::Element_ISOZ() HeatConduct = 29; Description = "Isotope-Z. Radioactive liquid, decays into photons when touching PHOT or under negative pressure."; - Properties = TYPE_LIQUID|PROP_NEUTPENETRATE; + Properties = TYPE_LIQUID | PROP_NEUTPENETRATE | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/ISZS.cpp b/src/simulation/elements/ISZS.cpp index fc9146b18..813c3cbbc 100644 --- a/src/simulation/elements/ISZS.cpp +++ b/src/simulation/elements/ISZS.cpp @@ -32,7 +32,7 @@ void Element::Element_ISZS() HeatConduct = 251; Description = "Solid form of ISOZ, slowly decays into PHOT."; - Properties = TYPE_SOLID; + Properties = TYPE_SOLID | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/PBCN.cpp b/src/simulation/elements/PBCN.cpp index 21ad6930e..2b7602c0a 100644 --- a/src/simulation/elements/PBCN.cpp +++ b/src/simulation/elements/PBCN.cpp @@ -33,7 +33,7 @@ void Element::Element_PBCN() HeatConduct = 251; Description = "Powered breakable clone."; - Properties = TYPE_SOLID | PROP_NOCTYPEDRAW; + Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_NOCTYPEDRAW; CarriesTypeIn = 1U << FIELD_CTYPE; LowPressure = IPL; diff --git a/src/simulation/elements/PCLN.cpp b/src/simulation/elements/PCLN.cpp index c058379b7..2bf624875 100644 --- a/src/simulation/elements/PCLN.cpp +++ b/src/simulation/elements/PCLN.cpp @@ -33,7 +33,7 @@ void Element::Element_PCLN() HeatConduct = 251; Description = "Powered clone. When activated, duplicates any particles it touches."; - Properties = TYPE_SOLID | PROP_NOCTYPEDRAW; + Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_NOCTYPEDRAW; CarriesTypeIn = 1U << FIELD_CTYPE; LowPressure = IPL; diff --git a/src/simulation/elements/PHOT.cpp b/src/simulation/elements/PHOT.cpp index 17cabaab1..5467563b6 100644 --- a/src/simulation/elements/PHOT.cpp +++ b/src/simulation/elements/PHOT.cpp @@ -36,7 +36,7 @@ void Element::Element_PHOT() HeatConduct = 251; Description = "Photons. Refracts through glass, scattered by quartz, and color-changed by different elements. Ignites flammable materials."; - Properties = TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC; + Properties = TYPE_ENERGY | PROP_PHOTPASS | PROP_LIFE_DEC | PROP_LIFE_KILL_DEC; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/PQRT.cpp b/src/simulation/elements/PQRT.cpp index ef3f8e106..268682cd8 100644 --- a/src/simulation/elements/PQRT.cpp +++ b/src/simulation/elements/PQRT.cpp @@ -32,7 +32,7 @@ void Element::Element_PQRT() HeatConduct = 3; Description = "Powdered quartz, broken form of QRTZ."; - Properties = TYPE_PART| PROP_HOT_GLOW; + Properties = TYPE_PART | PROP_PHOTPASS | PROP_HOT_GLOW; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/QRTZ.cpp b/src/simulation/elements/QRTZ.cpp index a0c4987b6..1db2b1c89 100644 --- a/src/simulation/elements/QRTZ.cpp +++ b/src/simulation/elements/QRTZ.cpp @@ -32,7 +32,7 @@ void Element::Element_QRTZ() HeatConduct = 3; Description = "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures."; - Properties = TYPE_SOLID|PROP_HOT_GLOW|PROP_LIFE_DEC; + Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_HOT_GLOW | PROP_LIFE_DEC; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/RSST.cpp b/src/simulation/elements/RSST.cpp index d12f294f8..582e18873 100644 --- a/src/simulation/elements/RSST.cpp +++ b/src/simulation/elements/RSST.cpp @@ -32,7 +32,7 @@ void Element::Element_RSST() HeatConduct = 55; Description = "Resist. Solidifies on contact with photons, is destroyed by electrons and spark."; - Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPASS; + Properties = TYPE_LIQUID | PROP_CONDUCTS | PROP_LIFE_DEC | PROP_NEUTPASS | PROP_PHOTPASS; CarriesTypeIn = (1U << FIELD_CTYPE) | (1U << FIELD_TMP); LowPressure = IPL; diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp index 95423b398..7492323a5 100644 --- a/src/simulation/elements/SLTW.cpp +++ b/src/simulation/elements/SLTW.cpp @@ -32,7 +32,7 @@ void Element::Element_SLTW() LatentHeat = 7500; Description = "Saltwater, conducts electricity, difficult to freeze."; - Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE; + Properties = TYPE_LIQUID | PROP_CONDUCTS | PROP_LIFE_DEC | PROP_NEUTPENETRATE | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp index 849682903..c5e1da417 100644 --- a/src/simulation/elements/WATR.cpp +++ b/src/simulation/elements/WATR.cpp @@ -33,7 +33,7 @@ void Element::Element_WATR() LatentHeat = 7500; Description = "Water. Conducts electricity, freezes, and extinguishes fires."; - Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPASS; + Properties = TYPE_LIQUID | PROP_CONDUCTS | PROP_LIFE_DEC | PROP_NEUTPASS | PROP_PHOTPASS; LowPressure = IPL; LowPressureTransition = NT;