Each Structure will have an Integrity attribute that degrades as the structure ages. Different structures will degrade at different rates based on what they do (e.g., fusion reactors will degrade faster than agridomes, agridomes will degrade faster than storage tanks, etc).
The decay rate will be affected by difficulty.
Structures not kept well maintained will eventually fail and become disabled. If they continue to be neglected they will eventually collapse.
So anyway, this task will be complete when the Structure object is modified as follows:
Integrity member added
Integrity member set/defined in the c'tor of derived types. This can be done by adding a pure virtual defineIntegry() function.
Integrity decay rate member added
Integrity decay rate set/defined in the c'tor of the derived types. This can be done by adding a pure virtual defineDegradationRate() function.
Basic logic code is added to degrade/decay integrity over time using defined decay rate.
Logic sets a disabled state when integrity reaches a predetermined percentage (first though 35%)
Logic sets a destroyed state based on a chance when integrity is lower than 25%. The lower the integrity, the higher the chance of the building collapsing.
I've got this feature stubbed out in every structure. What needs to be enumerated is the gameplay mechanics of each structure's custom decay rate and even if they should decay.
Each Structure will have an Integrity attribute that degrades as the structure ages. Different structures will degrade at different rates based on what they do (e.g., fusion reactors will degrade faster than agridomes, agridomes will degrade faster than storage tanks, etc).
The decay rate will be affected by difficulty.
Structures not kept well maintained will eventually fail and become disabled. If they continue to be neglected they will eventually collapse.
So anyway, this task will be complete when the Structure object is modified as follows: