Beispiel #1
0
    public bool HasProperty(BacteriaProperty property, out float level)
    {
        if ((m_properties == null) || !m_properties.ContainsKey(property))
        {
            level = 0;
            return(false);
        }

        level = m_properties[property];
        return(true);
    }
Beispiel #2
0
    public void AddProperty(BacteriaProperty property, float value)
    {
        if (m_properties == null)
        {
            m_properties = new Dictionary <BacteriaProperty, float>();
        }

        if (m_properties.ContainsKey(property))
        {
            Debug.LogWarning("Trying to add property to bacteria that already has this property.");
            return;
        }

        m_properties.Add(property, value);
        UpdateStaticProperties();
    }
Beispiel #3
0
    static public float BacteriaPropertyAtLevel(BacteriaProperty property, float level)
    {
        switch (property)
        {
        case BacteriaProperty.Multiplier:
            level = s_singleton.m_multiplierChancesFactor * level;
            break;

        case BacteriaProperty.Small:
            level = s_singleton.m_smallBacteriaScaleFactor * level;
            break;

        case BacteriaProperty.Big:
            level = s_singleton.m_bigBacteriaScaleFactor * level;
            break;

        case BacteriaProperty.Slow:
            level = s_singleton.m_slowBacteriaSpeedFactor * level;
            break;

        case BacteriaProperty.Quick:
            level = s_singleton.m_quickBacteriaSpeedFactor * level;
            break;

        case BacteriaProperty.Resistant:
            level = s_singleton.m_bacteriaResistanceFactor * level;
            break;

        case BacteriaProperty.Berserker:
            level = s_singleton.m_bacteriaBerserkFactor * level;
            break;

        case BacteriaProperty.Killer:
            level = s_singleton.m_bacteriaKillerChanceFactor * level;
            break;
        }
        return(level);
    }