Exemplo n.º 1
0
        public SkillDps(DamageMeter.Skills.Skill.Skill skill, SkillStats stats)
        {
            InitializeComponent();

            LabelName.Content = skill.SkillName;
            Update(skill, stats);
        }
Exemplo n.º 2
0
        internal static void LoadModSkillStatData(Player player, IModSkill modSkill)
        {
            const string statId = "Skills";

            Logger.Log($"Loading skill stat data for {modSkill.DisplayName} for player {player.playerID + 1}");

            Dictionary <string, StatData> dictionary = StatManager.data[statId][player.skillCategory];

            SkillStats skillStats = modSkill.Stats;

            skillStats.Initialize();

            skillStats.targetNames[0] = "EnemyHurtBox";
            skillStats.targetNames[1] = "DestructibleHurtBox";
            skillStats.targetNames[4] = "FFAHurtBox";

            StatData statData = new StatData(skillStats, player.skillCategory);

            List <string> val = statData.GetValue <List <string> >("targetNames", -1);

            if (val.Contains(Globals.allyHBStr) || val.Contains(Globals.enemyHBStr))
            {
                val.Add(Globals.ffaHBStr);
            }

            if (val.Contains(Globals.allyFCStr) || val.Contains(Globals.enemyFCStr))
            {
                val.Add(Globals.ffaFCStr);
            }

            string id = statData.GetValue <string>("ID", -1);

            dictionary[id] = statData;
            StatManager.globalSkillData[id] = statData;
        }
Exemplo n.º 3
0
    static private void CreateSkillStats(StatsHolder statsHolder)
    {
        TextAsset csvText = (TextAsset)AssetDatabase.LoadAssetAtPath(DATABASE_FOLDER + "/CSV/database - skill.csv", typeof(TextAsset));
        CSVFile   csvFile = new CSVFile(csvText.text);

        AssetDatabase.CreateFolder(DATABASE_FOLDER + "/Asset", "Skill");

        int csvCount = csvFile.length;

        for (int i = 0; i < csvCount; i++)
        {
            string id = csvFile.Get <string>(i, "ID");

            if (string.IsNullOrEmpty(id))
            {
                continue;
            }

            SkillStats c_prefab = ScriptableObjectUtility.CreateAsset <SkillStats>(DATABASE_FOLDER + "/Asset/Skill/", "[SkillStat] " + id);
            EditorUtility.SetDirty(c_prefab);

            c_prefab.id    = id;
            c_prefab.label = csvFile.Get <string>(i, "Label");

            c_prefab.parameter_1 = csvFile.Get <float>(i, "Parameter 1");
            c_prefab.parameter_2 = csvFile.Get <float>(i, "Parameter 2");
            c_prefab.parameter_3 = csvFile.Get <float>(i, "Parameter 3");
            c_prefab.parameter_4 = csvFile.Get <float>(i, "Parameter 4");

            statsHolder.stpObjectHolder.Add(c_prefab);
        }
    }
Exemplo n.º 4
0
        public void Update(DamageMeter.Skills.Skill.Skill skill, SkillStats stats, Entity currentBoss, bool timedEncounter)
        {
            var skillsId = "";

            for (var i = 0; i < skill.SkillId.Count; i++)
            {
                skillsId += skill.SkillId[i];
                if (i < skill.SkillId.Count - 1)
                {
                    skillsId += ",";
                }
            }

            LabelName.ToolTip          = skillsId;
            LabelNumberHitMana.Content = stats.HitsMana;
            LabelTotalMana.Content     = FormatHelpers.Instance.FormatValue(stats.Mana);

            IEnumerable <KeyValuePair <int, SkillDetailStats> > listStats = stats.SkillDetails.ToList();

            listStats = listStats.OrderByDescending(stat => stat.Value.Mana);
            SkillsDetailList.Items.Clear();
            foreach (var stat in listStats)
            {
                SkillsDetailList.Items.Add(new SkillDetailMana(stat.Value));
            }
        }
Exemplo n.º 5
0
    // Start is called before the first frame update
    private void Start()
    {
        string     PATH       = Application.streamingAssetsPath + "/SkillStats.json";
        string     data       = File.ReadAllText(PATH);
        SkillStats skillStats = SkillStats.CreateFromJson(data);

        ninjaKnife = skillStats.rangedNinja.Find(skill => skill.name == "Ninja Knife");

        kunai  = Resources.Load <GameObject>("Objects/EnemyKunai");
        skills = GetComponent <Skills>();
        rb     = this.GetComponent <Rigidbody2D>();

        if (playerObj == null)
        {
            playerObj = GameObject.FindGameObjectWithTag("pelaaja");
            if (playerObj != null)
            {
                player         = playerObj.transform;
                playerRenderer = playerObj.GetComponent <SpriteRenderer>();
            }
        }

        if (enemyObj == null)
        {
            enemyObj = gameObject;
        }
        enemy = enemyObj.GetComponent <Enemy>();

        timeBtwShots = startTimeBtwShots;
    }
Exemplo n.º 6
0
    // Start is called before the first frame update
    private void Start()
    {
        string     PATH       = Application.streamingAssetsPath + "/SkillStats.json";
        string     data       = File.ReadAllText(PATH);
        SkillStats skillStats = SkillStats.CreateFromJson(data);

        fireball = skillStats.boss.Find(skill => skill.name == "Fireball");
        iceBurst = skillStats.boss.Find(skill => skill.name == "Ice Burst");

        fireballGO = Resources.Load <GameObject>("Objects/EnemyFireBall");
        iceSpearGO = Resources.Load <GameObject>("Objects/EnemyIceSpear");
        skills     = GetComponent <Skills>();
        rb         = this.GetComponent <Rigidbody2D>();

        if (playerObj == null)
        {
            playerObj = GameObject.FindGameObjectWithTag("pelaaja");
            if (playerObj != null)
            {
                player         = playerObj.transform;
                playerRenderer = playerObj.GetComponent <SpriteRenderer>();
            }
        }

        if (enemyObj == null)
        {
            enemyObj = gameObject;
        }

        timeBtwShots = startTimeBtwShots;
    }
Exemplo n.º 7
0
        public SkillDps(DamageMeter.Skills.Skill.Skill skill, SkillStats stats, Entity currentBoss, bool timedEncounter)
        {
            InitializeComponent();

            LabelName.Content = skill.SkillName;
            SkillIcon.Source  = BasicTeraData.Instance.Icons.GetImage(skill.IconName);
            Update(skill, stats, currentBoss, timedEncounter);
        }
Exemplo n.º 8
0
 public Skill(Texture2D choosePicture, Color color, string name, int iconID, SkillStats stats)
 {
     this.choosePicture = choosePicture;
     this.color         = color;
     this.name          = name;
     this.iconID        = iconID;
     this.stats         = stats;
 }
Exemplo n.º 9
0
        private static void UpdateSkillStats(SkillResult message, Entity entityTarget, PlayerInfo playerInfo, long time)
        {
            var entities = playerInfo.Dealt;

            entities.AddStats(time, entityTarget, new SkillsStats(playerInfo));

            var skillName      = message.SkillId.ToString();
            var skillShortName = message.SkillShortName;
            var iconName       = "";

            if (message.Skill != null)
            {
                skillName = message.Skill.Name;
                iconName  = message.Skill.IconName;
            }
            var skillKey = new Skill(skillName, skillShortName, new List <int> {
                message.SkillId
            }, iconName, message.Skill?.NpcInfo);


            SkillStats skillStats;
            var        dictionarySkillStats = entities.GetSkills(time, entityTarget);

            dictionarySkillStats.TryGetValue(skillKey, out skillStats);
            if (skillStats == null)
            {
                skillStats = new SkillStats(playerInfo, entityTarget);
            }
            if (message.IsHp)
            {
                if (message.IsHeal)
                {
                    skillStats.AddData(message.SkillId, message.Heal, message.IsCritical, SkillStats.Type.Heal, time);
                }
                else
                {
                    skillStats.AddData(message.SkillId, message.Damage, message.IsCritical, SkillStats.Type.Damage, time);
                }
            }
            else
            {
                skillStats.AddData(message.SkillId, message.Mana, message.IsCritical, SkillStats.Type.Mana, time);
            }

            var skill      = dictionarySkillStats.Keys.ToList();
            var indexSkill = skill.IndexOf(skillKey);

            if (indexSkill != -1)
            {
                foreach (
                    var skillid in skill[indexSkill].SkillId.Where(skillid => !skillKey.SkillId.Contains(skillid)))
                {
                    skillKey.SkillId.Add(skillid);
                }
            }
            dictionarySkillStats.Remove(skillKey);
            dictionarySkillStats.Add(skillKey, skillStats);
        }
Exemplo n.º 10
0
    /// <summary>Function called externally to read the unmodified skill stat value designated</summary>
    /// <param name="statToGet_">Enum for which skill stat to get</param>
    /// <returns>Int for what the skill stat's value is without modifiers</returns>
    public int GetSkillStatLevelValue(SkillStats statToGet_)
    {
        switch (statToGet_)
        {
        case SkillStats.Strength: return(this.strength);

        case SkillStats.Finesse: return(this.finesse);

        case SkillStats.Willpower: return(this.willpower);

        case SkillStats.Spirit: return(this.spirit);

        default: return(0);
        }
    }
Exemplo n.º 11
0
    /// <summary>Function called externally to read the skill stat value designated with it's modifier</summary>
    /// <param name="statToGet_">Enum for which skill stat to get</param>
    /// <returns>Int for what the skill stat's value is with modifiers</returns>
    public int GetSkillStatLevelValueWithMod(SkillStats statToGet_)
    {
        switch (statToGet_)
        {
        case SkillStats.Strength: return(this.strength + this.strengthMod);

        case SkillStats.Finesse: return(this.finesse + this.finesseMod);

        case SkillStats.Willpower: return(this.willpower + this.willpowerMod);

        case SkillStats.Spirit: return(this.spirit + this.spiritMod);

        default: return(0);
        }
    }
Exemplo n.º 12
0
    static private SkillStats[] GetSkillFromIDs(StatsHolder statsHolder, string[] skillArray)
    {
        SkillStats[] skillStats = new SkillStats[skillArray.Length];

        for (int k = 0; k < skillArray.Length; k++)
        {
            SkillStats findObject = statsHolder.FindObject <SkillStats>(skillArray[k]);

            if (findObject != null)
            {
                skillStats[k] = findObject;
            }
        }

        return(skillStats);
    }
Exemplo n.º 13
0
 public PlayerDefinition(
     string userId,
     string name,
     CombatStats combatStats,
     SkillStats skillStats,
     SkillResources skillResources,
     Statistics statistics,
     PlayerAppearanceDefinition appearance,
     InventoryDefinition inventory)
 {
     this.UserId         = userId;
     this.Name           = name;
     this.CombatStats    = combatStats ?? new CombatStats();
     this.SkillStats     = skillStats ?? new SkillStats();
     this.SkillResources = skillResources ?? new SkillResources();
     this.Statistics     = statistics ?? new Statistics();
     this.Appearance     = appearance;
     this.Inventory      = inventory ?? new InventoryDefinition(null, null);
 }
Exemplo n.º 14
0
    /// <summary>Function called from ModifyStatsEffect.cs to change a skill stat modifier</summary>
    /// <param name="statModifier_">Enum for which skill stat to change</param>
    /// <param name="amountToChange_">Int for how much to change the skill stat's value</param>
    public void ChangeSkillStatModifier(SkillStats statModifier_, int amountToChange_)
    {
        switch (statModifier_)
        {
        case SkillStats.Strength: this.strengthMod += amountToChange_;
            break;

        case SkillStats.Finesse: this.finesseMod += amountToChange_;
            break;

        case SkillStats.Willpower: this.willpowerMod += amountToChange_;
            break;

        case SkillStats.Spirit: this.spiritMod += amountToChange_;
            break;

        default: break;
        }
    }
Exemplo n.º 15
0
    private void Start()
    {
        string     PATH       = Application.streamingAssetsPath + "/SkillStats.json";
        string     data       = File.ReadAllText(PATH);
        SkillStats skillStats = SkillStats.CreateFromJson(data);

        fireball       = skillStats.player.Find(skill => skill.name == "Fireball");
        iceBurst       = skillStats.player.Find(skill => skill.name == "Ice Burst");
        iceSpiral      = skillStats.player.Find(skill => skill.name == "Ice Spiral");
        lightningSigil = skillStats.player.Find(skill => skill.name == "Lightning Sigil");
        dash           = skillStats.player.Find(skill => skill.name == "Dash");

        fireballGO  = Resources.Load <GameObject>("Objects/FireBall");
        iceSpearGO  = Resources.Load <GameObject>("Objects/IceSpear");
        lightningGO = Resources.Load <GameObject>("Objects/Lightning");

        SceneManager.activeSceneChanged += ResetCooldowns;

        skills = GetComponent <Skills>();
    }
Exemplo n.º 16
0
        public void Update(DamageMeter.Skills.Skill.Skill skill, SkillStats stats)
        {
            var skillsId = "";

            for (var i = 0; i < skill.SkillId.Count; i++)
            {
                skillsId += skill.SkillId[i];
                if (i < skill.SkillId.Count - 1)
                {
                    skillsId += ",";
                }
            }

            LabelId.Content           = skillsId;
            LabelCritRateHeal.Content = stats.CritRateHeal + "%";


            LabelNumberHitHeal.Content  = stats.HitsHeal;
            LabelNumberCritHeal.Content = stats.CritsHeal;

            LabelTotalHeal.Content   = FormatHelpers.Instance.FormatValue(stats.Heal);
            LabelBiggestHit.Content  = FormatHelpers.Instance.FormatValue(stats.HealBiggestHit);
            LabelBiggestCrit.Content = FormatHelpers.Instance.FormatValue(stats.HealBiggestCrit);


            LabelAverageCrit.Content = FormatHelpers.Instance.FormatValue(stats.HealAverageCrit);
            LabelAverageHit.Content  = FormatHelpers.Instance.FormatValue(stats.HealAverageHit);
            LabelAverage.Content     = FormatHelpers.Instance.FormatValue(stats.HealAverageTotal);


            IEnumerable <KeyValuePair <int, SkillDetailStats> > listStats = stats.SkillDetails.ToList();

            listStats = listStats.OrderByDescending(stat => stat.Value.HealAverageTotal);
            SkillsDetailList.Items.Clear();
            foreach (var stat in listStats)
            {
                SkillsDetailList.Items.Add(new SkillDetailHeal(stat.Value));
            }
        }
Exemplo n.º 17
0
        public List <UnitInterface> Execute(SkillStats skillStats, List <UnitInterface> units, GameDamageManager.DMGRegistry dmgRegistry, MapBlockManager mapBlockManager, MapGrid mapGrid)
        {
            var findUnits = mapGrid.FindUnitsFromRange <MonsterUnit>(dmgRegistry.target.currentTile, skillStats.parameter_1);

            if (findUnits != null)
            {
                int unitLength = findUnits.Count;
                if (unitLength > 0)
                {
                    for (int i = 0; i < unitLength; i++)
                    {
                        //If FIND_UNIT not exist, and its not the initial target
                        if (!units.Contains(findUnits[i]) && findUnits[i] != dmgRegistry.target)
                        {
                            units.Add(findUnits[i]);
                        }
                    }
                }
            }

            return(units);
        }
Exemplo n.º 18
0
        public void Update(DamageMeter.Skills.Skill.Skill skill, SkillStats stats, Entity currentBoss, bool timedEncounter)
        {
            var skillsId = "";

            for (var i = 0; i < skill.SkillId.Count; i++)
            {
                skillsId += skill.SkillId[i];
                if (i < skill.SkillId.Count - 1)
                {
                    skillsId += ",";
                }
            }

            LabelName.ToolTip        = skillsId;
            LabelCritRateDmg.Content = stats.CritRateDmg + "%";

            LabelDamagePercentage.Content = stats.DamagePercentage(currentBoss, timedEncounter) + "%";
            LabelTotalDamage.Content      = FormatHelpers.Instance.FormatValue(stats.Damage);

            LabelNumberHitDmg.Content = stats.HitsDmg;

            LabelNumberCritDmg.Content = stats.CritsDmg;

            LabelAverageCrit.Content  = FormatHelpers.Instance.FormatValue(stats.DmgAverageCrit);
            LabelBiggestCrit.Content  = FormatHelpers.Instance.FormatValue(stats.DmgBiggestCrit);
            LabelAverageHit.Content   = FormatHelpers.Instance.FormatValue(stats.DmgAverageHit);
            LabelAverageTotal.Content = FormatHelpers.Instance.FormatValue(stats.DmgAverageTotal);

            IEnumerable <KeyValuePair <int, SkillDetailStats> > listStats = stats.SkillDetails.ToList();

            listStats = listStats.OrderByDescending(stat => stat.Value.Damage);
            SkillsDetailList.Items.Clear();
            foreach (var stat in listStats)
            {
                SkillsDetailList.Items.Add(new SkillDetailDps(stat.Value, currentBoss, timedEncounter));
            }
        }
Exemplo n.º 19
0
    private Piece _MakePiece(string name, int color)
    {
        listSkillStats = new List <SkillStats> ();

        if (name == "Warrior")
        {
            ic = ItemContainer.Load(pathAux + name);

            foreach (Item item in ic.items)
            {
                newHealth           = GetHealth(item);
                newSkillStats       = new SkillStats();
                newSkillStats.name  = item.name;
                newSkillStats.power = item.power;
                newSkillStats.range = item.range;
                newSkillStats.cost  = item.cost;

                listSkillStats.Add(newSkillStats);
            }

            newPiece = new Piece(color, listSkillStats);
            newPiece.SetName("Warrior");
            newPiece.SetMaxHealth(newHealth);
            newPiece.SetCurrentHealth(newHealth);
            return(newPiece);
        }

        if (name == "Archer")
        {
            ic = ItemContainer.Load(pathAux + name);

            foreach (Item item in ic.items)
            {
                newHealth           = GetHealth(item);
                newSkillStats       = new SkillStats();
                newSkillStats.name  = item.name;
                newSkillStats.power = item.power;
                newSkillStats.range = item.range;
                newSkillStats.cost  = item.cost;

                listSkillStats.Add(newSkillStats);
            }

            newPiece = new Piece(color, listSkillStats);
            newPiece.SetName("Archer");
            newPiece.SetMaxHealth(newHealth);
            newPiece.SetCurrentHealth(newHealth);

            return(newPiece);
        }
        if (name == "Boss")
        {
            ic = ItemContainer.Load(pathAux + name);

            foreach (Item item in ic.items)
            {
                newHealth           = GetHealth(item);
                newSkillStats       = new SkillStats();
                newSkillStats.name  = item.name;
                newSkillStats.power = item.power;
                newSkillStats.range = item.range;
                newSkillStats.cost  = item.cost;

                listSkillStats.Add(newSkillStats);
            }

            newPiece = new Piece(color, listSkillStats);
            newPiece.SetName("Boss");
            newPiece.SetMaxHealth(newHealth);
            newPiece.SetCurrentHealth(newHealth);

            return(newPiece);
        }

        if (name == "NoPiece")
        {
            newSkillStats = new SkillStats();
            newPiece      = new NoPiece();
            newPiece.SetName("NoPiece");

            return(newPiece);
        }

        return(null);
    }
Exemplo n.º 20
0
 public ProjectileSkill(Texture2D choosePicture, Color color, string name, int iconID, SkillStats stats, Projectile.ProjectileData projectileData)
     : base(choosePicture, color, name, iconID, stats)
 {
     this.projectileData = projectileData;
 }
Exemplo n.º 21
0
 public MapSkill(Texture2D choosePicture, Color color, string name, int iconID, SkillStats stats, Sprite mine, int strength)
     : base(choosePicture, color, name, iconID, stats)
 {
     this.mine     = mine;
     this.strength = strength;
 }