Exemplo n.º 1
0
 //Checking if the OldMan is near
 void IsTheOldManIsNear()
 {
     if (MainHero.IsPressedF() && mainHero.IsNear("OldMan") && MainHero.IsCanTalk)
     {
         TheOldManIsNear();
     }
 }
Exemplo n.º 2
0
        private void OnAllAttribute(KProtoBuf buf)
        {
            S2C_SYNC_ALL_ATTRIBUTE respond     = buf as S2C_SYNC_ALL_ATTRIBUTE;
            MajorPlayer            majorPlayer = PlayerManager.GetInstance().MajorPlayer;

            majorPlayer.HeroData[KAttributeType.atMaxHP]          = respond.MaxHP;
            majorPlayer.HeroData[KAttributeType.atMaxMP]          = respond.MaxMP;
            majorPlayer.HeroData[KAttributeType.atAttack]         = respond.Attack;
            majorPlayer.HeroData[KAttributeType.atDefence]        = respond.Defence;
            majorPlayer.HeroData[KAttributeType.atMiss]           = respond.Miss;
            majorPlayer.HeroData[KAttributeType.atCrit]           = respond.Crit;
            majorPlayer.HeroData[KAttributeType.atReduceCrit]     = respond.ReduceCrit;
            majorPlayer.HeroData[KAttributeType.atCritHurt]       = respond.CritHurt;
            majorPlayer.HeroData[KAttributeType.atReduceCritHurt] = respond.ReduceCritHurt;
            majorPlayer.HeroData[KAttributeType.atAttackSpeed]    = respond.AttackSpeed;
            majorPlayer.HeroData[KAttributeType.atMoveSpeed]      = respond.MoveSpeed;
            majorPlayer.HeroData[KAttributeType.atHpRecover]      = respond.HpRecover;
            majorPlayer.HeroData[KAttributeType.atMpRecover]      = respond.MpRecover;
            majorPlayer.HeroData[KAttributeType.atReflex]         = respond.Reflex;
            majorPlayer.HeroData[KAttributeType.atReduceDefence]  = respond.ReduceDefence;
            majorPlayer.HeroData[KAttributeType.atDamageMore]     = respond.DamageMore;
            majorPlayer.HeroData[KAttributeType.atDamageLess]     = respond.DamageLess;
            majorPlayer.HeroData[KAttributeType.atReduceDamage]   = respond.ReduceDamage;
            majorPlayer.HeroData[KAttributeType.atExtDamage]      = respond.ExtDamage;
            majorPlayer.HeroData[KAttributeType.atDamageBack]     = respond.DamageBack;
            majorPlayer.HeroData[KAttributeType.atAttackRecover]  = respond.AttackRecover;
            majorPlayer.HeroData[KAttributeType.atUpAttack]       = respond.UpAttack;

            if (MainHero != null)
            {
                MainHero.property.maxHp = respond.MaxHP;
                MainHero.property.maxMp = respond.MaxMP;
                MainHero.DispatchEvent(ControllerCommand.SET_SPEED, respond.MoveSpeed);
            }
        }
Exemplo n.º 3
0
        private void OnSelfAttribute(KProtoBuf buf)
        {
            S2C_SYNC_SELF_ATTRIBUTE respond = buf as S2C_SYNC_SELF_ATTRIBUTE;
            KAttributeType          eType   = (KAttributeType)respond.AttributeType;
            int nValue = respond.AttributeValue;

            MajorPlayer majorPlayer = PlayerManager.GetInstance().MajorPlayer;

            majorPlayer.HeroData[eType] = nValue;

            switch (eType)
            {
            case KAttributeType.atMaxHP:
                MainHero.property.maxHp = nValue;
                break;

            case KAttributeType.atMaxMP:
                MainHero.property.maxMp = nValue;
                break;

            case KAttributeType.atMoveSpeed:
                MainHero.DispatchEvent(ControllerCommand.SET_SPEED, nValue);
                break;
            }
        }
Exemplo n.º 4
0
 public void DoMainHeroBuff(King toKing, TeamAttackingData data, EffectTimeType time)
 {
     if (MainHero == null)
     {
         return;
     }
     MainHero.DoBuff(toKing, data, time);
 }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //for the future using classes
        mainHero = GameObject.Find("MainHero").AddComponent <MainHero>();

        //won/lost the last game
        IsAfterTheGame();
    }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            Field    f    = new Field(20, 20);
            MainHero hero = new MainHero(0, 0, 0, 0);
            Enemy    e1   = new Enemy(7, 6);

            f.CreateObstacle(4, 5); f.CreateObstacle(6, 7);
            f.CreateObstacle(4, 6); f.CreateObstacle(7, 7);
            f.CreateObstacle(4, 7); f.CreateObstacle(8, 7);
            f.CreateObstacle(5, 4); f.CreateObstacle(9, 7);
            f.CreateObstacle(6, 4); f.CreateObstacle(10, 7);
            f.CreateObstacle(8, 8); f.CreateObstacle(3, 2);
            f.CreateObstacle(8, 9); f.CreateObstacle(3, 1);
            f.CreateObstacle(2, 3); f.CreateObstacle(4, 5);
            f.CreateObstacle(3, 3); f.CreateObstacle(4, 6);
            f.CreateObstacle(1, 3); f.CreateObstacle(4, 7);

            ConsoleKeyInfo key = new ConsoleKeyInfo();

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    key = Console.ReadKey(true);
                    if (key.Key == ConsoleKey.RightArrow)
                    {
                        hero.SetSteps(0, 1);
                    }
                    else if (key.Key == ConsoleKey.LeftArrow)
                    {
                        hero.SetSteps(0, -1);
                    }
                    else if (key.Key == ConsoleKey.DownArrow)
                    {
                        hero.SetSteps(1, 0);
                    }
                    else if (key.Key == ConsoleKey.UpArrow)
                    {
                        hero.SetSteps(-1, 0);
                    }
                    else if (key.Key == ConsoleKey.Escape)
                    {
                        break;
                    }
                }
                else
                {
                    hero.SetSteps(0, 0);
                }
                hero.Movement(f);
                hero.WriteDown(f);
                e1.WriteDown(f);
                f.CreateField();
                Console.Clear();
                f.ClearUp();
            }
        }
Exemplo n.º 7
0
    private void OnTriggerEnter(Collider collider)
    {
        MainHero mainHero = collider.gameObject.GetComponent <MainHero>();

        if (mainHero != null)
        {
            AddArmor(_armorBonus, IsSuperArmorBonus);
        }
    }
Exemplo n.º 8
0
    private void OnTriggerEnter(Collider collider)
    {
        MainHero mainHero = collider.gameObject.GetComponent <MainHero>();

        if (mainHero != null)
        {
            AddHeath(_healthBonus, IsSuperHealthBonus);
        }
    }
Exemplo n.º 9
0
        public Playground()
        {
            MainHero    mainhero = MainHero.getInstance(100, 15);
            UnitMonster monster  = new UnitMonster(100, 10);

            BattleMechanicSimplistic fight = new BattleMechanicSimplistic();

            fight.Fight1vs1(mainhero, monster);
        }
    private void OnTriggerEnter(Collider collider)
    {
        MainHero mainHero = collider.gameObject.GetComponent <MainHero>();

        if (mainHero != null)
        {
            GameController.Instance.ExitFromCurrentLevelFound(); //Герой нашел выход с уровня
        }
    }
Exemplo n.º 11
0
 void Update()
 {
     IsTheOldManIsNear();
     // to enabled go to the next dialog
     if (MainHero.IsPressedF())
     {
         IsAfterTheGame();
     }
 }
Exemplo n.º 12
0
        private void NotifyCastSkillFail(KProtoBuf buf)
        {
            S2C_CAST_SKILL_FAIL_NOTIFY respond = buf as S2C_CAST_SKILL_FAIL_NOTIFY;

            Debug.LogWarning("NotifyCastSkillFail ");
            if (SceneLogic.GetInstance().MainHero.ActiveAction is ActionWaitSkill)
            {
                MainHero.DispatchEvent(ControllerCommand.FinishImmediate);
            }
        }
Exemplo n.º 13
0
    void Update()
    {
        mainHero.Update();

        if (MainHero.IsPressedF())
        {
            MainHero.IsLeft = true;
            IsTableIsNear();
            IsBuildingIsNear();
        }
    }
Exemplo n.º 14
0
    void Update()
    {
        if (!en)
        {
            en = pc.enemy.GetComponent <MainHero>();
        }

        CheckDistance();
        States();
        AIAgent();
    }
Exemplo n.º 15
0
        public void Start(ref MainHero mainHero, ref Boss boss)
        {
            var rnd = new Random();

            Map.Size = rnd.Next(10, 20);

            Map[0]            = mainHero;
            mainHero.Location = 0;
            Map[Map.Size - 1] = boss;
            boss.Location     = Map.Size - 1;

            NewGame();
        }
Exemplo n.º 16
0
    public override void Init(bool UserSoure = true)
    {
        Name = Content["0"];

        //if (Content.ContainsKey("Army") && UserSoure) { this.army = Game.DynamicDataManager.GetGameData<Army>(Content["Army"]); } else { SaveValue("Army", ""); }
        if (UserSoure)
        {
            army = InitParaByDynamic <Army>(UserSoure, "Army", "");
        }

        // if (Content.ContainsKey("MainHero"))
        //     MainHero = GameDataTool.GetOrNewGameDataByDynamic<Hero>(UserSoure, Content["MainHero"]);
        // else { SaveValue("MainHero", ""); }
        MainHero = InitParaByDynamic <Hero>(UserSoure, "MainHero");

        if (MainHero != null)
        {
            MainHero.SetTeam(this);
        }

        // if (Content.ContainsKey("MinorHero"))
        //     MinorHero = GameDataTool.GetOrNewGameDataByDynamic<Hero>(UserSoure, Content["MinorHero"]);
        // else { SaveValue("MinorHero", ""); }
        MinorHero = InitParaByDynamic <Hero>(UserSoure, "MinorHero");
        if (MinorHero != null)
        {
            MinorHero.SetTeam(this);
        }

        // for (int i = 0; i < units.Length; i++)
        // {
        //     if (Content.ContainsKey("Unit_" + i))
        //         units[i] = GameDataTool.GetOrNewGameDataByDynamic<Unit>(UserSoure, Content["Unit_" + i]);
        //     else { SaveValue("Unit_" + i, ""); }
        // }
        units = InitParas <Unit>(UserSoure, "Unit", units.Length, Game.DynamicDataManager);


        for (int i = 0; i < units.Length; i++)
        {
            if (units[i] != null)
            {
                units[i].SetTeam(this);
            }
        }
    }
Exemplo n.º 17
0
    void SceneTriggers()
    {
        if (isEndOfScene == false)
        {
            if (MainHero.IsPressedF() && isWaitingNextRound == false)   //if F pressed
            {
                //Checking where is the contoler and makes demage to an enemy
                Controller.IsCanGo = false;
                UpdateEnemyHelth();

                StartCoroutine("WaitNextRound");
                CheckHealth(); //what to do, if heroHealth or enemyHealth <= 0
                StartCoroutine("CheckTheEndOfScene");
                isWaitingNextRound = true;
            }
        }
    }
Exemplo n.º 18
0
        public static void UpdateLogic(EventArgs args)
        {
            if (!MenuManager.IsEnable)
            {
                return;
            }
            if (_updater == null)
            {
                _updater = new Sleeper();
            }
            if (_updater.Sleeping)
            {
                return;
            }
            _updater.Sleep(500);
            var illus =
                ObjectManager.GetEntities <Hero>().Where(x => x.IsValid && x.IsIllusion && x.IsControllable && x.IsAlive).ToArray();
            var replicate = illus.FirstOrDefault(x => x.HasModifier("modifier_morph_replicate"));
            var hybrid    = illus.FirstOrDefault(x => x.HasModifier("modifier_morph_hybrid_special"));

            if (MainHero == null || !MainHero.IsValid)
            {
                if (Members.MainHero != null && Members.MainHero.IsValid)
                {
                    MainHero = new MainHero(Members.MainHero);
                }
            }

            if (Replicate == null || !Replicate.IsValid)
            {
                if (replicate != null)
                {
                    Replicate = new Replicate(replicate);
                }
            }

            if (Hybrid == null || !Hybrid.IsValid)
            {
                if (hybrid != null)
                {
                    Hybrid = new Hybrid(hybrid);
                }
            }
        }
Exemplo n.º 19
0
        public static void HeroVsMonster()
        {
            MainHero    h = new MainHero(armorType1, swordType1);
            MonsterHexo m = new MonsterHexo();

            bool a = true;

            while (a)
            {
                if (h.ArmorType1Obj.ArmorStrength > 0)
                {
                    h.ArmorType1Obj.ArmorStrength = h.ArmorType1Obj.ArmorStrength - m.Damage;
                    Console.WriteLine("|||\t Монстр ударяет по вам! Но урон прошёл по броне \t|||");
                }
                else
                {
                    h.Health = h.Health - m.Damage;
                    Console.WriteLine($"|||\t Монстр нанёс вам {m.Damage} урона, теперь у вас {h.Health} жизней \t|||");
                }
                if (m.Health > 0)
                {
                    m.Health = m.Health - h.SwordType1Obj.SwordDamage;
                    Console.WriteLine($"|||\t Вы нанесли {h.SwordType1Obj.SwordDamage} урона монстру! У монстра осталось {m.Health} жизней \t|||");
                }
                if (h.Health < 0)
                {
                    Console.WriteLine($"|||\t Вы были побеждены монстром! \t|||");

                    a = false;
                }
                if (m.Health < 0)
                {
                    Console.WriteLine($"|||\t Вы победили монстра!! \t|||");

                    a = false;
                }
            }
            StartMenu gotoMenu = new StartMenu();

            gotoMenu.Menu();
        }
Exemplo n.º 20
0
        public void Fight1vs1(MainHero mh, UnitMonster monster)
        {
            /*for (int i = 0; i < 10; i++)
             * {
             *  mh.Health = mh.Health - monster.Damage;
             *  monster.Health -= mh.Damage;
             *  Console.WriteLine(mh.Health);
             *  Console.WriteLine(monster.Health);
             * }*/



            while (mh.Health >= 0 && monster.Health >= 0)
            {
                mh.Health       = mh.Health - monster.Damage;
                monster.Health -= mh.Damage;
                round++;
                Console.WriteLine("round" + round);
                Console.WriteLine(mh.Health);
                Console.WriteLine(monster.Health);
            }
        }
Exemplo n.º 21
0
 public void Save(string savename, MainHero mainHero, Boss boss)
 {
     using (StreamWriter sw = new StreamWriter($"saves/savelog.txt", true))
     {
         sw.WriteLine($"{savename}.txt");
     }
     using (StreamWriter sw = new StreamWriter($"saves/{savename}.txt"))
     {
         sw.WriteLine($"Map Size - {Map.Size}");
         for (int i = 0; i < mainHero.Location; i++)
         {
             sw.WriteLine($"null: Location - {i}");
         }
         for (int i = mainHero.Location; i < Map.Size; i++)
         {
             if (Map[i] is Unit)
             {
                 if (Map[i] is MainHero)
                 {
                     MainHero temp = (MainHero)Map[i];
                     sw.WriteLine($"Unit/MainHero/: Name - {temp.Name}, HP - {temp.HP}, Mana - {temp.Mana}, Armor - {temp.Armor}, Damage - {temp.Damage}, Gold - {temp.Gold}, Location - {temp.Location}, ");
                 }
                 else if (Map[i] is Boss)
                 {
                     Boss temp = (Boss)Map[i];
                     sw.WriteLine($"Unit/Boss/: Name - {temp.Name}, HP - {temp.HP}, Mana - {temp.Mana}, Armor - {temp.Armor}, Damage - {temp.Damage}, Location - {temp.Location}, ");
                 }
                 else
                 {
                     //Все рядовые мобы
                     if (Map[i] is Goblin)
                     {
                         Goblin temp = (Goblin)Map[i];
                         sw.WriteLine($"Unit/Goblin/: Name - {temp.Name}, HP - {temp.HP}, Mana - {temp.Mana}, Armor - {temp.Armor}, Damage - {temp.Damage}, Gold - {temp.Gold}, Location - {temp.Location}, ");
                     }
                     else if (Map[i] is Spider)
                     {
                         Spider temp = (Spider)Map[i];
                         sw.WriteLine($"Unit/Spider/: Name - {temp.Name}, HP - {temp.HP}, Mana - {temp.Mana}, Armor - {temp.Armor}, Damage - {temp.Damage}, Location - {temp.Location}, ");
                     }
                 }
             }
             else if (Map[i] is Loot)
             {
                 if (Map[i] is Chest)
                 {
                     Chest temp = (Chest)Map[i];
                     sw.WriteLine($"Loot/Chest/: Gold - {temp.Gold}, Location - {temp.Location}, ");
                 }
                 else if (Map[i] is Aura)
                 {
                     if (Map[i] is AttackAura)
                     {
                         AttackAura temp = (AttackAura)Map[i];
                         sw.WriteLine($"Loot/Aura/AttackAura/: AttackBuff - {temp.AttackBuff}, Location - {temp.Location}, ");
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 22
0
        static void Main(string[] args)
        {
            var Game = new Game();

            var MainHero = new MainHero("MainHero", 100, 0, 2, 20, 100, 0);
            var Boss     = new Boss("Boss", 100, 0, 5, 5, Game.Map.Size - 1);


            Game.BattleEventArgs.MainHero = MainHero;
            Game.OnBattleEvent           += Game_OnBattleEvent;


            using (StreamReader sr = new StreamReader("saves/savelog.txt"))
            {
                if (sr.ReadLine() == null)
                {
                    Console.WriteLine("1 - Начать новую игру\n3 - Выйти из игры");
                }
                else
                {
                    Console.WriteLine("1 - Начать новую игру\n2 - Загрузить игру\n3 - Выйти из игры");
                }
            }
            int menu = Convert.ToInt32(Console.ReadLine());

            Console.Clear();

            if (menu == 1)
            {
                Game.Start(ref MainHero, ref Boss);
            }
            else if (menu == 2)
            {
                Game.Load(AskSaveName(), ref MainHero, ref Boss);
            }
            else if (menu == 3)
            {
                Environment.Exit(0);
            }

            while (!Game.End)
            {
                MainHero.ShowStatus();
                Console.WriteLine("-------------------------------------------");
                if (Game.Map[Game.Map.Size - 2] != MainHero) //Обычная ходьба по подземелью
                {
                    Console.WriteLine("Ваши действия:\n1 - Идти вперед\n8 - Сохраниться\n9 - Выйти из игры");
                    int turn = Convert.ToInt32(Console.ReadLine());
                    Console.Clear();


                    if (turn == 1)
                    {
                        if (Game.Map[MainHero.Location + 1] is Loot)
                        {
                            if (Game.Map[MainHero.Location + 1] is Chest)
                            {
                                Chest temp = (Chest)Game.Map[MainHero.Location + 1];
                                Console.Write($"Вы нашли золото!\n+{temp.Gold} золота\n");
                                Console.WriteLine("-------------------------------------------");
                                MainHero.Gold          += temp.Gold;
                                Game.Map[temp.Location] = MainHero;
                                MainHero.Location++;
                            }
                            else if (Game.Map[MainHero.Location + 1] is Aura)
                            {
                                if (Game.Map[MainHero.Location + 1] is AttackAura)
                                {
                                    AttackAura temp = (AttackAura)Game.Map[MainHero.Location + 1];
                                    Console.Write($"Вы обнаружили алтарь древних Богов Войны!\n+{temp.AttackBuff} к урону\n");
                                    Console.WriteLine("-------------------------------------------");
                                    MainHero.Damage        += temp.AttackBuff;
                                    Game.Map[temp.Location] = MainHero;
                                    MainHero.Location++;
                                }
                            }
                        }
                        else if (Game.Map[MainHero.Location + 1] is Unit)
                        {
                            Unit temp = (Unit)Game.Map[MainHero.Location + 1];
                            Console.WriteLine($"Вы встретились с {temp.Name}!");
                            Console.WriteLine("-------------------------------------------");
                            Game.BattleEventArgs.Enemy = temp;
                            Game.Meeting(temp, Game.BattleEventArgs);

                            Game.Map[temp.Location] = MainHero;
                            MainHero.Location++;
                        }
                    }
                    else if (turn == 8)
                    {
                        Console.WriteLine("Выберите название для сохранения");
                        string savename = Console.ReadLine();
                        Game.Save(savename, MainHero, Boss);
                    }
                    else if (turn == 9)
                    {
                        Environment.Exit(0);
                    }
                }
                else //Встреча с боссом
                {
                    Console.Write("Впереди босс...\nВаши действия:\n1 - Идти вперед\n2 - Отдохнуть, восстановив здоровье, но дав боссу времени на приготовления\n");
                    int turn = Convert.ToInt32(Console.ReadLine());
                    Console.Clear();
                    if (turn == 2)
                    {
                        var rnd  = new Random();
                        int temp = rnd.Next(5, 11);
                        Console.WriteLine($"Вы полностью восстановились, но {Boss.Name} увеличил свою броню на {temp}");
                        Console.WriteLine("-------------------------------------------");
                        Boss.Armor += temp;
                        MainHero.HP = 100; //Изменить на максимум
                    }
                    Console.WriteLine($"Вы встретились с {Boss.Name}!");
                    Game.BattleEventArgs.Enemy = Boss;
                    Game.Meeting(Boss, Game.BattleEventArgs);

                    Game.Map[Boss.Location] = MainHero;
                    MainHero.Location++;
                    Game.End = true;
                }
            }
        }
Exemplo n.º 23
0
    private DialogInterface table;  //для наследования класса DialogInterface

    #endregion
    void Start()
    {
        mainHero = GameObject.Find("MainHero").AddComponent <MainHero>();
    }
Exemplo n.º 24
0
 void Start()
 {
     pl = transform.root.GetComponent <MainHero>();
 }
Exemplo n.º 25
0
 public InitStatisticsUiEvent(MainHero mh, List <Hero> list)
 {
     HeadHero = mh;
     Heroes   = list;
 }
Exemplo n.º 26
0
        public void Load(string savename, ref MainHero mainHero, ref Boss boss)
        {
            using (StreamReader sr = new StreamReader($"saves/{savename}"))
            {
                //Поиск размера
                string buff = sr.ReadLine();
                buff     = buff.Remove(0, (buff.IndexOf("-") + 2));
                Map.Size = Convert.ToInt32(buff);
                //

                //Поиск всего, что лежит на карте
                for (int i = 0; !sr.EndOfStream; i++)
                {
                    buff = sr.ReadLine();
                    if (buff.Contains("null"))
                    {
                        Map[i] = null;
                    }
                    else
                    {
                        string typeOfObject_Main = buff.Substring(0, buff.IndexOf("/"));
                        buff = buff.Remove(0, (buff.IndexOf("/") + 1));
                        string typeOfObject_1 = "", typeOfObject_2 = ""; //Если создаются новые ветки наследования объектов, то сюда просто новое
                        if (typeOfObject_Main == "Unit")
                        {
                            typeOfObject_1 = buff.Substring(0, buff.IndexOf("/"));
                            buff           = buff.Remove(0, (buff.IndexOf(":") + 2));
                        }
                        else if (typeOfObject_Main == "Loot")
                        {
                            typeOfObject_1 = buff.Substring(0, buff.IndexOf("/"));
                            if (typeOfObject_1 == "Chest")
                            {
                                buff = buff.Remove(0, (buff.IndexOf(":") + 2));
                            }
                            else if (typeOfObject_1 == "Aura")
                            {
                                buff           = buff.Remove(0, (buff.IndexOf("/") + 1));
                                typeOfObject_2 = buff.Substring(0, buff.IndexOf("/"));
                                if (typeOfObject_2 == "AttackAura")
                                {
                                    buff = buff.Remove(0, (buff.IndexOf(":") + 2));
                                }
                            }
                        }
                        List <string> attributes = new List <string>();
                        for (int j = 0; buff != ""; j++)
                        {
                            buff = buff.Remove(0, (buff.IndexOf("-") + 2));
                            attributes.Add(buff.Substring(0, buff.IndexOf(",")));
                            buff = buff.Remove(0, (buff.IndexOf(",") + 2));
                        }


                        if (typeOfObject_Main == "Unit")
                        {
                            if (typeOfObject_1 == "MainHero")
                            {
                                MainHero temp = (MainHero)Map[i];
                                temp     = new MainHero(attributes[0], Convert.ToInt32(attributes[1]), Convert.ToInt32(attributes[2]), Convert.ToInt32(attributes[3]), Convert.ToInt32(attributes[4]), Convert.ToInt32(attributes[5]), Convert.ToInt32(attributes[6]));
                                Map[i]   = temp;
                                mainHero = temp;
                            }
                            else if (typeOfObject_1 == "Boss")
                            {
                                Boss temp = (Boss)Map[i];
                                temp   = new Boss(attributes[0], Convert.ToInt32(attributes[1]), Convert.ToInt32(attributes[2]), Convert.ToInt32(attributes[3]), Convert.ToInt32(attributes[4]), Convert.ToInt32(attributes[5]));
                                Map[i] = temp;
                                boss   = temp;
                            }
                            else
                            {
                                if (typeOfObject_1 == "Goblin")
                                {
                                    Goblin temp = (Goblin)Map[i];
                                    temp   = new Goblin(attributes[0], Convert.ToInt32(attributes[1]), Convert.ToInt32(attributes[2]), Convert.ToInt32(attributes[3]), Convert.ToInt32(attributes[4]), Convert.ToInt32(attributes[5]), Convert.ToInt32(attributes[6]));
                                    Map[i] = temp;
                                }
                                else if (typeOfObject_1 == "Spider")
                                {
                                    Spider temp = (Spider)Map[i];
                                    temp   = new Spider(attributes[0], Convert.ToInt32(attributes[1]), Convert.ToInt32(attributes[2]), Convert.ToInt32(attributes[3]), Convert.ToInt32(attributes[4]), Convert.ToInt32(attributes[5]));
                                    Map[i] = temp;
                                }
                            }
                        }
                        else if (typeOfObject_Main == "Loot")
                        {
                            if (typeOfObject_1 == "Chest")
                            {
                                Chest temp = (Chest)Map[i];
                                temp   = new Chest(Convert.ToInt32(attributes[0]), Convert.ToInt32(attributes[1]));
                                Map[i] = temp;
                            }
                            else if (typeOfObject_1 == "Aura")
                            {
                                if (typeOfObject_2 == "AttackAura")
                                {
                                    AttackAura temp = (AttackAura)Map[i];
                                    temp   = new AttackAura(Convert.ToInt32(attributes[0]), Convert.ToInt32(attributes[1]));
                                    Map[i] = temp;
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 27
0
 void Start()
 {
     pc = GetComponent <MainHero>();
 }