public static IEnumerator Hit(this IObjectWithArmoredLife objectWithLife, Vector2Int position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) CellObject cellObject = objectWithLife.cellObject; if (cellObject.coords != position) { Log.Warning($"Was not on the specified cell of hit sequence: {cellObject.coords} instead of {position} ({objectWithLife.gameObject.get_name()}).", 31, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\IObjectWithArmoredLife.cs"); CellObject cellObject2 = cellObject.parentMap.GetCellObject(position.get_x(), position.get_y()); objectWithLife.SetCellObject(cellObject2); } return(objectWithLife.PlayHitAnimation()); }
public static void LethalHit(this IObjectWithArmoredLife objectWithLife, Vector2Int position) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown CellObject cellObject = objectWithLife.cellObject; if (cellObject.coords != position) { Log.Warning($"Was not on the specified cell of hit sequence: {cellObject.coords} instead of {position} ({objectWithLife.gameObject.get_name()}).", 49, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Maps\\Objects\\IObjectWithArmoredLife.cs"); CellObject cellObject2 = cellObject.parentMap.GetCellObject(position.get_x(), position.get_y()); objectWithLife.SetCellObject(cellObject2); } MonoBehaviourExtensions.StartCoroutineImmediateSafe(objectWithLife, objectWithLife.PlayLethalHitAnimation(), null); }
public override IEnumerator UpdateView(FightStatus fightStatus) { int fightId = fightStatus.fightId; if (fightStatus.TryGetEntity(concernedEntity, out IEntityWithBoardPresence entityStatus)) { int change = 0; int num = 0; int num2 = 0; LifeModificationType lifeModificationType = LifeModificationType.Undefined; if (armorAfter.HasValue) { num = armorAfter.Value; if (armorBefore.HasValue) { int value = armorBefore.Value; change += num - value; if (value > num) { lifeModificationType = LifeModificationType.Damage; } else if (value < num) { lifeModificationType = LifeModificationType.ArmorGain; } } } if (lifeAfter.HasValue) { num2 = lifeAfter.Value; if (lifeBefore.HasValue) { int value2 = lifeBefore.Value; change += num2 - value2; if (value2 > num2) { lifeModificationType = ((num2 > 0) ? LifeModificationType.Damage : LifeModificationType.Death); } else if (value2 < num2) { lifeModificationType = ((entityStatus.type == EntityType.ObjectMechanism) ? LifeModificationType.ArmorGain : LifeModificationType.Heal); } } } if (lifeAfter.HasValue && entityStatus.type == EntityType.Hero) { HeroStatus heroStatus = (HeroStatus)entityStatus; if (heroStatus.ownerId == fightStatus.localPlayerId) { FightMap current = FightMap.current; if (null != current) { current.SetLocalPlayerHeroLife(num2, heroStatus.baseLife); } } if (fightStatus.TryGetEntity(heroStatus.ownerId, out PlayerStatus entityStatus2)) { AbstractPlayerUIRework view = entityStatus2.view; if (null != view) { view.ChangeHeroLifePoints(num2); } TryDrawLowLifeMessage(num2, entityStatus2); } } IsoObject isoObject = entityStatus.view; if (null != isoObject) { IObjectWithArmoredLife objectWithArmoredLife2; IObjectWithArmoredLife objectWithArmoredLife = objectWithArmoredLife2 = (isoObject as IObjectWithArmoredLife); if (objectWithArmoredLife2 != null) { int life = lifeAfter.HasValue ? num2 : objectWithArmoredLife.life; int armor = armorAfter.HasValue ? num : objectWithArmoredLife.armor; objectWithArmoredLife.SetArmoredLife(life, armor); } else { Log.Error(FightEventErrors.EntityHasIncompatibleView <IObjectWithArmoredLife>(entityStatus), 151, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ArmoredLifeChangedEvent.cs"); objectWithArmoredLife = null; } switch (lifeModificationType) { case LifeModificationType.ArmorGain: yield return(FightSpellEffectFactory.PlayGenericEffect(SpellEffectKey.ArmorGain, fightId, parentEventId, isoObject, fightStatus.context)); ValueChangedFeedback.Launch(change, ValueChangedFeedback.Type.Heal, isoObject.cellObject.get_transform()); break; case LifeModificationType.Damage: yield return(FightSpellEffectFactory.PlayGenericEffect(SpellEffectKey.Damage, fightId, parentEventId, isoObject, fightStatus.context)); ValueChangedFeedback.Launch(change, ValueChangedFeedback.Type.Damage, isoObject.cellObject.get_transform()); if (objectWithArmoredLife != null) { yield return(objectWithArmoredLife.Hit(isoObject.area.refCoord)); } break; case LifeModificationType.Heal: yield return(FightSpellEffectFactory.PlayGenericEffect(SpellEffectKey.Heal, fightId, parentEventId, isoObject, fightStatus.context)); ValueChangedFeedback.Launch(change, ValueChangedFeedback.Type.Heal, isoObject.cellObject.get_transform()); break; case LifeModificationType.Death: yield return(FightSpellEffectFactory.PlayGenericEffect(SpellEffectKey.Damage, fightId, parentEventId, isoObject, fightStatus.context)); ValueChangedFeedback.Launch(change, ValueChangedFeedback.Type.Damage, isoObject.cellObject.get_transform()); objectWithArmoredLife?.LethalHit(isoObject.area.refCoord); break; default: throw new ArgumentOutOfRangeException(); case LifeModificationType.Undefined: break; } } else { Log.Error(FightEventErrors.EntityHasNoView(entityStatus), 197, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ArmoredLifeChangedEvent.cs"); } } else { Log.Error(FightEventErrors.EntityNotFound <IEntityWithBoardPresence>(concernedEntity), 202, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\ArmoredLifeChangedEvent.cs"); } FightLogicExecutor.FireUpdateView(fightId, EventCategory.LifeArmorChanged); }