battlestart(mob/A,mob/B,mob/C,mob/D,mob/E,mob/F,mob/G,mob/H,mob/I,mob/J,mob/K,mob/L)
var/list/playerlist = list(A,B,C,D,E,F,G,H,I,J,K,L)
for(var/mob/M in playerlist)
if(M == null)
playerlist -= M
queue(playerlist,A,B,C,D,E,F,G,H,I,J,K,L)
queue(list/playerlist,mob/A,mob/B,mob/C,mob/D,mob/E,mob/F,mob/G,mob/H,mob/I,mob/J,mob/K,mob/L)
var/mob/fastest = playerlist[1]
if(playerlist.len > 1)
for(var/mob/M in playerlist)
if(M.agl>fastest.agl) //<--Line 609//
fastest=M
if(fastest.key)
fastest.battleprompt(A,B,C,D,E,F,G,H,I,K,J,K,L)
else
fastest.monbattleprompt(A,B,C,D,E,F,G,H,I,K,J,K,L)
playerlist -= fastest
if(playerlist.len == 0)
if(hpcheck(A,B,C,D,E,F,G,H,I,K,J,K,L))
spawn()
battlestart(A,B,C,D,E,F,G,H,I,J,K,L)
else
if(hpcheck(A,B,C,D,E,F,G,H,I,K,J,K,L))
spawn()
queue(playerlist,A,B,C,D,E,F,G,H,I,J,K,L)
battleprompt(mob/A,mob/B,mob/C,mob/D,mob/E,mob/F,mob/G,mob/H,mob/I,mob/J,mob/K,mob/L)
if(src.hp > 0)
var/attack = input(src,"What would you like to do?")in list("Attack","Spell","Item","Run")
if(attack == "Attack")
var/list/targets = list()
if(E != null)
targets += E
if(F != null)
targets += F
if(G != null)
targets += G
if(H != null)
targets += H
if(I != null)
targets += I
if(J != null)
targets += J
if(K != null)
targets += K
if(L != null)
targets += L
for(var/mob/M in targets)
if(M.hp <= 0)
targets -= M
if(targets.len == 0)
return
var/mob/target = input(src,"Attack who?")in targets//list(E,F,G,H,I,J,K,L)
var/damage = round((src.batatk-target.def)/2)
damage += rand(round(damage/100),-1*round(damage/100))
damage += rand(1,-1)
if(damage < 1)
var/superrandomnumber = rand(1,3)
if(superrandomnumber == 1)
damage = 1
if(src.chargeup == 1)
src.batatk = src.batatk/2
src.chargeup = 0
A << "[src] attacks!"
B << "[src] attacks!"
C << "[src] attacks!"
D << "[src] attacks!"
sleep(10)
var/randnum = rand(1,100)
if(randnum >= 97)
A << "[src] misses [target]"
B << "[src] misses [target]"
C << "[src] misses [target]"
D << "[src] misses [target]"
else
randnum = rand(1,100)
if(randnum > 95)
A << "Critical hit!"
B << "Critical hit!"
C << "Critical hit!"
D << "Critical hit!"
sleep(10)
damage = src.batatk+rand(-2,2)
if(damage > 0)
A << "[src] does [damage] damage to [target]!"
B << "[src] does [damage] damage to [target]!"
C << "[src] does [damage] damage to [target]!"
D << "[src] does [damage] damage to [target]!"
target.hp -= damage
if(target.hp <= 0)
target.hp = 0
target.invisibility = 1
if(damage <= 0)
A << "[src] fails to damage [target]!"
B << "[src] fails to damage [target]!"
C << "[src] fails to damage [target]!"
D << "[src] fails to damage [target]!"
//Attacking is the only available command so I haven't tried anything below this =P//
Problem description:
runtime error: Cannot read null.agl
proc name: queue (/mob/proc/queue)
source file: Complex Procs.dm,609
usr: Cowdude (/mob/player)
src: Cowdude (/mob/player)
call stack:
Cowdude (/mob/player): queue(/list (/list), Cowdude (/mob/player), Cowdude2 (/mob/player), null, null, the stagbeetle A (/mob/monsters/stagbeetle), Slime B (/mob/monsters/Slime), Red Slime C (/mob/monsters/Red_Slime), Slime D (/mob/monsters/Slime), null, null, null, null)
Cowdude (/mob/player): queue(/list (/list), Cowdude (/mob/player), Cowdude2 (/mob/player), null, null, the stagbeetle A (/mob/monsters/stagbeetle), Slime B (/mob/monsters/Slime), Red Slime C (/mob/monsters/Red_Slime), Slime D (/mob/monsters/Slime), null, null, null, null)
In the above code, A, B, C, D are players, and E->L are monsters (4 players, 8 monsters).
There is a proc before this btw, but it probably has nothing wrong.
This runtime error occurs when the slowest of A, B, C, and D attack (I've only tested this with two people in a party though; Byond 3.5 makes it hard to multikey =P)
If I think of anything else regaurding this I'll edit or something
Lummox JR