Created
December 10, 2017 21:47
-
-
Save MatthewBlanchard/e47379609c87352978bf73c6d7b9de3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Ship; | |
namespace Ship | |
{ | |
namespace Firespray31 | |
{ | |
public class BobaFettScum : Firespray31 | |
{ | |
public BobaFettScum() : base() | |
{ | |
PilotName = "Boba Fett (S&V)"; | |
PilotSkill = 8; | |
Cost = 39; | |
IsUnique = true; | |
PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Elite); | |
PrintedUpgradeIcons.Add(Upgrade.UpgradeType.Title); | |
SkinName = "Boba Fett"; | |
PilotAbilities.Add(new Abilities.BobaFettScumAbility()); | |
faction = Faction.Scum; | |
} | |
} | |
} | |
} | |
namespace Abilities | |
{ | |
public class BobaFettScumAbility : GenericAbility | |
{ | |
public override void Initialize(GenericShip host) | |
{ | |
base.Initialize(host); | |
HostShip.AfterGenerateAvailableActionEffectsList += BobaFettScumPilotAbility; | |
} | |
public void BobaFettScumPilotAbility(GenericShip ship) | |
{ | |
ship.AddAvailableActionEffect(new BobaFettScumAction()); | |
} | |
private class BobaFettScumAction : ActionsList.GenericAction | |
{ | |
public BobaFettScumAction() | |
{ | |
Name = EffectName = "Boba Fett's Ability"; | |
IsReroll = true; | |
} | |
public override void ActionEffect(System.Action callBack) | |
{ | |
Vector2 range = new Vector2(1, 1); | |
Console.Write(Host.ShipId.ToString()); | |
int rerolledDice = Board.BoardManager.GetShipsAtRange(Host, range, Team.Type.Any).Count; | |
DiceRerollManager diceRerollManager = new DiceRerollManager | |
{ | |
NumberOfDiceCanBeRerolled = rerolledDice, | |
CallBack = callBack | |
}; | |
diceRerollManager.Start(); | |
} | |
public override bool IsActionEffectAvailable() | |
{ | |
Vector2 range = new Vector2(1, 1); | |
int shipsatrange1 = Board.BoardManager.GetShipsAtRange(Host, range, Team.Type.Any).Count; | |
if (shipsatrange1 > 0) | |
return true; | |
return false; | |
} | |
public override int GetActionEffectPriority() | |
{ | |
int result = 0; | |
if (Combat.CurrentDiceRoll.BlanksNotRerolled > 0) result = 95; | |
return result; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment