void IStaticEffect.StaticEffect() { List <Card> cardsInPlay = Card.Networking.GetCardsInPlay(); bool isTurnedOn = false; foreach (Card c in cardsInPlay) { if ((c.IsFaceUp) && (c.CardClass == CardClass.KING || c.CardClass == CardClass.QUEEN)) { isTurnedOn = true; } } if (!Card.HasBuff(buff)) { buff = Card.AddBuff(0, 0, true, true, this); } if (isTurnedOn && Card.IsAlive) { buff.Attack = 7; } else { buff.Attack = 0; } if (wasTurnedOn != isTurnedOn) { Card.Networking.SyncCard(Card); wasTurnedOn = isTurnedOn; } }
public void AfterAttacking(Card defender, Action callback) { Buff newBuff = defender.AddBuff(0, 0, true, false, this); newBuff.Keywords.Add(Keyword.START_PHASE_PARASITE); buffs.Add(newBuff); callback(); }
public override void OnUpdate(Board board) { if (IsFriend) { Card left = null; Card right = null; foreach (Card c in board.MinionFriend) { c.RemoveBuffById(Id); if (c.Index == Index - 1) { left = c; } if (c.Index == Index + 1) { right = c; } } if (left != null && !IsSilenced) { left.AddBuff(new Buff(1, 0, Id)); } if (right != null && !IsSilenced) { right.AddBuff(new Buff(1, 0, Id)); } } else { Card left = null; Card right = null; foreach (Card c in board.MinionEnemy) { c.RemoveBuffById(Id); if (c.Index == Index - 1) { left = c; } if (c.Index == Index + 1) { right = c; } } if (left != null && !IsSilenced) { left.AddBuff(new Buff(1, 0, Id)); } if (right != null && !IsSilenced) { right.AddBuff(new Buff(1, 0, Id)); } } }
public void OnStartPhase(MasqueradePlayer turn, Action callback) { if (turn == Card.LastOwner) { Card.AddBuff(2, 0, false, true, this); } else { Card.AddBuff(0, 2, false, true, this); } callback(); }
void IStaticEffect.StaticEffect() { if (Card.IsAlive && Card.IsFaceUp) { foreach (KeyValuePair <Card, Buff> b in buffs) { if (b.Key.Owner != Card.Owner) { b.Key.RemoveBuff(b.Value); } } foreach (byte b in Card.Owner.Hand.CardsOwned) { Card c = Card.Networking.TheCardIndex.GetCard(b); if (!buffs.ContainsKey(c)) { buffs.Add(c, c.AddBuff(0, 2, true, false, this)); } if (!c.HasBuff(buffs[c])) { buffs[c] = c.AddBuff(0, 2, true, false, this); } } } else { if (buffs.Count > 0) { foreach (KeyValuePair <Card, Buff> b in buffs) { b.Key.RemoveBuff(b.Value); } buffs.Clear(); } } }
void IStaticEffect.StaticEffect() { if (Card.IsAlive) { if (!Card.HasBuff(buff)) { buff = Card.AddBuff(0, 0, true, true, this); } lastAttack = buff.Attack; buff.Attack = Card.Owner.Hand.CardsOwned.Count * 2; if (lastAttack != buff.Attack) { Card.Sync(); } } }
void IStaticEffect.StaticEffect() { if (Card.IsAlive) { if (ThereAreOtherNobles) { if (!Card.HasBuff(buff)) { buff = Card.AddBuff(3, 0, true, true, this); buff.Keywords.Add(Keyword.CANT_BE_KILLED); } } else { Card.RemoveBuff(buff); } } }
void IAfterAttacking.AfterAttacking(Card defender, System.Action callback) { if (!Card.HasBuff(buff)) { stacks = 0; buff = Card.AddBuff(0, 0, true, true, this); } stacks++; buff.Attack = stacks * -1; buff.Defense = stacks * -1; Card.Sync(); if (callback != null) { callback(); } }
void IStaticEffect.StaticEffect() { if (Card.IsAlive && Card.IsFaceUp) { if (theKing == null) { if (Card.Owner != null) { foreach (MasqueradePlayer p in Card.Networking.MasqueradePlayers) { foreach (byte b in p.Hand.CardsOwned) { Card c = Card.Networking.TheCardIndex.GetCard(b); if (c.CardClass == CardClass.KING) { theKing = c; } } } } } if (theKing != null) { if (!theKing.HasBuff(buff)) { buff = theKing.AddBuff(0, 0, true, true, this); buff.Keywords.Add(Keyword.CANT_BE_KILLED); } } } else { if (theKing != null && buff != null) { theKing.RemoveBuff(buff); buff = null; } } }
private void SeedSmartCc() { SmartCc.SimuCount++; Board root = new Board(); HREntity HeroEnemy = HRPlayer.GetEnemyPlayer().GetHero(); Card ce = Card.Create(HeroEnemy.GetCardId(), false, HeroEnemy.GetEntityId()); root.HeroEnemy = ce; HREntity HeroFriend = HRPlayer.GetLocalPlayer().GetHero(); root.HeroFriend = Card.Create(HeroFriend.GetCardId(), true, HeroFriend.GetEntityId()); root.HeroEnemy.CurrentHealth = HeroEnemy.GetHealth() - HeroEnemy.GetDamage(); root.HeroEnemy.MaxHealth = 30; root.HeroEnemy.CurrentArmor = HeroEnemy.GetArmor(); root.HeroFriend.CurrentHealth = HeroFriend.GetHealth() - HeroFriend.GetDamage(); root.HeroFriend.MaxHealth = 30; root.HeroFriend.IsFrozen = HeroFriend.IsFrozen(); root.HeroFriend.CurrentArmor = HeroFriend.GetArmor(); root.HeroFriend.CurrentAtk = HeroFriend.GetATK(); if (HRCard.GetCards(HRPlayer.GetEnemyPlayer(), HRCardZone.SECRET).Count > 0) { root.SecretEnemy = true; } if (HRPlayer.GetEnemyPlayer().HasWeapon()) { HRCard weaponEnemyCard = HRPlayer.GetEnemyPlayer().GetWeaponCard(); if (weaponEnemyCard != null) { root.WeaponEnemy = Card.Create(weaponEnemyCard.GetEntity().GetCardId(), false, weaponEnemyCard.GetEntity().GetEntityId()); } } if (HRPlayer.GetLocalPlayer().HasWeapon()) { HRCard weaponFriendCard = HRPlayer.GetLocalPlayer().GetWeaponCard(); if (weaponFriendCard != null) { root.WeaponFriend = Card.Create(weaponFriendCard.GetEntity().GetCardId(), true, weaponFriendCard.GetEntity().GetEntityId()); root.WeaponFriend.IsTired = (weaponFriendCard.GetEntity().GetNumAttacksThisTurn() > 0 || HeroFriend.GetNumAttacksThisTurn() > 0); } } root.ManaAvailable = HRPlayer.GetLocalPlayer().GetNumAvailableResources(); foreach (HREntity e in GetEnemyEntitiesOnBoard()) { Card newc = Card.Create(e.GetCardId(), false, e.GetEntityId()); newc.CurrentAtk = e.GetATK(); newc.CurrentHealth = e.GetHealth() - e.GetDamage(); newc.MaxHealth = e.GetHealth(); foreach (HREntity az in e.GetEnchantments()) { Buff b = Buff.GetBuffById(az.GetCardId()); if (b != null) { b.OwnerId = az.GetCreatorId(); newc.AddBuff(b); newc.currentAtk -= b.Atk; newc.CurrentHealth -= b.Hp; newc.maxHealth -= b.Hp; } } newc.CurrentCost = e.GetCost(); newc.IsCharge = e.HasCharge(); newc.IsDivineShield = e.HasDivineShield(); newc.IsEnraged = e.IsEnraged(); newc.IsFrozen = e.IsFrozen(); newc.HasFreeze = e.IsFreeze(); newc.IsStealth = e.IsStealthed(); newc.IsSilenced = e.IsSilenced(); newc.HasPoison = e.IsPoisonous(); newc.IsWindfury = e.HasWindfury(); newc.IsTaunt = e.HasTaunt(); newc.Index = e.GetTag(HRGameTag.ZONE_POSITION) - 1; // HRLog.Write(e.GetName() + " at " + newc.Index.ToString()); root.MinionEnemy.Add(newc); } foreach (HREntity e in GetFriendEntitiesOnBoard()) { Card newc = Card.Create(e.GetCardId(), true, e.GetEntityId()); newc.CurrentAtk = e.GetATK(); newc.CurrentHealth = e.GetHealth() - e.GetDamage(); newc.MaxHealth = e.GetHealth(); foreach (HREntity az in e.GetEnchantments()) { Buff b = Buff.GetBuffById(az.GetCardId()); if (b != null) { b.OwnerId = az.GetCreatorId(); newc.AddBuff(b); newc.currentAtk -= b.Atk; newc.CurrentHealth -= b.Hp; newc.MaxHealth -= b.Hp; } } newc.CurrentCost = e.GetCost(); newc.IsCharge = e.HasCharge(); newc.IsDivineShield = e.HasDivineShield(); newc.IsEnraged = e.IsEnraged(); newc.IsFrozen = e.IsFrozen(); newc.HasFreeze = e.IsFreeze(); newc.IsStealth = e.IsStealthed(); newc.IsSilenced = e.IsSilenced(); newc.HasPoison = e.IsPoisonous(); newc.IsWindfury = e.HasWindfury(); newc.IsTaunt = e.HasTaunt(); newc.IsTired = e.IsExhausted(); newc.IsImmune = e.IsImmune(); newc.Index = e.GetTag(HRGameTag.ZONE_POSITION) - 1; newc.CountAttack = e.GetTag(HRGameTag.NUM_ATTACKS_THIS_TURN); root.MinionFriend.Add(newc); } foreach (HRCard c in HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.SECRET)) { Card newc = Card.Create(c.GetEntity().GetCardId(), true, c.GetEntity().GetEntityId()); root.Secret.Add(newc); } foreach (HRCard c in GetAllCardsInHand()) { Card newc = Card.Create(c.GetEntity().GetCardId(), true, c.GetEntity().GetEntityId()); root.Hand.Add(newc); } if (!HRPlayer.GetLocalPlayer().GetHeroPower().IsExhausted()) { root.Ability = Card.Create(HRPlayer.GetLocalPlayer().GetHeroPower().GetCardId(), true, HRPlayer.GetLocalPlayer().GetHeroPower().GetEntityId()); } if (!HRPlayer.GetEnemyPlayer().GetHeroPower().IsExhausted()) { root.EnemyAbility = Card.Create(HRPlayer.GetEnemyPlayer().GetHeroPower().GetCardId(), false, HRPlayer.GetEnemyPlayer().GetHeroPower().GetEntityId()); } root.TurnCount = SmartCc.TurnCount + 1; SmartCc.root = root; }
public void BeforeAttacking(Card defender, Action callback) { buff = defender.AddBuff(0, 0, true, true, this); buff.Keywords.Add(Keyword.NO_BONUSES); callback(); }
void IStartPhase.OnStartPhase(MasqueradePlayer currentPlayer, System.Action callback) { if (currentPlayer == Card.Owner && Card.IsFaceUp && Card.IsAlive) { if (!Card.HasBuff(buff)) { buff = Card.AddBuff(0, 0, true, true, this); } List <byte> targets = new List <byte>(); foreach (byte b in Card.Owner.Hand.CardsOwned) { Card c = Card.Networking.TheCardIndex.GetCard(b); if (!c.HasKeyword(Keyword.CANT_BE_DISCARDED)) { targets.Add(b); } } Card.Networking.StartCoroutine(Card.Networking.PickACardCOR( Card.Owner.PlayerIndex, targets.ToArray(), delegate(byte choice) { if (targets.Contains(choice)) { //Kill the card and give Whitemane +5 buff.Attack = 5; buff.Defense = 5; Card.Networking.SyncCard(Card); Card foundCard = Networking.TheCardIndex.GetCard(choice); foundCard.StartCoroutine(foundCard.Flip(true, (b) => { foundCard.Kill(); callback(); })); } else { //If somebody failed the sanity check they're probably cheating //The most reasonable thing to do is still just cancel buff.Attack = 0; buff.Defense = 0; Card.Networking.SyncCard(Card); callback(); } }, delegate { //Don't kill anybody buff.Attack = 0; buff.Defense = 0; Card.Networking.SyncCard(Card); callback(); }, new Color(0, .5f, 0) )); CustomConsole.Log("It's his owner's start phase, and Sorceror Theodoric Whitemane is choosing someone to sacrifice.", UnityEngine.Color.green); } }