public virtual bool ContainsAttribute(ENT_ATTR type) { for (int i = 0; i < attribList.Count; i++) { if (attribList[i].attr.type == type) { return(true); } } return(false); }
public virtual void RemoveAttributesByType(ENT_ATTR type) { for (int i = 0; i < attribList.Count; i++) { if (attribList[i].attr.type == type) { EntityAttribute rem = attribList[i].attr; Debug.Log("Removed " + rem.name); attribList.RemoveAt(i); rem.OnRemove(this); i--; } } }
public bool isAdditive; // true: The attribute is additive. false: the attribute is multiplicative. (this is only relevant for modifiers affecting numerical stats, and not for something like poison) public EntityAttribute(ENT_ATTR type, float value, float duration = float.PositiveInfinity, bool stackable = false, bool isAdditive = true, string name = "") { this.name = name; this.type = type; this.value = value; if (duration > 0f) { this.duration = duration; } else { this.duration = float.PositiveInfinity; } this.stackable = stackable; this.isAdditive = isAdditive; }