예제 #1
0
    static public Spell StringToSpell(string spellType)
    {
        Spell behavior = null;

        switch (spellType)
        {
        case "AddHealth":
            behavior = new AddHealth();
            break;

        case "Antidote":
            behavior = new Antidote();
            break;

        case "Armor":
            behavior = new Armor();
            break;

        case "DieOff":
            behavior = new DieOff();
            break;

        case "Revive":
            behavior = new Revive();
            break;
        }
        return(behavior);
    }
예제 #2
0
        /// <summary>
        /// Metoda, která pro danou buňku rozhodne, zdali patří do příští generace.
        /// </summary>
        /// <param name="cell">buňka, která bude vyhodnocena</param>
        /// <returns>True, patří-li buňka do další generace, jinak false.</returns>
        public Boolean EvaluationOfCell(Point cell, HashSet <Point> cells)
        {
            int numberOfNeighbours = 0; //počet živých sousedů buňky

            //cyklus, který spočítá počet živých sousedů dané buňky
            foreach (Point direction in Surroundings)
            {
                Point surroundingCell = new Point(cell.X + direction.X, cell.Y + direction.Y);
                if (cells.Contains(surroundingCell))
                {
                    numberOfNeighbours++;
                }
            }

            if (cells.Contains(cell))
            {
                //buňka žije a je tedy nutné rozhodnout, jestli přežije
                if (Survive.Contains(numberOfNeighbours))
                {
                    return(true);
                }
            }
            else
            {
                //buňka je mrtvá a je tedy nutné rozhodnout, jestli obživne
                if (Revive.Contains(numberOfNeighbours))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #3
0
파일: HeroesUI.cs 프로젝트: jrpartida/LOTF
    public void ShowBleedOutTimer(bool show, Revive player)
    {
        if (player.gameObject != MyPlayer)
        {
            return;
        }

        _BleedOutTimer.SetActive(show);
        _BleedOutTimer.GetComponent <BleedOutTimer>().Player = player;
    }
예제 #4
0
    public void Death()
    {
        if (health <= 0)
        {
            playerDeath.Play();
            //Prevent the player from moving
            pm.enabled = false;
            isDead     = true;
            //sprite.material.color = new Color(51,51,51);
            // Debug.Log("Spawned");

            pm.FreezeRB();

            Revive revCircle = Instantiate(reviveObject, transform.position + -Vector3.forward * 3f, Quaternion.identity).GetComponent <Revive>();
            revCircle.SetParameters(this);
            reviveCircle = revCircle;
        }
    }
예제 #5
0
    private void Start()
    {
        iGLevelManager.coinsToRevive.text = coinsToRevive.ToString();
        scene      = SceneManager.GetActiveScene();
        mColliders = GetComponents <Collider>();

        ReactivateCollider = () => { foreach (Collider c in mColliders)
                                     {
                                         c.enabled = true;
                                     }
        };
        DesactivatePanel = delegate()
        {
            iGLevelManager.canvas[0].SetActive(true);
            iGLevelManager.canvas[2].SetActive(false);
            iGLevelManager.adWatchButton.SetActive(false);
            iGLevelManager.reviveButton.SetActive(true);
        };
    }
예제 #6
0
 public void MergeFrom(ItemSettings other)
 {
     if (other == null)
     {
         return;
     }
     if (other.ItemId != 0)
     {
         ItemId = other.ItemId;
     }
     if (other.ItemType != 0)
     {
         ItemType = other.ItemType;
     }
     if (other.Category != 0)
     {
         Category = other.Category;
     }
     if (other.DropFreq != 0F)
     {
         DropFreq = other.DropFreq;
     }
     if (other.DropTrainerLevel != 0)
     {
         DropTrainerLevel = other.DropTrainerLevel;
     }
     if (other.pokeball_ != null)
     {
         if (pokeball_ == null)
         {
             pokeball_ = new global::POGOProtos.Settings.Master.Item.PokeballAttributes();
         }
         Pokeball.MergeFrom(other.Pokeball);
     }
     if (other.potion_ != null)
     {
         if (potion_ == null)
         {
             potion_ = new global::POGOProtos.Settings.Master.Item.PotionAttributes();
         }
         Potion.MergeFrom(other.Potion);
     }
     if (other.revive_ != null)
     {
         if (revive_ == null)
         {
             revive_ = new global::POGOProtos.Settings.Master.Item.ReviveAttributes();
         }
         Revive.MergeFrom(other.Revive);
     }
     if (other.battle_ != null)
     {
         if (battle_ == null)
         {
             battle_ = new global::POGOProtos.Settings.Master.Item.BattleAttributes();
         }
         Battle.MergeFrom(other.Battle);
     }
     if (other.food_ != null)
     {
         if (food_ == null)
         {
             food_ = new global::POGOProtos.Settings.Master.Item.FoodAttributes();
         }
         Food.MergeFrom(other.Food);
     }
     if (other.inventoryUpgrade_ != null)
     {
         if (inventoryUpgrade_ == null)
         {
             inventoryUpgrade_ = new global::POGOProtos.Settings.Master.Item.InventoryUpgradeAttributes();
         }
         InventoryUpgrade.MergeFrom(other.InventoryUpgrade);
     }
     if (other.xpBoost_ != null)
     {
         if (xpBoost_ == null)
         {
             xpBoost_ = new global::POGOProtos.Settings.Master.Item.ExperienceBoostAttributes();
         }
         XpBoost.MergeFrom(other.XpBoost);
     }
     if (other.incense_ != null)
     {
         if (incense_ == null)
         {
             incense_ = new global::POGOProtos.Settings.Master.Item.IncenseAttributes();
         }
         Incense.MergeFrom(other.Incense);
     }
     if (other.eggIncubator_ != null)
     {
         if (eggIncubator_ == null)
         {
             eggIncubator_ = new global::POGOProtos.Settings.Master.Item.EggIncubatorAttributes();
         }
         EggIncubator.MergeFrom(other.EggIncubator);
     }
     if (other.fortModifier_ != null)
     {
         if (fortModifier_ == null)
         {
             fortModifier_ = new global::POGOProtos.Settings.Master.Item.FortModifierAttributes();
         }
         FortModifier.MergeFrom(other.FortModifier);
     }
     if (other.stardustBoost_ != null)
     {
         if (stardustBoost_ == null)
         {
             stardustBoost_ = new global::POGOProtos.Settings.Master.Item.StardustBoostAttributes();
         }
         StardustBoost.MergeFrom(other.StardustBoost);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
예제 #7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ItemId != 0)
            {
                hash ^= ItemId.GetHashCode();
            }
            if (ItemType != 0)
            {
                hash ^= ItemType.GetHashCode();
            }
            if (Category != 0)
            {
                hash ^= Category.GetHashCode();
            }
            if (DropFreq != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DropFreq);
            }
            if (DropTrainerLevel != 0)
            {
                hash ^= DropTrainerLevel.GetHashCode();
            }
            if (pokeball_ != null)
            {
                hash ^= Pokeball.GetHashCode();
            }
            if (potion_ != null)
            {
                hash ^= Potion.GetHashCode();
            }
            if (revive_ != null)
            {
                hash ^= Revive.GetHashCode();
            }
            if (battle_ != null)
            {
                hash ^= Battle.GetHashCode();
            }
            if (food_ != null)
            {
                hash ^= Food.GetHashCode();
            }
            if (inventoryUpgrade_ != null)
            {
                hash ^= InventoryUpgrade.GetHashCode();
            }
            if (xpBoost_ != null)
            {
                hash ^= XpBoost.GetHashCode();
            }
            if (incense_ != null)
            {
                hash ^= Incense.GetHashCode();
            }
            if (eggIncubator_ != null)
            {
                hash ^= EggIncubator.GetHashCode();
            }
            if (fortModifier_ != null)
            {
                hash ^= FortModifier.GetHashCode();
            }
            if (stardustBoost_ != null)
            {
                hash ^= StardustBoost.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
예제 #8
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ItemId != 0)
            {
                hash ^= ItemId.GetHashCode();
            }
            if (ItemType != 0)
            {
                hash ^= ItemType.GetHashCode();
            }
            if (Category != 0)
            {
                hash ^= Category.GetHashCode();
            }
            if (DropFreq != 0F)
            {
                hash ^= DropFreq.GetHashCode();
            }
            if (DropTrainerLevel != 0)
            {
                hash ^= DropTrainerLevel.GetHashCode();
            }
            if (pokeball_ != null)
            {
                hash ^= Pokeball.GetHashCode();
            }
            if (potion_ != null)
            {
                hash ^= Potion.GetHashCode();
            }
            if (revive_ != null)
            {
                hash ^= Revive.GetHashCode();
            }
            if (battle_ != null)
            {
                hash ^= Battle.GetHashCode();
            }
            if (food_ != null)
            {
                hash ^= Food.GetHashCode();
            }
            if (inventoryUpgrade_ != null)
            {
                hash ^= InventoryUpgrade.GetHashCode();
            }
            if (xpBoost_ != null)
            {
                hash ^= XpBoost.GetHashCode();
            }
            if (incense_ != null)
            {
                hash ^= Incense.GetHashCode();
            }
            if (eggIncubator_ != null)
            {
                hash ^= EggIncubator.GetHashCode();
            }
            if (fortModifier_ != null)
            {
                hash ^= FortModifier.GetHashCode();
            }
            return(hash);
        }
예제 #9
0
 public void MergeFrom(ItemSettings other)
 {
     if (other == null)
     {
         return;
     }
     if (other.ItemId != 0)
     {
         ItemId = other.ItemId;
     }
     if (other.ItemType != 0)
     {
         ItemType = other.ItemType;
     }
     if (other.Category != 0)
     {
         Category = other.Category;
     }
     if (other.DropFreq != 0F)
     {
         DropFreq = other.DropFreq;
     }
     if (other.DropTrainerLevel != 0)
     {
         DropTrainerLevel = other.DropTrainerLevel;
     }
     if (other.pokeball_ != null)
     {
         if (pokeball_ == null)
         {
             pokeball_ = new global::PokemonGoDesktop.API.Proto.PokeballAttributes();
         }
         Pokeball.MergeFrom(other.Pokeball);
     }
     if (other.potion_ != null)
     {
         if (potion_ == null)
         {
             potion_ = new global::PokemonGoDesktop.API.Proto.PotionAttributes();
         }
         Potion.MergeFrom(other.Potion);
     }
     if (other.revive_ != null)
     {
         if (revive_ == null)
         {
             revive_ = new global::PokemonGoDesktop.API.Proto.ReviveAttributes();
         }
         Revive.MergeFrom(other.Revive);
     }
     if (other.battle_ != null)
     {
         if (battle_ == null)
         {
             battle_ = new global::PokemonGoDesktop.API.Proto.BattleAttributes();
         }
         Battle.MergeFrom(other.Battle);
     }
     if (other.food_ != null)
     {
         if (food_ == null)
         {
             food_ = new global::PokemonGoDesktop.API.Proto.FoodAttributes();
         }
         Food.MergeFrom(other.Food);
     }
     if (other.inventoryUpgrade_ != null)
     {
         if (inventoryUpgrade_ == null)
         {
             inventoryUpgrade_ = new global::PokemonGoDesktop.API.Proto.InventoryUpgradeAttributes();
         }
         InventoryUpgrade.MergeFrom(other.InventoryUpgrade);
     }
     if (other.xpBoost_ != null)
     {
         if (xpBoost_ == null)
         {
             xpBoost_ = new global::PokemonGoDesktop.API.Proto.ExperienceBoostAttributes();
         }
         XpBoost.MergeFrom(other.XpBoost);
     }
     if (other.incense_ != null)
     {
         if (incense_ == null)
         {
             incense_ = new global::PokemonGoDesktop.API.Proto.IncenseAttributes();
         }
         Incense.MergeFrom(other.Incense);
     }
     if (other.eggIncubator_ != null)
     {
         if (eggIncubator_ == null)
         {
             eggIncubator_ = new global::PokemonGoDesktop.API.Proto.EggIncubatorAttributes();
         }
         EggIncubator.MergeFrom(other.EggIncubator);
     }
     if (other.fortModifier_ != null)
     {
         if (fortModifier_ == null)
         {
             fortModifier_ = new global::PokemonGoDesktop.API.Proto.FortModifierAttributes();
         }
         FortModifier.MergeFrom(other.FortModifier);
     }
 }
예제 #10
0
 private void OnEnable()
 {
     _Player = gameObject.GetComponentInParent <HeroesUI>().MyPlayer.GetComponent <Revive>();
 }