mob
verb
Attack(mob/M as mob in oview(1))
M.attacked = 1
var/damage = usr.Strength-M.Defense+rand(0,5)
M.Health -= damage
if(damage > 0)
M << "[usr] attacks you and does [damage] damage"
usr << "You attack [M] for [damage] damage"
M.Health-=damage
else
M << "[usr]'s attack bounces off of you!"
usr << "Your attack bounces off of [M.]!"
M.Deathcheck()
usr.Levelup()
mob
Monster
Slime
icon = 'Monsters.dmi'
icon_state = "Slime"
Health = 50
Mhealth = 50
Strength = 7
Defense = 3
GoldGive = 10
ExpGive = 10
Level = 1
attacked = 0
var/mob/characters/monster
New()
.=..()
spawn(1)
Wander()
proc/Wander()
Deathcheck()
while(src)
if(attacked==1)
if(monster in oview(5))
step_towards(src,monster)
Deathcheck()
else
attacked = 0
Wander()
else
step_rand(src)
for(monster in view(src))
break
sleep(5)
spawn(40)
Wander()
Bump(mob/characters/M.)
if(ismob(M))
var/damage = usr.Strength-M.Defense+rand(0,5)
M.Health -= damage
if(damage > 0)
M << "[usr] attacks you and does [damage] damage"
usr << "You attack [monster] for [damage] damage"
M.Health -= damage
else
M << "[usr]'s attack bounces off of you!"
usr << "Your attack bounces off of [M.]!"
M.Deathcheck()
I think this might be the problem...
mob
Warrior_Skills
verb/Double_Strike(mob/M as mob in oview(1))
set category = "Skills"
M.attacked = 1
var/damage = usr.Strength*2-M.Defense+rand(0,5)
var/damage = usr.Strength-M.Defense+rand(0,5)
if(dsdamage > 0)
Double_Strike = rand(1,3)
if(Double_Strike==2)
M << "[usr] attacks you and does [damage] damage"
usr. << "You perform Double Strike for [damage]"
view() << "[src]([key]: Double Strike!"
M.Health-=damage
else
usr. << "You missed!"
else
M << "[usr]'s attack bounces off of you!"
usr << "Your attack bounces off of [M.]!"
M.Deathcheck()
usr.Levelup()
Problem description:
Every time I attack a monster or a monster attacks me the damage is doubled. It doesnt say the damage is doubled but my health is reduced twice as much as the damage said. Please help T_T
You were still taking var/damage from Health twice...