Exemplo n.º 1
0
 public static void AddOrUpdateLegionfallBuilding(MobileContribution contribution)
 {
     if (LegionfallData.instance.m_legionfallDictionary.ContainsKey(contribution.ContributionID))
     {
         LegionfallData.instance.m_legionfallDictionary.Remove(contribution.ContributionID);
     }
     LegionfallData.MobileContributionData mobileContributionData = default(LegionfallData.MobileContributionData);
     mobileContributionData.contribution          = contribution;
     mobileContributionData.underAttackExpireTime = 0L;
     LegionfallData.instance.m_legionfallDictionary.Add(contribution.ContributionID, mobileContributionData);
 }
Exemplo n.º 2
0
 private void Update()
 {
     if (this.m_lootDisplayPending && this.m_contributeButton.interactable)
     {
         this.m_delayBeforeShowingLoot -= Time.deltaTime;
         if (this.m_delayBeforeShowingLoot > 0f)
         {
             return;
         }
     }
     if (this.m_delayBeforeShowingLoot <= 0f && this.m_lootDisplayTimeRemaining > 0f && this.m_lootItemQuantity > 0)
     {
         if (!this.m_gotLootArea.activeSelf)
         {
             Main.instance.m_UISound.Play_GetItem();
             this.m_gotLootArea.SetActive(true);
             this.m_lootAreaCanvasGroup.alpha = 0f;
             iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
             {
                 "name",
                 "Fade Loot In",
                 "from",
                 0f,
                 "to",
                 1f,
                 "easeType",
                 "easeOutCubic",
                 "time",
                 0.5f,
                 "onupdate",
                 "FadeLootInCallback",
                 "oncomplete",
                 "FadeLootInCompleteCallback"
             }));
         }
         ItemRec record = StaticDB.itemDB.GetRecord(this.m_lootItemID);
         if (record != null)
         {
             this.m_gotLootItemName.text = record.Display + ((this.m_lootItemQuantity != 1) ? (" (" + this.m_lootItemQuantity + "x)") : string.Empty);
         }
         else
         {
             this.m_gotLootItemName.text = "???" + ((this.m_lootItemQuantity != 1) ? (" (" + this.m_lootItemQuantity + "x)") : string.Empty);
         }
         this.m_rewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, this.m_lootItemID, 1, 0, 0);
         this.m_lootDisplayTimeRemaining -= Time.deltaTime;
     }
     else if (this.m_lootDisplayTimeRemaining <= 0f && this.m_lootDisplayPending)
     {
         if (this.m_gotLootArea.activeSelf)
         {
             iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
             {
                 "name",
                 "Fade Loot Out",
                 "from",
                 0f,
                 "to",
                 1f,
                 "easeType",
                 "easeOutCubic",
                 "time",
                 0.5f,
                 "onupdate",
                 "FadeLootOutCallback",
                 "oncomplete",
                 "FadeLootOutCompleteCallback"
             }));
         }
         this.m_lootDisplayPending = false;
     }
     if (LegionfallData.legionfallDictionary.ContainsKey(this.m_contributionID))
     {
         LegionfallData.MobileContributionData mobileContributionData = (LegionfallData.MobileContributionData)LegionfallData.legionfallDictionary[this.m_contributionID];
         MobileContribution contribution = mobileContributionData.contribution;
         if (contribution.State == 3)
         {
             if (mobileContributionData.underAttackExpireTime == 0L)
             {
                 mobileContributionData.underAttackExpireTime = GarrisonStatus.CurrentTime() + (long)mobileContributionData.contribution.CurrentValue;
             }
             long num = mobileContributionData.underAttackExpireTime - GarrisonStatus.CurrentTime();
             num = ((num <= 0L) ? 0L : num);
             Duration duration = new Duration((int)num, false);
             this.m_healthText.text            = StaticDB.GetString("TIME_LEFT", null) + " " + duration.DurationString;
             this.m_progressFillBar.fillAmount = contribution.CurrentValue / contribution.UpperValue;
         }
     }
 }