// Token: 0x0600161D RID: 5661 RVA: 0x0025A7DC File Offset: 0x002589DC public void UpdateCapacity() { GATTR_ENUM type = GATTR_ENUM.EGE_PETRSS_CAPACITY; GATTR_ENUM type2 = GATTR_ENUM.EGE_PETRSS_CAPACITY_PERCENT; this.Capacity = 0u; this.Capacity += DataManager.Instance.AttribVal.GetEffectBaseVal(type); ulong num = (ulong)this.Capacity * (ulong)DataManager.Instance.AttribVal.GetEffectBaseVal(type2) / 10000UL; this.Capacity += (uint)num; GameManager.OnRefresh(NetworkNews.Refresh_PetResource, null); }
// Token: 0x06000343 RID: 835 RVA: 0x000289F8 File Offset: 0x00026BF8 public void UpdateCapacity() { GATTR_ENUM type = GATTR_ENUM.EGA_FOOD_CAPACITY; GATTR_ENUM type2 = GATTR_ENUM.EGE_FOOD_CAPACITY_PERCENT; this.Capacity = 15000u; switch (this.Type) { case ResourceType.Grain: type = GATTR_ENUM.EGA_FOOD_CAPACITY; type2 = GATTR_ENUM.EGE_FOOD_CAPACITY_PERCENT; break; case ResourceType.Rock: type = GATTR_ENUM.EGA_ROCK_CAPACITY; type2 = GATTR_ENUM.EGE_ROCK_CAPACITY_PERCENT; break; case ResourceType.Wood: type = GATTR_ENUM.EGA_WOOD_CAPACITY; type2 = GATTR_ENUM.EGE_WOOD_CAPACITY_PERCENT; break; case ResourceType.Steel: type = GATTR_ENUM.EGA_STEEL_CAPACITY; type2 = GATTR_ENUM.EGE_STEEL_CAPACITY_PERCENT; break; case ResourceType.Money: type = GATTR_ENUM.EGA_MONEY_CAPACITY; type2 = GATTR_ENUM.EGE_MONEY_CAPACITY_PERCENT; break; } this.Capacity += DataManager.Instance.AttribVal.GetEffectBaseVal(type); ulong num = (ulong)this.Capacity * (ulong)DataManager.Instance.AttribVal.GetEffectBaseVal(type2) / 10000UL; this.Capacity += (uint)num; GameManager.OnRefresh(NetworkNews.Refresh_Resource, null); }
// Token: 0x060005B5 RID: 1461 RVA: 0x0007E260 File Offset: 0x0007C460 public uint GetEffectBaseVal(GATTR_ENUM Type) { bool flag = false; for (int i = 0; i < this.bUpdate.Length; i++) { if (this.bUpdate[i]) { switch (i) { case 0: BSInvokeUtil.getInstance.updateBuildEffectval(this.UpdateBaseVal[i]); break; case 1: BSInvokeUtil.getInstance.updateTechnlolgyEffectval(this.UpdateBaseVal[i]); break; case 2: this.UpdateHeroCalData(); BSInvokeUtil.getInstance.updateHeroEffectval(this.HeroNum, this.calcHeroData, this.UpdateBaseVal[i]); break; case 3: this.UpdateBuffData(); BSInvokeUtil.getInstance.updateBuffBonus(this.BuffNum, this.BuffItem, this.UpdateBaseVal[i]); break; case 4: BSInvokeUtil.getInstance.updateVIPBonus(this.UpdateBaseVal[i]); break; case 5: BSInvokeUtil.getInstance.updateWonderBonus(this.UpdateBaseVal[i]); break; case 6: BSInvokeUtil.getInstance.updateCastleSkinBonus(this.UpdateBaseVal[i]); break; case 7: BSInvokeUtil.getInstance.updatePetAttribBonum(this.UpdateBaseVal[i]); break; } this.bUpdate[i] = false; flag = true; } } if (this.bUpdateLordEquipVal) { BSInvokeUtil.getInstance.updateLordBonus(this.LordEquipBaseVa); flag = true; } this.bUpdateLordEquipVal = false; if (this.bUpdateTalentVal) { BSInvokeUtil.getInstance.updateTalentval(this.TalentBaseVa); flag = true; } this.bUpdateTalentVal = false; DataManager instance = DataManager.Instance; if (this.bUpdateJailVal) { if (instance.PrisonerHighestLevel != 0) { this.JailAddTroopAtk = (uint)instance.LevelUpTable.GetRecordByKey((ushort)instance.PrisonerHighestLevel).PrisonEffect; } else { this.JailAddTroopAtk = 0u; } flag = true; } this.bUpdateJailVal = false; if (flag) { Array.Clear(this.TotalBaseVal, 0, this.TotalBaseVal.Length); for (int j = 0; j < this.TotalBaseVal.Length; j++) { for (int k = 0; k < this.UpdateBaseVal.Length; k++) { this.TotalBaseVal[j] += this.UpdateBaseVal[k][j]; } } Array.Clear(this.LordBaseVal, 0, this.LordBaseVal.Length); if (instance.beCaptured.nowCaptureStat == LoadCaptureState.None || instance.beCaptured.nowCaptureStat == LoadCaptureState.Returning) { for (int l = 0; l < this.LordBaseVal.Length; l++) { this.LordBaseVal[l] = this.TalentBaseVa[l] + this.LordEquipBaseVa[l]; } } this.TotalBaseVal[15] += this.JailAddTroopAtk; } if (Type == GATTR_ENUM.EGA_WALL_DEFENCE_ADD && instance.beCaptured.nowCaptureStat != LoadCaptureState.None && instance.beCaptured.nowCaptureStat != LoadCaptureState.Returning) { return(0u); } if (instance.beCaptured.nowCaptureStat == LoadCaptureState.None || instance.beCaptured.nowCaptureStat == LoadCaptureState.Returning) { return(this.TotalBaseVal[(int)Type] + this.TalentBaseVa[(int)Type] + this.LordEquipBaseVa[(int)Type]); } return(this.TotalBaseVal[(int)Type]); }
// Token: 0x060019AF RID: 6575 RVA: 0x002B8790 File Offset: 0x002B6990 private CString GetEffectStr(GATTR_ENUM effect, double effectValue) { CString cstring = null; int num = 0; if (this.m_DeshieldCStr != null) { ushort[] array = new ushort[] { 4326, 4327, 4328, 4311, 4312, 4313, 4314, 4316, 4317, 4318, 4319, 4321, 4322, 4323, 4324 }; switch (effect) { case GATTR_ENUM.EGA_DESHIELD_INFANTRY_ATK: cstring = this.m_DeshieldCStr[3]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[3])); break; case GATTR_ENUM.EGA_DESHIELD_CAVALRY_ATK: cstring = this.m_DeshieldCStr[4]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[4])); break; case GATTR_ENUM.EGA_DESHIELD_RANGED_ATK: cstring = this.m_DeshieldCStr[5]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[5])); break; case GATTR_ENUM.EGA_DESHIELD_SIEGE_ATK: cstring = this.m_DeshieldCStr[6]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[6])); break; case GATTR_ENUM.EGA_DESHIELD_INFANTRY_DEF: cstring = this.m_DeshieldCStr[7]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[7])); break; case GATTR_ENUM.EGA_DESHIELD_CAVALRY_DEF: cstring = this.m_DeshieldCStr[8]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[8])); break; case GATTR_ENUM.EGA_DESHIELD_RANGED_DEF: cstring = this.m_DeshieldCStr[9]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[9])); break; case GATTR_ENUM.EGA_DESHIELD_SIEGE_DEF: cstring = this.m_DeshieldCStr[10]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[10])); break; case GATTR_ENUM.EGA_DESHIELD_INFANTRY_HEALTH: cstring = this.m_DeshieldCStr[11]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[11])); break; case GATTR_ENUM.EGA_DESHIELD_CAVALRY_HEALTH: cstring = this.m_DeshieldCStr[12]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[12])); break; case GATTR_ENUM.EGA_DESHIELD_RANGED_HEALTH: cstring = this.m_DeshieldCStr[13]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[13])); break; case GATTR_ENUM.EGA_DESHIELD_SIEGE_HEALTH: cstring = this.m_DeshieldCStr[14]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[14])); break; default: switch (effect) { case GATTR_ENUM.EGE_DESHIELD_ATK: num = 5; cstring = this.m_DeshieldCStr[0]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[0])); break; case GATTR_ENUM.EGE_DESHIELD_DEF: cstring = this.m_DeshieldCStr[1]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[1])); break; case GATTR_ENUM.EGE_DESHIELD_HEALTH: cstring = this.m_DeshieldCStr[2]; cstring.ClearString(); cstring.Append(this.DM.mStringTable.GetStringByID((uint)array[2])); break; } break; } double f = effectValue / 100.0 + (double)num; cstring.DoubleToFormat(f, 2, false); if (this.GM.IsArabic) { cstring.AppendFormat("%{0}"); } else { cstring.AppendFormat("{0}%"); } return(cstring); } return(null); }
// Token: 0x060019AE RID: 6574 RVA: 0x002B85B8 File Offset: 0x002B67B8 private void SetEffectValueCloumText(bool bEnable, int panelObjectIdx, int textIdx, GATTR_ENUM effect, double effectValue, Color c, Vector2 size) { this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].enabled = bEnable; this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].rectTransform.sizeDelta = size; this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].rectTransform.anchoredPosition = new Vector2(10f, 0f); this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].color = c; this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].fontSize = 18; this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].resizeTextMaxSize = 18; this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].alignment = TextAnchor.UpperLeft; if (GUIManager.Instance.IsArabic) { this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].AdjuestUI(); this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].alignment = TextAnchor.UpperRight; } this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].text = this.GetEffectStr(effect, effectValue).ToString(); this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].UpdateArabicPos(); this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].resizeTextForBestFit = true; this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].SetAllDirty(); this.m_ScrollPanelData[panelObjectIdx].m_Text[textIdx].cachedTextGenerator.Invalidate(); this.m_ScrollPanelData[panelObjectIdx].m_Shadow[textIdx].enabled = true; this.m_ScrollPanelData[panelObjectIdx].m_Outline[textIdx].enabled = true; }