Пример #1
0
    public void ApplyBounus(ObjectController target)
    {
        switch (bounus_type)
        {
        case BounusType.Stats:
            switch (stats_bounus.value_type)
            {
            case SetStatsField.ValueType.Raw:
                target.AddMaxStats(stats_bounus.stats_type, stats_bounus.value);
                break;

            case SetStatsField.ValueType.Percentage:
                if ((int)STATSTYPE.DEFENSE <= (int)stats_bounus.stats_type && (int)stats_bounus.stats_type <= (int)STATSTYPE.HASTE)
                {
                    target.AddMaxStats(stats_bounus.stats_type, (float)System.Math.Round(stats_bounus.value, 1));
                }
                else
                {
                    target.AddMaxStats(stats_bounus.stats_type, (float)System.Math.Round(stats_bounus.value * target.MaxStats.Get(stats_bounus.stats_type), 0));
                }
                break;
            }
            break;

        case BounusType.Passive:
            if (target.GetPassive(passive_bounus.GetType()) != null)
            {
                return;
            }
            CachedPassive = (PassiveSkill)passive_bounus.Instantiate();
            CachedPassive.InitSkill(target);
            target.Passives.Add(CachedPassive);
            break;
        }
    }
Пример #2
0
    protected void PassiveStatus()
    {
        if (m_PassiveSkill)
        {
            System.Reflection.FieldInfo[] fieldInfos = m_PassiveSkill.GetType().GetFields(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic);

            string output = "======" + m_PassiveSkill.m_StatusName + "======\n";

            foreach (var item in fieldInfos)
            {
                try
                {
                    output += $"{item.Name}: {item.GetValue(m_PassiveSkill)}\n";
                }
                catch (ArgumentException)
                {
                    output += $"{item.Name}: unobtainable\n";
                }
            }

            Debug.Log(output, this);
        }
    }