public void setData(GameItem i, bool b, bool bc) { clear(); if (i == null) { return; } item = i; text.text = i.Name; money.text = GameDefine.getBigInt(bc ? i.Price.ToString() : (i.Price / 2).ToString()); moneyImg.gameObject.SetActive(true); if (b) { icon[(int)item.ItemType].gameObject.SetActive(true); } else { icon1[(int)item.ItemType].gameObject.SetActive(true); } }
public void setValue(int hp) { if (start) { pos = movePos; updatePosition(); } if (hp < 0) { hp = 0; } float v = hp / (float)maxHP; movePos = (101.0f - v * 101.0f); dis = 0.0f; textHP.text = GameDefine.getBigInt(hp.ToString(), true); if (right) { transYellow.anchoredPosition = new Vector2(2 + movePos, 0.0f); } else { transYellow.anchoredPosition = new Vector2(-2 - movePos, 0.0f); } white.gameObject.SetActive(true); times = 10; start = true; }
public void show(int itemID, int gold, OnEventOver over) { onEventOver = over; show(); string str; if (itemID != GameDefine.INVALID_ID) { str = GameMessageData.instance.getData(GameMessageType.Get1).message[0][1]; GameItem item = GameItemData.instance.getData(itemID); str = str.Replace("0", item.Name); } else { str = GameMessageData.instance.getData(GameMessageType.Get1).message[0][0]; str = str.Replace("0", GameDefine.getBigInt(gold.ToString())); } text.text = str; time = 0.0f; }
public void jump(int hp, int mp, GameSkillResutlType type, GameSkillOtherEffect otherType, OnEventOver over) { clear(); gameObject.SetActive(true); onEventOver = over; jumpCount = 0; RectTransform trans = GetComponent <RectTransform>(); position = trans.anchoredPosition; string str = GameDefine.getBigInt(hp.ToString()); if (mp != 0) { str = GameDefine.getBigInt(mp.ToString()); } float ox = 6.0f * str.Length / 2.0f; for (int i = 0; i < str.Length; i++) { GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>("Prefab/TextUI")); trans = obj.GetComponent <RectTransform>(); trans.SetParent(transform); trans.anchoredPosition = new Vector2(-ox + i * 6.0f, 0.0f); trans.localScale = new Vector3(0.5f, 0.5f, 0.5f); GameBattleJumpHPUIText jumpText = obj.GetComponent <GameBattleJumpHPUIText>(); jumpText.jump(-i * 0.1f, onJumpOver); Text text = obj.GetComponent <Text>(); text.text = str.Substring(i, 1); if (type == GameSkillResutlType.Cure || otherType == GameSkillOtherEffect.HealAll) { text.color = new Color(0.0f, 1.0f, 0.0f); } if (hp < 0 || mp < 0) { text.color = new Color(0.0f, 1.0f, 0.0f); } if (mp > 0) { text.color = new Color(0.0f, 0.9f, 1.0f); } objs.Add(obj); } }
public void updateText() { if (bagUI0.Enabled) { itemText.text = bagUI0.getItemDes(); } else { itemText.text = bagUI1.getItemDes(); } moneyText.text = GameDefine.getBigInt(GameUserData.instance.Gold.ToString()); }
public void jump(GameBattleAttackResultSide side, int hp, OnEventOver over) { clear(); gameObject.SetActive(true); RectTransform trans = GetComponent <RectTransform>(); if (side == GameBattleAttackResultSide.Right) { trans.anchoredPosition = new Vector2(-40.0f, 30.0f); } else { trans.anchoredPosition = new Vector2(54.0f, -24.0f); } position = trans.anchoredPosition; onEventOver = over; jumpCount = 0; string str = GameDefine.getBigInt(hp.ToString()); float ox = 6.0f * str.Length / 2.0f; for (int i = 0; i < str.Length; i++) { GameObject obj = Instantiate <GameObject>(Resources.Load <GameObject>("Prefab/TextUI")); trans = obj.GetComponent <RectTransform>(); trans.SetParent(transform); trans.anchoredPosition = new Vector2(-ox + i * 6.0f, 0.0f); trans.localScale = new Vector3(0.5f, 0.5f, 0.5f); GameBattleJumpHPUIText jumpText = obj.GetComponent <GameBattleJumpHPUIText>(); jumpText.jump(-i * 0.1f, onJumpOver); Text text = obj.GetComponent <Text>(); text.text = str.Substring(i, 1); if (hp < 0) { text.color = new Color(0.0f, 1.0f, 0.0f, 1.0f); } objs.Add(obj); } }
public void updateData() { GameBattleStage stage = GameBattleManager.instance.ActiveBattleStage; title.text = stage.SDES.Title; win.text = stage.SDES.Win; lose.text = stage.SDES.Lose; proficiency.text = stage.SDES.Proficiency; int enemyCount = GameBattleUnitManager.instance.getEnemyCount(); string enemyCountStr = enemyCount.ToString(); if (enemyCount < 10) { enemyCountStr = enemyCountStr.Insert(0, "0"); } int userCount = GameBattleUnitManager.instance.getUserCount(); string userCountStr = userCount.ToString(); if (userCount < 10) { userCountStr = userCountStr.Insert(0, "0"); } int npcCount = GameBattleUnitManager.instance.getNpcCount(); string npcCountStr = npcCount.ToString(); if (npcCount < 10) { npcCountStr = npcCountStr.Insert(0, "0"); } int turnCount = GameBattleTurn.instance.Turn; string turnCountStr = turnCount.ToString(); if (turnCount < 10) { turnCountStr = turnCountStr.Insert(0, "00"); } else if (turnCount < 100) { turnCountStr = turnCountStr.Insert(0, "0"); } enemy.text = GameDefine.getBigInt(enemyCountStr); user.text = GameDefine.getBigInt(userCountStr); npc.text = GameDefine.getBigInt(npcCountStr); turn.text = GameDefine.getBigInt(turnCountStr); }
public void updateData(GameUnitBase unitBase) { GameUnit unit = GameUnitData.instance.getData(unitBase.UnitID); nameText.text = unit.Name; short count = 0; for (int i = 0; i < (int)GameSpiritType.Count; i++) { count += tempData[userID].power[i]; } text.text = GameDefine.getBigInt((unitBase.BaseSpiritPower - count).ToString()); textMax.text = GameDefine.getBigInt(unitBase.BaseSpiritPower.ToString()); for (int i = 0; i < (int)GameSpiritType.Count; i++) { int p = unitBase.SpiritPower[i] + tempData[userID].power[i]; powerText[i].text = GameDefine.getBigInt(p.ToString()); if (tempData[userID].power[i] > 0) { powerText[i].color = new Color(0.0f, 0.5f, 1.0f); } else { powerText[i].color = textColor; } int f = (int)(p / 10.0f); if (p % 10 > 0) { f += 1; } if (f > 10) { f = 10; } if (p > 0) { power[i].showFrame(3 + f); } } }
public void setData(GameSkill skill) { clear(); if (skill == null) { return; } text.text = skill.Name; mp.text = GameDefine.getBigInt(skill.MPCost.ToString()); move.text = GameDefine.getBigInt(skill.MoveCost.ToString()); image.gameObject.SetActive(true); }
public void setData(GameSaveDataInfo info) { if (info.Stage == 0) { image.gameObject.SetActive(false); text.text = ""; lvText.text = ""; Proficiency0.text = ""; Proficiency1.text = ""; Turn0.text = ""; Turn1.text = ""; time.text = ""; return; } selection = false; image.gameObject.SetActive(true); GameBattleStage stage = GameBattleData.instance.getStage(info.Stage); text.text = stage.SDES.Title; lvText.text = GameDefine.getBigInt(info.LV.ToString()); Proficiency0.text = GameStringData.instance.getString(GameStringType.SL0); Proficiency1.text = GameDefine.getBigInt(info.Proficiency.ToString()) + " "; if (info.Proficiency < info.Stage - info.Stage / 5) { Proficiency1.text += GameStringData.instance.getString(GameStringType.SL2); } else { Proficiency1.text += GameStringData.instance.getString(GameStringType.SL3); } Turn0.text = GameStringData.instance.getString(GameStringType.SL4); Turn1.text = GameDefine.getBigInt(info.TurnCount.ToString()); DateTime dt = DateTime.Parse("1970-01-01 00:00:00").AddSeconds(info.TimeData); time.text = dt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") + " "; dt = DateTime.Parse("1970-01-01 00:00:00").AddSeconds(info.Time); time.text += GameStringData.instance.getString(GameStringType.Time0) + string.Format("{0:T}", dt); }
public void setData(GameSkill m) { clear(); if (m == null) { return; } skill = m; text.text = m.Name; sp.text = GameDefine.getBigInt(m.MPCost.ToString()); mv.text = GameDefine.getBigInt(m.MoveCost.ToString()); icon.gameObject.SetActive(true); }
public void updateData(GameBattleUnit battleUnit) { clear(); GameUnit gameUnit = GameUnitData.instance.getData(battleUnit.UnitID); atkText.text = GameDefine.getBigInt(battleUnit.PhysicalAttack.ToString()); defText.text = GameDefine.getBigInt(battleUnit.Defence.ToString()); magText.text = GameDefine.getBigInt(battleUnit.MagicAttack.ToString()); spdText.text = GameDefine.getBigInt(battleUnit.Speed.ToString()); for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { int ad = battleUnit.AttributeDefence[i]; if (ad > 100) { ad = 100; } if (ad < -100) { ad = -100; } if (ad > 0) { red[i].gameObject.SetActive(false); blue[i].gameObject.SetActive(true); red[i].anchoredPosition = new Vector2(-1.5f - width, 0.0f); blue[i].anchoredPosition = new Vector2(-1.5f - width * (1.0f - ad / 100.0f), 0.0f); } else { red[i].gameObject.SetActive(true); blue[i].gameObject.SetActive(false); blue[i].anchoredPosition = new Vector2(-1.5f + width, 0.0f); red[i].anchoredPosition = new Vector2(-1.5f - width * (1.0f + ad / 100.0f), 0.0f); } textTypes[i].text = GameDefine.getBigInt(Mathf.Abs(battleUnit.AttributeDefence[i]).ToString()); } }
public void updateText() { if (shopUI.Enabled) { itemText.text = shopUI.getItemDes(); } else { itemText.text = bagUI.getItemDes(); } moneyText.text = GameDefine.getBigInt(GameUserData.instance.Gold.ToString()); if (bagUI.itemFull()) { shopUI.enableAll(false); } }
public void show(OnEventOver over, GameBattleUnit unit, GameUnitLevelUp lv) { onEventOver = over; show(); level0.text = GameDefine.getBigInt((unit.LV - 1).ToString()); level1.text = GameDefine.getBigInt((unit.LV).ToString()); hp0.text = GameDefine.getBigInt(unit.HPMax.ToString()); hp1.text = GameDefine.getBigInt((unit.HPMax + lv.HP).ToString()); mp0.text = GameDefine.getBigInt(unit.MPMax.ToString()); mp1.text = GameDefine.getBigInt((unit.MPMax + lv.MP).ToString()); str0.text = GameDefine.getBigInt(unit.Str.ToString()); str1.text = GameDefine.getBigInt((unit.Str + lv.StrBase + lv.StrRand).ToString()); vit0.text = GameDefine.getBigInt(unit.Vit.ToString()); vit1.text = GameDefine.getBigInt((unit.Vit + lv.VitBase + lv.VitRand).ToString()); int0.text = GameDefine.getBigInt(unit.Int.ToString()); int1.text = GameDefine.getBigInt((unit.Int + lv.IntBase + lv.IntRand).ToString()); avg0.text = GameDefine.getBigInt(unit.Avg.ToString()); avg1.text = GameDefine.getBigInt((unit.Avg + lv.AvgBase + lv.AvgRand).ToString()); luk0.text = GameDefine.getBigInt(unit.Luk.ToString()); luk1.text = GameDefine.getBigInt((unit.Luk + lv.LukBase + lv.LukRand).ToString()); if (lv.Skill[0] != null) { GameSkill m = GameSkillData.instance.getData(lv.Skill[0].SkillID); skill.text = m.Name; } else { skill.text = ""; } time = 0.0f; }
public void setValue(int hp, int hm, string name) { if (hp > hm) { hp = hm; } maxHP = hm; float v = hp / (float)maxHP; pos = (101.0f - v * 101.0f); textName.text = name; textHP.text = GameDefine.getBigInt(hp.ToString(), true); textHPMax.text = GameDefine.getBigInt(maxHP.ToString(), true); updatePosition(); start = false; }
public void show(GameBattleUnit unit, bool top) { show(); #if (UNITY_ANDROID || UNITY_IPHONE) top = true; #endif trans.anchoredPosition = top ? new Vector2(0.0f, 166.0f + GameCanvasScale.instance.Height - GameDefine.SCENE_HEIGHT) : Vector2.zero; text.text = unit.Name; hp.text = GameDefine.getBigInt(unit.HP.ToString(), true); hpMax.text = GameDefine.getBigInt(unit.HPMax.ToString(), true); mp.text = GameDefine.getBigInt(unit.MP.ToString(), true); mpMax.text = GameDefine.getBigInt(unit.MPMax.ToString(), true); move.text = GameDefine.getBigInt(unit.Move.ToString()); moveMax.text = GameDefine.getBigInt(unit.MoveMax.ToString()); showFade(); }
public void show(GameBattleUnit unit, bool top) { show(); #if (UNITY_ANDROID || UNITY_IPHONE) top = true; #endif trans.anchoredPosition = top ? new Vector2(0.0f, 166.0f + GameCanvasScale.instance.Height - GameDefine.SCENE_HEIGHT) : Vector2.zero; attack.text = GameDefine.getBigInt(unit.PhysicalAttack.ToString()); defence.text = GameDefine.getBigInt(unit.Defence.ToString()); lv.text = GameDefine.getBigInt(unit.LV.ToString()); exp.text = GameDefine.getBigInt(unit.EXP.ToString()); effect0.SetActive(unit.checkEffect(GameSkillResutlEffect.StrUp)); effect1.SetActive(unit.checkEffect(GameSkillResutlEffect.VitUp)); effect2.SetActive(unit.checkEffect(GameSkillResutlEffect.IntUp)); effect3.SetActive(unit.checkEffect(GameSkillResutlEffect.MoveUp)); showFade(); }
public void showItem(GameUnitBase unitBase, GameItem item) { GameUnit gameUnit = GameUnitData.instance.getData(unitBase.UnitID); GameBattleUnitData unitData = new GameBattleUnitData(); GameBattleUnitData unitData1 = new GameBattleUnitData(); GameItem weapon = GameItemData.instance.getData(unitBase.Weapon); GameItem armor = GameItemData.instance.getData(unitBase.Armor);; GameItem accessory = GameItemData.instance.getData(unitBase.Accessory);; GameAttributeDefence md = GameAttributeDefenceData.instance.getData(gameUnit.AttributeDefenceID); for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { if (md != null) { unitData.AttributeDefence[i] = md.AttributeDefence[i]; } else { unitData.AttributeDefence[i] = 100; } } unitData.Attack += unitBase.Str; unitData.Defence += unitBase.Vit / 2; if (weapon != null) { unitData.Attack += weapon.Attack; unitData.Defence += weapon.Defence; unitData.Hit += weapon.AttackHit; unitData.Miss += weapon.AttackMiss; unitData.Critical += weapon.AttackCritical; unitData.Double += weapon.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData.AttributeDefence[i] -= (short)(weapon.AttributeDefence[i] * unitData.AttributeDefence[i] / 100.0f); } } if (armor != null) { unitData.Attack += armor.Attack; unitData.Defence += armor.Defence; unitData.Hit += armor.AttackHit; unitData.Miss += armor.AttackMiss; unitData.Critical += armor.AttackCritical; unitData.Double += armor.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData.AttributeDefence[i] -= (short)(armor.AttributeDefence[i] * unitData.AttributeDefence[i] / 100.0f); } } if (accessory != null) { unitData.Attack += accessory.Attack; unitData.Defence += accessory.Defence; unitData.Hit += accessory.AttackHit; unitData.Miss += accessory.AttackMiss; unitData.Critical += accessory.AttackCritical; unitData.Double += accessory.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData.AttributeDefence[i] -= (short)(accessory.AttributeDefence[i] * unitData.AttributeDefence[i] / 100.0f); } } if (item != null) { unitData1.Attack = unitData.Attack; unitData1.Defence = unitData.Defence; unitData1.Hit = unitData.Hit; unitData1.Miss = unitData.Miss; unitData1.Critical = unitData.Critical; unitData1.Double = unitData.Double; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData1.AttributeDefence[i] = unitData.AttributeDefence[i]; } if (weapon != null && item.ItemType == GameItemType.Weapon) { unitData1.Attack -= weapon.Attack; unitData1.Defence -= weapon.Defence; unitData1.Hit -= weapon.AttackHit; unitData1.Miss -= weapon.AttackMiss; unitData1.Critical -= weapon.AttackCritical; unitData1.Double -= weapon.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData1.AttributeDefence[i] += (short)(weapon.AttributeDefence[i] * unitData1.AttributeDefence[i] / 100.0f); } } if (armor != null && item.ItemType == GameItemType.Armor) { unitData1.Attack -= armor.Attack; unitData1.Defence -= armor.Defence; unitData1.Hit -= armor.AttackHit; unitData1.Miss -= armor.AttackMiss; unitData1.Critical -= armor.AttackCritical; unitData1.Double -= armor.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData1.AttributeDefence[i] += (short)(armor.AttributeDefence[i] * unitData1.AttributeDefence[i] / 100.0f); } } if (accessory != null && item.ItemType == GameItemType.Accessory) { unitData1.Attack -= accessory.Attack; unitData1.Defence -= accessory.Defence; unitData1.Hit -= accessory.AttackHit; unitData1.Miss -= accessory.AttackMiss; unitData1.Critical -= accessory.AttackCritical; unitData1.Double -= accessory.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData1.AttributeDefence[i] += (short)(accessory.AttributeDefence[i] * unitData1.AttributeDefence[i] / 100.0f); } } unitData1.Attack += item.Attack; unitData1.Defence += item.Defence; unitData1.Hit += item.AttackHit; unitData1.Miss += item.AttackMiss; unitData1.Critical += item.AttackCritical; unitData1.Double += item.AttackDouble; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { unitData1.AttributeDefence[i] -= (short)(item.AttributeDefence[i] * unitData1.AttributeDefence[i] / 100.0f); } } attack.text = GameDefine.getBigInt(unitData.Attack.ToString()); defence.text = GameDefine.getBigInt(unitData.Defence.ToString()); hit.text = GameDefine.getBigInt(unitData.Hit.ToString()); speed.text = GameDefine.getBigInt(unitData.Miss.ToString()); fire.text = GameDefine.getBigInt(unitData.AttributeDefence[(int)GameAttributeType.Fire].ToString()); thunder.text = GameDefine.getBigInt(unitData.AttributeDefence[(int)GameAttributeType.Thunder].ToString()); ice.text = GameDefine.getBigInt(unitData.AttributeDefence[(int)GameAttributeType.Ice].ToString()); illusion.text = GameDefine.getBigInt(unitData.AttributeDefence[(int)GameAttributeType.Illusion].ToString()); light0.text = GameDefine.getBigInt(unitData.AttributeDefence[(int)GameAttributeType.Light].ToString()); dark.text = GameDefine.getBigInt(unitData.AttributeDefence[(int)GameAttributeType.Dark].ToString()); attack1.text = GameDefine.getBigInt(unitData1.Attack.ToString()); defence1.text = GameDefine.getBigInt(unitData1.Defence.ToString()); hit1.text = GameDefine.getBigInt(unitData1.Hit.ToString()); speed1.text = GameDefine.getBigInt(unitData1.Miss.ToString()); fire1.text = GameDefine.getBigInt(unitData1.AttributeDefence[(int)GameAttributeType.Fire].ToString()); thunder1.text = GameDefine.getBigInt(unitData1.AttributeDefence[(int)GameAttributeType.Thunder].ToString()); ice1.text = GameDefine.getBigInt(unitData1.AttributeDefence[(int)GameAttributeType.Ice].ToString()); illusion1.text = GameDefine.getBigInt(unitData1.AttributeDefence[(int)GameAttributeType.Illusion].ToString()); light1.text = GameDefine.getBigInt(unitData1.AttributeDefence[(int)GameAttributeType.Light].ToString()); dark1.text = GameDefine.getBigInt(unitData1.AttributeDefence[(int)GameAttributeType.Dark].ToString()); attack1.color = defaultColor; defence1.color = defaultColor; hit1.color = defaultColor; speed1.color = defaultColor; fire1.color = defaultColor; thunder1.color = defaultColor; ice1.color = defaultColor; illusion1.color = defaultColor; light1.color = defaultColor; dark1.color = defaultColor; Color colorRed = Color.red; Color colorGreen = new Color(0.0f, 0.39f, 0.0f); if (unitData1.Attack > unitData.Attack) { attack1.color = Color.red; } if (unitData1.Defence > unitData.Defence) { defence1.color = Color.red; } if (unitData1.Hit > unitData.Hit) { hit1.color = Color.red; } if (unitData1.Miss > unitData.Miss) { speed1.color = Color.red; } if (unitData1.Attack < unitData.Attack) { attack1.color = colorGreen; } if (unitData1.Defence < unitData.Defence) { defence1.color = colorGreen; } if (unitData1.Hit < unitData.Hit) { hit1.color = colorGreen; } if (unitData1.Miss < unitData.Miss) { speed1.color = colorGreen; } if (unitData1.AttributeDefence[(int)GameAttributeType.Fire] < unitData.AttributeDefence[(int)GameAttributeType.Fire]) { fire1.color = Color.red; } if (unitData1.AttributeDefence[(int)GameAttributeType.Thunder] < unitData.AttributeDefence[(int)GameAttributeType.Thunder]) { thunder1.color = Color.red; } if (unitData1.AttributeDefence[(int)GameAttributeType.Ice] < unitData.AttributeDefence[(int)GameAttributeType.Ice]) { ice1.color = Color.red; } if (unitData1.AttributeDefence[(int)GameAttributeType.Illusion] < unitData.AttributeDefence[(int)GameAttributeType.Illusion]) { illusion1.color = Color.red; } if (unitData1.AttributeDefence[(int)GameAttributeType.Light] < unitData.AttributeDefence[(int)GameAttributeType.Light]) { light1.color = Color.red; } if (unitData1.AttributeDefence[(int)GameAttributeType.Dark] < unitData.AttributeDefence[(int)GameAttributeType.Dark]) { dark1.color = Color.red; } if (unitData1.AttributeDefence[(int)GameAttributeType.Fire] > unitData.AttributeDefence[(int)GameAttributeType.Fire]) { fire1.color = colorGreen; } if (unitData1.AttributeDefence[(int)GameAttributeType.Thunder] > unitData.AttributeDefence[(int)GameAttributeType.Thunder]) { thunder1.color = colorGreen; } if (unitData1.AttributeDefence[(int)GameAttributeType.Ice] > unitData.AttributeDefence[(int)GameAttributeType.Ice]) { ice1.color = colorGreen; } if (unitData1.AttributeDefence[(int)GameAttributeType.Illusion] > unitData.AttributeDefence[(int)GameAttributeType.Illusion]) { illusion1.color = colorGreen; } if (unitData1.AttributeDefence[(int)GameAttributeType.Light] > unitData.AttributeDefence[(int)GameAttributeType.Light]) { light1.color = colorGreen; } if (unitData1.AttributeDefence[(int)GameAttributeType.Dark] > unitData.AttributeDefence[(int)GameAttributeType.Dark]) { dark1.color = colorGreen; } }
public void updateData(GameUnitBase unitBase) { clear(); GameUnit gameUnit = GameUnitData.instance.getData(unitBase.UnitID); short Str = unitBase.Str; short Vit = unitBase.Vit; short Avg = unitBase.Avg; short Int = unitBase.Int; short Luk = unitBase.Luk; int hp = unitBase.HP; int mp = unitBase.MP; short move = (short)(Avg / 25 + gameUnit.Move); for (int i = 0; i < (int)GameSpiritType.Count; i++) { powerText[i].text = GameDefine.getBigInt(unitBase.SpiritPower[i].ToString()); int f = (int)(unitBase.SpiritPower[i] / 10.0f); if (unitBase.SpiritPower[i] % 10 > 0) { f += 1; } if (f > 10) { f = 10; } if (unitBase.SpiritPower[i] > 0) { power[i].showFrame(3 + f); } } nameText.text = gameUnit.Name; lvText.text = GameDefine.getBigInt(unitBase.LV.ToString()); moveText.text = GameDefine.getBigInt(move.ToString()); moveMaxText.text = GameDefine.getBigInt(move.ToString()); hpText.text = GameDefine.getBigInt(hp.ToString()); hpMaxText.text = GameDefine.getBigInt(hp.ToString()); mpText.text = GameDefine.getBigInt(mp.ToString()); mpMaxText.text = GameDefine.getBigInt(mp.ToString()); strText.text = GameDefine.getBigInt(Str.ToString()); intText.text = GameDefine.getBigInt(Int.ToString()); vitText.text = GameDefine.getBigInt(Vit.ToString()); avgText.text = GameDefine.getBigInt(Avg.ToString()); lukText.text = GameDefine.getBigInt(Luk.ToString()); // transHP.anchoredPosition = new Vector2( -2.0f , 0.0f ); // transMP.anchoredPosition = new Vector2( -2.0f , 0.0f ); }
public void updateData(GameUnitBase unitBase) { clear(); GameUnit gameUnit = GameUnitData.instance.getData(unitBase.UnitID); short Str = unitBase.Str; short Vit = unitBase.Vit; short Avg = unitBase.Avg; short Int = unitBase.Int; short Luk = unitBase.Luk; short[] AttributeDefence = new short[(int)GameAttributeType.Cure]; GameAttributeDefence md = GameAttributeDefenceData.instance.getData(gameUnit.AttributeDefenceID); for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { if (md != null) { AttributeDefence[i] = md.AttributeDefence[i]; } else { AttributeDefence[i] = 100; } } int atk = 0; int def = 0; int mag = Int; int spd = Avg; GameItem weapon = GameItemData.instance.getData(unitBase.Weapon); GameItem armor = GameItemData.instance.getData(unitBase.Armor); GameItem accessory = GameItemData.instance.getData(unitBase.Accessory); if (weapon != null) { atk += weapon.Attack; def += weapon.Defence; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { AttributeDefence[i] -= (short)(weapon.AttributeDefence[i] * AttributeDefence[i] / 100.0f); } } if (armor != null) { atk += armor.Attack; def += armor.Defence; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { AttributeDefence[i] -= (short)(armor.AttributeDefence[i] * AttributeDefence[i] / 100.0f); } } if (accessory != null) { atk += accessory.Attack; def += accessory.Defence; for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { AttributeDefence[i] -= (short)(accessory.AttributeDefence[i] * AttributeDefence[i] / 100.0f); } } atk += Str; def += (short)(Vit / 2.0f); atkText.text = GameDefine.getBigInt(atk.ToString()); defText.text = GameDefine.getBigInt(def.ToString()); magText.text = GameDefine.getBigInt(mag.ToString()); spdText.text = GameDefine.getBigInt(spd.ToString()); for (int i = 0; i <= (int)GameAttributeType.Dark; i++) { int ad = AttributeDefence[i]; if (ad > 100) { ad = 100; } if (ad < -100) { ad = -100; } if (ad > 0) { red[i].gameObject.SetActive(false); blue[i].gameObject.SetActive(true); red[i].anchoredPosition = new Vector2(-1.5f - width, 0.0f); blue[i].anchoredPosition = new Vector2(-1.5f - width * (1.0f - ad / 100.0f), 0.0f); } else { red[i].gameObject.SetActive(true); blue[i].gameObject.SetActive(false); blue[i].anchoredPosition = new Vector2(-1.5f + width, 0.0f); red[i].anchoredPosition = new Vector2(-1.5f - width * (1.0f + ad / 100.0f), 0.0f); } textTypes[i].text = GameDefine.getBigInt(Mathf.Abs(AttributeDefence[i]).ToString()); } }
public void updateData(GameBattleUnit battleUnit) { clear(); GameUnit gameUnit = GameUnitData.instance.getData(battleUnit.UnitID); transHP.anchoredPosition = new Vector2(-2.0f, 0.0f); transMP.anchoredPosition = new Vector2(-2.0f, 0.0f); transHP.anchoredPosition = new Vector2(-2.0f - 75.0f * (1.0f - (float)battleUnit.HP / battleUnit.HPMax), 0.0f); if (battleUnit.MPMax > 0) { transMP.anchoredPosition = new Vector2(-2.0f - 75.0f * (1.0f - (float)battleUnit.MP / battleUnit.MPMax), 0.0f); } nameText.text = gameUnit.Name; lvText.text = GameDefine.getBigInt(battleUnit.LV.ToString()); moveText.text = GameDefine.getBigInt(battleUnit.Move.ToString()); moveMaxText.text = GameDefine.getBigInt(battleUnit.MoveMax.ToString()); hpText.text = GameDefine.getBigInt(battleUnit.HP.ToString(), true); hpMaxText.text = GameDefine.getBigInt(battleUnit.HPMax.ToString(), true); mpText.text = GameDefine.getBigInt(battleUnit.MP.ToString(), true); mpMaxText.text = GameDefine.getBigInt(battleUnit.MPMax.ToString(), true); strText.text = GameDefine.getBigInt(battleUnit.Str.ToString()); intText.text = GameDefine.getBigInt(battleUnit.Int.ToString()); vitText.text = GameDefine.getBigInt(battleUnit.Vit.ToString()); avgText.text = GameDefine.getBigInt(battleUnit.Avg.ToString()); lukText.text = GameDefine.getBigInt(battleUnit.Luk.ToString()); image[0].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.StrUp)); image[1].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.VitUp)); image[2].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.IntUp)); image[3].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.MoveUp)); image[4].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.PhyImmunity)); image[5].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.MagImmunity)); image[6].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.Violent)); image[7].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.Palsy)); image[8].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.Fetter)); image[9].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.Silence)); image[10].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.Miss)); image[11].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.Poison)); image[12].gameObject.SetActive(battleUnit.checkEffect(GameSkillResutlEffect.SummonKiller)); for (int i = 0; i < (int)GameSpiritType.Count; i++) { powerText[i].text = GameDefine.getBigInt(battleUnit.SpiritPower[i].ToString()); int f = (int)(battleUnit.SpiritPower[i] / 10.0f); if (battleUnit.SpiritPower[i] % 10 > 0) { f += 1; } if (f > 10) { f = 10; } if (battleUnit.SpiritPower[i] > 0) { power[i].showFrame(3 + f); } } }