Battle system delima. in Developer Help
|
|
Problem: My battle system isn't exactly the best, and its kinda *Cough*Gay*Cough*. But I need it were it works in the best way possible for a .Hack RPG game, and then on my monster A.I system, I need it were if a monster is attacking one person it wont go off attacking someone else it sees. Here are the codes:
Battle System:
mob/verb/Attack(mob/M in oview(1)) var/damage = usr.Str/M.Def M<<"[src] attacked you for [damage] damage!" if(src.client) src<<"You attacked [M] for [damage] damage!" M.Hp -= damage src.deathcheck(M) if(src.client) else return..()
mob/proc/deathcheck(mob/M as mob) if(M.Hp<=0) if(M.client) M.loc = locate(11,4,1) M.Hp = M.Mhp M<<"[src] killed you!" src.Levelup() else src<<"You killed [M]!" del(M) src.Exp+=rand(10,50) sleep(200) world.Repop()
mob proc Levelup() if(usr.Exp>=src.MExp) usr.Lvl++ usr.Exp=0 usr.MExp+=rand(1,25) usr.Str+=rand(1,10) usr.Def+=rand(4,5) usr<<"You gained a level!" else ..()
|
Monster A.I:
mob/monster/Basilisk icon = 'Monsters.dmi' icon_state = "Basilisk" Hp = 100 Str = 15 Def = 10 proc/move() for(var/mob/M in oview()) if(get_step_away(src,M,3)) if(!M.client) continue else walk_to(src,M,1,4) else continue spawn(20) move() proc/attackplayer() for(var/mob/M in oview(1)) if(get_step_away(src,M,1)) if(!M.client) continue else src.Attack(M) else return..() spawn(20) attackplayer()
New() attackplayer() move()
|
Thanks in advance for your help.
~C
|