예제 #1
0
            public void EndSkillCommodityUpdates(InteractionInstance ths)
            {
                foreach (CommodityChange change in ths.mActiveCommodityChanges)
                {
                    if (!CommodityTest.IsSkill(change.Commodity))
                    {
                        continue;
                    }

                    ths.EndCommodityUpdate(change, false);
                }
            }
예제 #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);
                    }
                }
            }