Beispiel #1
0
        public FioraPassive(Obj_GeneralParticleEmitter emitter, AIHeroClient enemy) : base(emitter.Index, (uint)emitter.NetworkId, emitter as GameObject)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                Passive = PassiveType.UltPassive;
                Color   = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color   = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                Passive = PassiveType.PassiveTimeout;
                Color   = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color   = Color.Green;
            }
            PassiveDistance = Passive == PassiveType.UltPassive ? 400 : 200;
        }
Beispiel #2
0
    public Texture2D GetPassiveTexture(PassiveType pt)
    {
        Texture2D tx = null;

        switch (pt)
        {
        case PassiveType.Flying:
            tx = Fly;
            break;

        case PassiveType.FlyingHit:
            tx = FlyHit;
            break;

        case PassiveType.DefenseAddOne:
            tx = Mole;
            break;

        case PassiveType.MultiArrow:
            tx = Haste;
            break;

        case PassiveType.WoundBite:
            tx = Flamming;
            break;
        }
        return(tx);
    }
        public FioraPassive(Obj_GeneralParticleEmitter emitter, AIHeroClient enemy)
            : base(emitter.Index, (uint)emitter.NetworkId, emitter as GameObject)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                Passive = PassiveType.UltPassive;
                Color = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                Passive = PassiveType.PassiveTimeout;
                Color = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color = Color.Green;
            }
            PassiveDistance = Passive == PassiveType.UltPassive ? 400 : 200;
        }
Beispiel #4
0
        public FioraPassive(Obj_GeneralParticleEmitter emitter, Obj_AI_Hero enemy)
            : base((ushort) emitter.Index, (uint) emitter.NetworkId)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                //PassiveManager.PassiveList.RemoveAll(
                //    p => p.Target.Equals(Target) && !p.Type.Equals(PassiveType.UltPassive));
                Passive = PassiveType.UltPassive;
                Color = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                PassiveManager.PassiveList.RemoveAll(p => p.Target.Equals(Target) && p.Type.Equals(PassiveType.Passive));
                Passive = PassiveType.PassiveTimeout;
                Color = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color = Color.Green;
            }
            //Console.WriteLine("[PASSIVE] Type: {0} Target: {2} Name: {1}", Passive, Name, Target.Name);
            PassiveDistance = Passive.Equals(PassiveType.UltPassive) ? 320 : 200;
        }
Beispiel #5
0
 public PassiveObject(string passiveName, Obj_GeneralParticleEmitter obj, PassiveType passiveType, PassiveDirection passiveDirection)
 {
     PassiveName      = passiveName;
     Object           = obj;
     PassiveType      = passiveType;
     PassiveDirection = passiveDirection;
 }
Beispiel #6
0
 /// <summary>
 /// l=Lightning
 /// s=Snow
 /// v=Vanille
 /// z=Sazh
 /// h=Hope
 /// f=Fang
 /// </summary>
 /// <param name="characters"></param>
 public PassiveSet(PassiveType type, LockingLevel level = LockingLevel.Any, string characters = "lsvzhf")
 {
     this.Characters   = characters;
     this.LockingLevel = level;
     this.Type         = type;
     Passives.passives.Add(this);
 }
Beispiel #7
0
        public FioraPassive(Obj_GeneralParticleEmitter emitter, AIHeroClient enemy)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                //PassiveManager.PassiveList.RemoveAll(
                //    p => p.Target.Equals(Target) && !p.Type.Equals(PassiveType.UltPassive));
                Passive = PassiveType.UltPassive;
                Color   = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color   = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                //PassiveManager.PassiveList.RemoveAll(p => p.Target.Equals(Target) && p.Type.Equals(PassiveType.Passive));
                Passive = PassiveType.PassiveTimeout;
                Color   = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color   = Color.Green;
            }
            //Console.WriteLine("[PASSIVE] Type: {0} Target: {2} Name: {1}", Passive, Name, Target.Name);
            PassiveDistance = Passive.Equals(PassiveType.UltPassive) ? 400 : 200;
        }
Beispiel #8
0
    public void Initialize(PassiveType passiveType, PassiveDB data, PassiveSelectScreen parent)
    {
        if (data == null)
        {
            return;
        }

        this.passiveDB   = data;
        this.passiveType = passiveType;
        this.hasItem     = data.hasPassive;
        this.parent      = parent;

        SetCanUse(hasItem);
        SetIcon();
        if (Language.Instance.NowLanguage == LanguageType.Korean)
        {
            SetText(data.koreanDescription);
            SetPrice(data.koreanName, data.price);


            text.font = Language.Instance.KoreanFont;
            //text.fontSize += 15;
            priceText.font     = Language.Instance.KoreanFont;
            priceText.fontSize = originSize + 15;
        }
        else
        {
            SetText(data.englishDescription);
            SetPrice(data.englishName, data.price);
            priceText.fontSize = originSize + 7;
        }
    }
    public void SaveMyPassivies()
    {
        if (CheckLogin() == false)
        {
            return;
        }
        //저장
        string data = string.Empty;

        for (int i = 0; i < (int)PassiveType.PassiveEnd; i++)
        {
            PassiveType passiveType = (PassiveType)i;
            int         value       = PlayerPrefs.GetInt(passiveType.ToString(), 0);
            if (i == 0)
            {
                data += value.ToString();
            }
            else if (i != 0)
            {
                data += "," + value.ToString();
            }
        }

        this.SaveToCloud(data);
    }
        public FioraPassive(Obj_GeneralParticleEmitter emitter, Obj_AI_Hero enemy)
            : base((ushort)emitter.Index, (uint)emitter.NetworkId)
        {
            Target = enemy;

            if (emitter.Name.Contains("Base_R"))
            {
                Passive = PassiveType.UltPassive;
                Color   = Color.White;
            }
            else if (emitter.Name.Contains("Warning"))
            {
                Passive = PassiveType.Prepassive;
                Color   = Color.Blue;
            }
            else if (emitter.Name.Contains("Timeout"))
            {
                PassiveManager.PassiveList.RemoveAll(p => p.Target.Equals(Target) && p.Type.Equals(PassiveType.Passive));
                Passive = PassiveType.PassiveTimeout;
                Color   = Color.Red;
            }
            else
            {
                Passive = PassiveType.Passive;
                Color   = Color.Green;
            }
            //Console.WriteLine("[PASSIVE] Type: {0} Target: {2} Name: {1}", Passive, Name, Target.Name);
            PassiveDistance = Passive.Equals(PassiveType.UltPassive) ? 320 : 200;
        }
Beispiel #11
0
 public bool IsType(bool isType, PassiveType type)
 {
     if (this.type == type)
     {
         return(true);
     }
     return(isType);
 }
Beispiel #12
0
 public bool HasPassive(PassiveType passiveType)
 {
     if (myPassive == null)
     {
         return(false);
     }
     return(myPassive.Contains(passiveType));
 }
Beispiel #13
0
 public void RemovePassive(PassiveType passiveType)
 {
     if (myPassive == null)
     {
         return;
     }
     myPassive.Remove(passiveType);
 }
Beispiel #14
0
 public PassiveStatus(bool hasPassive, PassiveType passiveType, Vector2 targetPredictedPosition
                      , List <PassiveDirection> passiveDirections, List <Vector2> passivePredictedPositions)
 {
     HasPassive                = hasPassive;
     PassiveType               = passiveType;
     TargetPredictedPosition   = targetPredictedPosition;
     PassiveDirections         = passiveDirections;
     PassivePredictedPositions = passivePredictedPositions;
 }
 public bool HasPassiveType(PassiveType type)
 {
     foreach (Passive p in Passives)
     {
         if (p.Type == type)
         {
             return(true);
         }
     }
     return(false);
 }
    public void Initialize(PassiveType passiveType, PassiveDB passiveDb)
    {
        this.passiveType = passiveType;
        //아이콘세팅

        //텍스트 세팅
        this.price = passiveDb.price;
        SetIcon(passiveType.ToString());

        SetText(passiveDb);
    }
 public bool HasPassive(PassiveType passiveType)
 {
     if (PassiveDB == null)
     {
         return(false);
     }
     if (PassiveDB.ContainsKey(passiveType) == false)
     {
         return(false);
     }
     return(PassiveDB[passiveType].hasPassive);
 }
Beispiel #18
0
 public void AddPassive(PassiveType passiveType)
 {
     if (myPassive == null)
     {
         return;
     }
     if (myPassive.Count > 2)
     {
         return;
     }
     myPassive.Add(passiveType);
 }
    public void SetPrefPassiveData()
    {
        for (int i = 0; i < (int)PassiveType.PassiveEnd; i++)
        {
            PassiveType passiveType = (PassiveType)i;

            if (HasPassive(passiveType) == true)
            {
                continue;
            }

            if (PlayerPrefs.GetInt(passiveType.ToString(), 0) == 1)
            {
                BuyPassiveItem(passiveType);
            }
        }
    }
Beispiel #20
0
    public void SetPassiveUI(PassiveType passiveType)
    {
        switch (passiveType)
        {
        case PassiveType.Healer:
            uiLinks.passive.sprite = Resources.Load <Sprite>(PrefabsDir.healerPDir);
            break;

        case PassiveType.SpeedBoost:
            uiLinks.passive.sprite = Resources.Load <Sprite>(PrefabsDir.speedBoosterPDir);
            break;

        case PassiveType.CriticBoost:
            break;

        default:
            break;
        }
    }
Beispiel #21
0
 public void OpenPassiveBuyScreen(PassiveType type, PassiveDB data)
 {
     if (passiveBuyScreen == null)
     {
         return;
     }
     //돈이 되면 창 열기
     if (playerGoods.GetCurrentMedal() >= data.price)
     {
         passiveBuyScreen.gameObject.SetActive(true);
         passiveBuyScreen.Initialize(type, data);
         nowBuyingPassive = type;
     }
     //돈이 부족할때
     else
     {
         Debug.Log("돈이 부족합니다");
         SoundManager.Instance.PlaySoundEffect("error");
     }
     //
 }
    //세이브 읽어와서 실제로 등록하는 부분
    public void ApplyData(string data)
    {
        string[] split = data.Trim().Split(',');
        //
        //
        if (split.Length != 0)
        {
            for (int i = 0; i < split.Length; i++)
            {
                PassiveType passiveType = (PassiveType)i;
                PlayerPrefs.SetInt(passiveType.ToString(), int.Parse(split[i]));
            }
        }
        else if (split.Length == 0)
        {
        }


        DatabaseLoader.Instance.SetPrefPassiveData();

        //
    }
Beispiel #23
0
 public static bool CheckPassive(PassiveType pt, Transform chess)
 {
     CharacterPassive chessPassive = chess.GetComponent<CharacterPassive>();
     return chessPassive.PassiveDict[pt];
 }
Beispiel #24
0
 public PassiveObject(string passiveName, Obj_GeneralParticleEmitter obj, PassiveType passiveType, PassiveDirection passiveDirection)
 {
     PassiveName = passiveName;
     Object = obj;
     PassiveType = passiveType;
     PassiveDirection = passiveDirection;
 }
Beispiel #25
0
 public PassiveStatus(bool hasPassive, PassiveType passiveType, Vector2 targetPredictedPosition
     , List<PassiveDirection> passiveDirections, List<Vector2> passivePredictedPositions)
 {
     HasPassive = hasPassive;
     PassiveType = passiveType;
     TargetPredictedPosition = targetPredictedPosition;
     PassiveDirections = passiveDirections;
     PassivePredictedPositions = passivePredictedPositions;
 }
Beispiel #26
0
 public PassiveList(Obj_GeneralParticleEmitter pass, PassiveType type, PassiveDirection dircetion)
 {
     Passive     = pass;
     PassiveType = type;
     Direction   = dircetion;
 }
Beispiel #27
0
        public static bool CheckPassive(PassiveType pt, Transform chess)
        {
            CharacterPassive chessPassive = chess.GetComponent <CharacterPassive>();

            return(chessPassive.PassiveDict[pt]);
        }
    /// <summary>
    /// //////////////////// //파일 저장 //파일 저장 //파일 저장 //파일 저장
    ///
    /// </summary>



    //파일 저장
    public void BuyPassiveItem(PassiveType passiveType)
    {
        ChangePassiveDB(passiveType);
    }
    // 코루틴 .
    private void ChangePassiveDB(PassiveType passiveType)
    {
        if (passiveDB.ContainsKey(passiveType) == false)
        {
            return;
        }

        if (passiveDB[passiveType].hasPassive == true)
        {
            return;
        }


        string Filepath;

#if UNITY_EDITOR
        Filepath = Application.streamingAssetsPath + "/" + "PassiveItemDB.db";
#else
        Filepath = Application.persistentDataPath + "/" + "PassiveItemDB.db";
#endif

        if (!File.Exists(Filepath))
        {
            Debug.LogWarning("File \"" + Filepath + "\" does not exist. Attempting to create from \"" +
                             Application.dataPath + "!/assets/" + "PassiveItemDB.db");

            WWW loadDB = new WWW("jar:file://" + Application.dataPath + "!/assets/" + "PassiveItemDB.db");
            while (!loadDB.isDone)
            {
            }
            File.WriteAllBytes(Filepath, loadDB.bytes);
        }
        string connectionString = "URI=file:" + Filepath;
        //  ItemList.Clear();

        // using을 사용함으로써 비정상적인 예외가 발생할 경우에도 반드시 파일을 닫히도록 할 수 있다.
        using (IDbConnection dbConnection = new SqliteConnection(connectionString))
        {
            dbConnection.Open();

            using (IDbCommand dbCmd = dbConnection.CreateCommand())  // EnterSqL에 명령 할 수 있다.
            {
                //수정
                string ID      = ((int)passiveType).ToString();
                string Boolean = "True";

                string sqlQuery = "UPDATE  PassiveItemDB  SET " +
                                  "HasItem =" + "'" + Boolean + "'"
                                  + "WHERE PassiveType = " + ID;

                // string sqlQuery = "INSERT INTO ItemTable  (Name,Desc) VALUES('죽창','죽창이다.')";


                //string sqlQuery = "DELETE FROM ItemTable Where ID =5";
                // WHere을 붙인 이유는 테이블 전체를 돌기 때문에 해당 아이디만 수정하게 선택한것.
                Debug.Log(sqlQuery);
                //UPDATE UserInfo  SET  Money = 11, Scene ='dd', Pos ='0,0,1', Car ='0,0,1'

                dbCmd.CommandText = sqlQuery;
                using (IDataReader reader = dbCmd.ExecuteReader()) // 테이블에 있는 데이터들이 들어간다.
                {
                    dbConnection.Close();
                    reader.Close();
                }
            }
        }

        //DB재갱신
        LoadPassiveItemDB();
    }
Beispiel #30
0
 public Texture2D GetPassiveTexture(PassiveType pt)
 {
     Texture2D tx = null;
     switch(pt){
         case PassiveType.Flying:
             tx = Fly;
             break;
         case PassiveType.FlyingHit:
             tx = FlyHit;
             break;
         case PassiveType.DefenseAddOne:
             tx = Mole;
             break;
         case PassiveType.MultiArrow:
             tx = Haste;
             break;
         case PassiveType.WoundBite:
             tx = Flamming;
             break;
     }
     return tx;
 }
Beispiel #31
0
 public Passive()
 {
     type = PassiveType.Passive;
 }
Beispiel #32
0
 public Passive(PassiveType getPassive, int tickCount)
 {
     Type = getPassive;
     time = tickCount;
 }
Beispiel #33
0
 public Passive(PassiveType getPassive, int tickCount)
 {
     Type = getPassive;
     time = tickCount;
 }
Beispiel #34
0
 public PassiveList(GameObject pass, PassiveType type, PassiveDirection dircetion)
 {
     Passive     = pass;
     PassiveType = type;
     Direction   = dircetion;
 }