// Principalement utilisé pour calculer les stats du personnage en fonction de son level
 public void AddStatBase(StatController stat, int level = 1)
 {
     for (int i = 0; i < Stats.Count; i++)
     {
         Stats[i].AddBaseValue(stat.Stats[i].StatValue * level);
     }
 }
 public void SetStatBase(StatController stat)
 {
     for (int i = 0; i < Stats.Count; i++)
     {
         Stats[i].SetBaseValue(stat.Stats[i].StatValue);
     }
 }
 public void Remove(StatController stat, StatModifierType modifierType)
 {
     for (int i = 0; i < Stats.Count; i++)
     {
         Stats[i].RemoveStatModifier(stat.Stats[i].StatValue, modifierType);
     }
 }
Example #4
0
        // En dur parce que flemme (Pardon j'ai échoué)

        #endregion

        #region Functions 

        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */



        public CharacterStatController(CharacterData data)
        {
            characterData = data;
            statController = new StatController(data.StatController);
            hp = GetHPMax();
            scratch = 0;
            level = data.CharacterLevel;
        }
Example #5
0
 public void RemoveStat(StatController stat, StatModifierType addType)
 {
     /*if (stat.statModel != statController.statModel)
     {
         Debug.Log("Les deux stats n'ont pas le même modèle, l'opération n'est pas optimisé");
         // faire l'opération pas optimisé
     }*/
     statController.Remove(stat, addType);
     if (OnStatChanged != null) OnStatChanged.Invoke(this);
 }
Example #6
0
        public void DrawCharacter()
        {
            textCharacterName.text = partyData.CharacterStatControllers[indexCharacterSelection].CharacterData.CharacterName;
            imageCharacterFaceOutline.sprite = partyData.CharacterStatControllers[indexCharacterSelection].CharacterData.CharacterFace;
            imageCharacterFace.sprite = partyData.CharacterStatControllers[indexCharacterSelection].CharacterData.CharacterFace;
            currentCharacterStat = partyData.CharacterStatControllers[indexCharacterSelection].StatController;
            DrawCharacterStat();
            DrawWeaponLevel();
            DrawSkillList();
            for (int i = 0; i < characterDatas.Count; i++)
            {
                if(characterDatas[i] == partyData.CharacterStatControllers[indexCharacterSelection].CharacterData)
                {
                    movelist[i].SetActive(true);
                    continue;
                }
                movelist[i].SetActive(false);
            }

        }
Example #7
0
        public void DrawCharacter()
        {
            textCharacterName.text = partyData.CharacterStatControllers[indexCharacterSelection].CharacterData.CharacterName;

            currentCharacterStat = partyData.CharacterStatControllers[indexCharacterSelection].StatController;
            previewCharacterStat = partyData.CharacterStatControllers[indexCharacterSelection].StatController;
            int index = indexCharacterSelection;
            for (int i = 0; i < imageCharacterFaceOutline.Length; i++)
            {
                imageCharacterFace[i].sprite = partyData.CharacterStatControllers[index].CharacterData.CharacterFace;
                imageCharacterFaceOutline[i].sprite = partyData.CharacterStatControllers[index].CharacterData.CharacterFace;
                index += 1;
                index = index % partyData.CharacterStatControllers.Count;
            }
            DrawCharacterStat();
            DrawEquipement();


            weapon.DrawText(dictionary.GetSpriteIcon(partyData.CharacterEquipement[indexCharacterSelection].GetWeaponType()), partyData.CharacterEquipement[indexCharacterSelection].GetWeapon().WeaponName);

        }
 public StatController(StatController stat)
 {
     Stats.Clear();
     if (stat.Stats == null)
     {
         for (int i = 0; i < stat.StatEditor.Count; i++)
         {
             for (int j = 0; j < stat.StatEditor[i].StatDictionary.Count; j++)
                 Stats.Add(new Stat(stat.StatEditor[i].StatDictionary[j]));
             for (int j = 0; j < stat.StatEditor[i].StatDictionary2.Count; j++)
                 Stats.Add(new Stat(stat.StatEditor[i].StatDictionary2[j]));
             for (int j = 0; j < stat.StatEditor[i].StatDictionary3.Count; j++)
                 Stats.Add(new Stat(stat.StatEditor[i].StatDictionary3[j]));
         }
     }
     else
     {
         for (int i = 0; i < stat.Stats.Count; i++)
         {
             Stats.Add(new Stat(stat.Stats[i]));
         }
     }
 }