private void updateShockEffect(PartyMember partyMember, Delta delta) { shudderManager.Update(partyMember, delta); if (shudderManager.Finished) { finished = true; } bool shocked = shudderManager.ShudderCounter % 2 == 0; partyMember.BattleEntity.Position = shudderManager.PartyMemberStartPosition + (new Vector2(5.0f, 0.0f) * (shocked ? -1 : 1)); partyMember.BattleEntity.Tint = shocked ? Color.Yellow : Color.White; partyMember.BattleEntity.PauseAnimation = true; }
public static void UpdateShudder(PartyMember partyMember, Color tint, ShudderManager shudderManager, Delta delta) { shudderManager.Update(partyMember, delta); if (shudderManager.Finished) { partyMember.BattleEntity.Tint = Color.White; partyMember.BattleEntity.PauseAnimation = false; } else { float shudderPercentage = shudderManager.ShudderTimer / shudderManager.ShudderTime; if (shudderManager.ShudderCounter % 2 != 0) { shudderPercentage = 1.0f - shudderPercentage; } partyMember.BattleEntity.Position = shudderManager.PartyMemberStartPosition + new Vector2(shudderPercentage * shudderDistance, 0.0f); partyMember.BattleEntity.Tint = tint; partyMember.BattleEntity.PauseAnimation = true; } }