mob/monsters
var/monster
var/isattacking = 0
var/monhp
var/monmaxhp
// This seems to be undefined?!?!
var/mob/monster/M
proc
ddamage(M as mob,damage)
M.monhp -= damage
M.death_check(M)
death_check(M as mob)
if(M.monhp < 1)
killmon(M)
killmon(M)
del(M)
var/dropi = rand(0,10)
if(dropi <= 8)
ID:149490
Apr 20 2002, 7:31 am
|
|
here try this
mob/monsters var monster isattacking = 0 monhp = 100 monmaxhp = 100 proc/ddamage(M as mob,damage) M.monhp -= damage spawn() death_check() proc/death_check(M as mob) if(M.monhp < 1) spawn() killmon() del src var/dropi = rand(0,10) if(dropi <= 8) |
In response to Buzzyboy
|
|
Problems noted in yellow...
mob/monsters Here it is cleaned up: mob var isattacking = 0 hp maxhp monster hp = 100 maxhp = 100 proc ddamage() hp -= damage death_check() death_check() if(hp < 1) // death announcement to taste here if(prob(80)) drop() // define your drop routine here // or whatever you were trying to do del(src) |
In response to Skysaw
|
|
Lastly, the syntax is del(src) Actually, both work... del src and del(src) Both work fine. |
In response to Kevin Kitsune
|
|
Kevin Kitsune wrote:
Lastly, the syntax is del(src) Ahh... so they do. (who was that masked man?) |
In your ddamage() and death_check() procs you are using a plain mob named M as input, but are trying to treat M as a mob/monsters. For instance, monhp is defined for a mob/monsters, not a plain mob. This seems to be the larger issue you should fix.
Either way, within a proc, an argument will be used over a var with the same name declared for an object. In other words, the M as mob in your procs will be used, not the var/mob/monster/M. In this case, if you wanted the var/mob/monster/M within those procs, you could use src.M.