ID:166518
 
I know you guys may get this quite often, but How hard i it to make an attack system, because I was just thinking of all the stuff I have to join onto it, like , I've made a simple attack system where I press attack and it randomizes a number between 5,10. but I've also got a strength stat on this so that I can raise my level, How would I make it so that apon a certain strength level it does a certain damage depeneding on the strength level...


Thanks for reading

Nexus6669.

p.s sorry for posting so much.
well you could made a damage formula like Strength/2+rand(1,5)
to get your attack power.
Nexus6669 wrote:
I know you guys may get this quite often, but How hard i it to make an attack system, because I was just thinking of all the stuff I have to join onto it, like , I've made a simple attack system where I press attack and it randomizes a number between 5,10. but I've also got a strength stat on this so that I can raise my level, How would I make it so that apon a certain strength level it does a certain damage depeneding on the strength level...


Thanks for reading

Nexus6669.

p.s sorry for posting so much.

in order to have a strength based battle system, you have to of course have a strength var

var/strength = 1


now, in your battle system, wherever you figure up the damage, simply use the strength var

var/damage = strength + rand(5, 10)


get it?
In response to Koil
Ok I get it, thank you very much, you have been most helpfull :)
In response to Nexus6669
  mob/Move()
if(lifting)return 0
return ..()
obj
icon='Test Tube.dmi'
icon_state="weights"
layer=MOB_LAYER+1
verb
Lift()
set category="Action"
set src in oview(0)
if(usr.lifting)
usr.lifting=0
icon_state="weights"
else
usr << "You start lifting"
icon_state="lifting weight"
usr.lifting=1
AGAIN
if(!usr.lifting)return
else
var/random=rand(1,2)
var/stam=rand(1,2)
usr.strength+=random
usr.stamina-=stam
sleep(10)
goto AGAIN



Here's the code to lift a weight and gain strength.


 mob
verb
attack(mob/M as mob in oview (1))
set category="Action"
set src in oview(1)
usr << "You attack [M]"
oview() << "[usr] attacks [M]"
var/damage = strength + rand(1,2)
world << "[damage] damage"
M:powerlevel -= damage
M:Finish()


Here's the attack code, for some reason "var/damage = strength + rand(1,2)" I think there is something wrong here, it compiles ok, but it won't add the strength from my stats onto the random part. hard to explain, say it's like it won't add the strength on the random.