예제 #1
0
        public bool IsCardAvailable(ArchetypeID card)
        {
            int num;

            this.GlobalCollection.get_Counts().TryGetValue(card, out num);
            return(num > 0);
        }
예제 #2
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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
                }
            }
        }
예제 #6
0
        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);
        }
예제 #7
0
 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";
 }
예제 #8
0
 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";
 }
예제 #9
0
 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);
 }