<commit_before>﻿/* 
 * This file is part of the whisper project.
 * Copyright (C) 2016  soulson (a.k.a. foxic)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using Whisper.Game.Objects;
using Whisper.Game.Units;
using Whisper.Shared.Math;

namespace Whisper.Game.Characters
{
    public class Character : Unit
    {
        public const int MaxActionButtons = 120;

        public Character(ObjectID id, string name, IList<ActionButton> actionButtons, IList<Spell> spells) : base(id, ObjectTypeID.Player, (ushort)CharacterFields.END)
        {
            ActionButtons = actionButtons;
            Spells = spells;
            Name = name;

            // initialize default values
            DamageDoneArcaneMultiplier = 1.0f;
            DamageDoneFrostMultiplier = 1.0f;
            DamageDoneFireMultiplier = 1.0f;
            DamageDoneNatureMultiplier = 1.0f;
            DamageDoneShadowMultiplier = 1.0f;
            DamageDoneHolyMultiplier = 1.0f;
            DamageDonePhysicalMultiplier = 1.0f;

            UnitFlags |= UnitFlags.PvPUnit;

            // TODO: instead of 0x18 as described here, this field has value 0x28 for players. need to determine the difference
            UnitFlags2 |= UnitFlags2.Supportable;
            UnitFlags2 |= UnitFlags2.CanHaveAuras;

            // TODO: these need to be updated as implemented
            RestState = RestState.Normal;
            WatchedFactionIndex = -1;

            // TODO: remove magic values
            SetField(UnitFields.Health, 51);
            SetField(UnitFields.Mana, 165);
            SetField(UnitFields.MaxHealth, 51);
            SetField(UnitFields.MaxMana, 165);
            SetField(UnitFields.Strength, 20);
            SetField(UnitFields.Agility, 20);
            SetField(UnitFields.Stamina, 20);
            SetField(UnitFields.Intellect, 23);
            SetField(UnitFields.Spirit, 23);
            SetField(UnitFields.DisplayID, 50);
            SetField(UnitFields.NativeDisplayID, 50);
            SetField(UnitFields.FactionTemplate, 1);
            SetField(UnitFields.AttackTimeBase, 2000);
            SetField(UnitFields.AttackTimeOffhand, 2000);
            SetField(UnitFields.AttackTimeRanged, 2000);
            SetField(UnitFields.BoundingRadius, 0.208f);
            SetField(UnitFields.CombatReach, 1.5f);
            SetField(UnitFields.BaseMana, 100);
            SetField(UnitFields.BaseHealth, 31);
            SetField(CharacterFields.XPNextLevel, 400);
        }

        public string Name
        {
            get;
            private set;
        }

        public int ZoneID
        {
            get;
            set;
        }

        public OrientedVector3 BindPoint
        {
            get;
            set;
        }

        public IList<ActionButton> ActionButtons<commit_msg>Confirmed correct value for CombatReach and moved it to default initial value for Character.<commit_after>﻿/* 
 * This file is part of the whisper project.
 * Copyright (C) 2016  soulson (a.k.a. foxic)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using Whisper.Game.Objects;
using Whisper.Game.Units;
using Whisper.Shared.Math;

namespace Whisper.Game.Characters
{
    public class Character : Unit
    {
        public const int MaxActionButtons = 120;

        public Character(ObjectID id, string name, IList<ActionButton> actionButtons, IList<Spell> spells) : base(id, ObjectTypeID.Player, (ushort)CharacterFields.END)
        {
            ActionButtons = actionButtons;
            Spells = spells;
            Name = name;

            // initialize default values
            CombatReach = 1.5f;
            DamageDoneArcaneMultiplier = 1.0f;
            DamageDoneFrostMultiplier = 1.0f;
            DamageDoneFireMultiplier = 1.0f;
            DamageDoneNatureMultiplier = 1.0f;
            DamageDoneShadowMultiplier = 1.0f;
            DamageDoneHolyMultiplier = 1.0f;
            DamageDonePhysicalMultiplier = 1.0f;

            UnitFlags |= UnitFlags.PvPUnit;

            // TODO: instead of 0x18 as described here, this field has value 0x28 for players. need to determine the difference
            UnitFlags2 |= UnitFlags2.Supportable;
            UnitFlags2 |= UnitFlags2.CanHaveAuras;

            // TODO: these need to be updated as implemented
            RestState = RestState.Normal;
            WatchedFactionIndex = -1;

            // TODO: remove magic values
            SetField(UnitFields.Health, 51);
            SetField(UnitFields.Mana, 165);
            SetField(UnitFields.MaxHealth, 51);
            SetField(UnitFields.MaxMana, 165);
            SetField(UnitFields.Strength, 20);
            SetField(UnitFields.Agility, 20);
            SetField(UnitFields.Stamina, 20);
            SetField(UnitFields.Intellect, 23);
            SetField(UnitFields.Spirit, 23);
            SetField(UnitFields.DisplayID, 50);
            SetField(UnitFields.NativeDisplayID, 50);
            SetField(UnitFields.FactionTemplate, 1);
            SetField(UnitFields.AttackTimeBase, 2000);
            SetField(UnitFields.AttackTimeOffhand, 2000);
            SetField(UnitFields.AttackTimeRanged, 2000);
            SetField(UnitFields.BoundingRadius, 0.208f);
            SetField(UnitFields.BaseMana, 100);
            SetField(UnitFields.BaseHealth, 31);
            SetField(CharacterFields.XPNextLevel, 400);
        }

        public string Name
        {
            get;
            private set;
        }

        public int ZoneID
        {
            get;
            set;
        }

        public OrientedVector3 BindPoint
        {
            get;
            set;
        }

        public IList<ActionButton> ActionButtons
{'fraction_non_alphanumeric': 0.07590618336886994, 'fraction_numerical': 0.024164889836531627, 'mean_word_length': 2.2113190324052945, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3381238', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1894, 'n_words': 558}