public bool IsCardAvailable(ArchetypeID card) { int num; this.GlobalCollection.get_Counts().TryGetValue(card, out num); return(num > 0); }
public bool MoveToDeck(ArchetypeID card) { bool result = false; if (this.tryToMove(card, 1)) { result = true; this.deck.SetAsModified(card, true); this.Collection.set_RememberedArchetype(card); } return(result); }
public bool MoveFromDeck(ArchetypeID card) { bool result = false; int num; if (this.current_deck.get_Counts().TryGetValue(card, out num) && num > 0) { this.deck.SetAsModified(card, false); this.Collection.set_RememberedArchetype(null); this.current_deck.AddToCount(card, -1); this.deck_editor_saver.set_UnsavedChanges(true); result = true; } return(result); }
private Move MakeCounterMove(MySqlDataReader reader, Move moveTwo, String name, String description, int level, String archetype, int energyPoints) { //primary_move_target, primary_move_accuracy, power_percent String primaryMoveTarget = reader.GetString("primary_move_target"); double primaryMoveAccuracy = reader.GetDouble("primary_move_accuracy"); double powerPercent = reader.GetDouble("power_percent"); ArchetypeID archetypeID = Archetype.GetArchetypeID(archetype); Move move = null; if (moveTwo == null) { move = new CounterMove(name, description, powerPercent, primaryMoveAccuracy, primaryMoveTarget, level, archetypeID, energyPoints, energyPoints); } else { move = new CounterMove(moveTwo, name, description, powerPercent, primaryMoveAccuracy, primaryMoveTarget, level, archetypeID, energyPoints, energyPoints); } return(move); }
public void SignalSoulTrap() { Dictionary <ArchetypeID, int> dictionary = new Dictionary <ArchetypeID, int>(); foreach (global::H.L l in this.deck.get_Stacks()) { ArchetypeID a = l.get_Archetype().A; int count = this.GlobalCollection.GetCount(a); if (count < 0) { Debug.Log(string.Format(Constants.Yb(), a, count)); dictionary.Add(a, -count); } } foreach (KeyValuePair <ArchetypeID, int> keyValuePair in dictionary) { for (int i = 0; i < keyValuePair.Value; i++) { this.MoveFromDeck(keyValuePair.Key); } } }
private bool tryToMove(ArchetypeID card, int count) { bool result = false; if (count > 0) { int num; this.GlobalCollection.get_Counts().TryGetValue(card, out num); int num2 = Mathf.Min(count, num); if (num2 < count) { Debug.LogWarning(string.Format(Constants.FY(), count, num, card)); } if (num2 > 0) { result = true; this.current_deck.AddToCount(card, num2); this.deck_editor_saver.set_UnsavedChanges(true); } } return(result); }
public CounterMove(Move secondaryMove, String name, String description, double accuracy, double powerPercent, String target, int level, ArchetypeID moveArchetype, int energyPoints, int maxEnergyPoints) { SecondaryMove = secondaryMove; MoveName = name; MoveDescription = description; PrimaryMoveAccuracy = accuracy; MoveTarget = target; MoveLevel = level; MoveEnergyPoints = energyPoints; MoveMaxEnergyPoints = maxEnergyPoints; MovePowerPercent = powerPercent; MoveType = "COUNTER"; }
public RegularMove(Move secondaryMove, String name, String description, double accuracy, String target, int level, ArchetypeID moveArchetype, int energyPoints, int maxEnergyPoints, double powerPercent, double recoildDamagePercent) { SecondaryMove = secondaryMove; MoveName = name; MoveDescription = description; PrimaryMoveAccuracy = accuracy; MoveTarget = target; MoveLevel = level; MoveEnergyPoints = energyPoints; MoveMaxEnergyPoints = maxEnergyPoints; RecoilDamagePercent = recoildDamagePercent; MovePowerPercent = powerPercent; MoveType = "REGULAR"; }
public PriorityMove(String name, String description, double accuracy, String target, int level, ArchetypeID moveArchetype, int energyPoints, int maxEnergyPoints, double powerPercent, int priorityLevel) { MoveName = name; MoveDescription = description; PrimaryMoveAccuracy = accuracy; MoveTarget = target; MoveLevel = level; MoveEnergyPoints = energyPoints; MoveMaxEnergyPoints = maxEnergyPoints; MovePowerPercent = powerPercent; AdjustPriorityMove(priorityLevel); }