Ejemplo n.º 1
0
        protected override void SetInitialValues()
        {
            _animatorVariables = new PlayerAnimatorVariables();
            _cinemachine       = GameObject.FindObjectOfType <CinemachineVirtualCamera>();
            _uIManager         = GameObject.FindObjectOfType <UIManager>();
            _playerStateManage = GameObject.FindObjectOfType <PlayerStateManager>();
            _activePlayerUI    = GameObject.FindObjectOfType <ActivePlayersUIComponent>();
            _animator          = this.GetComponent <Animator>();
            _audioComponent    = this.GetComponent <AudioComponent>();

            _damageDealerComponent = this.GetComponent <DamageDealerComponent>();
            _damageTakerComponent  = this.GetComponent <DamageTakerComponent>();

            _miniMapComponent = GameObject.FindObjectOfType <MiniMapComponent>();


            if (_canMoveByClick)
            {
                _movementMouseComponent = this.GetComponent <MovementMouseComponent>();
            }
            if (_canInteract)
            {
                _interactableComponent = this.GetComponent <InteractableComponent>();
            }
            if (_canPoop)
            {
                _stomachComponent = this.GetComponent <StomachComponent>();
            }
        }
Ejemplo n.º 2
0
        public void Anim_SpawnPoop()
        {
            GameObject gameObject = Instantiate(_genericPoopComponent, _spawnSpot.position, Quaternion.identity);

            gameObject.GetComponent <GenericPoopComponent>().SetCurrentPoopScriptable(_currentPoop, _poopedBy);

            _currentPoop = null;
            _poopedBy    = null;
        }
Ejemplo n.º 3
0
        protected override void SetInitialValues()
        {
            _inputManager             = GameObject.FindObjectOfType <InputManager>();
            _playerStateManager       = GameObject.FindObjectOfType <PlayerStateManager>();
            _uiManager                = GameObject.FindObjectOfType <UIManager>();
            _animator                 = this.GetComponent <Animator>();
            _currentInteractableState = EnumInteractableState.Nothing;
            _stomachComponent         = this.GetComponent <StomachComponent>();

            _animatorVariables = new InteractableAnimatorVariables();
        }
Ejemplo n.º 4
0
 private void OnApplyMetabolicMultiplier(EntityUid uid, StomachComponent component, ApplyMetabolicMultiplierEvent args)
 {
     if (args.Apply)
     {
         component.UpdateInterval *= args.Multiplier;
         return;
     }
     // This way we don't have to worry about it breaking if the stasis bed component is destroyed
     component.UpdateInterval /= args.Multiplier;
     // Reset the accumulator properly
     if (component.AccumulatedFrameTime >= component.UpdateInterval)
     {
         component.AccumulatedFrameTime = component.UpdateInterval;
     }
 }
Ejemplo n.º 5
0
        public void TurnItIntoAPoop(PoopScriptable poopScriptable, StomachComponent poopedBy)
        {
            // => Player Structure
            _poopedBy = poopedBy;
            _animator.runtimeAnimatorController = poopScriptable.PoopAnimator;
            _isMainPlayer          = false;
            _canMoveByClick        = poopScriptable.CanMoveByClick;
            _canInteract           = poopScriptable.CanInteract;
            _canPoop               = poopScriptable.CanPoop;
            _spriteForActiveStatus = poopScriptable.SpriteForActiveStatus;

            // => Interact Component
            this._interactableComponent.TurnItIntoAPoop(poopScriptable);

            // => DamageTakerOptions
            _damageTakerComponent.TurnItIntoAPoop(poopScriptable);

            // => DamageDealerOptions
            _damageDealerComponent.TurnItIntoAPoop(poopScriptable);

            this.StartCoroutine(StartDeathCooldown(poopScriptable.DeathCooldown));
        }
Ejemplo n.º 6
0
 public void SetCurrentPoop(PoopScriptable currentPoop, StomachComponent poopedBy)
 {
     _currentPoop = currentPoop;
     _poopedBy    = poopedBy;
     _animator.SetTrigger(_animatorVariables.StartPoop);
 }
Ejemplo n.º 7
0
        private void LoadEntities()
        {
            throw new NotImplementedException();
            int entitesCount     = _savedComponents.Positions.Length;
            int?firstEntityIndex = null;

            _context.ReplacePlayerEntity(_savedComponents.PlayerEntityId);
            for (int i = 0; i < entitesCount; i++)
            {
                GameEntity entity = _context.CreateEntity();
                if (!firstEntityIndex.HasValue)
                {
                    firstEntityIndex = entity.creationIndex;
                }
                int currentEntityIndex = entity.creationIndex;
                int componentIndex     = currentEntityIndex - firstEntityIndex.Value;

                IdComponent savedId = _savedComponents.Ids[componentIndex];
                entity.ReplaceId(savedId.Id);

                bool[] componentPresence = _savedComponents.EntityToHasComponent[savedId.Id];

                PositionComponent savedPosition = _savedComponents.Positions[componentIndex];
                if (componentPresence[GameComponentsLookup.Position])
                {
                    entity.AddPosition(savedPosition.Position);
                    entity.AddPositionAfterLastTurn(default(Position));
                }

                VisionComponent savedVision = _savedComponents.Visions[componentIndex];
                if (componentPresence[GameComponentsLookup.Vision])
                {
                    entity.AddVision(savedVision.VisionRange, savedVision.PerceptionRange,
                                     savedVision.EntitiesNoticed ?? new HashSet <Guid>());
                }

                RecipeeComponent savedRecipee = _savedComponents.Recipees[componentIndex];
                if (componentPresence[GameComponentsLookup.Recipee])
                {
                    entity.AddRecipee(savedRecipee.RecipeeName);
                }

                EnergyComponent savedEnergy = _savedComponents.Energies[componentIndex];
                if (componentPresence[GameComponentsLookup.Energy])
                {
                    entity.AddEnergy(savedEnergy.EnergyGainPerSegment, savedEnergy.Energy);
                }

                IntegrityComponent savedIntegrity = _savedComponents.Integrities[componentIndex];
                if (componentPresence[GameComponentsLookup.Integrity])
                {
                    entity.AddIntegrity(savedIntegrity.Integrity, savedIntegrity.MaxIntegrity);
                }

                SkillsComponent savedSkill = _savedComponents.Skills[componentIndex];
                if (componentPresence[GameComponentsLookup.Skills])
                {
                    entity.AddSkills(savedSkill.Skills);
                }

                StomachComponent savedStomach = _savedComponents.Stomachs[componentIndex];
                if (componentPresence[GameComponentsLookup.Stomach])
                {
                    entity.AddStomach(savedStomach.Satiation, savedStomach.MaxSatiation);
                }

                TeamComponent savedTeam = _savedComponents.Teams[componentIndex];
                if (componentPresence[GameComponentsLookup.Team])
                {
                    entity.AddTeam(savedTeam.Team);
                }

                LooksComponent savedLooks = _savedComponents.Looks[componentIndex];
                if (componentPresence[GameComponentsLookup.Looks])
                {
                    entity.AddLooks(savedLooks.BodySprite);
                }

                EdibleComponent savedEdible = _savedComponents.Edibles[componentIndex];
                if (componentPresence[GameComponentsLookup.Edible])
                {
                    entity.AddEdible(savedEdible.Satiety);
                }

                if (componentPresence[GameComponentsLookup.BlockingPosition])
                {
                    entity.isBlockingPosition = true;
                }

                entity.isFinishedTurn = true;
                if (_context.playerEntity.Id == entity.id.Id)
                {
                    entity.isPlayerControlled = true;
                }
            }
        }
Ejemplo n.º 8
0
 public void SetCurrentPoopScriptable(PoopScriptable poop, StomachComponent poopedBy)
 {
     _currentPoop = poop;
     _poopedBy    = poopedBy;
 }
Ejemplo n.º 9
0
        private void OnComponentInit(EntityUid uid, StomachComponent component, ComponentInit args)
        {
            var solution = _solutionContainerSystem.EnsureSolution(uid, DefaultSolutionName);

            solution.MaxVolume = component.InitialMaxVolume;
        }