Ejemplo n.º 1
0
        public string SkillDescriptionFull(string[] args, CreateEntity ent)
        {
            StringBuilder b = new StringBuilder();

            b.Append(SkillDescription);
            if (dmg_type == CreateEntity.DamageType.Magic)
            {
                b.Append($" Potency Amount: {ent.DealNormalMagicDMG(SkillPotency)}.");
            }
            else if (dmg_type == CreateEntity.DamageType.Physical)
            {
                b.Append($" Potency Amount: {ent.DealNormalDMG(SkillPotency)}.");
            }
            else if (dmg_type == CreateEntity.DamageType.Buff)
            {
                b.Append($" Potency Amount: {SkillPotency}.");
            }
            else if (dmg_type == CreateEntity.DamageType.Passive)
            {
                b.Append($" Potency Amount: {SkillPotency * .001m}.");
            }

            foreach (string g in args)
            {
                b.Append(g);
            }
            return(b.ToString());
        }
Ejemplo n.º 2
0
        public int TakeDMG(CreateEntity attacker, DamageType dt, int skillDamage, CreateSkill.StatusEffect effects = CreateSkill.StatusEffect.none)
        {
            if (skillDamage <= 0)
            {
                skillDamage = 1;
            }
            decimal total = (dt == DamageType.Physical) ? attacker.DealNormalDMG(skillDamage) : attacker.DealNormalMagicDMG(skillDamage);

            if (total == 0 || physicalImmune || magicalImmune)
            {
                return(0);
            }

            decimal reduction         = 0;
            int     currentTurnDamage = 0;

            if (dt == DamageType.Physical)//FIX AFTER
            {
                reduction = (decimal)PDefValue / 9999m;
            }
            else
            {
                reduction = (decimal)MDefValue / 9999m;
            }

            if (effects != CreateSkill.StatusEffect.none)
            {
                switch (effects)
                {
                case CreateSkill.StatusEffect.stun:
                    stunDuration += 2;
                    break;

                case CreateSkill.StatusEffect.mute:
                    muteDuration += 4;
                    break;

                case CreateSkill.StatusEffect.blind:
                    blindDuration += 4;
                    break;

                case CreateSkill.StatusEffect.poison:
                    Poisoned((int)total, 4);
                    break;
                }
            }
            currentTurnDamage = (int)(total - total * reduction);
            if (currentTurnDamage < 0)
            {
                ExtensionMethods.WriteToLog(ExtensionMethods.LogType.CustomMessage, null, "Current Turn Damage variable is 0 or lower. It should never equal this. In CreateEntity > TakeDMG");
            }


            int one = 0;
            int per = (int)((decimal)currentTurnDamage - (decimal)currentTurnDamage * .1m);

            if (per > 1)
            {
                one = UtilityClass.ReturnRandom(per, ++currentTurnDamage);
            }
            else
            {
                one = 1;
            }
            //ExtensionMethods.WriteToLog($"{two} || ");
            HP.Current -= one;
            return(one);
        }