コード例 #1
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);
 }
コード例 #2
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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }
コード例 #5
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;
        }
コード例 #6
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;
        }
コード例 #7
0
        public void Add(AttackDataStat attackDataStat)
        {
            damage += attackDataStat.Damage;
            damageVariance += attackDataStat.DamageVariance;

            knockbackDamage += attackDataStat.KnockbackDamage;
            knockbackDamageVariance += attackDataStat.KnockbackDamageVariance;

            launchDamage += attackDataStat.LaunchDamage;
            launchDamageVariance += attackDataStat.LaunchDamageVariance;

            stunDamage += attackDataStat.StunDamage;
            stunDamageVariance += attackDataStat.StunDamageVariance;

            accuracy += attackDataStat.Accuracy;
            accuracyVariance += attackDataStat.AccuracyVariance;

            feverValue += attackDataStat.FeverValue;
            feverValueMax += attackDataStat.FeverValueMax;
        }
コード例 #8
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;
        }
コード例 #9
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;
        }
コード例 #10
0
        /* ======================================== *\
         *           GETTERS AND SETTERS            *
        \* ======================================== */

        #endregion

        #region Functions 

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

        public AttackData(AAttackProcessor attackProcess, CharacterStatController user, WeaponData weaponData)
        {
            attackProcessor = attackProcess;
            attackDataStat = attackProcessor.CreateAttack(user, weaponData);
        }
コード例 #11
0
 private bool ProcessLaunch(AttackDataStat attack, CharacterStatController target)
 {
     return true;
 }
コード例 #12
0
 private bool ProcessKnockback(AttackDataStat attack, CharacterStatController target)
 {
     return true;
 }
コード例 #13
0
 public override AttackDataStat CreateAttack(CharacterStatController user, WeaponData weaponData)
 {
     AttackDataStat res = new AttackDataStat(weaponData);
     return res;
 }
コード例 #14
0
 public virtual DamageMessage ProcessAttack(AttackDataStat attack, CharacterStatController target)
 {
     DamageMessage res = new DamageMessage();
     return res;
 }