3 string m_DamageZoneRecived;
13 override void CreateActionComponent()
21 typename m_LastValidType;
22 string m_CurrentDamageZone =
"";
23 int m_LastValidComponentIndex = -1;
36 override void CreateConditionComponents()
42 override bool IsUsingProxies()
47 override bool HasTarget()
55 Object targetObject = target.GetObject();
56 Object targetParent = target.GetParent();
57 if ( !targetParent || !targetParent.IsInherited(
TentBase) )
60 if ( player && targetObject && targetParent )
63 PluginRepairing module_repairing;
65 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections,
"view");
69 string damageZone =
"";
71 for (
int s = 0; s < selections.Count(); s++)
73 if ( DamageSystem.GetDamageZoneFromComponentName(tent, selections[s], damageZone) )
76 if (tent.GetHealthLevel(
"" + damageZone) ==
GameConstants.STATE_RUINED )
101 override void OnFinishProgressServer(
ActionData action_data )
103 Object targetParent = action_data.m_Target.GetParent();
104 ItemBase usedItem = action_data.m_MainItem;
106 string damageZone = RepairTentPartActionData.Cast(action_data).m_DamageZone;
107 if (!
GetGame().IsMultiplayer())
110 if ( targetParent && targetParent.IsInherited(
TentBase) && damageZone !=
"" )
113 float m_RepairedLevel = usedItem.GetHealthLevel();
115 tent.SetAllowDamage(
true);
116 targetParent.SetHealth01(
"" + damageZone,
"", targetParent.GetHealthLevelValue(m_RepairedLevel));
117 tent.ProcessInvulnerabilityCheck(tent.GetInvulnerabilityTypeString());
119 if (usedItem.GetQuantity() > 1)
122 int val = usedItem.GetQuantity();
124 usedItem.SetQuantity(val);
133 RepairTentPartActionData action_data =
new RepairTentPartActionData;
139 super.WriteToContext(ctx, action_data);
140 RepairTentPartActionData repair_action_data;
142 if( HasTarget() &&
Class.CastTo(repair_action_data,action_data) )
145 ctx.Write(repair_action_data.m_DamageZone);
149 override bool ReadFromContext(
ParamsReadContext ctx, out ActionReciveData action_recive_data )
151 if(!action_recive_data)
155 super.ReadFromContext(ctx, action_recive_data);
161 if ( !ctx.Read(zone) )
164 recive_data_repair.m_DamageZoneRecived = zone;
169 override void HandleReciveData(ActionReciveData action_recive_data,
ActionData action_data)
171 super.HandleReciveData(action_recive_data, action_data);
174 RepairTentPartActionData.Cast(action_data).m_DamageZone = recive_data_repair.m_DamageZoneRecived;