mob/var/target
mob
Monster
Class="Monster"//importent for Player Attack
MainClass="Monster"
SubClass="Mellee"//importent for Monster Attack
MelleeMonster//only name
icon=
Level=
HP=
MP=
MaxHP=
MaxMP=
Str=
Def=
Exp=
S1Exp=//exp for common Soul
S2Exp=//exp for uncommon Soul
S3Exp=//exp for rare Soul
Gold=
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob
Monster
Class="Monster"
MainClass="Monster"
SubClass="Energy"
EnergyMonster
icon=
Level=
HP=
MP=
MaxHP=
MaxMP=
Str=
Def=
Exp=
S1Exp=
S2Exp=
S3Exp=
Gold=
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob
Monster
Class="Monster"
MainClass="Soul Knight"
SubClass="Mellee"
MelleeKnight
icon=
Level=
HP=
MP=
MaxHP=
MaxMP=
Str=
Def=
Exp=
S1Exp=
S2Exp=
S3Exp=
Gold=
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob
Monster
Class="Monster"
MainClass="Soul Knight"
SubClass="Energy"
EnergyKnight
icon=
Level=
HP=
MP=
MaxHP=
MaxMP=
Str=
Def=
Exp=
S1Exp=
S2Exp=
S3Exp=
Gold=
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob
Monster
Class="Monster"
MainClass="Soul Mutant"
SubClass="Mellee"
MelleeMutant
icon=
Level=
HP=
MP=
MaxHP=
MaxMP=
Str=
Def=
Exp=
S1Exp=
S2Exp=
S3Exp=
Gold=
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob
Monster
Class="Monster"
MainClass="Soul Mutant"
SubClass="Energy"
EnergyMutant
icon=
Level=
HP=
MP=
MaxHP=
MaxMP=
Str=
Def=
Exp=
S1Exp=
S2Exp=
S3Exp=
Gold=
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
New()
src.HP=src.MaxHP
src.MP=src.MaxMP
spawn()
src.wander()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob/proc
wander()//they walk all the time
while(src)
step_rand(src)
sleep(rand(15,25))
if(var/mob/M in oview(5))
src.targetMonster()////or SK or SM. modular work
else src.wander()
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//different target proc for MainClass=Monster,Soul Knight, Soul Mutant
mob/proc
targetMonster()
for(var/mob/M in oview(5))
if(M.MainClass=="Ghost" || M.MainClass=="Monster")
src.wander()
return
else
src.target=M
src.dir=get_dir(src,src.target)
src.attack()
mob/proc
targetSK()
for(var/mob/M in oview(5))
if(M.MainClass=="Ghost" || M.MainClass=="Soul Knight")
src.wander()
return
else
src.target=M
src.dir=get_dir(src,src.target)
src.attack()
mob/proc
targetSM()
for(var/mob/M in oview(5))
if(M.MainClass=="Ghost" || M.MainClass=="Soul Mutant")
src.wander()
return
else
src.target=M
src.dir=get_dir(src,src.target)
src.attack()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
mob/proc
attack//one attack proc with boths ways Mellee and Energy by class of Monster, later with a new to class for more ways to attack like with skills
for(var/mob/M in get_step(src,src.dir))
if(src.SubClass=="Mellee")
flick("Attack[src.icon_state]",src)
var/damage=((src.Str*2)+src.HP)-(M.Def+M.MP)
damage=max(0,damage+rand(-1,1))
M.HP -= damage
M.DamageShow(damage,200,0,0)
M.DeathCheck(src)
if(src.SubClass=="Energy")
flick("Attack[src.icon_state]",src)
var/damage=((src.Str*2)+src.MP)-(M.Def+M.MP)
damage=max(0,damage+rand(-1,1))
M.MP -= damage
M.DamageShow(damage,0,0,200)
M.DeathCheck(src)
i will add 6 different NPCs, they use wander proc all the time until they find a target, but they cant target all! and then they attack.
but i am sure my idea is bad and nooblike, pls could anyone give me some tips or is my idea good? i am ask cause the logical part of that.
i think my attack proc is good(use a attack verb like that for player, thats for friendly fire), but i am not sure with the wander proc and the target. i think if they target me they dont stop to follow me. i need something that they stop it if i run away.
problem 1:wander proc logical part.
problem 2:target proc logical part.
problem 3:that they loose target.
42error:proc definition not allowed inside another proc
i hate procs