ID:140120
 
Code:
mob
verb
Attack()
set category="Combat"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
usr.adddmg =4/ usr.Str
usr.adddmg += usr.dmg
E.HP-=usr.dmg
view()<<"[usr] attacks [E] for [usr.dmg] HP!


Problem description:

What I'm trying to do is

For every 4 Str you add 1dmg... I tried making a proc but I know my proc()is wrong just a bit confused on how to do this
so ditched that idea and just tried to add variables together during the damage calulation

(Tried with what I did above and I got no errors but it also does not calculate still just hits for my normal damage)

4/str = +1dmg? how do I add it to my usr.[str] <-- also another question should I be using src.[str] usr seems to be fine running multiplayer tests with friends our stats do keep to our selves was just making sure

(Not making a game or anything but still trying to learn this stuff via Testbed i made on dream maker, if theres any chance I could get a few peoples "Msn live" so I can ask questions that would be great I'm really a slow learner" ):)

You do not need to define the adddmg variable under /mob. They can be local to the verb. Additionally, your operations seem to mostly be backwards: 4/Str should be Str/4, and adddmg+=dmg should be dmg+=adddmg. Anyway, this is what it should look like:

var/damage = usr.dmg + usr.Str/4
E.HP -= damage
In response to Garthor
Well you gave me the right idea of how to do it now ,it still does not seem to be working the damage does not change with it in or with it not in I checked my variables they are right ..
In response to DeathBane
DeathBane wrote:
Well you gave me the right idea of how to do it now ,it still does not seem to be working the damage does not change with it in or with it not in I checked my variables they are right ..


Okay it is me I'm not too sure what I did but I apparently made my Str completely Null ); wtf


EDIT: Oh snap... I didnt even bother change the msg for showing me how much damage is done :< Thank you for your help