mob/var
LVL = 1
HP = 30
MP = 50
EXP = 0
Cash = 0
STR = 5
DEF = 5
EXPN = 100
mob
icon = 'Person.dmi'
Stat()
stat("LVL",LVL)
stat("HP",HP)
stat("MP",MP)
stat("EXP",EXP)
stat("Cash",Cash)
stat("STR",STR)
stat("DEF",DEF)
stat("EXP NEEDED",EXPN)
Del()
var/obj/gold/G = new(loc)
G.amount = rand(1,10)
..()
Login()
icon_state = gender
..()
proc
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
usr.EXP += 10
usr:lvlcheck()
del(src)
lvlcheck()
if(usr.EXP >=usr.EXPN) // if usr's exp is, or is bigger than what needed..
usr.LVL +=1 // add a lvl
usr.EXP = 0 // reset exp
usr.EXPN = usr.EXPN * 1.15 // double needed exp
usr.STR += rand(1,6)
usr.HP += rand(20,50)
usr.MP += rand(15,40)
usr.DEF += rand(1,7)
//insert bonuses here. Ie: strength, speed, etc.. Ex: usr.speed += 10
This is all fine, it adds on stats as needed, but my problem comes up here
verb
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
if (M.HP <= 0) //if M's HP are at or below 0...
usr << "[M] is already dead!"
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = usr.STR * 1.5 - M.DEF * 2
world << "[damage] damage!"
M.HP -= damage
M.DeathCheck()
ok so
var/damage = usr.STR * 1.5 - M.DEF * 2
Wsay(msg as text)
world << "[usr]: [msg]"
obj
gold //define a "gold" prototype, which is a kind of obj
icon = 'gold.dmi' //set the default icon
var
amount
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
usr.Cash += amount //add to usr.wealth
del(src) //delete the gold
turf
grass
icon = 'grass.dmi'
tree
icon = 'tree.dmi'
woodenfloor
icon = 'Wooden Floor.dmi'
world
turf = /turf/grass
monster
wasp
icon = 'wasp.dmi'
var
M.DEF = 4
M.HP = 20
greendevil
icon = 'green devil.dmi'
var
M.DEF= 7
M.HP= 50
can you tell me why these arnt working, i tryed just putting them as
monster
wasp
icon = 'wasp.dmi'
var
DEF = 4
HP = 20
greendevil
icon = 'green devil.dmi'
var
DEF= 7
HP= 50
and i have also tryed taking out the monster part
PS: how would i get my stats to affect the amount of damage i do
If you can form your problem in:
"I want it to do (this), but instead it does (this)."
One problem at a time, instead of saying "I want to do this, and this. Why isn't it working?", It would be a lot easier to help you.
Major flaw that I see (unless intended, which I doubt.) is your monsters are not under the mob type.
Where you have:
since monster is not indented under anything, you're just defining a new datum of type /monster.
There's a very very good chance that you meant to have this as:
Note that I also took out the var line, because those variables are already defined the parent type, /mob. You are just setting their values.
Basically it all comes down to an understanding of object trees, parent types, inheritance, and all that good stuff. I'd suggest you brush up on whatever chapter of the DM guide that covers that kinda stuff.