ID:146935
 
mob
var
attack = 5
equiped = 0
health = 100
maxhealth = 100
obj
var
attackadd
//Define all objects

obj
proc/respawn()
new src.type(locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.maxz)))//Makes a new src at a random location
weapons
icon = 'weapons.dmi'


verb/get()//global verb for all object under the /obj/weapons
set src in oview(1)
set category = null
src.respawn()//Calls the respawn proc
src.Move(usr)//You picked it up
verb/equip()
set src in usr
set category = null
if(!usr.equiped)
usr.attack+=src.attackadd//The power of the the weapon is now with you
src.verbs+=/obj/weapons/proc/unequip//Now you can unequip the weapon
src.verbs-=/obj/weapons/verb/equip//No longer have the equip verb
src.suffix+="Equiped"//Shows it as equiped
usr.equiped = 1
else
usr << "You already have something equiped!"
proc/unequip()
set src in usr
if(!usr.equiped)//Extra precautions
usr << "You don't have anything equiped!"
else
usr.attack-=src.attackadd//You can no longer use the power of the weapon
src.verbs-=/obj/weapons/proc/unequip
src.verbs+=/obj/weapons/verb/equip
src.suffix = ""//No longer shows it as equiped
usr.equiped = 0
verb
drop()
set src in usr
if(src.suffix == "Equiped")
usr << "Un-equip [src] first!"
else
src.Move(usr.loc)
shortsword
attackadd = 25//This is the var we'll use to judge the amount of power the weapon has
icon_state = "short sword"
club
attackadd = 10
icon_state = "club"

rustysword
attackadd = 15
icon_state = "rusty sword"

mob
Stat()
..()
statpanel("Items",contents)//Items


it isn't appilying the weapon's attack value to the players attack value on the stats panel
I'm really not in the mood to read your code but show all codes in DM tags please. It makes it easier for people to read/understand.

The DM tags are done like:

<DM>
coding
</DM>

To achieve this:

mob
verb
Haha()
usr << "Haha it sucks to be you!"
In response to DeathAwaitsU
mob
flicking you off
icon = 'finger.dmi'
icon_state = '_,|,, 0.o'


sweet. i think i have mastered it! n_n
Psychotic wrote:
>       verb/equip()
> set src in usr
> set category = null
> if(!usr.equiped)
> usr.attack+=src.attackadd//The power of the the weapon is now with you
> src.verbs+=/obj/weapons/proc/unequip//Now you can unequip the weapon
> src.verbs-=/obj/weapons/verb/equip//No longer have the equip verb
> src.suffix+="Equiped"//Shows it as equiped
> usr.equiped = 1
> else
> usr << "You already have something equiped!"
> proc/unequip()
> set src in usr
> if(!usr.equiped)//Extra precautions
> usr << "You don't have anything equiped!"
> else
> usr.attack-=src.attackadd//You can no longer use the power of the weapon
> src.verbs-=/obj/weapons/proc/unequip
> src.verbs+=/obj/weapons/verb/equip
> src.suffix = ""//No longer shows it as equiped
> usr.equiped = 0
> verb
> drop()
> set src in usr
> if(src.suffix == "Equiped")
> usr << "Un-equip [src] first!"
> else
> src.Move(usr.loc)
> shortsword
> attackadd = 25//This is the var we'll use to judge the amount of power the weapon has
> icon_state = "short sword"
> club
> attackadd = 10
> icon_state = "club"
>
> rustysword
> attackadd = 15
> icon_state = "rusty sword"
>
> mob
> Stat()
> ..()
> statpanel("Items",contents)//Items
>

it isn't appilying the weapon's attack value to the players attack value on the stats panel

The only thing that I could think of is try instead of
usr.attack += src.attackadd
try this]
 usr.attack += src.attackadd = usr.total_attack
or something like that...
In response to ChibiGoku04
don't worry..i got it. i forgot that it was cade sensative...

usr.attack-=src.attackadd


should be
usr.Attack-=src.attackadd


but now..the weapon's arn't subtracting the ammount of added attack when the weapon is unrquiped.. ¬_¬;;
In response to Psychotic
Did the src.attackadd add to your usr.attack??
In response to Psychotic
Psychotic wrote:
don't worry..i got it. i forgot that it was cade sensative...

> usr.attack-=src.attackadd
>

should be
> usr.Attack-=src.attackadd
>

but now..the weapon's arn't subtracting the ammount of added attack when the weapon is unrquiped.. ¬_¬;;

Not exactly right. You don't have "Attack" defined. I don't see any problem's with the problem. I have the same exact code and i have no problems with it.
In response to Mega fart cannon
He has "Attack" Defined in another file.
I know, cause he showed me his stats once.
(I was the one who helped him figure out the case sensitive stuff.. i own, Muhahahahahahah XD)
In response to Takaru
Dude...
Jebus.

else
usr.attack-=src.attackadd//You can no longer use the power of the weapon
src.verbs-=/obj/weapons/proc/unequip
src.verbs+=/obj/weapons/verb/equip
src.suffix = ""//No longer shows it as equiped
usr.equiped = 0


Should be...

else
usr.Attack-=src.attackadd//You can no longer use the power of the weapon
src.verbs-=/obj/weapons/proc/unequip
src.verbs+=/obj/weapons/verb/equip
src.suffix = ""//No longer shows it as equiped
usr.equiped = 0


Otherwise, Adding to The players attack strenght, and taking away from another attack strenght, which is also the players, but he doesnt use it. There for, a + b = Your attack with a weapon, and a - b = Your attack -without a weapon- Making it c - b just wouldnt make any sence, eh?
In response to Takaru
Takaru wrote:
He has "Attack" Defined in another file.
I know, cause he showed me his stats once.
(I was the one who helped him figure out the case sensitive stuff.. i own, Muhahahahahahah XD)

Then what's the point of having 2 attack vars?
In response to Mega fart cannon
No point, i think the other one came with the equip and unequip, he might have gotten it from a demo, or from someone else
In response to ChibiGoku04
im now going to add in the attack verb.