示例#1
0
        private void Update()
        {
            if (GameManager.Instance.Dungeon == null)
            {
                return;
            }
            RoomHandler absoluteRoomFromPosition     = self.GetAbsoluteRoom();
            List <DeadlyDeadlyGoopManager> roomGoops = absoluteRoomFromPosition.RoomGoops;

            if (roomGoops != null)
            {
                for (int i = 0; i < roomGoops.Count; i++)
                {
                    bool isOverGoop = roomGoops[i].IsPositionInGoop(self.specRigidbody.UnitCenter);
                    if (isOverGoop)
                    {
                        IntVector2 goopedCellVector = (self.specRigidbody.UnitCenter / DeadlyDeadlyGoopManager.GOOP_GRID_SIZE).ToIntVector2(VectorConversions.Floor);

                        DeadlyDeadlyGoopManager currentGoopManager = roomGoops[i];
                        GoopDefinition          currentGoopDef     = currentGoopManager.goopDefinition;
                        if (currentGoopDef.AppliesCharm && currentGoopDef.CharmModifierEffect != null)
                        {
                            self.statusEffectsToApply.Add(currentGoopDef.CharmModifierEffect);
                            if (currentGoopDef.CharmModifierEffect.AppliesTint)
                            {
                                self.AdjustPlayerProjectileTint(currentGoopDef.CharmModifierEffect.TintColor, 2);
                            }
                        }
                        if (currentGoopDef.AppliesCheese && currentGoopDef.CheeseModifierEffect != null)
                        {
                            self.statusEffectsToApply.Add(currentGoopDef.CheeseModifierEffect);
                            if (currentGoopDef.CheeseModifierEffect.AppliesTint)
                            {
                                self.AdjustPlayerProjectileTint(currentGoopDef.CheeseModifierEffect.TintColor, 2);
                            }
                        }
                        if (currentGoopDef.AppliesDamageOverTime && currentGoopDef.HealthModifierEffect != null)
                        {
                            self.statusEffectsToApply.Add(currentGoopDef.HealthModifierEffect);
                            if (currentGoopDef.HealthModifierEffect.AppliesTint)
                            {
                                self.AdjustPlayerProjectileTint(currentGoopDef.HealthModifierEffect.TintColor, 2);
                            }
                        }
                        if ((currentGoopDef.AppliesSpeedModifier || currentGoopDef.AppliesSpeedModifierContinuously) && currentGoopDef.SpeedModifierEffect != null)
                        {
                            self.statusEffectsToApply.Add(currentGoopDef.SpeedModifierEffect);
                            if (currentGoopDef.SpeedModifierEffect.AppliesTint)
                            {
                                self.AdjustPlayerProjectileTint(currentGoopDef.HealthModifierEffect.TintColor, 2);
                            }
                        }
                        if (currentGoopDef.damagesEnemies)
                        {
                            self.baseData.damage += currentGoopDef.damagePerSecondtoEnemies;
                            self.AdjustPlayerProjectileTint(currentGoopDef.baseColor32, 2);
                        }

                        if (currentGoopManager.IsPositionOnFire(self.specRigidbody.UnitCenter))
                        {
                            self.statusEffectsToApply.Add(currentGoopDef.fireEffect);
                            if (currentGoopDef.fireEffect.AppliesTint)
                            {
                                self.AdjustPlayerProjectileTint(currentGoopDef.fireEffect.TintColor, 2);
                            }
                        }
                        if (currentGoopManager.IsPositionFrozen(self.specRigidbody.UnitCenter))
                        {
                            self.statusEffectsToApply.Add(StaticStatusEffects.frostBulletsEffect);
                            self.AdjustPlayerProjectileTint(ExtendedColours.frostBulletsTint, 2);
                        }

                        AbsorbedGoops.Add(currentGoopDef);
                        for (int j = 0; j < StaticReferenceManager.AllGoops.Count; j++)
                        {
                            if (StaticReferenceManager.AllGoops[j])
                            {
                                StaticReferenceManager.AllGoops[j].RemoveGoopCircle(self.specRigidbody.UnitCenter, 0.5f);
                            }
                        }
                    }
                }
            }
        }