mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-23 08:32:11 +00:00
Fixed a few other runtimes. Space movement should be working slightly better. Projectile weapons now give a X has fired Y message, this might get removed in the near future depending on how spammy it ends up being. Projectiles now give a X has been hit by Y rather than a X has been shot by Y because knowing who shot you when you could not see them was rather silly. Securitrons will no longer scan for weapons when they are set to not scan for weapon auth, they also will nolonger ignore arrest status if set to check for weapon auth and the guy has it. Shotguns are nolonger on the Securitron's ignore list if weapon auth is on while all melee class weapons like eswords and batons are now on the list. The incinerator disposal is part of the station loop. A window has been added to the north side of tool storage. Emergency Storage now has the proper access. Disposal's mass driver control will no longer fire tox's mass driver. Removed a few old grey pipes in the courtroom. Toxins test chamber once again has a teleportation beacon. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2495 316c924e-a436-60f5-8080-3fe189b3f50e
106 lines
2.5 KiB
Plaintext
106 lines
2.5 KiB
Plaintext
/obj/item/weapon/gun
|
|
name = "gun"
|
|
desc = "Its a gun. It's pretty terrible, though."
|
|
icon = 'gun.dmi'
|
|
icon_state = "detective"
|
|
item_state = "gun"
|
|
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT | USEDELAY
|
|
m_amt = 2000
|
|
w_class = 3.0
|
|
throwforce = 5
|
|
throw_speed = 4
|
|
throw_range = 5
|
|
force = 5.0
|
|
origin_tech = "combat=1"
|
|
|
|
var
|
|
fire_sound = 'Gunshot.ogg'
|
|
obj/item/projectile/in_chamber = null
|
|
caliber = ""
|
|
silenced = 0
|
|
recoil = 0
|
|
|
|
proc
|
|
load_into_chamber()
|
|
special_check(var/mob/M)
|
|
|
|
|
|
load_into_chamber()
|
|
return 0
|
|
|
|
|
|
special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
|
|
return 1
|
|
|
|
|
|
emp_act(severity)
|
|
for(var/obj/O in contents)
|
|
O.emp_act(severity)
|
|
|
|
|
|
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)//TODO: go over this
|
|
if(flag) return //we're placing gun on a table or in backpack
|
|
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
|
|
|
|
if(istype(user, /mob/living))
|
|
var/mob/living/M = user
|
|
if ((M.mutations & CLUMSY) && prob(50))
|
|
M << "\red The [src.name] blows up in your face."
|
|
M.take_organ_damage(0,20)
|
|
M.drop_item()
|
|
del(src)
|
|
return
|
|
|
|
if (!user.IsAdvancedToolUser())
|
|
user << "\red You don't have the dexterity to do this!"
|
|
return
|
|
|
|
add_fingerprint(user)
|
|
|
|
var/turf/curloc = user.loc
|
|
var/turf/targloc = get_turf(target)
|
|
if (!istype(targloc) || !istype(curloc))
|
|
return
|
|
|
|
if(!special_check(user)) return
|
|
if(!load_into_chamber())
|
|
user << "\red *click*";
|
|
return
|
|
|
|
if(!in_chamber) return
|
|
|
|
in_chamber.firer = user
|
|
in_chamber.def_zone = user.zone_sel.selecting
|
|
|
|
if(targloc == curloc)
|
|
user.bullet_act(in_chamber)
|
|
del(in_chamber)
|
|
update_icon()
|
|
return
|
|
|
|
if(recoil)
|
|
spawn()
|
|
shake_camera(user, recoil + 1, recoil)
|
|
|
|
if(silenced)
|
|
playsound(user, fire_sound, 10, 1)
|
|
else
|
|
playsound(user, fire_sound, 50, 1)
|
|
user.visible_message("\red [user.name] fires the [src.name]!", "\red You fire the [src.name]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
|
|
|
in_chamber.original = targloc
|
|
in_chamber.loc = get_turf(user)
|
|
user.next_move = world.time + 4
|
|
in_chamber.silenced = silenced
|
|
in_chamber.current = curloc
|
|
in_chamber.yo = targloc.y - curloc.y
|
|
in_chamber.xo = targloc.x - curloc.x
|
|
spawn()
|
|
if(in_chamber) in_chamber.process()
|
|
sleep(1)
|
|
in_chamber = null
|
|
|
|
update_icon()
|
|
return
|
|
|