public static EffectBase CreateInstance(ObjectEffect effect) { if (effect is ObjectEffectLadder) return new EffectLadder(effect as ObjectEffectLadder); if (effect is ObjectEffectCreature) return new EffectCreature(effect as ObjectEffectCreature); if (effect is ObjectEffectDate) return new EffectDate(effect as ObjectEffectDate); if (effect is ObjectEffectDice) return new EffectDice(effect as ObjectEffectDice); if (effect is ObjectEffectDuration) return new EffectDuration(effect as ObjectEffectDuration); if (effect is ObjectEffectMinMax) return new EffectMinMax(effect as ObjectEffectMinMax); if (effect is ObjectEffectMount) return new EffectMount(effect as ObjectEffectMount); if (effect is ObjectEffectString) return new EffectString(effect as ObjectEffectString); if (effect is ObjectEffectInteger) return new EffectInteger(effect as ObjectEffectInteger); return new EffectBase(effect); }
public EffectBase(ObjectEffect effect) { Id = effect.actionId; try { m_template = ObjectDataManager.Instance.Get<Effect>(Id, true); if (m_template == null) m_template = new Effect(); } catch (Exception ex) { logger.Debug("Can't find effect Id {0} : {1}", Id, ex.Message); m_template = new Effect(); } }
public EffectInteger(ObjectEffect effect, int value) : base (effect) { m_value = (short) value; }