obj/planet
DblClick(O)
if(src:owner=="nobody")
if(usr:settlers>0)
usr:settlers-=1
usr.z=src:Z1
usr:planets+=1
src.owner=usr
usr<<'bom.wav'
usr<<"You settled [src]."
src.name=input("What name do you want to give your new planet?","name?") as text
else
usr<<"You can't settle more than one planet."
else if(src:owner==usr)
usr.z=src:Z1
src.owner=usr
usr<<'bom.wav'
else
if(usr:selected)
walk_to(usr:selected,src,1,20)
if(usr:selected in oview(1))
var/damage
var/damage2
var/watchers=list(usr,src:owner)
start
sleep(10)
damage=0
damage2=0
for(var/obj/ship/S in usr:selected:ships)
damage+=S:str
watchers<<"[usr]'s fleet attacks [src] for [damage] damage."
var/target
var/damager
hurt
sleep(10)
target=null
for(var/obj/ship/S in src.fleet)
if(S:HP>0)
target=S
goto goon
goon
if(!target)
usr<<"You conquered [src]!"
src:owner=usr
for(var/obj/building/B in world)
if(B:z==src.Z1)
B:owner=usr
src:owner:planets-=1
for(var/obj/planet/P in world)
if(P:z!=3)
if(P:owner)
if(P:owner!=usr)
if(P:owner!="nobody")
return 0
world<<"<font color=blue size=+3> [usr] won!"
world.Reboot()
return 0
damager=damage
damage-=target:HP
target:HP-=damager
if(target:HP<=0)
if(damage>0)
goto hurt
for(var/obj/ship/S in src.fleet)
damage2+=S:str
watchers<<"[usr]'s fleet attacks [src] for [damage2] damage."
usr:selected:damage1(damage2)
if(!usr:selected)
return
damage=0
goto start
Problem description:It changes the HP of all the ships in src.fleet, not only of the target.
You also need to stop using goto. Its only place is in very very complex loops, which you don't have here. Instead you could use while() loops, and commands like break and continue, and clean the whole thing up.
Until those items are cleaned up you have little hope of properly debugging your problem.
And why set owner to "nobody" instead of just null, which is vastly more sensible?
Lummox JR