public void OnApplianceTaken(IGameController gc, InventoryMedicalItemBase appliance, BodyParts bodyPart) { if (IsTreated) { return; } if (TreatedStage != null) { if (TreatedStage.OnApplianceTaken != null) { TreatedStage.OnApplianceTaken(gc, new ApplianceInfo { Appliance = appliance, BodyPart = bodyPart }, this); } } else { var stage = GetActiveStage(gc.WorldTime.Value); if (stage != null && stage.OnApplianceTaken != null) { stage.OnApplianceTaken(gc, new ApplianceInfo { Appliance = appliance, BodyPart = bodyPart }, this); } } }
public bool OnApplianceTaken(IGameController gc, InventoryMedicalItemBase tool, BodyParts bodyPart, ActiveInjury injury) { if (_toolsNeeded.Count == 0) { return(true); } if (bodyPart != injury.BodyPart) { return(false); } if (_toolsNeeded[0].IsApplicableToGroup(tool.Name)) { if (_lastToolTime.HasValue) { if ((gc.WorldTime.Value - _lastToolTime.Value).TotalMinutes > MaximumTimeBetweenAppliancesInGameMinutes) { _toolsNeeded = _toolsOriginal.ToList(); _lastToolTime = null; return(false); } } _lastToolTime = gc.WorldTime; _toolsNeeded.RemoveAt(0); if (_toolsNeeded.Count == 0) { injury.Invert(); injury.DeclareInjuryTreated(); if (OnTreated != null) { OnTreated.Invoke(); } Events.NotifyAll(l => l.InjuryHealed(injury.Injury)); } return(true); } return(false); }
public void OnApplianceTaken(IGameController gc, InventoryMedicalItemBase item, BodyParts bodyPart) { InjuryStage stage = null; if (TreatedStage == null) { stage = GetActiveStage(_gc.WorldTime.Value); } else { stage = TreatedStage; } if (stage != null && stage.OnApplySpecialItem != null) { stage.OnApplySpecialItem(gc, item, bodyPart, this); } }
public void InjectionApplied(InventoryMedicalItemBase appliance) { }
public void OnApplianceTaken(InventoryMedicalItemBase item, BodyParts bodyPart) { _monitors.ForEach(x => x.OnApplianceTaken(item, bodyPart)); }
public void InjectionApplied(IGameController sender, InventoryMedicalItemBase appliance) { }