Ejemplo n.º 1
0
    //////////////////////////////////////////
    /// GetExample()
    /// Returns an example of this class.
    /// Used for testing json serialization.
    //////////////////////////////////////////
    public static AppliedEffectData GetExample() {
        AppliedEffectData ex = new AppliedEffectData();
        ex.EffectID = "BLESSING_A";
        ex.Target = CombatTargets.Self;

        return ex;
    }
Ejemplo n.º 2
0
    //////////////////////////////////////////
    /// GetExample()
    /// Returns an example of this class.
    /// Used for testing json serialization.
    //////////////////////////////////////////
    public static AppliedEffectData GetExample()
    {
        AppliedEffectData ex = new AppliedEffectData();

        ex.EffectID = "BLESSING_A";
        ex.Target   = CombatTargets.Self;

        return(ex);
    }
Ejemplo n.º 3
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 );
    }
Ejemplo n.º 4
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);
        }
    }
Ejemplo n.º 5
0
    //////////////////////////////////////////
    /// ApplyEffect()
    /// Applies incoming effect on this model.
    //////////////////////////////////////////
    public void ApplyEffect(AppliedEffectData i_effectApplied)
    {
        // create a new effect from the data
        Effect effect = new Effect(i_effectApplied);

        // get the currently applied effects on this model
        Dictionary <string, Effect> dictEffects = GetPropertyValue <Dictionary <string, Effect> >("Effects");

        // only apply the effect if it's not already on the character (subject to change? ugh...it's a dictionary!)
        if (dictEffects.ContainsKey(i_effectApplied.EffectID) == false)
        {
            dictEffects.Add(i_effectApplied.EffectID, effect);
            SetProperty("Effects", dictEffects);
        }

        //Debug.Log( "Applying effect " + i_effectApplied.EffectID );
    }
Ejemplo n.º 6
0
    //////////////////////////////////////////
    /// ApplyEffect()
    /// Applies incoming effect on this model.
    //////////////////////////////////////////
    public void ApplyEffect( AppliedEffectData i_effectApplied ) {
        // create a new effect from the data
        Effect effect = new Effect( i_effectApplied );

        // get the currently applied effects on this model
        Dictionary<string, Effect> dictEffects = GetPropertyValue<Dictionary<string, Effect>>( "Effects" );

        // only apply the effect if it's not already on the character (subject to change? ugh...it's a dictionary!)
        if ( dictEffects.ContainsKey( i_effectApplied.EffectID ) == false ) {
            dictEffects.Add( i_effectApplied.EffectID, effect );
            SetProperty( "Effects", dictEffects );
        }

        //Debug.Log( "Applying effect " + i_effectApplied.EffectID );
    }