示例#1
0
        public void UpdateBed()
        {
            Ownables   soleOwner   = base.sm.masterTarget.Get(base.smi).GetComponent <MinionIdentity>().GetSoleOwner();
            Assignable assignable  = null;
            Assignable assignable2 = soleOwner.GetAssignable(Db.Get().AssignableSlots.MedicalBed);

            if ((Object)assignable2 != (Object)null && assignable2.CanAutoAssignTo(base.sm.masterTarget.Get(base.smi).GetComponent <MinionIdentity>().assignableProxy.Get()))
            {
                assignable = assignable2;
            }
            else
            {
                assignable = soleOwner.GetAssignable(Db.Get().AssignableSlots.Bed);
                if ((Object)assignable == (Object)null)
                {
                    assignable = soleOwner.AutoAssignSlot(Db.Get().AssignableSlots.Bed);
                    if ((Object)assignable != (Object)null)
                    {
                        AssignableReachabilitySensor sensor = GetComponent <Sensors>().GetSensor <AssignableReachabilitySensor>();
                        sensor.Update();
                    }
                }
            }
            base.smi.sm.bed.Set(assignable, base.smi);
        }
    public void FindAvailableMedicalBed(Navigator navigator)
    {
        Clinic                 clinic    = null;
        AssignableSlot         clinic2   = Db.Get().AssignableSlots.Clinic;
        Ownables               soleOwner = gameObject.GetComponent <MinionIdentity>().GetSoleOwner();
        AssignableSlotInstance slot      = soleOwner.GetSlot(clinic2);

        if ((UnityEngine.Object)slot.assignable == (UnityEngine.Object)null)
        {
            Assignable assignable = soleOwner.AutoAssignSlot(clinic2);
            if ((UnityEngine.Object)assignable != (UnityEngine.Object)null)
            {
                clinic = assignable.GetComponent <Clinic>();
            }
        }
        else
        {
            clinic = slot.assignable.GetComponent <Clinic>();
        }
        if ((UnityEngine.Object)clinic != (UnityEngine.Object)null && navigator.CanReach(clinic))
        {
            base.smi.sm.clinic.Set(clinic.gameObject, base.smi);
            base.smi.GoTo(base.smi.sm.incapacitation_root.rescue.waitingForPickup);
        }
    }
示例#3
0
        public void AutoAssignClinic()
        {
            Ownables               soleOwner = base.sm.masterTarget.Get(base.smi).GetComponent <MinionIdentity>().GetSoleOwner();
            AssignableSlot         clinic    = Db.Get().AssignableSlots.Clinic;
            AssignableSlotInstance slot      = soleOwner.GetSlot(clinic);

            if (slot != null && !((Object)slot.assignable != (Object)null))
            {
                soleOwner.AutoAssignSlot(clinic);
            }
        }
示例#4
0
            public static void AutoAssignClinic(WoundMonitor.Instance smi)
            {
                Ownables               component = smi.sm.masterTarget.Get(smi).GetComponent <Ownables>();
                AssignableSlot         clinic    = Db.Get().AssignableSlots.Clinic;
                AssignableSlotInstance slot      = component.GetSlot(clinic);

                if (slot == null || (Object)slot.assignable != (Object)null)
                {
                    return;
                }
                component.AutoAssignSlot(clinic);
            }
        public void UpdateMessStation()
        {
            Ownables          soleOwner            = base.sm.eater.Get(base.smi).GetComponent <MinionIdentity>().GetSoleOwner();
            List <Assignable> preferredAssignables = Game.Instance.assignmentManager.GetPreferredAssignables(soleOwner, Db.Get().AssignableSlots.MessStation);

            if (preferredAssignables.Count == 0)
            {
                soleOwner.AutoAssignSlot(Db.Get().AssignableSlots.MessStation);
                preferredAssignables = Game.Instance.assignmentManager.GetPreferredAssignables(soleOwner, Db.Get().AssignableSlots.MessStation);
            }
            Assignable value = (preferredAssignables.Count <= 0) ? null : preferredAssignables[0];

            base.smi.sm.messstation.Set(value, base.smi);
        }