///<summary> Sets variables up for use, sets adjustedDamage to resistance adjusted damage if dynamicDamage is not chosen. </summary> public void Setup(ResistanceInfo targetR) { delay.ResetTimer(); attackGap.timer = 0; if (limitType == DamageLimit.NONE) { limit.timer = 1; } else { limit.ResetTimer(); } if (!dynamicDamage) { adjustedDamage = (targetR != null) ? GetAdjustedDamage(targetR) : damage; } }
///<summary> Sets variables up for use. </summary> public void Setup(GameObject targetObject) { destroy = false; target = targetObject; if (condition == DestroyCondition.TIMER_ZERO) { limit.ResetTimer(); } }
///<summary> Sets Info and variables up for use. </summary> public void Setup(EnvironObject targetEO, EnvironObject lastSourceEO) { if (damageI) { damageI = Instantiate(damageI); damageI.Setup(targetEO.resistances); } if (appearanceI) { appearanceI = Instantiate(appearanceI); appearanceI.Setup(targetEO.gameObject); if (appearanceI.hideOnResistance && targetEO.resistances) //Turns off Appearance particles and materials if hideOnResistance has been set up { if (targetEO.resistances.HasTypeIDMatch(ResistanceType.NULLIFY_DAMAGE, appearanceI.hideIDList.Distinct())) { appearanceI.TurnOff(); } } } limit.ResetTimer(); lastSource = lastSourceEO; target = targetEO; if (similarity == Similarity.SELECTIVE) { uniqueID = selectiveDescription; } if (similarity == Similarity.UNIQUE) { uniqueID = GetInstanceID().ToString(); firstSource = lastSourceEO; } }
///<summary> Updates several timers, returns true if an attack can be made. </summary> private bool CanAttack() { delay.UpdateTimer(); //Attacks can only be made when delay has timed out, attack gap has timed out, if (delay.belowZero) //and limit is still above zero { attackGap.UpdateTimer(); if (limitType == DamageLimit.TIME_LIMIT) { limit.UpdateTimer(); } } if (attackGap.belowZero) { attackGap.ResetTimer(); if (limit.aboveZero) { return(true); } } return(false); }