private void Start() { attackSelectionUI = GetObjects.instance.getAttackSelection(); Toggle toggleComponent = GetComponent <Toggle>(); toggleComponent.onValueChanged.AddListener(inputToggled); }
public static AttackSelection[] Add(AttackSelection n, AttackSelection[] list) { ArrayList tmp = new ArrayList(); foreach(AttackSelection str in list) tmp.Add(str); tmp.Add(n); return tmp.ToArray(typeof(AttackSelection)) as AttackSelection[]; }
public void FromData_ReturnsSelection_WithDamage() { var damageData = damageHelper.BuildData("my roll", "my damage type", "my condition"); var damageEntry = damageHelper.BuildEntry(damageData); var data = attackHelper.BuildData("name", damageEntry, "effect", 4.2, "attack type", 9266, "time period", true, true, true, true, string.Empty, string.Empty); var rawData = attackHelper.BuildEntry(data); var selection = AttackSelection.From(rawData); Assert.That(selection.AttackType, Is.EqualTo("attack type")); Assert.That(selection.Damages, Has.Count.EqualTo(1)); Assert.That(selection.Damages[0].Roll, Is.EqualTo("my roll")); Assert.That(selection.Damages[0].Type, Is.EqualTo("my damage type")); Assert.That(selection.Damages[0].Condition, Is.EqualTo("my condition")); Assert.That(selection.DamageEffect, Is.EqualTo("effect")); Assert.That(selection.DamageBonusMultiplier, Is.EqualTo(4.2)); Assert.That(selection.FrequencyQuantity, Is.EqualTo(9266)); Assert.That(selection.FrequencyTimePeriod, Is.EqualTo("time period")); Assert.That(selection.IsMelee, Is.True); Assert.That(selection.IsNatural, Is.True); Assert.That(selection.IsPrimary, Is.True); Assert.That(selection.IsSpecial, Is.True); Assert.That(selection.Name, Is.EqualTo("name")); Assert.That(selection.Save, Is.Empty); Assert.That(selection.SaveAbility, Is.Empty); Assert.That(selection.SaveDcBonus, Is.Zero); }
public BattleAction(AttackSelection t, Combatant u, int tID, int id, int ul) { this.type = t; this.user = u; this.targetID = tID; this.useID = id; this.useLevel = ul; }
private Ability GetAbilityForAttack(Dictionary <string, Ability> abilities, AttackSelection attackSelection) { if (!attackSelection.IsMelee || !abilities[AbilityConstants.Strength].HasScore) { return(abilities[AbilityConstants.Dexterity]); } return(abilities[AbilityConstants.Strength]); }
private AttackSelection Parse(string input, string originalSize, string advancedSize) { var selection = AttackSelection.From(input); if (selection.IsNatural && originalSize != advancedSize) { foreach (var damage in selection.Damages) { damage.Roll = GetAdjustedDamage(damage.Roll, originalSize, advancedSize); } } return(selection); }
public void Setup() { selection = new AttackSelection(); attackHelper = new AttackHelper(); damageHelper = new DamageHelper(); }
public static AttackSelection[] Remove(int index, AttackSelection[] list) { ArrayList tmp = new ArrayList(); foreach(AttackSelection str in list) tmp.Add(str); tmp.RemoveAt(index); return tmp.ToArray(typeof(AttackSelection)) as AttackSelection[]; }