コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: ActiveInjury.cs プロジェクト: ArcticWolves/zara
        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);
            }
        }
コード例 #4
0
ファイル: ZaraEventsListener.cs プロジェクト: unitycoder/zara
 public void InjectionApplied(InventoryMedicalItemBase appliance)
 {
 }
コード例 #5
0
 public void OnApplianceTaken(InventoryMedicalItemBase item, BodyParts bodyPart)
 {
     _monitors.ForEach(x => x.OnApplianceTaken(item, bodyPart));
 }
コード例 #6
0
 public void InjectionApplied(IGameController sender, InventoryMedicalItemBase appliance)
 {
 }