private void UseTacticCard(CardData card, Player player, Unit unitToUpgrade) { UnitBaseData TempUpgrade = UnitBaseData.CreateInstance <UnitBaseData>(); TempUpgrade.Strength = card.Value; unitToUpgrade.AddTempUpgrade(TempUpgrade); }
public void Initialise(UnitBaseData data){ Type = data.Type; BaseData = data; CurrentBaseHP = data.HP; Prisoner = false; Defending = false; }
public void Initialise(UnitBaseData data) { Type = data.Type; BaseData = data; CurrentBaseHP = data.HP; Prisoner = false; Defending = false; }
public void AddTempUpgrade(UnitBaseData Upgrade) { if (CurrentTempUpgrade == null) { CurrentTempUpgrade = Upgrade; OnUpdate(this); } }
public void AddUpgrade(UnitBaseData Upgrade) { //Don't apply the upgrade if a unit is knocked out, should probably return something to acknowledge that it wasn't applied if (!IsKO()) { CurrentUpgrade = Upgrade; OnUpdate(this); } }
public UnitBaseData CreateUpgrade() { UnitBaseData Upgrade = UnitBaseData.CreateInstance <UnitBaseData>(); Upgrade.Type = Type; Upgrade.HP = (int)Mathf.Round((float)BaseData.HP / 10); Upgrade.Strength = (int)Mathf.Round((float)BaseData.Strength / 10); Upgrade.Speed = (int)Mathf.Round((float)BaseData.Speed / 10); return(Upgrade); }
public void SetUnitData(UnitId newId) { unitState.SetActive(true); UnitBaseData unitData = UnitDatabase.Instance.unitData[(int)newId]; int level = dataManager.Upgrade[(int)newId]; UnitLevelData unitLevelData = unitData.GetLevelData(level); unitName.text = unitData.Name; unitExplanation.text = unitData.Explanation; unitLevel.text = level.ToString(); unitStatus.text = "공격력 : " + unitLevelData.Attack.ToString() + " 방어력 : " + unitLevelData.Defense.ToString() + " 마법방어력 : " + unitLevelData.MagicDefense.ToString() + " 체력 : " + unitLevelData.Health.ToString() + " 이동속도 : " + unitLevelData.MoveSpeed.ToString() + " 공격속도 : " + unitLevelData.AttackSpeed.ToString(); unitCreateCost.text = unitData.Cost.ToString(); unitCreateTime.text = unitData.CreateTime.Hours.ToString("00") + ":" + unitData.CreateTime.Minutes.ToString("00") + ":" + unitData.CreateTime.Seconds.ToString("00"); currentUnit = newId; }
private void UseUpgradeCard(CardData card, Player player, Unit unitToUpgrade) { UnitBaseData upgrade = unitToUpgrade.CreateUpgrade(); unitToUpgrade.AddUpgrade(upgrade); }
public void RemoveTempUpgrade() { CurrentTempUpgrade = null; OnUpdate(this); }
public void AddTempUpgrade(UnitBaseData Upgrade) { if (CurrentTempUpgrade == null) { CurrentTempUpgrade = Upgrade; OnUpdate(this); } }
public void AddUpgrade(UnitBaseData Upgrade) { //Don't apply the upgrade if a unit is knocked out, should probably return something to acknowledge that it wasn't applied if (!IsKO()) { CurrentUpgrade = Upgrade; OnUpdate(this); } }
public void RemoveTempUpgrade() { CurrentTempUpgrade = null; OnUpdate(this); }