3 string m_DamageZoneRecived;
13 override void CreateActionComponent()
44 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
47 Object targetObject = target.GetObject();
48 Object targetParent = target.GetParent();
63 string damageZone =
"";
65 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections,
LOD.NAME_VIEW);
67 foreach (
string selection : selections)
70 if (carEntity && DamageSystem.GetDamageZoneFromComponentName(carEntity, selection, damageZone))
72 if (damageZone ==
"Engine")
74 int zoneHP = car.GetHealthLevel(damageZone);
92 Object tgObject = action_data.m_Target.GetObject();
94 string damageZone = RepairCarPartActionData.Cast(action_data).m_DamageZone;
98 if (tgObject && damageZone !=
"")
104 float zoneMax = car.GetMaxHealth(damageZone,
"");
105 float randomValue =
Math.RandomFloatInclusive(zoneMax * 0.05, zoneMax * 0.15);
110 car.SetHealth(damageZone,
"", (zoneMax *
GameConstants.DAMAGE_RUINED_VALUE) + randomValue);
114 car.SetHealth(damageZone,
"", (zoneMax *
GameConstants.DAMAGE_BADLY_DAMAGED_VALUE) + randomValue);
118 car.SetHealth(damageZone,
"", (zoneMax *
GameConstants.DAMAGE_DAMAGED_VALUE) + randomValue);
125 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem,
UADamageApplied.BUILD);
132 RepairCarPartActionData actionData =
new RepairCarPartActionData();
138 super.WriteToContext(ctx, action_data);
139 RepairCarPartActionData repairActionData;
144 ctx.Write(repairActionData.m_DamageZone);
150 if (!action_recive_data)
153 super.ReadFromContext(ctx, action_recive_data);
162 reciveDataRepair.m_DamageZoneRecived = zone;
170 super.HandleReciveData(action_recive_data, action_data);
173 RepairCarPartActionData.Cast(action_data).m_DamageZone = reciveDataRepair.m_DamageZoneRecived;