public static AbilityAttribute Generate(AttackAbility ability) { for (int i = 0; i < 10000; i++) { string roll = TableRoller.Roll("AttackAttributes"); AbilityAttribute attribute; if (simpleAttributes.Contains(roll)) { attribute = new AbilityAttribute { type = roll }; attribute.priority = UnityEngine.Random.Range(12.5f, 100f); attribute.points = AbilityAttributeAppraiser.Appraise(ability, attribute); if (negativeAttributes.Contains(attribute.type) && attribute.priority < 50) { continue; } return(attribute); } attribute = attributes[roll](ability); if (attribute != null) { attribute.priority = UnityEngine.Random.Range(12.5f, 100f); attribute.points = AbilityAttributeAppraiser.Appraise(ability, attribute); if (negativeAttributes.Contains(attribute.type) && attribute.priority < 50) { continue; } return(attribute); } } Debug.Log("FAILED TO FIND VALID ATTRIBUTE FOR ABILITY!"); return(null); }
public static AbilityAttribute Generate(PassiveAbility ability) { for (int i = 0; i < 10000; i++) { string roll = TableRoller.Roll("PassiveAttributes"); AbilityAttribute attribute; if (simpleAttributes.Contains(roll)) { attribute = new AbilityAttribute { type = roll }; attribute.priority = RNG.Float(12.5f, 100f); attribute.points = AbilityAttributeAppraiser.Appraise(ability, attribute); return(attribute); } attribute = attributes[roll](ability); if (attribute != null) { attribute.priority = RNG.Float(12.5f, 100f); attribute.points = AbilityAttributeAppraiser.Appraise(ability, attribute); return(attribute); } } Debug.Log("FAILED TO FIND VALID ATTRIBUTE FOR ABILITY!"); return(null); }
public BossMechanic() { type = TableRoller.Roll("BossMechanics"); if (type == "damageZones") { int healRoll = Random.Range(0, 2); if (healRoll == 0) { options.Add("heals"); } } }
public ElementalAffinity(Element baseType, bool positive = true) { amount = int.Parse(TableRoller.Roll("ElementalAffinityDegree")); if (!positive) { amount *= -1; } if (positive) { type = GetPositiveAffinity(baseType); } else { type = GetNegativeAffinity(baseType); } }