public Ability Clone() { Ability ab = new Ability(); ab.ID = ID; ab.name = name; ab.icon = icon; ab.desp = desp; ab.type = type; ab.cost = cost; ab.cooldown = cooldown; ab.currentCD = currentCD; ab.aStats = aStats.Clone(); ab.range = range; ab.shootObject = shootObject; ab.shootPosOffset = shootPosOffset; ab.moveType = moveType; ab.duration = duration; ab.launchObj = launchObj; ab.autoDestroyLaunchObj = autoDestroyLaunchObj; ab.launchObjActiveDuration = launchObjActiveDuration; return(ab); }
public AttackInstance Clone() { AttackInstance aInstance = new AttackInstance(); aInstance.srcUnit = srcUnit; aInstance.isAOE = isAOE; aInstance.aoeDistance = aoeDistance; aInstance.aStats = aStats.Clone(); return(aInstance); }
//apply effect to all active hostile unit void ApplyEffectAll() { //get all active hostile unit from UnitTracker List <Unit> unitList = UnitTracker.GetAllUnitList(); for (int i = 0; i < unitList.Count; i++) { //clone the attack stats so that the original value wont get modified when making further calculation AttackInstance aInstance = new AttackInstance(); aInstance.aStats = aStats.Clone(); unitList[i].ApplyAttack(aInstance); } }
public AttackStats CloneAttackStats() { return(aStats.Clone()); }