Пример #1
0
    //////////////////////////////////////////
    /// Effect()
    //////////////////////////////////////////
    public Effect(AppliedEffectData i_data)
    {
        // store a reference to the actual data of this effect
        m_data = IDL_Effects.GetData(i_data.EffectID);

        if (m_data != null)
        {
            // set the # of turns this effect will last
            m_nRemainingTurns = m_data.Duration;
        }
        else
        {
            Debug.LogError("Warning, no effect data for " + i_data.EffectID);
        }
    }
Пример #2
0
    //////////////////////////////////////////
    /// UpdateView()
    //////////////////////////////////////////
    public override void UpdateView()
    {
        // see if the blessing is actually on the character
        CharacterModel model  = (CharacterModel)ModelToView;
        bool           bHas   = model.HasEffect(BlessingKey);
        EffectData     effect = IDL_Effects.GetData(BlessingKey);

        // change the icon, if neccessary
        if (bHas && m_eState == BlessingStates.Off)
        {
            SetState(BlessingStates.On, effect);
        }
        else if (bHas == false && m_eState == BlessingStates.On)
        {
            SetState(BlessingStates.Off, effect);
        }

        // update the tooltip the first time this view is updated
        if (m_bInit == false)
        {
            m_bInit = true;
            UpdateTooltip(effect);
        }
    }