private void DisplayProperty(float indent, SimulationProperty property, SimulationObject context)
        {
            int propertyIndex = context.GetPropertyIndex(property.Name);

            context.DebugInfo.SetPropertyContent(propertyIndex, this.IndentedToggle(indent, context.DebugInfo.DisplayPropertyContent(propertyIndex), "{0} = <color=orange>{1}</color> {2}", new object[]
            {
                property.Name,
                property.Value,
                (!context.IsPropertyDirty(property.Name)) ? string.Empty : "<size=11><color=red>(Dirty)</color></size>"
            }));
            if (context.DebugInfo.DisplayPropertyContent(propertyIndex))
            {
                indent += 20f;
                UnityEngine.GUILayout.BeginVertical(new GUILayoutOption[0]);
                this.IndentedLabel(indent, "<size=11><color=grey>Index: <b>{0}</b></color></size>", new object[]
                {
                    context.GetPropertyIndex(property.Name)
                });
                this.IndentedLabel(indent, "BaseValue:", " <b>{0}</b>", new object[]
                {
                    property.BaseValue
                });
                this.IndentedLabel(indent, "Value:", " <b>{0}</b>", new object[]
                {
                    property.Value
                });
                if (property.InternalPropertyDescriptor.Composition != SimulationPropertyComposition.None)
                {
                    this.IndentedLabel(indent, "Composition:", " <b>{0}</b>", new object[]
                    {
                        property.PropertyDescriptor.Composition.ToString()
                    });
                }
                string text  = (property.PropertyDescriptor.MinValue != float.MinValue) ? ("[" + property.PropertyDescriptor.MinValue.ToString("F")) : "]-inf";
                string text2 = (property.PropertyDescriptor.MaxValue != float.MaxValue) ? (property.PropertyDescriptor.MaxValue.ToString("F") + "]") : "inf[";
                this.IndentedLabel(indent, "Range:", " <b>{0},{1}</b>", new object[]
                {
                    text,
                    text2
                });
                UnityEngine.GUILayout.EndVertical();
                Diagnostics.Assert(property.ModifierProviders != null);
                if (property.ModifierProviders.Count > 0)
                {
                    context.DebugInfo.SetPropertyModifier(propertyIndex, this.IndentedToggle(indent, context.DebugInfo.DisplayPropertyModifier(propertyIndex), "<b>Modifiers</b>", new object[0]));
                    if (context.DebugInfo.DisplayPropertyModifier(propertyIndex))
                    {
                        indent += 20f;
                        for (int i = 0; i < property.ModifierProviders.Count; i++)
                        {
                            this.DisplayModifier(indent, property.ModifierProviders.Data[i], context);
                        }
                        indent -= 20f;
                    }
                }
                indent -= 20f;
            }
        }
Beispiel #2
0
    protected bool IAmInDarkForm(BattleSimulationUnit unit, BattleSimulationTarget potentialTarget)
    {
        if (unit.Unit == null)
        {
            return(false);
        }
        SimulationProperty property = unit.Unit.SimulationObject.GetProperty(SimulationProperties.ShiftingForm);

        return(property != null && property.Value == 1f);
    }
Beispiel #3
0
    public float GetCooldownDurationReduction(Army army)
    {
        float num = 0f;
        SimulationProperty property = army.SimulationObject.GetProperty(SimulationProperties.CooldownReduction);

        if (property == null)
        {
            foreach (Unit unit in army.Units)
            {
                property = unit.SimulationObject.GetProperty(SimulationProperties.CooldownReduction);
                if (property == null)
                {
                    return(0f);
                }
                num = Math.Min(num, property.Value);
            }
            return(num);
        }
        num = Math.Min(num, property.Value);
        return(num);
    }