chara/proc
Encounter()
var/times=10
var/mtype
var/list/monster/m
var/monster/mon
for(var/i=0;i<times;i++)
mtype=pick(typesof(/monster))
m+=new mtype()
for(var/monster/M in m)
if(!mon)
mon=M
else
var/oldrate=abs(mon.GetRating()-src.GetRating())
var/newrate=abs(M.GetRating()-src.GetRating())
if(newrate<oldrate)
mon=M
spawn()
src.Attack(mon)
spawn()
mon.Attack(src)
Problem description:
What I'm trying to do is make a list randomly from all the monster types and then pick the one that has the closest difficulty corresponding to the characters power. However, it just won't work. It gives a runtime error. It says there's a type mismatch. I must be missing where.