add new PhotonReflectWavelengths property, add reflection color for POLO
This commit is contained in:
parent
08ba035a53
commit
6d141b0722
@ -288,6 +288,12 @@ int luacon_element_getproperty(const char * key, int * format, unsigned int * mo
|
|||||||
offset = offsetof(Element, Hardness);
|
offset = offsetof(Element, Hardness);
|
||||||
*format = 0;
|
*format = 0;
|
||||||
}
|
}
|
||||||
|
// Not sure if this should be enabled
|
||||||
|
// Also, needs a new format type for unsigned ints
|
||||||
|
/*else if (!strcmp(key, "photonreflectwavelengths")) {
|
||||||
|
offset = offsetof(Element, PhotonReflectWavelengths);
|
||||||
|
*format = ;
|
||||||
|
}*/
|
||||||
else if (!strcmp(key, "menu")) {
|
else if (!strcmp(key, "menu")) {
|
||||||
offset = offsetof(Element, MenuVisible);
|
offset = offsetof(Element, MenuVisible);
|
||||||
*format = 0;
|
*format = 0;
|
||||||
|
@ -4419,24 +4419,8 @@ killed:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should be replaced with a particle type attribute ("photwl" or something)
|
if (r&0xFF)
|
||||||
if ((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000;
|
parts[i].ctype &= elements[r&0xFF].PhotonReflectWavelengths;
|
||||||
else if ((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000;
|
|
||||||
else if ((r & 0xFF) == PT_SPRK) parts[i].ctype = 0x00000000;
|
|
||||||
else if ((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000;
|
|
||||||
else if ((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000;
|
|
||||||
else if ((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E;
|
|
||||||
else if ((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000;
|
|
||||||
else if ((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000;
|
|
||||||
else if ((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000;
|
|
||||||
else if ((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE;
|
|
||||||
else if ((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0;
|
|
||||||
else if ((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF;
|
|
||||||
else if ((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00;
|
|
||||||
else if ((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000;
|
|
||||||
else if ((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00;
|
|
||||||
else if ((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000;
|
|
||||||
else if ((r & 0xFF) == PT_GOLD) parts[i].ctype &= 0x3C038100;
|
|
||||||
|
|
||||||
if (get_normal_interp(t, parts[i].x, parts[i].y, parts[i].vx, parts[i].vy, &nrx, &nry))
|
if (get_normal_interp(t, parts[i].x, parts[i].y, parts[i].vx, parts[i].vy, &nrx, &nry))
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@ Element_ACID::Element_ACID()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 0;
|
Hardness = 0;
|
||||||
|
PhotonReflectWavelengths = 0x1FE001FE;
|
||||||
|
|
||||||
Weight = 10;
|
Weight = 10;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_BCOL::Element_BCOL()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 2;
|
Hardness = 2;
|
||||||
|
PhotonReflectWavelengths = 0x00000000;
|
||||||
|
|
||||||
Weight = 90;
|
Weight = 90;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_COAL::Element_COAL()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 20;
|
Hardness = 20;
|
||||||
|
PhotonReflectWavelengths = 0x00000000;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_DUST::Element_DUST()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 30;
|
Hardness = 30;
|
||||||
|
PhotonReflectWavelengths = 0x3FFFFFC0;
|
||||||
|
|
||||||
Weight = 85;
|
Weight = 85;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element::Element():
|
|||||||
Explosive(0),
|
Explosive(0),
|
||||||
Meltable(0),
|
Meltable(0),
|
||||||
Hardness(30),
|
Hardness(30),
|
||||||
|
PhotonReflectWavelengths(0x3FFFFFFF),
|
||||||
|
|
||||||
Weight(50),
|
Weight(50),
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ std::vector<StructProperty> Element::GetProperties()
|
|||||||
properties.push_back(StructProperty("Explosive", StructProperty::Integer, offsetof(Element, Explosive)));
|
properties.push_back(StructProperty("Explosive", StructProperty::Integer, offsetof(Element, Explosive)));
|
||||||
properties.push_back(StructProperty("Meltable", StructProperty::Integer, offsetof(Element, Meltable)));
|
properties.push_back(StructProperty("Meltable", StructProperty::Integer, offsetof(Element, Meltable)));
|
||||||
properties.push_back(StructProperty("Hardness", StructProperty::Integer, offsetof(Element, Hardness)));
|
properties.push_back(StructProperty("Hardness", StructProperty::Integer, offsetof(Element, Hardness)));
|
||||||
|
properties.push_back(StructProperty("PhotonReflectWavelengths", StructProperty::UInteger, offsetof(Element, PhotonReflectWavelengths)));
|
||||||
properties.push_back(StructProperty("Weight", StructProperty::Integer, offsetof(Element, Weight)));
|
properties.push_back(StructProperty("Weight", StructProperty::Integer, offsetof(Element, Weight)));
|
||||||
properties.push_back(StructProperty("Temperature", StructProperty::Float, offsetof(Element, Temperature)));
|
properties.push_back(StructProperty("Temperature", StructProperty::Float, offsetof(Element, Temperature)));
|
||||||
properties.push_back(StructProperty("HeatConduct", StructProperty::UChar, offsetof(Element, HeatConduct)));
|
properties.push_back(StructProperty("HeatConduct", StructProperty::UChar, offsetof(Element, HeatConduct)));
|
||||||
|
@ -33,6 +33,8 @@ public:
|
|||||||
int Explosive;
|
int Explosive;
|
||||||
int Meltable;
|
int Meltable;
|
||||||
int Hardness;
|
int Hardness;
|
||||||
|
// Photon wavelengths are ANDed with this value when a photon hits an element, meaning that only wavelengths present in both this value and the original photon will remain in the reflected photon
|
||||||
|
unsigned int PhotonReflectWavelengths;
|
||||||
int Weight;
|
int Weight;
|
||||||
float Temperature;
|
float Temperature;
|
||||||
unsigned char HeatConduct;
|
unsigned char HeatConduct;
|
||||||
|
@ -24,6 +24,7 @@ Element_GOLD::Element_GOLD()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 1;
|
Meltable = 1;
|
||||||
Hardness = 0;
|
Hardness = 0;
|
||||||
|
PhotonReflectWavelengths = 0x3C038100;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_GOO::Element_GOO()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 12;
|
Hardness = 12;
|
||||||
|
PhotonReflectWavelengths = 0x3FFAAA00;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_LAVA::Element_LAVA()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 2;
|
Hardness = 2;
|
||||||
|
PhotonReflectWavelengths = 0x3FF00000;
|
||||||
|
|
||||||
Weight = 45;
|
Weight = 45;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_NBLE::Element_NBLE()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 1;
|
Hardness = 1;
|
||||||
|
PhotonReflectWavelengths = 0x3FFF8000;
|
||||||
|
|
||||||
Weight = 1;
|
Weight = 1;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_NITR::Element_NITR()
|
|||||||
Explosive = 2;
|
Explosive = 2;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 3;
|
Hardness = 3;
|
||||||
|
PhotonReflectWavelengths = 0x0007C000;
|
||||||
|
|
||||||
Weight = 23;
|
Weight = 23;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_NSCN::Element_NSCN()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 1;
|
Meltable = 1;
|
||||||
Hardness = 1;
|
Hardness = 1;
|
||||||
|
PhotonReflectWavelengths = 0x00000000;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_PLEX::Element_PLEX()
|
|||||||
Explosive = 2;
|
Explosive = 2;
|
||||||
Meltable = 50;
|
Meltable = 50;
|
||||||
Hardness = 1;
|
Hardness = 1;
|
||||||
|
PhotonReflectWavelengths = 0x1F00003E;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_PLNT::Element_PLNT()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 10;
|
Hardness = 10;
|
||||||
|
PhotonReflectWavelengths = 0x0007C000;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_PLUT::Element_PLUT()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 0;
|
Hardness = 0;
|
||||||
|
PhotonReflectWavelengths = 0x001FCE00;
|
||||||
|
|
||||||
Weight = 90;
|
Weight = 90;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_POLO::Element_POLO()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 1;
|
Meltable = 1;
|
||||||
Hardness = 0;
|
Hardness = 0;
|
||||||
|
PhotonReflectWavelengths = 0x000FF200;
|
||||||
|
|
||||||
Weight = 90;
|
Weight = 90;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_PSCN::Element_PSCN()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 1;
|
Meltable = 1;
|
||||||
Hardness = 1;
|
Hardness = 1;
|
||||||
|
PhotonReflectWavelengths = 0x00000000;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_SNOW::Element_SNOW()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 20;
|
Hardness = 20;
|
||||||
|
PhotonReflectWavelengths = 0x03FFFFFF;
|
||||||
|
|
||||||
Weight = 50;
|
Weight = 50;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_SPRK::Element_SPRK()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 1;
|
Hardness = 1;
|
||||||
|
PhotonReflectWavelengths = 0x00000000;
|
||||||
|
|
||||||
Weight = 100;
|
Weight = 100;
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ Element_URAN::Element_URAN()
|
|||||||
Explosive = 0;
|
Explosive = 0;
|
||||||
Meltable = 0;
|
Meltable = 0;
|
||||||
Hardness = 0;
|
Hardness = 0;
|
||||||
|
PhotonReflectWavelengths = 0x003FC000;
|
||||||
|
|
||||||
Weight = 90;
|
Weight = 90;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user