proc battleinput() while(1) if(src.loc==locate(12,6,1) | src.loc==locate(12,3,1) | src.loc==locate(11,9,1) && src.pturn) for(var/mob/enemy/Prowler/o in locate(15,6,1)) for(var/mob/enemy/Bandit/i in locate(15,3,1)) var/tmp/action=input("What would you like to do?") in list ("Attack", "Run") if(action=="Attack") var/tmp/attackwho=input("Attack who?") in list ("Enemy 1", "Enemy 2") if(attackwho=="Enemy 1") var/tmp/randomdmg = rand(1,10) o.hp-= randomdmg world << "[src] attacks [o] for [randomdmg] dmg" src.pturn=0 if(attackwho=="Enemy 2") var/tmp/randomdmg = rand(1,30) i.hp-=randomdmg world << "[src] attacks [i] for [randomdmg] dmg" src.pturn=0 if(gturn==2) gturn=3 else if(gturn==1) gturn=2 if(action=="Run") if(prob(20)) src.loc=prevloc src.pturn=1 src.pturn=0 gturn=2 sleep(10)
enemyinput() while(1) for(var/mob/q in locate(11,9,1)) for(var/mob/y in locate(12,3,1)) for(var/mob/s in locate(12,6,1)) if(q.loc==locate(11,9,1) && y.loc==locate(12,3,1) && s.loc==locate(12,6,1) && !s.pturn && !y.pturn && !q.pturn) if(gturn==2) var/tmp/random=rand(0,1) if(random==0) var/tmp/turn=rand(0,2) if(turn==0) var/tmp/randomdmg = rand(0,10) q.hp-= randomdmg world << "[src] attacks [q] for [randomdmg]" else if(turn==1) var/tmp/randomdmg = rand(0,10) s.hp-=randomdmg world << "[src] attacks [s] for [randomdmg]" else if(turn==2) var/tmp/randomdmg = rand(0,10) y.hp-=randomdmg world << "[src] attacks [y] for [randomdmg]" s.pturn=0 y.pturn=0 q.pturn=1 gturn=3 if(random==1) var/tmp/turn=rand(0,2) if(turn==0) var/tmp/randomdmg = rand(1,30) q.hp-=randomdmg world << "[src] Super Attacks [q] for [randomdmg]" if(turn==1) var/tmp/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] Super Attacks [s] for [randomdmg]" if(turn==2) var/tmp/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] Super Attacks [y] for [randomdmg]" s.pturn=0 y.pturn=0 q.pturn=1 gturn=3 for(var/mob/y in locate(12,3,1)) for(var/mob/s in locate(12,6,1)) if(y.loc==locate(12,3,1) && s.loc==locate(12,6,1) && gturn==2) var/tmp/random=rand(0,1) if(!random) var/tmp/turn=rand(0,1) if(!turn) var/tmp/randomdmg = rand(1,30) y.hp-=randomdmg world << "[src] attacks [y] for [randomdmg]" else if(turn) var/tmp/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] attacks [s] for [randomdmg]" y.pturn=1 s.pturn=0 if(random) var/tmp/turn=rand(0,1) if(turn==0) var/tmp/randomdmg = rand(1,30) y.hp-=randomdmg world << "[src] super attacks [y] for [randomdmg]" else if(turn==1) var/tmp/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] super attacks [s] for [randomdmg]" gturn=3 for(var/mob/s in locate(12,6,1)) if(gturn==2) if(s.loc==locate(12,6,1)) var/tmp/random=rand(0,1) if(random==0) var/tmp/randomdmg = rand(1,10) s.hp-=randomdmg world << "[src] attacks [s] for [randomdmg]" if(random==1) var/tmp/randomdmg = rand(1,10) s.hp-=randomdmg world << "[src] super attacks [s] for [randomdmg]" sleep(100) s.pturn=1 gturn=3 sleep(10)
enemyinput1() while(1) for(var/mob/q in locate(11,9,1)) for(var/mob/y in locate(12,3,1)) for(var/mob/s in locate(12,6,1)) if(q.loc==locate(11,9,1) && y.loc==locate(12,3,1) && s.loc==locate(12,6,1) && gturn==3 && !q.pturn && !y.pturn && !s.pturn) var/tmp/random=rand(0,1) if(random==0) var/tmp/turn=rand(0,1) if(turn==0) var/tmp/randomdmg = rand(1,10) q.hp-=randomdmg world << "[src] attacks [q] for [randomdmg]" else if(turn==1) var/tmp/randomdmg = rand(1,10) s.hp-=randomdmg world << "[src] attacks [s] for [randomdmg]" else if(turn==2) var/tmp/randomdmg = rand(1,10) y.hp-=randomdmg world << "[src] attacks [y] for [randomdmg]" s.pturn=1 y.pturn=0 q.pturn=0 gturn=1 if(random==1) var/tmp/turn=rand(0,2) if(turn==0) var/tmp/randomdmg = rand(1,30) q.hp-=randomdmg world << "[src] Super Attacks [q] for [randomdmg]" if(turn==1) var/tmp/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] Super Attacks [s] for [randomdmg]" if(turn==2) var/tmp/randomdmg = rand(1,30) y.hp-=randomdmg world << "[src] Super Attacks [y] for [randomdmg]" gturn=1 for(var/mob/y in locate(12,3,1)) for(var/mob/s in locate(12,6,1) && y.loc==locate(12,3,1) && s.loc==locate(12,6,1) && gturn==3) if(s.loc==locate(12,6,1) && y.loc==locate(12,3,1) && s.loc==locate(12,6,1)) var/tmp/random=rand(0,1) if(random==0) var/tmp/a=rand(0,1) if(a==0) var/tmp/randomdmg = rand(1,10) y.hp-=randomdmg world << "[src] attacks [y] for [randomdmg]" else if(a==1) var/tmp/randomdmg = rand(1,10) s.hp-=randomdmg world << "[src] attacks [s] for [randomdmg]" if(random==1) var/tmp/a=rand(0,1) if(a==0) var/tmp/randomdmg = rand(1,30) y.hp-=randomdmg world << "[src] super attacks [y] for [randomdmg]" else if(a==1) var/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] super attacks [s] for [randomdmg]" y.pturn=1 s.pturn=0 gturn=1 for(var/mob/s in locate(12,6,1)) if(gturn==3) var/tmp/r=rand(0,1) if(r==0) var/tmp/randomdmg = rand(1,10) s.hp-=randomdmg world << "[src] attacks [s] for [randomdmg]" if(r==1) var/tmp/randomdmg = rand(1,30) s.hp-=randomdmg world << "[src] super attacks [s] for [randomdmg]" sleep(100) s.pturn=1 gturn=1 sleep(10)
|
That code is a mess.
Perhaps we can make it better, if you can explain step by step what you are trying to accomplish.