Example #1
0
 private void OnDestroy()
 {
     Scene.ActiveMB           = null;
     Scene.GameStats          = null;
     Scene.SceneTracker       = null;
     Scene.MutantControler    = null;
     Scene.MutantSpawnManager = null;
     Scene.Yacht            = null;
     Scene.PlaneCrash       = null;
     Scene.PlaneCrashAnimGO = null;
     Scene.TriggerCutScene  = null;
     Scene.RainFollowGO     = null;
     Scene.RainTypes        = null;
     Scene.WeatherSystem    = null;
     Scene.HudGui           = null;
     Scene.Cams             = null;
     Scene.Clock            = null;
     Scene.Atmosphere       = null;
     Scene.WorkScheduler    = null;
     Scene.LoadSave         = null;
     Scene.PlaneGreebles    = null;
     Scene.OceanFlat        = null;
     Scene.OceanCeto        = null;
     Scene.ShoreMask        = null;
     Scene.SinkHoleCenter   = null;
     Scene.CaveGrounds      = null;
 }
Example #2
0
 private void Awake()
 {
     Scene.ActiveMB           = this;
     Scene.GameStats          = this._gameStats;
     Scene.SceneTracker       = this._sceneTracker;
     Scene.MutantControler    = this._mutantControler;
     Scene.MutantSpawnManager = this._mutantSpawnManager;
     Scene.Yacht            = this._yacht;
     Scene.PlaneCrash       = this._plane;
     Scene.PlaneCrashAnimGO = this._planeCrashAnimGO;
     Scene.TriggerCutScene  = this._triggerCutScene;
     Scene.RainFollowGO     = this._rainFollowGO;
     Scene.RainTypes        = this._rainTypes;
     Scene.WeatherSystem    = this._weatherSystem;
     Scene.HudGui           = this._hudGui;
     Scene.Cams             = this._cams;
     Scene.Clock            = this._clock;
     Scene.Atmosphere       = this._atmos;
     Scene.WorkScheduler    = this._workScheduler;
     Scene.LoadSave         = this._loadSave;
     Scene.PlaneGreebles    = this._planeGreebles;
     Scene.OceanFlat        = this._oceanFlat;
     Scene.OceanCeto        = this._oceanCeto;
     Scene.ShoreMask        = this._shoreMask;
     Scene.SinkHoleCenter   = this._sinkHoleCenter;
     Scene.CaveGrounds      = this._caveGrounds;
 }
Example #3
0
 private void Start()
 {
     this.Hud = Scene.HudGui;
     base.InvokeRepeating("Life", 1f, 1f);
 }
Example #4
0
 private string GotItemText(HudGui.InventoryItemInfo iii, int amount)
 {
     string text;
     if (amount > 1)
     {
         text = amount + " " + (string.IsNullOrEmpty(iii._titlePluralText) ? iii._titleText : iii._titlePluralText);
     }
     else
     {
         text = iii._titleText;
     }
     if (iii._showCollectedItem)
     {
         text += " collected";
     }
     else
     {
         text += this._gotItemText;
     }
     return text;
 }
Example #5
0
 private void Start()
 {
     this.Hud = Scene.HudGui;
     base.InvokeRepeating("Life", 1f, 1f);
 }
Example #6
0
 private void Awake()
 {
     BleedBehavior.BloodAmount = 0f;
     BleedBehavior.BloodReductionRatio = 1f;
     this.explodeHash = Animator.StringToHash("explode");
     this.DSpots = GameObject.FindWithTag("DeadSpots").GetComponent<DeadSpotController>();
     this.Hud = Scene.HudGui;
     this.Ocean = GameObject.FindWithTag("Ocean");
     this.mutantControl = Scene.MutantControler;
     this.sceneInfo = Scene.SceneTracker;
     this.Player = base.gameObject.GetComponent<PlayerInventory>();
     this.camFollow = base.GetComponentInChildren<camFollowHead>();
     this.hitReaction = base.GetComponent<playerHitReactions>();
     this.Atmos = Scene.Atmosphere;
     this.FrostScript = LocalPlayer.MainCam.GetComponent<Frost>();
     this.Tuts = LocalPlayer.Tuts;
     this.Sfx = LocalPlayer.Sfx;
     this.animator = LocalPlayer.Animator;
     this.DyingVision = LocalPlayer.MainCam.GetComponent<Grayscale>();
     this.Fullness = 1f;
     this.bloodPropertyBlock = new MaterialPropertyBlock();
     if (!LevelSerializer.IsDeserializing)
     {
         CoopPlayerVariations component = base.GetComponent<CoopPlayerVariations>();
         this.PlayerVariation = UnityEngine.Random.Range(0, component.Variations.Length);
         this.PlayerVariationBody = UnityEngine.Random.Range(0, component.BodyMaterials.Length);
     }
     if (this.CurrentArmorTypes == null || this.CurrentArmorTypes.Length != this.ArmorModel.Length)
     {
         this.CurrentArmorTypes = new PlayerStats.ArmorTypes[this.ArmorModel.Length];
         for (int i = 0; i < this.CurrentArmorTypes.Length; i++)
         {
             this.CurrentArmorTypes[i] = PlayerStats.ArmorTypes.None;
             this.ArmorModel[i].SetActive(false);
         }
     }
     if (this.CurrentArmorHP == null || this.CurrentArmorHP.Length != this.ArmorModel.Length)
     {
         this.CurrentArmorHP = new int[this.ArmorModel.Length];
     }
     this.CaveDoors = GameObject.FindGameObjectsWithTag("CaveDoor");
 }
Example #7
0
 private void Awake()
 {
     Scene.ActiveMB = this;
     Scene.GameStats = this._gameStats;
     Scene.SceneTracker = this._sceneTracker;
     Scene.MutantControler = this._mutantControler;
     Scene.MutantSpawnManager = this._mutantSpawnManager;
     Scene.Yacht = this._yacht;
     Scene.PlaneCrash = this._plane;
     Scene.PlaneCrashAnimGO = this._planeCrashAnimGO;
     Scene.TriggerCutScene = this._triggerCutScene;
     Scene.RainFollowGO = this._rainFollowGO;
     Scene.RainTypes = this._rainTypes;
     Scene.WeatherSystem = this._weatherSystem;
     Scene.HudGui = this._hudGui;
     Scene.Cams = this._cams;
     Scene.Clock = this._clock;
     Scene.Atmosphere = this._atmos;
     Scene.WorkScheduler = this._workScheduler;
     Scene.LoadSave = this._loadSave;
     Scene.PlaneGreebles = this._planeGreebles;
     Scene.OceanFlat = this._oceanFlat;
     Scene.OceanCeto = this._oceanCeto;
     Scene.ShoreMask = this._shoreMask;
     Scene.SinkHoleCenter = this._sinkHoleCenter;
     Scene.CaveGrounds = this._caveGrounds;
 }
Example #8
0
 private void OnDestroy()
 {
     Scene.ActiveMB = null;
     Scene.GameStats = null;
     Scene.SceneTracker = null;
     Scene.MutantControler = null;
     Scene.MutantSpawnManager = null;
     Scene.Yacht = null;
     Scene.PlaneCrash = null;
     Scene.PlaneCrashAnimGO = null;
     Scene.TriggerCutScene = null;
     Scene.RainFollowGO = null;
     Scene.RainTypes = null;
     Scene.WeatherSystem = null;
     Scene.HudGui = null;
     Scene.Cams = null;
     Scene.Clock = null;
     Scene.Atmosphere = null;
     Scene.WorkScheduler = null;
     Scene.LoadSave = null;
     Scene.PlaneGreebles = null;
     Scene.OceanFlat = null;
     Scene.OceanCeto = null;
     Scene.ShoreMask = null;
     Scene.SinkHoleCenter = null;
     Scene.CaveGrounds = null;
 }
Example #9
0
        public void CheckForValidRecipe()
        {
            if (this.CheckStorage())
            {
                return;
            }
            IOrderedEnumerable <Receipe> orderedEnumerable  = null;
            IOrderedEnumerable <Receipe> orderedEnumerable2 = null;

            if (this._ingredients.Count > 0)
            {
                orderedEnumerable = from ar in this._receipeBook.AvailableReceipesCache
                                    where this._ingredients.All((ReceipeIngredient i) => ar._ingredients.Any((ReceipeIngredient i2) => i._itemID == i2._itemID))
                                    where this.CanCarryProduct(ar)
                                    orderby ar._ingredients.Length
                                    select ar;
                orderedEnumerable2 = from ar in this._receipeBook.AvailableUpgradeCache
                                     where this._ingredients.All((ReceipeIngredient i) => ar._ingredients.Any((ReceipeIngredient i2) => i._itemID == i2._itemID))
                                     where this.CanCarryProduct(ar)
                                     orderby ar._ingredients.Length
                                     select ar;
                this._validRecipe = orderedEnumerable.FirstOrDefault <Receipe>();
            }
            else
            {
                this._validRecipe = null;
            }
            bool flag = this._validRecipe != null;

            if (flag)
            {
                if (!this.CanCarryProduct(this._validRecipe))
                {
                    Scene.HudGui.CraftingReceipeBacking.gameObject.SetActive(false);
                    this._validRecipeFull = true;
                    flag = false;
                }
                else
                {
                    int num  = 0;
                    int num2 = this._validRecipe._ingredients.Sum((ReceipeIngredient i) => i._amount);
                    foreach (ReceipeIngredient cogIngredients in this._ingredients)
                    {
                        ReceipeIngredient receipeIngredient = this._validRecipe._ingredients.First((ReceipeIngredient i) => i._itemID == cogIngredients._itemID);
                        if (cogIngredients._amount > receipeIngredient._amount)
                        {
                            this._validRecipe = null;
                            flag = false;
                            break;
                        }
                        num += cogIngredients._amount;
                    }
                    this._validRecipeFull = false;
                    this._validRecipeFill = (float)num / (float)num2;
                    HudGui arg_25D_0 = Scene.HudGui;
                    IOrderedEnumerable <Receipe> arg_25D_1;
                    if (flag)
                    {
                        IOrderedEnumerable <Receipe> orderedEnumerable3 = from r in orderedEnumerable.Concat(orderedEnumerable2)
                                                                          orderby r._type, r._ingredients.Length
                        select r;
                        arg_25D_1 = orderedEnumerable3;
                    }
                    else
                    {
                        arg_25D_1 = null;
                    }
                    arg_25D_0.ShowValidCraftingRecipes(arg_25D_1);
                    Scene.HudGui.CraftingReceipeBacking.gameObject.SetActive(false);
                    if (num != num2 && flag)
                    {
                        Scene.HudGui.CraftingReceipeBacking.gameObject.SetActive(true);
                        Scene.HudGui.CraftingReceipeProgress.fillAmount = this._validRecipeFill;
                        flag = false;
                        this._validRecipe = null;
                    }
                }
            }
            else
            {
                Scene.HudGui.ShowValidCraftingRecipes(orderedEnumerable2);
                Scene.HudGui.CraftingReceipeBacking.gameObject.SetActive(false);
            }
            if (flag)
            {
                Scene.HudGui.HideUpgradesDistribution();
                this._craftSfx2Emitter.Play();
                base.gameObject.GetComponent <Renderer>().enabled = true;
            }
            if (!flag || !this.CanCraft)
            {
                this.CheckForValidUpgrade();
            }
        }
Example #10
0
 public void ShowReceipe(Receipe receipe, HudGui.InventoryItemInfo iii)
 {
     if (iii != null)
     {
         this._icon.mainTexture = iii._icon;
         this._icon.enabled = true;
     }
     else
     {
         this._icon.enabled = false;
     }
     if (receipe._type == Receipe.Types.Craft)
     {
         this._title.text = ((iii == null) ? ItemDatabase.ItemById(receipe._productItemID)._name : iii._titleText);
         if (receipe._productItemAmount > 1)
         {
             UILabel expr_82 = this._title;
             expr_82.text = expr_82.text + " x" + receipe._productItemAmount;
         }
     }
     else
     {
         string name = ItemDatabase.ItemById(receipe._ingredients[1]._itemID)._name;
         string text = name;
         switch (text)
         {
         case "Feather":
             this._title.text = "+Speed ";
             goto IL_29B;
         case "Tooth":
             this._title.text = "+Damage -Speed ";
             goto IL_29B;
         case "Booze":
             if (!this.CheckUpgradeBonus(receipe))
             {
                 this._title.text = "+Damage ";
             }
             goto IL_29B;
         case "Treesap":
             this._title.text = "Sticky ";
             goto IL_29B;
         case "Cloth":
             this._title.text = "Burning ";
             goto IL_29B;
         case "OrangePaint":
             this._title.text = "Orange ";
             goto IL_29B;
         case "BluePaint":
             this._title.text = "Blue ";
             goto IL_29B;
         case "Battery":
             this._title.text = "Recharged ";
             goto IL_29B;
         case "Cassette 1":
         case "Cassette 2":
         case "Cassette 3":
         case "Cassette 4":
         case "Cassette 5":
             this._title.text = name + " ";
             goto IL_29B;
         }
         this._title.text = string.Empty;
         IL_29B:
         UILabel expr_2A1 = this._title;
         expr_2A1.text += ((iii == null) ? ItemDatabase.ItemById(receipe._productItemID)._name : iii._titleText);
     }
 }