Ejemplo n.º 1
0
            public void BeginSkillCommodityUpdates(InteractionInstance ths, Dictionary <SkillNames, float> multipliers, bool applyFactor, bool log)
            {
                foreach (CommodityChange change in mActiveCommodities.Values)
                {
                    try
                    {
                        if (!CommodityTest.IsSkill(change.Commodity))
                        {
                            continue;
                        }

                        float multiplier = 1f;

                        SkillNames skill;
                        if (SkillManager.SkillCommodityMap.TryGetValue(change.Commodity, out skill))
                        {
                            if (!multipliers.TryGetValue(skill, out multiplier))
                            {
                                multiplier = 1f;
                            }
                        }

                        float original = multiplier;

                        if (applyFactor)
                        {
                            multiplier *= Relativity.Settings.GetDynamicSkillFactor(skill);
                        }

                        if (log)
                        {
                            Relativity.Logger.Append(Common.NewLine + ths.InstanceActor.FullName + " " + skill + ": " + original + " -> " + multiplier);
                        }

                        ths.BeginCommodityUpdate(change, multiplier);
                    }
                    catch (Exception e)
                    {
                        Common.Exception("Commodity: " + ((change != null) ? change.Commodity.ToString() : "<Null>"), e);
                    }
                }
            }
Ejemplo n.º 2
0
            public void BeginSkillCommodityUpdates(InteractionInstance ths, Dictionary<SkillNames, float> multipliers, bool applyFactor, bool log)
            {
                foreach (CommodityChange change in mActiveCommodities.Values)
                {
                    try
                    {
                        if (!CommodityTest.IsSkill(change.Commodity)) continue;

                        float multiplier = 1f;

                        SkillNames skill;
                        if (SkillManager.SkillCommodityMap.TryGetValue(change.Commodity, out skill))
                        {
                            if (!multipliers.TryGetValue(skill, out multiplier))
                            {
                                multiplier = 1f;
                            }
                        }

                        float original = multiplier;

                        if (applyFactor)
                        {
                            multiplier *= Relativity.Settings.GetDynamicSkillFactor(skill);
                        }

                        if (log)
                        {
                            Relativity.Logger.Append(Common.NewLine + ths.InstanceActor.FullName + " " + skill + ": " + original + " -> " + multiplier);
                        }

                        ths.BeginCommodityUpdate(change, multiplier);
                    }
                    catch (Exception e)
                    {
                        Common.Exception("Commodity: " + ((change != null) ? change.Commodity.ToString () : "<Null>"), e);
                    }
                }
            }