Exemple #1
0
    private void OnComponentInit(EntityUid uid, BloodstreamComponent component, ComponentInit args)
    {
        component.ChemicalSolution       = _solutionContainerSystem.EnsureSolution(uid, BloodstreamComponent.DefaultChemicalsSolutionName);
        component.BloodSolution          = _solutionContainerSystem.EnsureSolution(uid, BloodstreamComponent.DefaultBloodSolutionName);
        component.BloodTemporarySolution = _solutionContainerSystem.EnsureSolution(uid, BloodstreamComponent.DefaultBloodTemporarySolutionName);

        component.ChemicalSolution.MaxVolume       = component.ChemicalMaxVolume;
        component.BloodSolution.MaxVolume          = component.BloodMaxVolume;
        component.BloodTemporarySolution.MaxVolume = component.BleedPuddleThreshold * 4; // give some leeway, for chemstream as well

        // Fill blood solution with BLOOD
        _solutionContainerSystem.TryAddReagent(uid, component.BloodSolution, component.BloodReagent,
                                               component.BloodMaxVolume, out _);
    }
 private void OnMetabolizerInit(EntityUid uid, MetabolizerComponent component, ComponentInit args)
 {
     if (!component.SolutionOnBody)
     {
         _solutionContainerSystem.EnsureSolution(uid, component.SolutionName);
     }
     else
     {
         if (EntityManager.TryGetComponent <MechanismComponent>(uid, out var mech))
         {
             if (mech.Body != null)
             {
                 _solutionContainerSystem.EnsureSolution((mech.Body).Owner, component.SolutionName);
             }
         }
     }
 }
Exemple #3
0
 private void OnComponentInit(EntityUid uid, BloodstreamComponent component, ComponentInit args)
 {
     component.Solution = _solutionContainerSystem.EnsureSolution(uid, DefaultSolutionName);
     if (component.Solution != null)
     {
         component.Solution.MaxVolume = component.InitialMaxVolume;
     }
 }
Exemple #4
0
        private void OnComponentStartup(EntityUid uid, SliceableFoodComponent component, ComponentStartup args)
        {
            component.Count = component.TotalCount;
            var foodComp = EntityManager.EnsureComponent <FoodComponent>(uid);

            EntityManager.EnsureComponent <SolutionContainerManagerComponent>(uid);
            _solutionContainerSystem.EnsureSolution(uid, foodComp.SolutionName);
        }
        private void OnDrinkInit(EntityUid uid, DrinkComponent component, ComponentInit args)
        {
            SetOpen(uid, component.DefaultToOpened, component);

            if (EntityManager.TryGetComponent(uid, out DrainableSolutionComponent? existingDrainable))
            {
                // Beakers have Drink component but they should use the existing Drainable
                component.SolutionName = existingDrainable.Solution;
            }
            else
            {
                _solutionContainerSystem.EnsureSolution(uid, component.SolutionName);
            }

            UpdateAppearance(component);
        }
        private void OnInit(EntityUid uid, PuddleComponent component, ComponentInit args)
        {
            var solution = _solutionContainerSystem.EnsureSolution(uid, component.SolutionName);

            solution.MaxVolume = FixedPoint2.New(1000);
        }
 private void OnMetabolizerInit(EntityUid uid, MetabolizerComponent component, ComponentInit args)
 {
     _solutionContainerSystem.EnsureSolution(EntityManager.GetEntity(uid), component.SolutionName);
 }
Exemple #8
0
 private void OnComponentInit(EntityUid uid, LungComponent component, ComponentInit args)
 {
     component.LungSolution           = _solutionContainerSystem.EnsureSolution(uid, LungSolutionName);
     component.LungSolution.MaxVolume = 100.0f;
     component.LungSolution.CanReact  = false; // No dexalin lungs
 }
Exemple #9
0
        private void OnComponentInit(EntityUid uid, StomachComponent component, ComponentInit args)
        {
            var solution = _solutionContainerSystem.EnsureSolution(uid, DefaultSolutionName);

            solution.MaxVolume = component.InitialMaxVolume;
        }