override protected void LabourResult(int iterations) { if (iterations < 1) { return; } workflow -= iterations; bool materialsProblem = true; if (dig) { float production; while (iterations > 0) { iterations--; production = workObject.Dig(VOLUME_PER_ACTION, true, workplace.faceIndex); if (production == 0f) { StopWork(true); return; } } } else { while (iterations > 0) { iterations--; materialsProblem = colony.storage.TryGetResources(ResourceType.GetResourceTypeById(workplace.materialID), VOLUME_PER_ACTION); if (!materialsProblem) { if (workObject.PourIn(VOLUME_PER_ACTION, workplace.faceIndex)) { StopWork(true); } return; } else { break; } } } if (dig) { actionLabel = Localization.GetActionLabel(LocalizationActionLabels.DigInProgress) + " (" + ((int)((1 - workObject.GetVolumePercent()) * 100f)).ToString() + "%)"; } else { if (!materialsProblem) { actionLabel = Localization.GetActionLabel(LocalizationActionLabels.PouringInProgress) + " (" + ((int)(workObject.GetVolumePercent() * 100f)).ToString() + "%)"; } else { actionLabel = Localization.GetAnnouncementString(GameAnnouncements.NotEnoughResources); } } }
public void EnvironmentalStrike(byte i_faceIndex, Vector3 hitpoint, byte radius, float damage) { if (mainStructure != null) { mainStructure.ApplyDamage(damage); } else { Plane p = null; if (TryGetPlane(i_faceIndex, out p)) { p.EnvironmentalStrike(hitpoint, radius, damage); } else { extension?.Dig((int)damage, true, i_faceIndex); } } }
void LabourResult() { int x = (int)workflow; float production = x; if (dig) { production = workObject.Dig(x, true, workplace.faceIndex); if (production == 0f) { StopWork(true); return; } } else { production = workObject.PourIn(x, workplace.faceIndex); if (production != 0) { production = workObject.PourIn((int)production, workplace.faceIndex); if (production == 0) { StopWork(true); return; } } } workflow -= production; if (dig) { actionLabel = Localization.GetActionLabel(LocalizationActionLabels.DigInProgress) + " (" + ((int)((1 - workObject.GetVolumePercent()) * 100f)).ToString() + "%)"; } else { actionLabel = Localization.GetActionLabel(LocalizationActionLabels.PouringInProgress) + " (" + ((int)(workObject.GetVolumePercent() * 100f)).ToString() + "%)"; } }