52 override void CreateConditionComponents()
58 override void OnActionInfoUpdate(
PlayerBase player, ActionTarget target,
ItemBase item )
64 override string GetText()
72 if ( constrution_part )
74 return "#repair" +
" " + constrution_part.GetName();
84 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
90 override bool ActionConditionContinue( ActionData action_data )
92 return RepairCondition( action_data.m_Player, action_data.m_Target, action_data.m_MainItem ,
false );
95 override void OnFinishProgressServer( ActionData action_data )
98 Construction construction = base_building.GetConstruction();
101 string part_name = action_data.m_Target.GetObject().GetActionComponentName( RepairPartActionData.Cast(action_data).m_ComponentIndex );
103 PluginRepairing module_repairing;
106 DamageSystem.GetDamageZoneFromComponentName(base_building,part_name,zone_name);
107 module_repairing.Repair(action_data.m_Player,action_data.m_MainItem,base_building,
m_SpecialtyWeight,zone_name);
110 construction.TakeMaterialsServer(part_name,
true);
113 action_data.m_MainItem.DecreaseHealth(
UADamageApplied.REPAIR,
false );
118 switch( item.Type() )
137 RepairPartActionData action_data =
new RepairPartActionData;
143 super.WriteToContext(ctx, action_data);
144 RepairPartActionData repair_action_data;
148 repair_action_data.m_ComponentIndex = action_data.m_Target.GetComponentIndex();
149 ctx.Write(repair_action_data.m_ComponentIndex);
155 if(!action_recive_data)
161 super.ReadFromContext(ctx, action_recive_data);
166 if ( !ctx.Read(component_index) )
169 recive_data_repair.m_ComponentIndexRecived = component_index;
174 override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
176 super.HandleReciveData(action_recive_data, action_data);
179 RepairPartActionData.Cast(action_data).m_ComponentIndex = recive_data_repair.m_ComponentIndexRecived;
186 Object target_object = target.GetObject();
187 if ( target_object && target_object.CanUseConstruction() )
189 string part_name = target_object.GetActionComponentName( target.GetComponentIndex() );
192 Construction construction = base_building.GetConstruction();
193 ConstructionPart construction_part = construction.GetConstructionPart( part_name );
195 if ( construction_part )
198 if ( !base_building.
IsFacingPlayer( player, part_name ) && !player.GetInputController().CameraIsFreeLook() && base_building.
HasProperDistance( construction_part.GetMainPartName(), player ) )
213 DamageSystem.GetDamageZoneFromComponentName(base_building,part_name,zone_name);
214 if ( base_building.GetHealthLevel(zone_name) <
GameConstants.STATE_WORN || base_building.GetHealthLevel(zone_name) ==
GameConstants.STATE_RUINED )
220 if ( !construction.HasMaterials(part_name,
true) )
237 return " repaired " + action_data.m_Target.GetObject().GetDisplayName() +
" with " + action_data.m_MainItem.GetDisplayName();