DIFF

class ConstructionBase

ConstructionBase › ConstructionBasic

Constructors 2

void ~ConstructionBase()

Constants 7

protected static const int MAX_MATERIAL_PILES = 64

safety cap for material pile spawning

static const float REPAIR_MATERIAL_PERCENTAGE = 0.15
static const float DECONSTURCT_MATERIAL_LOSS = 0.2
static const float DEFAULT_DECAY_RATE = -1.0

HP/s change

static const float DEFAULT_DECAY_THRESHOLD = 0.3

Percentage of max health where the decay stops

static const float DEFAULT_DECAY_RATE_COEF = 1.0

Default decay speed coef

Referenced by GetCurrentDecayCoef()
static const float SANDSTORM_DECAY_RATE_COEF = 1.5

Sandstorm decay speed coef

Referenced by GetCurrentDecayCoef()

Members 10

protected bool m_AnyPartBuildableByHands
protected Shape m_PlayerInsideTestCylinderDIAG_DEVELOPER
protected ConstructionBoxTrigger m_ConstructionBoxTrigger

Deprecated

Methods 93

override void Init()
Referenced by Rebuilding.Init()
protected void Cleanup()
Referenced by ~ConstructionBase()
protected void SetParent(EntityAI parent)
References m_EntityParent
protected void HandleSyncDataBuild(ConstructionPart part)
protected void HandleSyncDataDismantle(ConstructionPart part)
protected void HandleSyncDataDestroy(ConstructionPart part)
protected bool UpdatePartSyncStateLocal(ConstructionPart part)

Returns 'true' if part state was locally changed

void HandleEntityFalling(string partName)

when supporting part is removed, entities on top of it should transform to surface Y height

override bool CanUseHandConstruction()
override void OnHealthLevelChanged(int oldLevel, int newLevel, string zone)
bool ExceptionCheck(string part_name)

Exceptions from 'dependent parts' hierarchy are handled here

void UpdateSpecificPartPhysics(ConstructionPart part)

update SPECIFIC part's physics

void UpdatePhysics()

update ALL parts physics. Sets hide first, then shows the rest. Use only if the update queue system won't cut it.

protected ConstructionPart CreatePartInstanceObject(typename partTypename)
protected typename GetDefaultPartInstanceTypename()

Override on lower implements to create desired part types

References ErrorEx()
ConstructionPart GetConstructionPart(string part_name)
Referenced by ActionBuildPart.OnFinishProgressServer(), ActionBuildPartHandsGeneric.SetBuildingAnimationEx(), ActionBuildPartInstantDebug.OnStartServer()
Show 47 more, ActionDestroyPartInstantDebug.ActionCondition(), ActionDismantlePartInstantDebug.ActionCondition(), BaseBuildingBase.OnPartBuiltServer(), BaseBuildingBase.OnPartDestroyedServer(), BaseBuildingBase.OnPartDismantledServer(), Construction.ExceptionCheck(), AddToConstructedParts(), CanDismantlePart(), CanRepairPart(), CanUseToolToBuildPart(), CanUseToolToDismantlePart(), DestroyMaterialsServer(), DropEssentialAttachments(), DropNonUsableMaterialsServer(), GetCollisionBoxData(), GetConstructionPartToDestroy(), GetConstructionPartToDismantle(), GetItemFallDetectionBoxData(), GetMaterialType(), HandleEntityFalling(), HasConflictPart(), HasMaterialsEx(), IsColliding(), IsCollidingEx(), IsPartConstructed(), MaterialIsRuined(), OnHealthLevelChanged(), ProcessOnPartBuiltServer(), ProcessOnPartDestroyedServer(), ProcessOnPartDismantledServer(), ReceiveMaterialsServer(), RemoveFromConstructedParts(), SetLockOnAttachedMaterials(), TakeMaterialsServer(), ConstructionPartRebuild.TryHandleUtilityParts(), ConstructionPartRebuildRubble.RubbleRemovalCheck(), DigitalCodeLock.SetDoorInfoFromSlot(), Fence.CheckGateState(), Fence.GateAttachmentConditions(), Fence.GateAttachmentsSanityCheck(), Fence.OnPartDestroyedServer(), Fence.OnPartDismantledServer(), Rebuilding.CanDisplayAttachmentCategoryConstruction(), Rebuilding.GetRebuildingPart(), ShelterSite.OnPartBuiltServer(), StaticFlagPole.FullyBuild(), and TerritoryFlag.OnPartDismantledServer()
bool CanBuildPartEx(string partName, ItemBase tool, out EConstructionInfoCategories failureReasonsMask)

not meant to replace, but rather extend the functionality for specific use

bool CanBuildUtilityPart(string partName)

Simplified condition for utility (non-)parts

void GetConstructionPartsUnableToBuild(string actionComponentName, out array<ConstructionPart> constructionParts, ItemBase tool, out string realConstructionTarget, bool useTool)
bool HasRequiredPart(string part_name)

checks if construction part has all the required parts built

bool PartHasAnySupportFulfilled(string part_name)

checks if construction part has all the required support

ConstructionPart GetConstructionPartToDismantle(string part_name, ItemBase tool)
bool HasDependentPart(string part_name)

checks if construction part has dependent part (that is already built) because of which it cannot be dismantled

bool SupportRemovalCheck(string part_name)

Checks if all supports would hold on part removal. Returns 'false' if some would fail

array<string> GetRequiredParts(string part_name, string main_part_name)
ConstructionPart GetConstructionPartToDestroy(string part_name)
protected void ShowConstructionPart(string part_name)

Animates AnimationSource. Use on server only, AUTO-SYNCED

protected void HideConstructionPart(string part_name)

Animates AnimationSource. Use on server only, AUTO-SYNCED

bool HasMaterials(string part_name, bool repairing = false)
References HasMaterialsEx()
protected bool HasMaterialWithQuantityAttached(string slot_name, float quantity)
Referenced by HasMaterialsEx()
protected void MoveMaterialAttachmentToGround(notnull EntityAI parent, Man player, notnull ItemBase attachment, notnull InventoryLocation invloc, string partName)

The method does not care about the amount of materials that should be returned based on the cached quantity in the ConstructionMaterialData struct. If we start using this method for e.g. drop of materials that are not attached and locked to the construction parent then we need to change the method to handle the quantity accordingly

vector GetCollisionBoxSize(vector min_max[2])
References Math.AbsFloat(), and Vector()
Referenced by GetTriggerExtents(), IsColliding(), IsCollidingEx()
Show 1 more, ItemFall()
protected void GetCollisionBoxData(string part_name, out vector min_max[2])
Referenced by IsColliding(), and IsCollidingEx()
protected bool GetItemFallDetectionBoxData(string partName, out vector minMax[2])
Referenced by ItemFall()
vector GetBoxCenter(vector min_max[2])
References Vector()
void GetTriggerExtents(vector min_max[2], out vector extents[2])
protected void DrawDebugCollisionBox(vector min_max[2], int color)DIAG_DEVELOPER
Referenced by IsCollidingEx()
protected void DestroyDebugCollisionBox()DIAG_DEVELOPER
protected void DrawDebugInsideTestBox(vector min, vector max, int color)DIAG_DEVELOPER
protected void DestroyDebugInsideTestBoxes()DIAG_DEVELOPER
void BuildPartServer(notnull Man player, string part_name, int action_id)
void DismantlePartServer(notnull Man player, string part_name, int action_id)
void DestroyCollisionTrigger()