ID:262267
 
Code:
obj
ki_blast
icon = 'Ammo.dmi'
icon_state = "KI Blast"
layer = MOB_LAYER + 9
density = 1
Bump(mob/M)
if(istype(M,/mob/characters)||istype(M,/mob/monsters)||istype(M,/mob/multiform))
flick('Explosion.dmi',M)
del(src)
var/dmg = usr.str - M.powerlevel
M.powerlevel -= dmg
usr<<"<font color= Red>You did <b>[dmg]</b> damage to [M]"
if(M.powerlevel <= 0)
M.Die()
usr.LevelUp()
usr.Die()
del(src)


Problem description:
My problem is this when i the blast him no damage is severd.
Why is that?

var/dmg = usr.str - M.powerlevel
make that
var/dmg = M.powerlevel - usr.str
In response to tidus123
ok i'll try it
In response to Sayian Hunter
it still doesn't work do you know why ?
In response to Sayian Hunter
No...clue.
The problem is that you are pulling usr, src, and M out of your ass.

When you use the var, make a var called owner, than make it so that the kiball's owner = the person who used the var. Then do the ownervariable.str instead of usr.
In response to tidus123
tidus123 wrote:
var/dmg = usr.str - M.powerlevel
make that
var/dmg = M.powerlevel - usr.str

That's completely and utterly wrong. It's quite obvious that the intent of this line is to base dmg on the bumper's str var, and the bumpee's powerlevel. M is the bumpee, so swapping M and usr will not fix this. The real problem (or part of it) is that usr is not valid here.

Offering a suggestion at random will not help anyone. You didn't look at this code or even try to understand what it's doing, so you're in no position to help debug it. It's great that you want to help, but please don't just post stuff out of the blue that isn't helpful.

Lummox JR