13 override void CreateActionComponent()
15 float time = SetCallbackDuration(m_ActionData.m_MainItem);
38 override void CreateConditionComponents()
51 m_Text =
"#build " + constrution_part.GetName();
55 override bool CanBeUsedLeaning()
62 if (player.IsPlacingLocal() || player.IsPlacingServer())
66 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
70 if (target.GetObject() && (!target.GetObject().CanUseConstructionBuild() || target.GetObject().CanUseHandConstruction()))
73 if ((!
GetGame().IsDedicatedServer()))
75 if (MiscGameplayFunctions.ComplexBuildCollideCheckClient(player, target, item,
m_VariantID))
84 override bool ActionConditionContinue(
ActionData action_data)
87 Construction construction = base_building.GetConstruction();
88 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
91 check_data.m_PartName = part_name;
92 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
94 bool canBuild = construction.CanBuildPart(part_name, action_data.m_MainItem,
true);
97 bool collides = construction.IsCollidingEx(check_data);
99 return !collides && canBuild;
107 override void OnFinishProgressServer(
ActionData action_data)
110 Construction construction = base_building.GetConstruction();
112 string part_name = BuildPartActionData.Cast(action_data).m_PartType;
115 check_data.m_PartName = part_name;
116 check_data.m_AdditionalExcludes.Insert(action_data.m_Player);
118 if (!construction.IsCollidingEx(check_data) && construction.CanBuildPart(part_name, action_data.m_MainItem,
true))
121 construction.BuildPartServer(action_data.m_Player, part_name,
AT_BUILD_PART);
128 override string GetSoundCategory(
ActionData action_data)
130 return "Base_building";
135 BuildPartActionData action_data =
new BuildPartActionData;
142 if (super.SetupAction(player, target, item, action_data, extra_data))
144 SetBuildingAnimation(item);
146 if (!
GetGame().IsDedicatedServer())
149 BuildPartActionData.Cast(action_data).m_PartType = construction_action_data.GetBuildPartAtIndex(
m_VariantID).GetPartName();
157 protected void SetBuildingAnimation(
ItemBase item)
181 super.WriteToContext(ctx, action_data);
183 ctx.Write(BuildPartActionData.Cast(action_data).m_PartType);
186 override bool ReadFromContext(
ParamsReadContext ctx, out ActionReciveData action_recive_data)
189 super.ReadFromContext(ctx, action_recive_data);
192 if (ctx.Read(part_type))
203 override void HandleReciveData(ActionReciveData action_recive_data,
ActionData action_data)
205 super.HandleReciveData(action_recive_data, action_data);
210 override string GetAdminLogMessage(
ActionData action_data)
213 string partName = BuildPartActionData.Cast(action_data).m_PartType;
215 string message =
string.Format(
"Built %1 on %2 with %3", partName, action_data.m_Target.GetObject().GetDisplayName(), action_data.m_MainItem.GetDisplayName());