Victory()
var/CPPool
var/ExpPool
var/Party
sleep(10)
for(var/mob/Player/A in world)
if(A.z == src.z)
A.ExpGain = 0
A.CPGain = 0
A.AttackUp = 0
ExpPool = round(ExpPool)
CPPool = round(CPPool)
if(A.PartyPosition == 1)
Party = A.Partysize
if(A.icon_state == "Down")
return
ExpPool+=A.ExpGain
CPPool+=A.CPGain
ExpPool = ExpPool/Party
CPPool = CPPool/Party
ExpPool = round(ExpPool)
CPPool = round(CPPool)
src<<sound('mm3selected.mid')
for(var/mob/A in src.group)
A<<sound('mm3selected.mid')
for(var/mob/Player/A in world)
if(A.z == src.z)
A<<"Victory!"
flick("Victory",A)
if(A.icon_state == "Down")
spawn(0)
A.HP = 1
sleep(70)
return
for(var/mob/Player/B in world)
if(B.z == A.z)
if(B.PartyPosition == 1)
A.Exp += ExpPool/B.Partysize
A.CP += CPPool/B.Partysize
spawn(0)
sleep(10)
A<<"You gain [ExpPool] exp."
sleep(10)
A<<"You gain [CPPool] CP."
sleep(70)
for(var/mob/Player/A in world)
if(A.z == src.z)
if(A.PartyPosition == 1)
A.inbattle = 0
A.inmenu = 0
A<<sound('Needle Stage.mid',1)
A.client.lazy_eye = 0
for(var/obj/Face/C in world)
if(C.z == A.z)
del(C)
A.close_menu()
A.dir = EAST
A.icon_state = "Left"
A.loc = locate(A.lastx,A.lasty,A.lastz)
for(var/mob/Player/B in A.group)
B.inbattle = 0
B.inmenu = 0
B<<sound('Needle Stage.mid',1)
B.client.lazy_eye = 0
B.close_menu()
B.dir = EAST
B.icon_state = null
B.loc = A.loc
return
Problem description:
Get ready for the messiest code ever. My problem is when I had my var at 0 hp, it doesnt play through the code. I;m sure that this code can be shorter and all, i just want to find the error.