ID:155789
 
How do I make a system where I press a verb like laserbeam it starts charging gathering power and then when i press it again it fires the beam doing the charged damage and have it so while im charging this attack i cant charge any other attacks nor fire the laser beam if another chargeable attack is clicked

example: click laserbeam starts charging then click finger beam and it fires laserbeam instead of laser beam only firing when laser beam is clicked again
Mastergamerxxx wrote:
How do I make a system where I press a verb like laserbeam it starts charging gathering power and then when i press it again it fires the beam doing the charged damage and have it so while im charging this attack i cant charge any other attacks nor fire the laser beam if another chargeable attack is clicked

example: click laserbeam starts charging then click finger beam and it fires laserbeam instead of laser beam only firing when laser beam is clicked again

Well, you need to make some vars, so...

mob/var
charging=0
powercharged==0
mob/verb
LaserBeam()
if(charging==1)
new/obj/beam/B // I hope you've coded the beam already.
B.power=[usr.powercharged] // The user already charged some power, so it's now in the beam as it's power.
usr.energy-= ??? // If you want to make the usr. loses energy after releasing the energy, type the ammount of energy you want there, or chakra, or whatever...
sleep(300) // Delete this part If you want, but the usr. may have a cooldown before using it again.
usr.powercharged==0 // now the power charged goes back to 0.
usr.charging=0 // Now you'll have the chance of charging again.

return // so it doesn't repeat the proc again...

if(charging==0)
usr<<"You're now focusing your power...
new/obj/charge // Maybe you want to make an overlay over the usr's icon, so his charge is visible, now you gotta make the charge overlay and stuff...
usr.powercharged+= 10[...] // The beam's power may be focused here ((You can delete this one If you've already coded the damage of the beam)).
usr.energy-=10 // You lose some energy for charging. You should make sleep (...) then add again the powercharged+= [...] thing, so the more time he keeps charging, the higher damage it'll do.
usr.charging= 1 // errr, enough (?)
return


Mostly Beams Systems have their own systems, which depends on the level, power, and some others vars of the usr. So you should take a look every day on the source, your ideas may improve it.

Good luck !
In response to Eternal_Memories
yeah cept one problem i have is if i were to make another beam move like this and clicked it itd fire that beam dude to the fact charge==1 also i do need the beam system of basicest sort added in to the example otherwise i have no clue how i would implement it in at all as its hard enough to do with the beam systems i got now
In response to Mastergamerxxx
anyone? sorta need help on this badly
In response to Mastergamerxxx
Simple, create a var that only that single tech uses.

var/BlueBeamCharging = 0

and then only call it during that Tech. Acourse there are a few other problems with doing it like that. But this is only meant to give you an idea, not 100% solve your problem.
In response to Matt3151
yeh one problem being id have to create a lot of vars for each technique and lige you 50% solved the problem the other 50% is me struggling to figure out how the hell im supose to get a beam system to correspond to that code in the right way
In response to Mastergamerxxx
so anyone have a answer?