private BattleCommand CreateBattleCommand(Target target, Ability ability, CommandType type) { return new BattleCommand { Actor = me, Target = target, Ability = ability, CommandType = type }; }
public RimuldarGeneralBehavior(Enemy owner) { me = owner; pressTheAdvantage = me.EquippedFinishers.FirstOrDefault(a => a.Name == "Press the Advantage"); solarBeam = me.EquippedAbilities.FirstOrDefault(a => a.Name == "Solar Beam"); cleave = me.EquippedAbilities.FirstOrDefault(a => a.Name == "Cleave"); sliceAndDice = me.EquippedAbilities.FirstOrDefault(a => a.Name == "Slice & Dice"); // The general can use the solar beam ability every other turn solarBeam.Cooldown = 1; }
public static int GetDamageForAbility(Combatant actor, Ability ability, Combatant target) { int modifier = ability.AbilityType == AbilityType.Physical ? actor.AttackPower : actor.MagicPower; modifier = GetEffectiveAttributeValue(modifier, 0.2f); // For now magic damage is not reducible, this will change in the very near future int damageReduction = ability.AbilityType == AbilityType.Physical ? target.Defense : 0; int damage = Random.Range(ability.DamageRange.Item1, ability.DamageRange.Item2) + modifier - damageReduction; return damage; }
public Finisher(Ability toClone) : base(toClone) { if (!(toClone is Finisher)) throw new ApplicationException("Attempted to create a finisher from a non finisher ability"); IsFinisher = true; ElementCost = new List<FinisherCostElement>(); Cooldown = 0; var castClone = toClone as Finisher; foreach (var cost in castClone.ElementCost) this.ElementCost.Add(new FinisherCostElement(cost.ElementType, cost.Amount)); }
public Ability(Ability toClone) { this.Id = toClone.Id; this.Name = toClone.Name; this.Description = toClone.Description; this.Icon = toClone.Icon; this.ElementType = toClone.ElementType; this.TargetType = toClone.TargetType; this.Cooldown = toClone.Cooldown; this.AudioClip = toClone.AudioClip; this.DamageRange = Tuple.Create(toClone.DamageRange.Item1, toClone.DamageRange.Item2); CooldownRemaining = 0; }
private void DrawRegular(float x, float y, int i, Ability ability) { var style = GUIManager.GetMessageBoxStyle(fontProperties); if (ability.Icon && ability.Icon.width > 0) UnityEngine.GUI.DrawTexture(new Rect(x, y, iconSize, iconSize), ability.Icon); string text = ability.Name; if (ability.CooldownRemaining > 0) text += " " + ability.CooldownRemaining; var content = new GUIContent(text); var contentSize = style.CalcSize(content); UnityEngine.GUI.Label(new Rect(x + iconSize + 10, y, contentSize.x, contentSize.y), content, style); if (abilityArray[i].IsSelected) UnityEngine.GUI.DrawTexture(new Rect(x, y + iconSize + 2, iconSize + 10 + contentSize.x, 2), textures.Pointer); }
private void DrawFinisher(float x, float y, int i, Ability ability) { var style = GUIManager.GetMessageBoxStyle(fontProperties); if (ability.Icon && ability.Icon.width > 0) UnityEngine.GUI.DrawTexture(new Rect(x, y, iconSize, iconSize), ability.Icon); string text = ability.Name; var content = new GUIContent(text); var contentSize = style.CalcSize(content); UnityEngine.GUI.Label(new Rect(x + iconSize + 10, y, contentSize.x, contentSize.y), content, style); var pillX = x + iconSize + 10 + contentSize.x + 5; var pillScale = 0.66f; foreach (var cost in (ability as Finisher).ElementCost) { var texture = FieldEffectDisplay.Instance.GetTextureForEffect(cost.ElementType); var textureWidth = texture.width * pillScale; var textureHeight = texture.height * pillScale; for (int j = 0; j < cost.Amount; j++) { UnityEngine.GUI.DrawTexture(new Rect(pillX, y, textureWidth, textureHeight), texture); pillX += textureWidth + 5; } } if (abilityArray[i].IsSelected) UnityEngine.GUI.DrawTexture(new Rect(x, y + iconSize + 2, iconSize + 10 + contentSize.x, 2), textures.Pointer); }
//public bool IsSelected { get; set; } public AbilityMenuItem(Ability ability, Action clickAction) : base(ability.Name, clickAction) { this.Ability = ability; }