////////////////////////////////////////// /// 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; }
////////////////////////////////////////// /// 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); }
////////////////////////////////////////// /// 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 ); }
////////////////////////////////////////// /// 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); } }
////////////////////////////////////////// /// 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 ); }
////////////////////////////////////////// /// 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 ); }