Exemple #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());
        }
Exemple #2
0
        /// <summary>
        /// can't figure out the math for this. Deal with it another time
        /// </summary>
        /// <param name="attacker"></param>
        /// <returns></returns>
        public bool AttackEvaded(CreateEntity attacker)
        {
            return(false);

            int g        = (int)(100m * ((decimal)AGI.Current / (decimal)AGI.Max));
            int accuracy = (int)(100m * ((decimal)attacker.AGI.Current / (decimal)attacker.AGI.Max));

            g -= accuracy;
            if (g < 0)
            {
                g = 0;
            }
            Random rnd   = new Random();
            int    total = rnd.Next(0, 101 - g);

            return(total >= g);
        }
Exemple #3
0
        public Combat(CreateEntity enemy, CreateEntity player, string discordName, SocketCommandContext pal, UserData userData, int multipleAttacks = 0)
        {
            _userData      = userData;
            multipleAttack = (multipleAttacks > 1) ? multipleAttacks : 0;
            _enemy         = enemy;
            _enemy.StartedCombat(this);
            _player = player;
            _player.StartedCombat(this);
            _discordName           = discordName;
            p                      = pal;
            multipleAttackSnapshot = multipleAttacks;
            _player.HP.Current     = _player.HP.Max;
            Thread t = new Thread(InitiateCombat);

            t.Start();
            //InitiateCombat();
        }
Exemple #4
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);
        }