I have a bit of a problem. I'm making a turn-based RPG where the player and enemy repeatedly attack each other. Whenever I update the code for attacking, I have to copy-paste it from the player to the enemy, replacing "player" with "enemy" and vice-versa. This becomes tedious, so I decided to create global variables called "attacker" and "attacked," which would be set depending on who's attacking who. In the code, I could refer to them instead of having two chunks of..."code."
The problem is that Construct 2 won't let me enter variable names as objects. Can this be done, do I have to keep copy-pasting, or is there another way to solve this problem?
Random, unrelated question that I DEFINITELY bothered to research EXTENSIVELY before asking: Is there a way to enter Java code or something similar instead of selecting actions? I can code much more quickly than I can click on things.