Uhh... yeah this is weird, i cant find the problem...
proc
Death(mob/M)
if (src.HP <= 0)
usr << "You have killed the [src]!"
usr.exp += src.expreward
usr.gold += src.goldreward
usr<< "You gain [src.expreward] exp and [src.goldreward] money"
checklevel(usr)
del (src)
PCDeath(mob/PC/M)
if(src.HP <= 0)
view(src) << "[src] died."
src.loc = locate(207,233,1)
src.HP = Max_HP
mob/monster
Slime
name = "Slime"
icon = 'monstermom.dmi'
icon_state = "slime"
HP = 60
Max_HP = 10
attack = 6
expreward = 10
defense = 5
agility = 10
goldreward = 1
var/mob/PC/P
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = 0
for(P in oview(5))
step_towards(src,P)
Found = TRUE
break
if(Found != TRUE)
step_rand(src)
sleep(10)
sleep(5)
Bump(mob/M)
if(istype(M,/mob/PC))
Attack(M)
proc/Attack(mob/PC/M)
flick("slimeattack",src)
sleep(4)
var/maxdamage = src.attack - (M.defense / 4) - (M.agility / 20)
var/damage = rand ((maxdamage /2), maxdamage)
M.HP -= damage
view(src) << "[src] attacks [M]!"
view(src) << "[damage] damage!"
M.PCDeath()
thats where i think i would be... if it isnt tell me where it might be... even if u dont have all the code...
ID:261851
Sep 28 2003, 3:24 pm
|
|
In response to Wanabe
|
|
Erm, no. "maxdamage" is the var that's defined on the previous line. =P
<code>var/maxdamage = src.attack - (M.defense / 4) - (M.agility / 20)</code> src.attack is too low compared to M.defense and M.agility, methinks, making maxdamage be negative. Add a check in there that prevents the attack if maxdamage is negative. |
var/damage = rand ((maxdamage /2), maxdamage)
as far as i can see, the creature has no max damage.....so you probly made a variable else where, making it go negative whitch would add the health.