protected override void Activate(Player owner, Player opponent, int damageTaken, GameField game) { NetworkId selectedId = null; do { var response = owner.NetworkPlayer.SendAndWaitForResponse <CardListMessage>(new SelectFromYourPokemonMessage("Select one of your other pokemon to attach Electrode to").ToNetworkMessage(NetworkId.Generate())); selectedId = response.Cards.FirstOrDefault(); } while (selectedId == null || selectedId.Equals(PokemonOwner.Id)); var colorResponse = owner.NetworkPlayer.SendAndWaitForResponse <SelectColorMessage>(new SelectColorMessage("Select energy type to become").ToNetworkMessage(NetworkId.Generate())); var buzzardEnergy = new BuzzardEnergy(PokemonOwner, colorResponse.Color) { ImageUrl = PokemonOwner.ImageUrl, SetCode = PokemonOwner.SetCode }; game.SendEventToPlayers(new PokemonDiedEvent() { Pokemon = PokemonOwner }); game.Cards.Add(buzzardEnergy.Id, buzzardEnergy); PokemonCard selectedPokemon = (PokemonCard)game.Cards[selectedId]; selectedPokemon.AttachEnergy(buzzardEnergy, game); PokemonOwner.ClearStatusEffects(); PokemonOwner.DamageCounters = 0; PokemonOwner.Owner.DiscardPile.AddRange(PokemonOwner.AttachedEnergy); PokemonOwner.AttachedEnergy.Clear(); if (PokemonOwner.EvolvedFrom != null) { PokemonOwner.Owner.DiscardPile.Add(PokemonOwner.EvolvedFrom); PokemonOwner.EvolvedFrom = null; } if (owner.ActivePokemonCard == PokemonOwner) { owner.ActivePokemonCard = null; owner.SelectActiveFromBench(game); } else { owner.BenchedPokemon.Remove(PokemonOwner); } game.GameState = GameFieldState.AbilitySpecial; game.SendEventToPlayers(new GameInfoEvent()); game.PushInfoToPlayer("Opponent is selecting a prize card", owner); opponent.SelectPrizeCard(1, game); game.GameState = GameFieldState.InTurn; game.SendEventToPlayers(new GameInfoEvent()); }
public bool Equals(ZeroTierNetwork network) { if (NetworkId == null || network == null) { return(false); } return(NetworkId.Equals(network.NetworkId)); }
public void UpdateNetwork(ZeroTierNetwork network) { if (network == null) { return; } if (!NetworkId.Equals(network.NetworkId)) { NetworkId = network.NetworkId; } if (!MacAddress.Equals(network.MacAddress)) { MacAddress = network.MacAddress; } if (!NetworkName.Equals(network.NetworkName)) { NetworkName = network.NetworkName; } if (!NetworkStatus.Equals(network.NetworkStatus)) { NetworkStatus = network.NetworkStatus; } if (!NetworkType.Equals(network.NetworkType)) { NetworkType = network.NetworkType; } if (MTU != network.MTU) { MTU = network.MTU; } if (DHCP != network.DHCP) { DHCP = network.DHCP; } if (Bridge != network.Bridge) { Bridge = network.Bridge; } if (BroadcastEnabled != network.BroadcastEnabled) { BroadcastEnabled = network.BroadcastEnabled; } if (PortError != network.PortError) { PortError = network.PortError; } if (NetconfRevision != network.NetconfRevision) { NetconfRevision = network.NetconfRevision; } AssignedAddresses = network.AssignedAddresses; Routes = network.Routes; if (!DeviceName.Equals(network.DeviceName)) { DeviceName = network.DeviceName; } if (AllowManaged != network.AllowManaged) { AllowManaged = network.AllowManaged; } if (AllowGlobal != network.AllowGlobal) { AllowGlobal = network.AllowGlobal; } if (AllowDefault != network.AllowDefault) { AllowDefault = network.AllowDefault; } if (IsConnected != network.IsConnected) { IsConnected = network.IsConnected; } }