Ejemplo n.º 1
0
 public void DrawCharacter(CharacterStatController stat, CharacterEquipementController characterEquipement)
 {
     textPlayerName.text = stat.CharacterData.CharacterName;
     hpGauge.DrawGauge(stat.Hp, stat.GetHPMax());
     DrawWeapon(characterEquipement.GetWeapon());
     //hpGauge.DrawHealthGauge(stat.Hp, stat.HpMax, stat.Scratch);
 }
Ejemplo n.º 2
0
        /*public void DrawCharacter(Character characterData)
        {
            textCharacterName.text = characterData.CharacterName;
            if (characterData.CharacterFace == null)
                characterFace.enabled = false;
            else
                characterFace.enabled = true;
            characterFace.sprite = characterData.CharacterFace;
            characterFaceOutline.sprite = characterData.CharacterFace;

            int healthBarNumber = ((int)characterData.CharacterStat.HpMax / 1000);
            healthBarNumber = Mathf.Max(0, healthBarNumber);
            for (int i = 0; i < healthBarNumber; i++)
            {
                if (healthBarList.Count <= i)
                    healthBarList.Add(Instantiate(transformBar, transformBarNumber));
                healthBarList[i].gameObject.SetActive(true);
            }
            for (int i = healthBarNumber; i < healthBarList.Count; i++)
            {
                healthBarList[i].gameObject.SetActive(false);
            }
            if (healthBarList.Count == 0)
                transformBarNumber.gameObject.SetActive(false);
            DrawHealth((int)characterData.CharacterStat.Hp, (int)characterData.CharacterStat.HpMax);
        }*/

        public void DrawCharacter(PlayerData characterData, CharacterStatController characterStat)
        {
            textCharacterName.text = characterData.CharacterName;
            if (characterData.CharacterFace == null)
                characterFace.enabled = false;
            else
                characterFace.enabled = true;
            characterFace.sprite = characterData.CharacterFace;
            characterFaceOutline.sprite = characterData.CharacterFace;

            int healthBarNumber = (characterStat.GetHPMax() / healthBarAmount);
            healthBarNumber = Mathf.Max(0, healthBarNumber);
            for(int i = 0; i < healthBarNumber; i++)
            {
                if(healthBarList.Count <= i)
                    healthBarList.Add(Instantiate(transformBar, transformBarNumber));
                healthBarList[i].gameObject.SetActive(true);
            }
            for(int i = healthBarNumber; i < healthBarList.Count; i++)
            {
                healthBarList[i].gameObject.SetActive(false);
            }
            if (healthBarList.Count == 0)
                transformBarNumber.gameObject.SetActive(false);
            DrawHealth(characterStat.GetHP(), characterStat.GetHPMax());
        }
Ejemplo n.º 3
0
 private bool ProcessLaunch(AttackDataStat attack, CharacterStatController target)
 {
     float variance = attack.LaunchDamage * (attack.LaunchDamageVariance * 0.01f);
     int rawDamage = (int)(attack.LaunchDamage + Random.Range(-variance, variance));
     rawDamage -= (int)target.GetStat(statLaunchResistance);
     return (rawDamage > 0);
 }
Ejemplo n.º 4
0
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */
        public CharacterBodyPartController(CharacterStatController characterStatController, List<BodyPartController> bodyPartControllers)
        {
            bodyPart = bodyPartControllers;
            mainBodyStatController = characterStatController;
            for(int i = 0; i < bodyPart.Count; i++)
            {
                bodyPart[i].InitializeBodyPart();
            }
        }
        public override AttackDataStat CreateAttack(CharacterStatController user, WeaponData weaponData)
        {
            AttackDataStat res = new AttackDataStat(weaponData);

            res.Damage = weaponData.BaseStat.GetValue(statDamage);
            res.DamageVariance = weaponData.BaseStat.GetValue(statDamageVariance);
            res.UserPosition += positionOffset;
            return res;
        }
 public virtual void InitializeBodyPart()
 {
     if(statController == null)
         statController = new CharacterStatController(partData);
     /*for (int i = 0; i < bodyPartBonus.Count; i++)
     {
         characterStatController.StatController.AddStat(new Stat(bodyPartBonus[i].StatName, bodyPartBonus[i].StatValue), bodyPartBonus[i].ModifierType);
     }*/
 }
Ejemplo n.º 7
0
        public override AttackDataStat CreateAttack(CharacterStatController user, WeaponData weaponData)
        {
            AttackDataStat res = new AttackDataStat(weaponData);

            res.Damage = user.GetStat(statHeal);
            res.DamageVariance = user.GetStat(statHealVariance);

            return res;
        }
Ejemplo n.º 8
0
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */
        protected void Awake()
        {
            targetDirection = characterDirection.DirectionTransform;
            if (characterData != null)
            {
                characterStatController = new CharacterStatController(characterData);
                //characterStatController.OnStatChanged += CallStatChange;
                CharacterDamage.CharacterStatController = characterStatController;
            }
        }
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */
        // Equipement
        /*public CharacterEquipementController(List<WeaponData> weaponDatas)
        {
            weapons = weaponDatas;
        }*/
        /*public CharacterEquipementController(List<WeaponData> weaponDatas, List<CharacterWeaponLevelData> weaponLevelDatas, CharacterStatController statController, CharacterGrowthController growth)
        {
            weapons = weaponDatas;
            for (int i = 0; i < weaponLevelDatas.Count; i++)
            {
                weaponLevels.Add(new CharacterWeaponLevel(weaponLevelDatas[i]));
            }
            characterStatController = statController;
            characterGrowthController = growth;
            EquipWeapon(0);
            SetNewLevel();
        }*/

        public CharacterEquipementController(List<WeaponData> weaponDatas, List<CharacterWeaponLevelData> weaponLevelDatas, CharacterStatController statController, CharacterGrowthController growth)
        {
            weapons = weaponDatas;
            for (int i = 0; i < weaponLevelDatas.Count; i++)
            {
                weaponLevels.Add(new CharacterWeaponLevel(weaponLevelDatas[i]));
            }
            characterStatController = statController;
            characterGrowthController = growth;
            EquipWeapon(0);
            SetNewLevel();
        }
        public override DamageMessage ProcessAttack(AttackDataStat attack, CharacterStatController target)
        {
            DamageMessage res;
            float finalDamage = target.GetHPMax() / 4f;
            res = new DamageMessage(attack.AttackType, 0, (int)finalDamage);
            target.Scratch += finalDamage;

            if (ProcessKnockback(attack, target) == true)
                res.knockback = true;
            if (ProcessLaunch(attack, target) == true)
                res.launch = true;
            return res;
        }
Ejemplo n.º 11
0
        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */
        public override AttackDataStat CreateAttack(CharacterStatController user, WeaponData weaponData)
        {
            AttackDataStat res = new AttackDataStat(weaponData);
            res.Damage = user.GetStat(statDamage);
            res.DamageVariance = user.GetStat(statDamageVariance);

            res.KnockbackDamage = user.GetStat(statKnockbackDamage);
            res.KnockbackDamageVariance = user.GetStat(statKnockbackDamageVariance);

            res.LaunchDamage = user.GetStat(statLaunchDamage);
            res.LaunchDamageVariance = user.GetStat(statLaunchDamageVariance);

            res.Accuracy = user.GetStat(statAccuracy);
            res.AccuracyVariance = user.GetStat(statAccuracyVariance);
            return res;
        }
Ejemplo n.º 12
0
        public override DamageMessage ProcessAttack(AttackDataStat attack, CharacterStatController target)
        {
            DamageMessage res;
            float variance = attack.Damage * (attack.DamageVariance * 0.01f);
            int rawHeal = (int)(attack.Damage + Random.Range(-variance, variance + 1));

            if (attack.ScratchDamage == true)
            {
                target.Scratch -= rawHeal;
                res = new DamageMessage(attack.AttackType, 0, rawHeal);
            }
            else
            {
                target.Hp += rawHeal;
                res = new DamageMessage(attack.AttackType, rawHeal, 0);
            }
            return res;
        }
Ejemplo n.º 13
0
        public override DamageMessage ProcessAttack(AttackDataStat attack, CharacterStatController target)
        {
            DamageMessage res;
            float variance = attack.Damage * (attack.DamageVariance * 0.01f);
            int damage = (int)(attack.Damage + Random.Range(-variance, variance + 1));

            if (attack.ScratchDamage == true)
            {
                target.Scratch -= damage;
                res = new DamageMessage(attack.AttackType, 0, damage);
            }
            else
            {
                target.Hp -= damage;
                res = new DamageMessage(attack.AttackType, damage, 0);
            }
            res.knockback = ProcessKnockback(attack, target);
            res.launch = ProcessLaunch(attack, target);
            return res;
        }
Ejemplo n.º 14
0
        public override DamageMessage ProcessAttack(AttackDataStat attack, CharacterStatController target)
        {
            DamageMessage res;
            int finalDamage = 0;
            float variance = attack.Damage * (attack.DamageVariance * 0.01f);
            int rawDamage = (int) (attack.Damage + Random.Range(-variance, variance+1));
            rawDamage = (int)(rawDamage * target.GetStat(statDefense));

            if (attack.ScratchDamage == true)
            {
                finalDamage = rawDamage;
                res = new DamageMessage(attack.AttackType, 0, finalDamage);
                // Exp
                if (target.Scratch + finalDamage > target.Hp)
                    res.exp = (int)(target.Hp - target.Scratch);
                else
                    res.exp = finalDamage;
                // Exp
                target.Scratch += finalDamage;
            }
            else
            {
                finalDamage = rawDamage + (int)target.Scratch;
                res = new DamageMessage(attack.AttackType, rawDamage, (int)target.Scratch);
                // Exp
                if (target.Hp - finalDamage < 0)
                    res.exp = (int)target.Hp;
                else
                    res.exp = finalDamage;
                // Exp
                target.Hp -= finalDamage;
                target.Scratch = 0;
            }
            if (ProcessKnockback(attack, target) == true)
                res.knockback = true;
            if (ProcessLaunch(attack, target) == true)
                res.launch = true;
            return res;
        }
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */
        public CharacterGrowthController(CharacterGrowthData growthData, CharacterStatController stat)
        {
            characterStatController = stat;
            characterGrowth = growthData;
            CalculateStat();
        }
 private bool ProcessLaunch(AttackDataStat attack, CharacterStatController target)
 {
     return true;
 }
Ejemplo n.º 17
0
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

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

        public AttackData(AAttackProcessor attackProcess, CharacterStatController user, WeaponData weaponData)
        {
            attackProcessor = attackProcess;
            attackDataStat = attackProcessor.CreateAttack(user, weaponData);
        }
Ejemplo n.º 18
0
 private void Awake()
 {
     statController = new CharacterStatController(partData);
 }
 private bool ProcessKnockback(AttackDataStat attack, CharacterStatController target)
 {
     return true;
 }
 public override AttackDataStat CreateAttack(CharacterStatController user, WeaponData weaponData)
 {
     AttackDataStat res = new AttackDataStat(weaponData);
     return res;
 }
Ejemplo n.º 21
0
 public virtual void SetCharacter(CharacterData data, CharacterStatController stat)
 {
     //characterData = data;
     characterStat = stat;
 }
Ejemplo n.º 22
0
 public void CallStatChange(CharacterStatController stat)
 {
     characterMovement.SetSpeed(stat.GetStat("Speed"));
 }
Ejemplo n.º 23
0
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

        /* ======================================== *\
         *                FUNCTIONS                 *
        \* ======================================== */
        private void Awake()
        {
            if (characterData != null)
                characterStatController = new CharacterStatController(characterData);
        }
Ejemplo n.º 24
0
 public virtual DamageMessage ProcessAttack(AttackDataStat attack, CharacterStatController target)
 {
     DamageMessage res = new DamageMessage();
     return res;
 }