You appear to have a misunderstanging with pointers, or just a simple mistake hiding in a blind spot.
In your enemy action you set
living=me;, but "living" is a single pointer so what happens is this.
1> Action
the_enemy_1 get run by the first entity created or loaded in level. It sets the global pointer
living to ##_ENTITY_number_1_##. Cool.
2> Action
the_enemy_1 get run by the second entity created or loaded in level. It sets the global pointer
living to ##_ENTITY_number_2_##.
BAD"living" is no longer pointing at ##_ENTITY_number_1_## anymore. So it is no longer "living" to any action.
See the problem?
What you need to do is set a flag of some sort onto the entities to mark them as living.
OK, pick a number between One and One Hundred.
50! I guessed it, Ha!
So now we will use skill 50 to store each entities living status in, to do this we go into the
the_enemy_1 action, and replace the line "living=me;" with "my.skill50=1;" instead.
So now what we've done will change the value of skill50 to be "1" when any entity runs the
the_enemy_1 action.
Any entities that DONT run
the_enemy_1 will still have their skill50 at Zero.
AS LONG AS WE NEVER USE SKILL50 FOR ANYTHING ELSE!! Sorry for yelling but its important.
Now the bullet needs to recognise whether the target is alive or dead.
Change its line "if(you==living)" to be "if(you.skill50==1)"
And that should be it. I havent looked any deeper into your code than that butit looks good at a glance.
Just remember, when the enemy is dead, you MAY want to set the entities skill50 to 0 when it dies,
unless, like me, you enjoy the spatter of blood when shooting corpses!!!
Also again REMEMBER never to use skill50 for any function than living/dead status or things WILL go weird.
Have fun....