<commit_before>﻿using CombatDataClasses.Interfaces;
using CombatDataClasses.LiveImplementation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CombatDataClasses.AbilityProcessing.EnemyAbilityProcessing
{
    public class BasicAbilityProcessing
    {
        public static List<IEffect> getCommand(FullCombatCharacter source, List<FullCombatCharacter> targets, CombatData combatData)
        {
            if (source.className == "Goblin")
            {
                return Goblins.GoblinAbilityProcessing.getCommand(source, targets, combatData);
            }
            if (source.className == "Boss Goblin")
            {
                return Goblins.GoblinAbilityProcessing.getCommand(source, targets, combatData);
            }
            if (source.className == "Blue Slime")
            {
                return Slimes.SlimeAbilityProcessing.getCommand(source, targets, combatData);
            }

            return new List<IEffect>();
        }

        public static FullCombatCharacter identifyWeakestTarget(List<FullCombatCharacter> characters)
        {
            FullCombatCharacter currentCharacter = characters[0];
            int currentWeakLevel = getWeakness(currentCharacter);
            foreach (FullCombatCharacter fcc in characters)
            {
                int newWeakLevel = getWeakness(fcc);
                if (newWeakLevel < currentWeakLevel)
                {
                    currentCharacter = fcc;
                    currentWeakLevel = newWeakLevel;
                }
            }
            return currentCharacter;
        }

        private static int getWeakness(FullCombatCharacter fcc)
        {
            int weakness = fcc.hp;

            if (ModificationsGeneration.BasicModificationsGeneration.hasMod(fcc, "Guard"))
            {
                weakness = weakness * 2;
            }

            if (ModificationsGeneration.BasicModificationsGeneration.hasMod(fcc, "Ranged"))
            {
                weakness = (int)(weakness * 3.5f);
            }

            if (ModificationsGeneration.BasicModificationsGeneration.hasMod(fcc, "Reckless"))<commit_msg>Fixed a bug where enemies continued attacking defeated character<commit_after>﻿using CombatDataClasses.Interfaces;
using CombatDataClasses.LiveImplementation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CombatDataClasses.AbilityProcessing.EnemyAbilityProcessing
{
    public class BasicAbilityProcessing
    {
        public static List<IEffect> getCommand(FullCombatCharacter source, List<FullCombatCharacter> targets, CombatData combatData)
        {
            if (source.className == "Goblin")
            {
                return Goblins.GoblinAbilityProcessing.getCommand(source, targets, combatData);
            }
            if (source.className == "Boss Goblin")
            {
                return Goblins.GoblinAbilityProcessing.getCommand(source, targets, combatData);
            }
            if (source.className == "Blue Slime")
            {
                return Slimes.SlimeAbilityProcessing.getCommand(source, targets, combatData);
            }

            return new List<IEffect>();
        }

        public static FullCombatCharacter identifyWeakestTarget(List<FullCombatCharacter> characters)
        {
            FullCombatCharacter currentCharacter = characters[0];
            int currentWeakLevel = getWeakness(currentCharacter);
            foreach (FullCombatCharacter fcc in characters)
            {
                int newWeakLevel = getWeakness(fcc);
                if (newWeakLevel < currentWeakLevel && fcc.hp > 0)
                {
                    currentCharacter = fcc;
                    currentWeakLevel = newWeakLevel;
                }
            }
            return currentCharacter;
        }

        private static int getWeakness(FullCombatCharacter fcc)
        {
            int weakness = fcc.hp;

            if (ModificationsGeneration.BasicModificationsGeneration.hasMod(fcc, "Guard"))
            {
                weakness = weakness * 2;
            }

            if (ModificationsGeneration.BasicModificationsGeneration.hasMod(fcc, "Ranged"))
            {
                weakness = (int)(weakness * 3.5f);
            }

            if (ModificationsGeneration.BasicModificationsGeneration.hasMod(fcc, "Reckless"))
{'fraction_non_alphanumeric': 0.0749498103948249, 'fraction_numerical': 0.002007584207004238, 'mean_word_length': 2.096685082872928, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3440419', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1075, 'n_words': 219}