ID:172863
 
I have solved my first problem, and now another pops up... grr. I cant seem to get my enemy to attack me and i cant get it to move around. Everything seems alright for the attacking part, but i have no clue as how to get the enemy to move. Here is my code:

//this is a test world started by Nick on 3/15/04 yet to be completed...
mob
icon = 'person.dmi' //makes it so all mobs will be created with the person icon
var
HP = 30 //declares a new variable called HP, with a value of 30
wealth //total money
UHP = 40 //new var Hp for user
Del()
var/obj/gold/G = new(loc) //create a new obj from the gold blueprint
G.amount = rand(1,100) //set its amount variable randomly
..() //call the parent
Login()
icon_state = gender //when a player logs in, make their icon's state
..() //the gender of their key. Then call the parent!
world << "[usr] had logged into Testworld!"
bug
icon = 'bug.dmi'
Bump(person.dmi)
attack()
usr << "Bug attacks [usr]!" //send this message to the usr
oview() << "Bug attacks [usr]!" //send this message to everybody else
var/damagebug = rand(1,10) //assign a random # to a new variable
world << "[damagebug] damage!" //tell the damage to the world
UHP -= damagebug //take away the damage from M

proc
DeathCheck() //checks to see if an attack is deadly
if (HP <= 0) //if the defender's HP is low enough...
world << "[src] dies!" //do the death messaging
world << "[src] was killed by [usr]!"
del(src) //delete whatever just died
InjuredCheck()
if (HP <=15)
icon = 'bugcut.dmi'
else
icon = 'bug.dmi'

verb
attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you
usr << "You attack [M]!" //send this message to the usr
oview() << "[usr] attacks [M]!" //send this message to everybody else
var/damage = rand(1,10) //assign a random # to a new variable
world << "[damage] damage!" //tell the damage to the world
M.HP -= damage //take away the damage from M
M.InjuredCheck() //check for injuries w/ proc
M.DeathCheck() //check for death with a proc
say(msg as text) //What the usr says is passed into "msg" as text
world << "[usr]: [msg]" //The world sees chatroom-like output
obj
gold //define a "gold" prototype, which is a kind of obj
icon = 'gold.dmi' //set the default icon
var
amount //declare a new variable called "amount"
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
usr.wealth += amount //add to usr.wealth
del(src) //delete the gold
obj
tree
icon = 'tree.dmi'
density = 1
turf
grass //defines a "grass" prototype, which is a kind of turf...
icon = 'grass.dmi' //and has an icon named 'grass.dmi'. In single quotes!
world //we set one of our world's characteristics:
turf = /turf/grass //its default turf is the grass turf.
mob/Stat() //Call the Stat proc that updates the stat window every Tenth of a second...
stat("Stats:",src.desc) //Place in the stat panel, the word Stats:, and the srcs description.
stat(" HP: ","[UHP]" ) //It makes it easier to read if you put a bunch of spaces like that.
stat(" Gold: ","[wealth]")
//end of code

Any help will be extremely appriciated. Im so close to having a fully operating game! Simple, but it is an acomplishment for a 7th grader!!!
No put usr in proc. Ungh.

Lummox JR
In response to Lummox JR
that doesn't make sense, be more clear please!
In response to Tabu34
Tabu34 wrote:
that doesn't make sense, be more clear please!

Required reading