void DoBuffInfo() { Texture2D startTex = TerritoryRed; int territoryPersent = 0; int redT = Mathf.RoundToInt((float)rc.PlayerATerritory.Count / (float)allMaps * 100.0f); int yelT = Mathf.RoundToInt((float)rc.PlayerBTerritory.Count / (float)allMaps * 100.0f); int buffX = 0; int buffRate = 0; if (mainInfoUI.playerSide == 1) { territoryPersent = redT; startTex = TerritoryRed; } else { territoryPersent = yelT; startTex = TerritoryYel; } buffX = BuffCalculation.BuffXValue(territoryPersent); buffRate = BuffCalculation.BuffRateValue(territoryPersent); GUI.DrawTexture(territoryStart, startTex); GUI.Label(new Rect(territoryStart.x + 30.0f, territoryStart.y, 60.0f, 24.0f), territoryPersent.ToString() + "%", numberStyle[0]); GUI.DrawTexture(new Rect(territoryStart.x + 90.0f, territoryStart.y + 4, 20, 20), iconVault.BuffInt[0]); GUI.Label(new Rect(territoryStart.x + 112, territoryStart.y + 4, 40, 20), "+" + buffX.ToString(), numberStyle[1]); GUI.DrawTexture(new Rect(territoryStart.x + 152, territoryStart.y + 4, 20, 20), iconVault.BuffInt[1]); GUI.Label(new Rect(territoryStart.x + 174, territoryStart.y + 4, 40, 20), "-" + buffX.ToString(), numberStyle[1]); GUI.DrawTexture(new Rect(territoryStart.x + 214, territoryStart.y + 4, 20, 20), iconVault.BuffRate[0]); GUI.Label(new Rect(territoryStart.x + 236, territoryStart.y + 4, 40, 20), "+" + buffRate.ToString(), numberStyle[1]); GUI.DrawTexture(new Rect(territoryStart.x + 276, territoryStart.y + 4, 20, 20), iconVault.BuffRate[1]); GUI.Label(new Rect(territoryStart.x + 298, territoryStart.y + 4, 40, 20), "-" + buffRate.ToString(), numberStyle[1]); }
void updateAllCharactersPowers() { foreach (Transform character in AllChesses) { BuffCalculation buffCal = new BuffCalculation(character); buffCal.UpdateBuffValue(); } }
public void Execute() { BuffSlidingUI bSUI = Camera.mainCamera.GetComponent <BuffSlidingUI>(); aider.GetComponent <CharacterPassive>().PassiveDict[mode] = true; BuffCalculation bCal = new BuffCalculation(aider); foreach (var pair in PowerList) { switch (pair.Key) { case PowerType.Critical: aider.GetComponent <BuffList>().ExtraDict[BuffType.CriticalHit] += pair.Value; BuffVisualUI(BuffType.CriticalHit, pair.Value, bSUI); MapHelper.SetFX(aider, fxBuffCritiq, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.Damage: aider.GetComponent <BuffList>().ExtraDict[BuffType.Attack] += pair.Value; BuffVisualUI(BuffType.Attack, pair.Value, bSUI); MapHelper.SetFX(aider, fxBuffAtk, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.Hp: aider.GetComponent <BuffList>().ExtraDict[BuffType.Defense] += pair.Value; BuffVisualUI(BuffType.Defense, pair.Value, bSUI); MapHelper.SetFX(aider, fxBuffDef, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.SkillRate: aider.GetComponent <BuffList>().ExtraDict[BuffType.SkillRate] += pair.Value; BuffVisualUI(BuffType.SkillRate, pair.Value, bSUI); MapHelper.SetFX(aider, fxBuffSkill, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.MoveRange: aider.GetComponent <BuffList>().ExtraDict[BuffType.MoveRange] += pair.Value; BuffVisualUI(BuffType.MoveRange, pair.Value, bSUI); MapHelper.SetFX(aider, fxBuffMove, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.AttackRange: aider.GetComponent <BuffList>().ExtraDict[BuffType.AttackRange] += pair.Value; BuffVisualUI(BuffType.AttackRange, pair.Value, bSUI); MapHelper.SetFX(aider, fxBuffRange, 4.0f); bCal.UpdateBuffValue(); break; } } }
public void Execute() { BuffCalculation bCal = new BuffCalculation(target); BuffSlidingUI bSUI = Camera.mainCamera.GetComponent <BuffSlidingUI>(); switch (mode) { case PowerType.Critical: target.GetComponent <BuffList>().ExtraDict[BuffType.CriticalHit] += Value; BuffVisualUI(BuffType.CriticalHit, Value, bSUI); MapHelper.SetFX(target, fxBuffCritiq, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.Damage: target.GetComponent <BuffList>().ExtraDict[BuffType.Attack] += Value; BuffVisualUI(BuffType.Attack, Value, bSUI); MapHelper.SetFX(target, fxBuffAtk, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.Hp: target.GetComponent <BuffList>().ExtraDict[BuffType.Defense] += Value; BuffVisualUI(BuffType.Defense, Value, bSUI); MapHelper.SetFX(target, fxBuffDef, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.SkillRate: target.GetComponent <BuffList>().ExtraDict[BuffType.SkillRate] += Value; BuffVisualUI(BuffType.SkillRate, Value, bSUI); MapHelper.SetFX(target, fxBuffSkill, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.MoveRange: target.GetComponent <BuffList>().ExtraDict[BuffType.MoveRange] += Value; BuffVisualUI(BuffType.MoveRange, Value, bSUI); MapHelper.SetFX(target, fxBuffMove, 4.0f); bCal.UpdateBuffValue(); break; case PowerType.AttackRange: target.GetComponent <BuffList>().ExtraDict[BuffType.AttackRange] += Value; BuffVisualUI(BuffType.AttackRange, Value, bSUI); MapHelper.SetFX(target, fxBuffRange, 4.0f); bCal.UpdateBuffValue(); break; } }
public void Execute() { BuffSlidingUI bSUI = Camera.mainCamera.GetComponent <BuffSlidingUI>(); IList atkList = new List <Transform>(); Transform localMap = aider.GetComponent <CharacterSelect>().getMapPosition(); Transform[] attackableMaps = localMap.GetComponent <Identy>().neighbor; foreach (Transform unit in attackableMaps) { if ((unit != null) && MapHelper.IsMapOccupied(unit)) { Transform character = MapHelper.GetMapOccupiedObj(unit); if (character.GetComponent <CharacterProperty>().Player == aider.GetComponent <CharacterProperty>().Player) { atkList.Add(character); } } } if (atkList.Count > 0) { foreach (Transform target in atkList) { // update data target.GetComponent <BuffList>().ExtraDict[BuffType.Defense] += 1; target.GetComponent <BuffList>().ExtraDict[BuffType.Attack] += 1; BuffCalculation buffCal = new BuffCalculation(target); buffCal.UpdateBuffValue(); //show Visual UI Dictionary <BuffType, int> dict = new Dictionary <BuffType, int>(); dict.Add(BuffType.Defense, 1); dict.Add(BuffType.Attack, 1); BuffUI bUI = new BuffUI(target, dict); bSUI.UIItems.Add(bUI); MapHelper.SetFX(target, fxBuffAtk, 4.0f); MapHelper.SetFX(target, fxBuffDef, 4.0f); } } bSUI.FadeInUI = true; }
public void Execute() { aider.GetComponent <CharacterPassive>().PassiveDict[PassiveType.Flying] = false; BuffCalculation bCal = new BuffCalculation(aider); switch (mode) { case PowerType.Critical: aider.GetComponent <BuffList>().ExtraDict[BuffType.CriticalHit] += Value; bCal.UpdateBuffValue(); break; case PowerType.Damage: aider.GetComponent <BuffList>().ExtraDict[BuffType.Attack] += Value; bCal.UpdateBuffValue(); break; case PowerType.Hp: aider.GetComponent <BuffList>().ExtraDict[BuffType.Defense] += Value; bCal.UpdateBuffValue(); break; case PowerType.SkillRate: aider.GetComponent <BuffList>().ExtraDict[BuffType.SkillRate] += Value; bCal.UpdateBuffValue(); break; case PowerType.MoveRange: aider.GetComponent <BuffList>().ExtraDict[BuffType.MoveRange] += Value; bCal.UpdateBuffValue(); break; case PowerType.AttackRange: aider.GetComponent <BuffList>().ExtraDict[BuffType.AttackRange] += Value; bCal.UpdateBuffValue(); break; } }