forked from Mirrors/openclonk
Physical: Make BreatheWater and CorrosionResist simple properties
parent
5bb3e81f4f
commit
1760c8851d
|
@ -172,8 +172,6 @@ struct C4PhysInfoNameMap_t { const char *szName; C4PhysicalInfo::Offset off; } C
|
|||
{ "Breath", &C4PhysicalInfo::Breath },
|
||||
{ "Jump", &C4PhysicalInfo::Jump },
|
||||
{ "Throw", &C4PhysicalInfo::Throw },
|
||||
{ "CorrosionResist", &C4PhysicalInfo::CorrosionResist },
|
||||
{ "BreatheWater", &C4PhysicalInfo::BreatheWater },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
|
@ -42,8 +42,6 @@ public:
|
|||
int32_t Breath;
|
||||
int32_t Jump;
|
||||
int32_t Throw;
|
||||
int32_t CorrosionResist;
|
||||
int32_t BreatheWater;
|
||||
public:
|
||||
void Default();
|
||||
void PromotionUpdate(int32_t iRank, bool fUpdateTrainablePhysicals=false, class C4Def *pTrainDef=NULL);
|
||||
|
|
|
@ -1028,7 +1028,7 @@ bool C4Object::ExecLife()
|
|||
// Forcefields are breathable.
|
||||
if (GBackMat(GetX(), GetY()+Shape.GetY()/2)==MVehic)
|
||||
{ Breathe=true; }
|
||||
else if (GetPhysical()->BreatheWater)
|
||||
else if (GetPropertyInt(P_BreatheWater))
|
||||
{ if (GBackMat(GetX(), GetY())==MWater) Breathe=true; }
|
||||
else
|
||||
{ if (!GBackSemiSolid(GetX(), GetY()+Shape.GetY()/2)) Breathe=true; }
|
||||
|
@ -1055,7 +1055,7 @@ bool C4Object::ExecLife()
|
|||
if (Alive)
|
||||
if (InMat!=MNone)
|
||||
if (::MaterialMap.Map[InMat].Corrosive)
|
||||
if (!GetPhysical()->CorrosionResist)
|
||||
if (!GetPropertyInt(P_CorrosionResist))
|
||||
DoEnergy(-::MaterialMap.Map[InMat].Corrosive/15,false,C4FxCall_EngCorrosion, NO_OWNER);
|
||||
|
||||
// InMat incineration
|
||||
|
|
|
@ -131,6 +131,8 @@ C4StringTable::C4StringTable()
|
|||
P[P_MouseDragImage] = "MouseDragImage";
|
||||
P[P_PictureTransformation] = "PictureTransformation";
|
||||
P[P_MeshTransformation] = "MeshTransformation";
|
||||
P[P_BreatheWater] = "BreatheWater";
|
||||
P[P_CorrosionResist] = "CorrosionResist";
|
||||
P[DFA_WALK] = "WALK";
|
||||
P[DFA_FLIGHT] = "FLIGHT";
|
||||
P[DFA_KNEEL] = "KNEEL";
|
||||
|
|
|
@ -219,6 +219,8 @@ enum C4PropertyName
|
|||
P_MouseDragImage,
|
||||
P_Animation,
|
||||
P_Action,
|
||||
P_BreatheWater,
|
||||
P_CorrosionResist,
|
||||
// Default Action Procedures
|
||||
DFA_WALK,
|
||||
DFA_FLIGHT,
|
||||
|
|
Loading…
Reference in New Issue