3 string m_DamageZoneRecived;
13 override void CreateActionComponent()
45 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
48 Object targetObject = target.GetObject();
49 Object targetParent = target.GetParent();
52 if (!carDoor || !player)
61 if (targetParent !=
null)
64 bool isPresent = carDoor.GetInventory().GetCurrentInventoryLocation(loc);
66 if (!isPresent || loc.GetSlot() == -1)
75 int zoneHP = carDoor.GetHealthLevel(
"");
84 Object tgObject = action_data.m_Target.GetObject();
86 string damageZone = RepairCarPartActionData.Cast(action_data).m_DamageZone;
96 float zoneMax = carDoor.GetMaxHealth(
"",
"");
97 float randomValue =
Math.RandomFloatInclusive(zoneMax * 0.05, zoneMax * 0.15);
102 carDoor.SetHealth(
"",
"", (zoneMax *
GameConstants.DAMAGE_RUINED_VALUE) + randomValue);
106 carDoor.SetHealth(
"",
"", (zoneMax *
GameConstants.DAMAGE_BADLY_DAMAGED_VALUE) + randomValue);
110 carDoor.SetHealth(
"",
"", (zoneMax *
GameConstants.DAMAGE_DAMAGED_VALUE) + randomValue);
117 if (action_data.m_MainItem.HasQuantity())
119 if (action_data.m_MainItem.GetQuantity() > 1)
121 int qnt = action_data.m_MainItem.GetQuantity();
122 qnt -= action_data.m_MainItem.GetQuantityMax() * 0.25;
123 action_data.m_MainItem.SetQuantity(qnt);
126 action_data.m_MainItem.Delete();
134 RepairCarPartActionData actionData =
new RepairCarPartActionData();
140 super.WriteToContext(ctx, action_data);
141 RepairCarPartActionData repairActionData;
146 ctx.Write(repairActionData.m_DamageZone);
152 if (!action_recive_data)
155 super.ReadFromContext(ctx, action_recive_data);
164 reciveDataRepair.m_DamageZoneRecived = zone;
172 super.HandleReciveData(action_recive_data, action_data);
175 RepairCarPartActionData.Cast(action_data).m_DamageZone = reciveDataRepair.m_DamageZoneRecived;