Esempio n. 1
0
    private void UseTacticCard(CardData card, Player player, Unit unitToUpgrade)
    {
        UnitBaseData TempUpgrade = UnitBaseData.CreateInstance <UnitBaseData>();

        TempUpgrade.Strength = card.Value;
        unitToUpgrade.AddTempUpgrade(TempUpgrade);
    }
Esempio n. 2
0
	public void Initialise(UnitBaseData data){
		Type = data.Type;
		BaseData = data;
		CurrentBaseHP = data.HP;
		Prisoner = false;
		Defending = false;
	}
Esempio n. 3
0
 public void Initialise(UnitBaseData data)
 {
     Type          = data.Type;
     BaseData      = data;
     CurrentBaseHP = data.HP;
     Prisoner      = false;
     Defending     = false;
 }
Esempio n. 4
0
 public void AddTempUpgrade(UnitBaseData Upgrade)
 {
     if (CurrentTempUpgrade == null)
     {
         CurrentTempUpgrade = Upgrade;
         OnUpdate(this);
     }
 }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
    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;
    }
Esempio n. 8
0
    private void UseUpgradeCard(CardData card, Player player, Unit unitToUpgrade)
    {
        UnitBaseData upgrade = unitToUpgrade.CreateUpgrade();

        unitToUpgrade.AddUpgrade(upgrade);
    }
Esempio n. 9
0
	public void RemoveTempUpgrade() {
		CurrentTempUpgrade = null;
		OnUpdate(this);
	}
Esempio n. 10
0
	public void AddTempUpgrade(UnitBaseData Upgrade) {
		if (CurrentTempUpgrade == null) {
			CurrentTempUpgrade = Upgrade;
			OnUpdate(this);
		}

	}
Esempio n. 11
0
	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);
		}
	}
Esempio n. 12
0
 public void RemoveTempUpgrade()
 {
     CurrentTempUpgrade = null;
     OnUpdate(this);
 }