mob/verb/Engage_in_battle(mob/M in oview(1)) set category = "Combat" switch(alert(M,"[usr] has chalenged you to a battle.","Accept?","Yes","No") == "Yes") if(M.npc == 0 && !M) //blah blah rest of the stuff.There IS coding here.
Problem description:
Problem is,now every time I compile,it keeps saying empty switch statement and it highlights the if(M.npc == 0 && !M) and every time the M chooses "no" It does what yes does...
mob/verb/Engage_in_battle(mob/M in oview(1)) set category = "Combat" if(alert(M,"[usr] has chalenged you to a battle.","Accept?","Yes","No") == "Yes") if(!M.npc && !M) // code
to use the =="" part, you would have to using an if() statement.
It should like the code above.
Also remember bolean (spelling?) vars. if(var==0) and if(var==1) shouldn't be used. use if(!var) and if(var)... Its a better use.
> mob/verb/Engage_in_battle(mob/M in oview(1)) > set category = "Combat" > if(alert(M,"[usr] has chalenged you to a battle.","Accept?","Yes","No") == "Yes") > if(!M.npc && !M) > // code >
to use the =="" part, you would have to using an if() statement.
It should like the code above.
Also remember bolean (spelling?) vars. if(var==0) and if(var==1) shouldn't be used. use if(!var) and if(var)... Its a better use.
Now it says if statement has no effect...argh...!!
It likely has something to do with what's AFTER the code you show us here. Please show the entire code for this verb.
mob/verb/Engage_in_battle(mob/M in oview(1)) set category = "Combat" if(alert(M,"[usr] has chalenged you to a battle.","Accept?","Yes","No") == "Yes") if(!M.npc && !M) usr << "You now have 5 seconds to stand in front of each other,facing each other." M << "You now have 5 seconds to stand in front of each other,facing each other." sleep(50) usr << "Starting battle..." M << "Starting battle..." view(3) << "Dont foget to use the attack verb!!!!!!!!!!!" sleep(15) view(3) << "GO!" M.icon_state = "Punch" usr.icon_state = "Punch" sleep(5) usr.x += 1 M.x += 1 sleep(5) usr.y += 1 M.y += 1 sleep(5) usr.x -= 1 M.x -= 1 sleep(5) usr.y -= 1 M.y -= 1 sleep(20) if(usr.KO == 0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) view(6) << pick("[usr] punches [M] in the balls making his eyes water...","[usr] throws a huge double-fisted punch [M]'s way!!!","[usr] smashes into [M]'s stomach!","[usr] kicks the tar out of this [M.Race]!!!") M.Stam -= usr.PL/2 view(6) << pick("[M] punches [usr] in the butt as he shits out of his face...","[M]'s foot suddenly appears in [usr]'s face,throwing him to the ground...","[M] farts in [usr]'s face distracting him!!!","[usr] blocks only to see [M] punch him from behind!!!") usr.Stam -= rand(1,15) sleep(5) if(usr.KO == 0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) sleep(750) view(6) << pick("[M] brings [usr] head down into the ground braking his skull...","[usr] turns around to see [M] kicking his way...","[M] smashes into [usr]'s head...") if(usr.KO == 0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) usr.Stam -= M.PL/2 sleep(5) usr.x += 1 M.x += 1 sleep(5) usr.y += 1 M.y += 1 sleep(5) usr.x -= 1 M.x -= 1 sleep(5) usr.y -= 1 M.y -= 1 sleep(20) if(usr.KO == 0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) sleep(50) if(usr.KO == 0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) sleep(1200) if(usr.KO == 0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) view(6) << pick("[usr] hits [M]'s chest winding him...","[usr] smashes [M]'s face in...","[M] trys to do a high kick,but [usr] grabs his foot and twists it...") M.Stam -= rand(1,15) if(usr.KO ==0 && M.KO == 0 && usr.Dead == 0 && M.Dead == 0 && M.npc == 0) view(6) << "TIME FOR A FINISHING BATTLE MOVE!!!" view(6) << "USE AN ENERGY ATTACK OR CONTINUE ATTACKING THE FOE!!!!" sleep(300) view(6) << "THE BATTLE HAS ENDED!!!!" view(6) << "Calculating results..." if(usr.Stam > M.Stam && M.npc == 0 && usr.KO == 0 && usr.Dead == 0) world << "[usr] has won the battle between himself and [M]!!!!!" usr.MaxPL += M.MaxPL/2 M.icon_state = "Norm" usr.icon_state = "Norm" if(M.Stam > usr.Stam && M.npc == 0 && M.KO == 0 && usr.Dead == 0) world << "[M] has won the battle between himself and [usr]!!!!!" M.MaxPL += usr.MaxPL/2 M.icon_state = "Norm" usr.icon_state = "Norm" if(M.KO == 1 && M.npc == 0 && M.Dead == 0) world << "[usr] has won the battle between himself and [M]!!!!!" usr.MaxPL += M.MaxPL/2 M.icon_state = "Norm" usr.icon_state = "Norm" if(M.Dead == 1 && M.npc == 0) world << "[usr] has won the battle between himself and [M]!!!!!" usr.MaxPL += M.MaxPL/2 M.icon_state = "Norm" usr.icon_state = "Norm" if(usr.KO == 1) world << "[M] has won the battle between himself and [usr]!!!!!" M.MaxPL += usr.MaxPL/2 M.icon_state = "Norm" usr.icon_state = "Norm" if(usr.Dead == 1) world << "[M] has won the battle between himself and [usr]!!!!!" M.MaxPL += usr.MaxPL/2 M.icon_state = "Norm" usr.icon_state = "Norm" if(usr.Stam == M.Stam && M.npc == 0) world << "[usr] and [M] have drawn in their battle!!!!!" M.icon_state = "Norm" usr.icon_state = "Norm" M.MaxPL += usr.MaxPL/4 usr.MaxPL += M.MaxPL/4 if(usr.KO == 1 && M.KO == 1 && M.npc == 0) world << "[usr] and [M] have drawn in their battle!!!!!" M.icon_state = "Norm" usr.icon_state = "Norm" M.MaxPL += usr.MaxPL/4 usr.MaxPL += M.MaxPL/4 if(usr.Dead == 1 && M.Dead == 1 && M.npc == 0) world << "[usr] and [M] have drawn in their battle!!!!!" M.icon_state = "Norm" usr.icon_state = "Norm" M.MaxPL += usr.MaxPL/4 usr.MaxPL += M.MaxPL/4