The basic components of the script are: player, enemy, turn controller, card, and card abilities. Currently, the turn controller has references to the player, enemy, card, and card skill (card have references to their respective card abilities).
The problem I’m facing is that I need to manipulate the player and enemy data within the turn controller. The card abilities need to access the player and enemy data (attack, defense, health) to calculate the effect and then return the result to the turn controller. However, this creates coupling between the card abilities and the player and enemy scripts. What solutions are available to resolve this issue?
I am a Chinese speaker, and my English is not very proficient. Please forgive me if there are any misunderstandings or unclear parts.