public new static EffectExecutionWithDurationDefinition FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject val = Extensions.Value <JObject>((IEnumerable <JToken>)token); JToken val2 = default(JToken); if (!val.TryGetValue("type", ref val2)) { Debug.LogWarning((object)"Malformed json: no 'type' property in object of class EffectExecutionWithDurationDefinition"); return(null); } string text = Extensions.Value <string>((IEnumerable <JToken>)val2); EffectExecutionWithDurationDefinition effectExecutionWithDurationDefinition; switch (text) { case "StoppableCaracChangedEffectDefinition": effectExecutionWithDurationDefinition = new StoppableCaracChangedEffectDefinition(); break; case "PropertyChangeEffectDefinition": effectExecutionWithDurationDefinition = new PropertyChangeEffectDefinition(); break; case "SpellCostModifierEffect": effectExecutionWithDurationDefinition = new SpellCostModifierEffect(); break; case "RegisterDamageProtectorEffectDefinition": effectExecutionWithDurationDefinition = new RegisterDamageProtectorEffectDefinition(); break; case "ChangeEntitySkinEffectDefinition": effectExecutionWithDurationDefinition = new ChangeEntitySkinEffectDefinition(); break; case "FloatingCounterModificationEffectDefinition": effectExecutionWithDurationDefinition = new FloatingCounterModificationEffectDefinition(); break; default: Debug.LogWarning((object)("Unknown type: " + text)); return(null); } effectExecutionWithDurationDefinition.PopulateFromJson(val); return(effectExecutionWithDurationDefinition); }
public new static FloatingCounterModificationEffectDefinition FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject jsonObject = Extensions.Value <JObject>((IEnumerable <JToken>)token); FloatingCounterModificationEffectDefinition floatingCounterModificationEffectDefinition = new FloatingCounterModificationEffectDefinition(); floatingCounterModificationEffectDefinition.PopulateFromJson(jsonObject); return(floatingCounterModificationEffectDefinition); }
public new static EffectExecutionDefinition FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject val = Extensions.Value <JObject>((IEnumerable <JToken>)token); JToken val2 = default(JToken); if (!val.TryGetValue("type", ref val2)) { Debug.LogWarning((object)"Malformed json: no 'type' property in object of class EffectExecutionDefinition"); return(null); } string text = Extensions.Value <string>((IEnumerable <JToken>)val2); EffectExecutionDefinition effectExecutionDefinition; switch (text) { case "ExplosionEffectDefinition": effectExecutionDefinition = new ExplosionEffectDefinition(); break; case "HealEffectDefinition": effectExecutionDefinition = new HealEffectDefinition(); break; case "CaracChangedEffectDefinition": effectExecutionDefinition = new CaracChangedEffectDefinition(); break; case "AddSpellInGameEffectDefinition": effectExecutionDefinition = new AddSpellInGameEffectDefinition(); break; case "DrawSpellEffectDefinition": effectExecutionDefinition = new DrawSpellEffectDefinition(); break; case "DiscardSpellEffectDefinition": effectExecutionDefinition = new DiscardSpellEffectDefinition(); break; case "DiscardSpellAndDrawEffectDefinition": effectExecutionDefinition = new DiscardSpellAndDrawEffectDefinition(); break; case "ThrowDiceEffectDefinition": effectExecutionDefinition = new ThrowDiceEffectDefinition(); break; case "ReturnSpellToHandEffectDefinition": effectExecutionDefinition = new ReturnSpellToHandEffectDefinition(); break; case "TeleportEffectDefinition": effectExecutionDefinition = new TeleportEffectDefinition(); break; case "SwapPositionsEffectDefinition": effectExecutionDefinition = new SwapPositionsEffectDefinition(); break; case "MoveInLineEffectDefinition": effectExecutionDefinition = new MoveInLineEffectDefinition(); break; case "ChargeEffectDefinition": effectExecutionDefinition = new ChargeEffectDefinition(); break; case "InvokeCreatureEffectDefinition": effectExecutionDefinition = new InvokeCreatureEffectDefinition(); break; case "DuplicateSummoningEffectDefinition": effectExecutionDefinition = new DuplicateSummoningEffectDefinition(); break; case "ResetActionEffectDefinition": effectExecutionDefinition = new ResetActionEffectDefinition(); break; case "TransformationEffectDefinition": effectExecutionDefinition = new TransformationEffectDefinition(); break; case "GrowEffectDefinition": effectExecutionDefinition = new GrowEffectDefinition(); break; case "ElementStateChangeEffectDefinition": effectExecutionDefinition = new ElementStateChangeEffectDefinition(); break; case "SetNonHealableLifeEffectDefinition": effectExecutionDefinition = new SetNonHealableLifeEffectDefinition(); break; case "ToggleElementaryStateEffectDefinition": effectExecutionDefinition = new ToggleElementaryStateEffectDefinition(); break; case "PlayEntityAnimationEffectDefinition": effectExecutionDefinition = new PlayEntityAnimationEffectDefinition(); break; case "RemoveEntityEffectDefinition": effectExecutionDefinition = new RemoveEntityEffectDefinition(); break; case "ReturnCompanionToHandEffectDefinition": effectExecutionDefinition = new ReturnCompanionToHandEffectDefinition(); break; case "ActivateFloorMechanismEffectDefinition": effectExecutionDefinition = new ActivateFloorMechanismEffectDefinition(); break; case "StealCaracEffectDefinition": effectExecutionDefinition = new StealCaracEffectDefinition(); break; case "TriggerFightActionEffectDefinition": effectExecutionDefinition = new TriggerFightActionEffectDefinition(); break; case "ResurrectCompanionsEffectDefinition": effectExecutionDefinition = new ResurrectCompanionsEffectDefinition(); break; case "ThrowSpecificEventTrigger": effectExecutionDefinition = new ThrowSpecificEventTrigger(); break; case "PhysicalDamageEffectDefinition": effectExecutionDefinition = new PhysicalDamageEffectDefinition(); break; case "MagicalDamageEffectDefinition": effectExecutionDefinition = new MagicalDamageEffectDefinition(); break; case "LifeLeechEffectDefinition": effectExecutionDefinition = new LifeLeechEffectDefinition(); break; case "StoppableCaracChangedEffectDefinition": effectExecutionDefinition = new StoppableCaracChangedEffectDefinition(); break; case "PropertyChangeEffectDefinition": effectExecutionDefinition = new PropertyChangeEffectDefinition(); break; case "SpellCostModifierEffect": effectExecutionDefinition = new SpellCostModifierEffect(); break; case "RegisterDamageProtectorEffectDefinition": effectExecutionDefinition = new RegisterDamageProtectorEffectDefinition(); break; case "ChangeEntitySkinEffectDefinition": effectExecutionDefinition = new ChangeEntitySkinEffectDefinition(); break; case "FloatingCounterModificationEffectDefinition": effectExecutionDefinition = new FloatingCounterModificationEffectDefinition(); break; default: Debug.LogWarning((object)("Unknown type: " + text)); return(null); } effectExecutionDefinition.PopulateFromJson(val); return(effectExecutionDefinition); }