public static IEnumerator PlaySpellEffect([NotNull] SpellEffect spellEffect, Vector2Int coords, [NotNull] SpellEffectInstantiationData instantiationData, [NotNull] CastTargetContext castTargetContext) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!FightMap.current.TryGetCellObject(coords.get_x(), coords.get_y(), out CellObject cellObject)) { yield break; } Transform transform = cellObject.get_transform(); FightContext context = castTargetContext.fightStatus.context; ITimelineContextProvider timelineContextProvider = null; Quaternion rotation = Quaternion.get_identity(); Vector3 scale = Vector3.get_one(); switch (spellEffect.orientationMethod) { case SpellEffect.OrientationMethod.None: { CameraHandler current = CameraHandler.current; if (null != current) { rotation = current.mapRotation.GetInverseRotation(); } break; } case SpellEffect.OrientationMethod.Context: if (cellObject.TryGetIsoObject(out CharacterObject isoObject)) { timelineContextProvider = isoObject; VisualEffectContext visualEffectContext; if ((visualEffectContext = (timelineContextProvider.GetTimelineContext() as VisualEffectContext)) != null) { visualEffectContext.GetVisualEffectTransformation(out rotation, out scale); } } else { Log.Warning($"Spell effect named '{spellEffect.get_name()}' orientation method is {SpellEffect.OrientationMethod.Context} but context provider could not be found.", 426, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs"); } break; case SpellEffect.OrientationMethod.SpellEffectTarget: rotation = instantiationData.GetOrientation(coords, castTargetContext); break; default: throw new ArgumentOutOfRangeException(); } float delayOverDistance = instantiationData.GetDelayOverDistance(coords); yield return(PlaySpellEffect(spellEffect, transform, rotation, scale, delayOverDistance, context, timelineContextProvider)); }
public static IEnumerator PlaySpellEffect([NotNull] SpellEffect spellEffect, [NotNull] IsoObject view, [NotNull] SpellEffectInstantiationData instantiationData, [NotNull] CastTargetContext castTargetContext) { CellObject cellObject = view.cellObject; if (null == cellObject) { Log.Warning("Tried to play spell effect " + spellEffect.get_name() + " on target named " + view.get_name() + " (" + ((object)view).GetType().Name + ") but the target is no longer on the board.", 449, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs"); yield break; } Transform transform = cellObject.get_transform(); FightContext context = castTargetContext.fightStatus.context; ITimelineContextProvider timelineContextProvider = view as ITimelineContextProvider; Quaternion rotation = Quaternion.get_identity(); Vector3 scale = Vector3.get_one(); switch (spellEffect.orientationMethod) { case SpellEffect.OrientationMethod.None: { CameraHandler current = CameraHandler.current; if (null != current) { rotation = current.mapRotation.GetInverseRotation(); } break; } case SpellEffect.OrientationMethod.Context: { VisualEffectContext visualEffectContext; if (timelineContextProvider != null && (visualEffectContext = (timelineContextProvider.GetTimelineContext() as VisualEffectContext)) != null) { visualEffectContext.GetVisualEffectTransformation(out rotation, out scale); } break; } case SpellEffect.OrientationMethod.SpellEffectTarget: rotation = instantiationData.GetOrientation(cellObject.coords, castTargetContext); break; default: throw new ArgumentOutOfRangeException(); } float delayOverDistance = instantiationData.GetDelayOverDistance(cellObject.coords); yield return(PlaySpellEffect(spellEffect, transform, rotation, scale, delayOverDistance, context, timelineContextProvider)); }