ID:139719
 
Code:
turf
ground
ground1
name = "Ground"
icon = 'Turfs.dmi'
icon_state = "ground1"
minable = 1 // Can be mined

Entered(var/atom/movable/M)
if(mined) // If the turf is mined
M << "You stepped on a mine!"
M.Mined() // Does the mine damage procedure


Problem description:
Well the code itself keeps telling me that Mined() is an undefined procedure. Which it isn't.

 
Mined() // Mine Damage
src.Hp -= 10 // Lose 10 Hp


So I think for some reason I can't call other procedures from the Entered procedure? (Which I should be I think) So I've got no idea what I'm doing wrong.

NOTE: Please don't post code, just tell me where I'm going wrong.
Sorry, I'm no good at explaining. I gave a small demo that I know isn't 100% correctly done. I'm stilling buzzing from a while ago.

mob
var/HP = 100
icon = 'eevee.dmi'
Stat()
statpanel("Vitals")
stat("Health Points: [src.HP]")

turf
var/is_mineable
icon = 'turfs.dmi'
icon_state = "grass"
is_mineable = 1 // Setting it to mineable (all turf)
Entered(mob/M) // Yeah.. when you have stepped on it as a mob
if(!is_mineable) // Checks if it is mineable
M << "Testing 1." // Sends a test message if it isn't mineable
return // Stop all procedures
else if(is_mineable) // If it is mineable..
M << "Testing 2." // Tests the message shit..
Mine_Check() // Runs the check procedures

proc
Mine_Check()
usr << "1.. 2.. 3.. Ding!" // Sending the output to the user
usr.HP -= rand(1,5) // Subtracts the health
In response to Neimo
So you're suggesting I use a turf proc instead of redirecting it to the player?
In response to Lugia319
Lugia319 wrote:
So you're suggesting I use a turf proc instead of redirecting it to the player?

My code isn't in the format that you might think it is, hold on.

.. (recoding it to the way you want it..)

mob
var/HP = 100
icon = 'eevee.dmi'
Stat()
statpanel("Vitals")
stat("Health Points: [src.HP]")

turf
var/is_mineable
Grass
icon = 'turfs.dmi'
icon_state = "grass"
is_mineable = 1 // Setting it to mineable (all turf)
Entered(mob/M) // Yeah.. when you have stepped on it as a mob
if(!is_mineable) // Checks if it is mineable
M << "Testing 1." // Sends a test message if it isn't mineable
return // Stop all procedures
else if(is_mineable) // If it is mineable..
M << "Testing 2." // Tests the message shit..
Mine_Check() // Runs the check procedures

proc
Mine_Check()
usr << "1.. 2.. 3.. Ding!" // Sending the output to the user
usr.HP -= rand(1,5) // Subtracts the health


or it can be done like..

mob
var/HP = 100
icon = 'eevee.dmi'
Stat()
statpanel("Vitals")
stat("Health Points: [src.HP]")

turf/Mine
var/is_mineable
icon = 'turfs.dmi'
Grass
icon_state = "grass"
is_mineable = 1 // Setting it to mineable (all turf)
Wild_Grass
icon_state = "wild grass"
is_mineable = 0
Entered(mob/M) // Yeah.. when you have stepped on it as a mob
if(!is_mineable) // Checks if it is mineable
M << "Testing 1." // Sends a test message if it isn't mineable
return // Stop all procedures
else if(is_mineable) // If it is mineable..
M << "Testing 2." // Tests the message shit..
Mine_Check() // Runs the check procedures


proc
Mine_Check()
usr << "1.. 2.. 3.. Ding!" // Sending the output to the user
usr.HP -= rand(1,5) // Subtracts the health
In response to Neimo
Don't use usr in procs.
M is an /atom/movable. You did not define /atom/movable/proc/Mined(). What you want to do is check if M is a mob, then typecast it, like so:

if(ismob(M))
var/mob/X = M
if(mined)
X.Mined()