<commit_before>﻿using Monsters;
using NPC;
using Pandaros.Settlers.Entities;
using Pandaros.Settlers.Models;
using Pipliz;
using Shared;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Pandaros.Settlers.Items.Weapons
{
    [ModLoader.ModManager]
    public static class WeaponFactory
    {
        public static Dictionary<ushort, IWeapon> WeaponLookup { get; } =  new Dictionary<ushort, IWeapon>();

        [ModLoader.ModCallback(ModLoader.EModCallbackType.OnUpdate, GameLoader.NAMESPACE + ".Items.Weapons.WeaponFactory.CheckIfMonstersNearby")]
        public static void CheckIfMonstersNearby()
        {
            if (ServerManager.ColonyTracker != null)
            {
                var punchDamage = Configuration.GetorDefault("ColonistPunchDamage", 30);

                foreach (var colony in ServerManager.ColonyTracker.ColoniesByID.Values)
                {
                    if (colony.DifficultySetting.ShouldSpawnZombies(colony))
                    {
                        foreach (var npc in colony.Followers)
                        {
                            var inv = Entities.SettlerInventory.GetSettlerInventory(npc);

                            if (inv.Weapon != null && !inv.Weapon.IsEmpty())
                            {
                                var target = MonsterTracker.Find(npc.Position, 1, punchDamage);

                                if (target != null && target.IsValid)
                                {
                                    npc.LookAt(target.Position);
                                    ServerManager.SendAudio(target.PositionToAimFor, "punch");
<commit_msg>extended range 1<commit_after>﻿using Monsters;
using NPC;
using Pandaros.Settlers.Entities;
using Pandaros.Settlers.Models;
using Pipliz;
using Shared;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Pandaros.Settlers.Items.Weapons
{
    [ModLoader.ModManager]
    public static class WeaponFactory
    {
        public static Dictionary<ushort, IWeapon> WeaponLookup { get; } =  new Dictionary<ushort, IWeapon>();

        [ModLoader.ModCallback(ModLoader.EModCallbackType.OnUpdate, GameLoader.NAMESPACE + ".Items.Weapons.WeaponFactory.CheckIfMonstersNearby")]
        public static void CheckIfMonstersNearby()
        {
            if (ServerManager.ColonyTracker != null)
            {
                var punchDamage = Configuration.GetorDefault("ColonistPunchDamage", 30);

                foreach (var colony in ServerManager.ColonyTracker.ColoniesByID.Values)
                {
                    if (colony.DifficultySetting.ShouldSpawnZombies(colony))
                    {
                        foreach (var npc in colony.Followers)
                        {
                            var inv = Entities.SettlerInventory.GetSettlerInventory(npc);

                            if (inv.Weapon != null && !inv.Weapon.IsEmpty())
                            {
                                var target = MonsterTracker.Find(npc.Position, 2, punchDamage);

                                if (target != null && target.IsValid)
                                {
                                    npc.LookAt(target.Position);
                                    ServerManager.SendAudio(target.PositionToAimFor, "punch");

{'fraction_non_alphanumeric': 0.08370972598614874, 'fraction_numerical': 0.0021077988557663355, 'mean_word_length': 1.7568464730290456, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5936254', 'n_tokens_mistral': 909, 'n_tokens_neox': 860, 'n_words': 160}