ID:2457361
 
(See the best response by Nadrew.)
Code:
        mana_regen()
if(mana < max_mana)
if(!on_cooldown("mana_regen"))
cooldown("mana_regen", Constants.REGEN_TICK_LENGTH)



mob/proc

mago()
icon = 'mobs.dmi'
base_state = "mago"
health = 20
max_health = 20
base_speed = 5
mana_regen()
gain_mana(1*(level)/2)
mana = 5
max_mana = 5


proc definition not allowed inside another proc


I want to define an individual regeneration of mana for each class. What is the best way to do this? I'm trying to put inside the "mago" settings but it is not working

if I set in a general mob the code works and goes to all classes like that




mob
icon = 'mobs.dmi'
base_state = "human"

pwidth = 16
pheight = 16
pixel_x = -8


var
class = ""
base_speed = 4

power = 2
speed = 5
mind = 5
defense = 2
resistance = 4

mana_regen()
gain_mana(1*(level)/2) // <-- HERE

Best response
You're trying to define a child type as a proc, you'll want to get rid of that part.