Make "being transparent to photons" a property PROP_PHOTPASS.

This commit is contained in:
Saveliy Skresanov 2024-04-10 21:48:51 +07:00
parent 36619df4f4
commit efeac4fd8a
23 changed files with 27 additions and 29 deletions

View File

@ -856,7 +856,7 @@ void LuaElements::Open(lua_State *L)
LCONST(TYPE_GAS); LCONST(TYPE_GAS);
LCONST(TYPE_ENERGY); LCONST(TYPE_ENERGY);
LCONST(PROP_CONDUCTS); LCONST(PROP_CONDUCTS);
LCONST(PROP_BLACK); LCONST(PROP_PHOTPASS);
LCONST(PROP_NEUTPENETRATE); LCONST(PROP_NEUTPENETRATE);
LCONST(PROP_NEUTABSORB); LCONST(PROP_NEUTABSORB);
LCONST(PROP_NEUTPASS); LCONST(PROP_NEUTPASS);

View File

@ -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 TYPE_ENERGY = UINT32_C(0x00000010); //16 Energy (Thunder, Light, Neutrons etc.)
constexpr auto STATE_FLAGS = UINT32_C(0x0000001F); constexpr auto STATE_FLAGS = UINT32_C(0x0000001F);
constexpr auto PROP_CONDUCTS = UINT32_C(0x00000020); //32 Conducts electricity 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_NEUTPENETRATE = UINT32_C(0x00000080); //128 Penetrated by neutrons
constexpr auto PROP_NEUTABSORB = UINT32_C(0x00000100); //256 Absorbs neutrons, reflect is default 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 constexpr auto PROP_NEUTPASS = UINT32_C(0x00000200); //512 Neutrons pass through, such as with glass

View File

@ -186,16 +186,14 @@ void SimulationData::init_can_move()
if (elements[movingType].Properties & TYPE_PART) if (elements[movingType].Properties & TYPE_PART)
can_move[movingType][PT_SAWD] = 0; 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++) for (destinationType = 0; destinationType < PT_NUM; destinationType++)
{ {
if (destinationType == PT_GLAS || destinationType == PT_PHOT || destinationType == PT_FILT || destinationType == PT_INVIS //a list of lots of things PHOT can move through
|| destinationType == PT_CLNE || destinationType == PT_PCLN || destinationType == PT_BCLN || destinationType == PT_PBCN if (elements[destinationType].Properties & PROP_PHOTPASS)
|| 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)
can_move[PT_PHOT][destinationType] = 2; 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) 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; can_move[PT_PROT][destinationType] = 2;

View File

@ -31,7 +31,7 @@ void Element::Element_BCLN()
HeatConduct = 251; HeatConduct = 251;
Description = "Breakable Clone."; 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; CarriesTypeIn = 1U << FIELD_CTYPE;
LowPressure = IPL; LowPressure = IPL;

View File

@ -29,7 +29,7 @@ void Element::Element_BGLA()
HeatConduct = 150; HeatConduct = 150;
Description = "Broken Glass, heavy particles formed when glass breaks under pressure. Meltable. Bagels."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_C5()
HeatConduct = 88; HeatConduct = 88;
Description = "Cold explosive, set off by anything cold."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -31,7 +31,7 @@ void Element::Element_CLNE()
HeatConduct = 251; HeatConduct = 251;
Description = "Clone. Duplicates any particles it touches."; Description = "Clone. Duplicates any particles it touches.";
Properties = TYPE_SOLID | PROP_NOCTYPEDRAW; Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_NOCTYPEDRAW;
CarriesTypeIn = 1U << FIELD_CTYPE; CarriesTypeIn = 1U << FIELD_CTYPE;
LowPressure = IPL; LowPressure = IPL;

View File

@ -33,7 +33,7 @@ void Element::Element_DSTW()
LatentHeat = 7500; LatentHeat = 7500;
Description = "Distilled water, does not conduct electricity."; Description = "Distilled water, does not conduct electricity.";
Properties = TYPE_LIQUID|PROP_NEUTPASS; Properties = TYPE_LIQUID | PROP_NEUTPASS | PROP_PHOTPASS;
LowPressure = IPL; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -33,7 +33,7 @@ void Element::Element_FILT()
HeatConduct = 251; HeatConduct = 251;
Description = "Filter for photons, changes the color."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_GLAS()
HeatConduct = 150; HeatConduct = 150;
Description = "Glass. Meltable. Shatters under pressure, and refracts photons."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -33,7 +33,7 @@ void Element::Element_GLOW()
HeatConduct = 44; HeatConduct = 44;
Description = "Glow, Glows under pressure."; Description = "Glow, Glows under pressure.";
Properties = TYPE_LIQUID | PROP_LIFE_DEC; Properties = TYPE_LIQUID | PROP_PHOTPASS | PROP_LIFE_DEC;
LowPressure = IPL; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -31,7 +31,7 @@ void Element::Element_H2()
HeatConduct = 251; HeatConduct = 251;
Description = "Hydrogen. Combusts with OXYG to make WATR. Undergoes fusion at high temperature and pressure."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_INVIS()
HeatConduct = 164; HeatConduct = 164;
Description = "Invisible to particles while under pressure."; Description = "Invisible to particles while under pressure.";
Properties = TYPE_SOLID | PROP_NEUTPASS; Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_PHOTPASS;
LowPressure = IPL; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_ISOZ()
HeatConduct = 29; HeatConduct = 29;
Description = "Isotope-Z. Radioactive liquid, decays into photons when touching PHOT or under negative pressure."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_ISZS()
HeatConduct = 251; HeatConduct = 251;
Description = "Solid form of ISOZ, slowly decays into PHOT."; Description = "Solid form of ISOZ, slowly decays into PHOT.";
Properties = TYPE_SOLID; Properties = TYPE_SOLID | PROP_PHOTPASS;
LowPressure = IPL; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -33,7 +33,7 @@ void Element::Element_PBCN()
HeatConduct = 251; HeatConduct = 251;
Description = "Powered breakable clone."; Description = "Powered breakable clone.";
Properties = TYPE_SOLID | PROP_NOCTYPEDRAW; Properties = TYPE_SOLID | PROP_PHOTPASS | PROP_NOCTYPEDRAW;
CarriesTypeIn = 1U << FIELD_CTYPE; CarriesTypeIn = 1U << FIELD_CTYPE;
LowPressure = IPL; LowPressure = IPL;

View File

@ -33,7 +33,7 @@ void Element::Element_PCLN()
HeatConduct = 251; HeatConduct = 251;
Description = "Powered clone. When activated, duplicates any particles it touches."; 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; CarriesTypeIn = 1U << FIELD_CTYPE;
LowPressure = IPL; LowPressure = IPL;

View File

@ -36,7 +36,7 @@ void Element::Element_PHOT()
HeatConduct = 251; HeatConduct = 251;
Description = "Photons. Refracts through glass, scattered by quartz, and color-changed by different elements. Ignites flammable materials."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_PQRT()
HeatConduct = 3; HeatConduct = 3;
Description = "Powdered quartz, broken form of QRTZ."; Description = "Powdered quartz, broken form of QRTZ.";
Properties = TYPE_PART| PROP_HOT_GLOW; Properties = TYPE_PART | PROP_PHOTPASS | PROP_HOT_GLOW;
LowPressure = IPL; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_QRTZ()
HeatConduct = 3; HeatConduct = 3;
Description = "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -32,7 +32,7 @@ void Element::Element_RSST()
HeatConduct = 55; HeatConduct = 55;
Description = "Resist. Solidifies on contact with photons, is destroyed by electrons and spark."; 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); CarriesTypeIn = (1U << FIELD_CTYPE) | (1U << FIELD_TMP);
LowPressure = IPL; LowPressure = IPL;

View File

@ -32,7 +32,7 @@ void Element::Element_SLTW()
LatentHeat = 7500; LatentHeat = 7500;
Description = "Saltwater, conducts electricity, difficult to freeze."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;

View File

@ -33,7 +33,7 @@ void Element::Element_WATR()
LatentHeat = 7500; LatentHeat = 7500;
Description = "Water. Conducts electricity, freezes, and extinguishes fires."; 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; LowPressure = IPL;
LowPressureTransition = NT; LowPressureTransition = NT;