ID:143835
 
Code:
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

> mob
> verb
> Attack(mob/M as mob in oview(1))
> M.attacked = 1
> var/damage = usr.Strength-M.Defense+rand(0,5)
> 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)
> 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()
>


You were still taking var/damage from Health twice...
In response to Zythyr
...............
In response to Monkeykid0049
Im not sure what to fix -_-.....I know its the var/damage but Im not sure which ones...
In response to Monkeykid0049
I fixed the problem you wanted in the code I gave you.
In response to Zythyr
Oh okay now it works...I dont really know why it stopped working......but Thanks
In response to Monkeykid0049
You're still using usr in procs, though, which you SHOULDN'T be. In Bump(), Wander(), and probably Deathcheck().
Monkeykid0049 wrote:
Code:
> 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


I cant believe we are still seeing zeta coding like this after all this time...

Your better off to just recode the whole thing, zeta is not coded very well. Sure, you may say that isnt zeta, but it is, whatever you got that code from, whatever the game name is, it originated from zeta no matter how far down its family tree you have to look.

Zeta turned into Elysium turned into Rebirth turned into the Naruto rips...

I know this might not seem very helpful but the best way to solve this problem is to ditch ALL the code and make your own.