obj/shoot
verb
Shoot(mob/PC/M,mob/MM in world)
if(M.rightarm == "Pistol")
var/obj/shot/Dual_Pistol/Pistol = new(M.loc)
walk(Pistol,M.dir)
for(MM in view(1))
MM.health -= 10
M.points += 10
M <<"IT WORKS!!!!"
Thank you for your time.
ID:175219
May 24 2003, 8:56 am
|
|
Ok I cooked up more coding, trying to figure out how to make this whole bullet thing...all I'm asking now is if someone would tell me if this would work. Before I change around most of my game only to find out it dosnt.
obj/shoot Thank you for your time. |
In response to Garthor
|
|
Ok what you gave me makes perfect sense, and after I adapted it to my game I recive some errors with the hurt proc
mob The errors are: NewWeaponsSystem.dm:98:error:-= :invalid proc definition NewWeaponsSystem.dm:99:error:if :invalid proc definition NewWeaponsSystem.dm:100:error::invalid proc definition Everything else should work perfectly...I didn't try it out in runtime yet. Thank you. |
In response to SSChicken
|
|
You forgot to indent everything after hurt(...).
|
In response to Garthor
|
|
Right...sorry that was a stupid mistake, I posted too quickly. I would also like to add each weapon doing a different amount of damage to my game. I did this but It just dosn't add the 10 to usr.damage
obj/proc/adddamage() There are no errors, its just that usr.damage dosn't become 10 when usr equips a pistol. I appreaciate all help given ^_^ |
In response to SSChicken
|
|
First of all, you shouldn't be using usr in procs, even if they are only called by verbs. Second, why have a variable belonging to the usr that determines damage when you can just use the damage based on the bullet object, like I showed?
|
In response to Garthor
|
|
Because I want many guns to use the same bullet but each gun to do a different amount of damage. EX: Both Pistol and MP use 9mm bullets but MP does more damage.
|
In response to SSChicken
|
|
Each gun has it's own bullet PROJECTILE. Different guns, however, can use the same ammo.
|
In response to Garthor
|
|
But my goal is for some guns to use the same bullets yet do different ammount of damage.
|
In response to SSChicken
|
|
Like I said, each gun has it's own PROJECTILE. AMMUNITION is completely different.
|
Wow, that's a lot more than I expected. It's pretty much a full-fledged gun system. I suggest you look through it, though, because there are some things you probably wouldn't want, and some things I didn't include, such as firing delay. You can fix the firing delay, however, by setting a variable on a gun to 0 when Shoot() is called, preventing it from shooting again until after a certain delay, like how you delay movement.