July 5th TG sync (#1883)

July 5th TG sync
This commit is contained in:
Poojawa
2017-07-05 22:14:19 -05:00
committed by GitHub
parent 454b9c3d68
commit b1b4826c0c
1264 changed files with 149689 additions and 570309 deletions
+5 -28
View File
@@ -37,9 +37,6 @@
var/weapon_weight = WEAPON_LIGHT
var/spread = 0 //Spread induced by the gun itself.
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
var/unique_reskin = 0 //allows one-time reskinning
var/current_skin = null //the skin choice if we had a reskin
var/list/options = list()
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
@@ -65,9 +62,9 @@
var/zoomable = FALSE //whether the gun generates a Zoom action on creation
var/zoomed = FALSE //Zoom toggle
var/zoom_amt = 3 //Distance in TURFs to move the user's screen forward (the "zoom" effect)
var/zoom_out_amt = 0
var/datum/action/toggle_scope_zoom/azoom
/obj/item/weapon/gun/Initialize()
. = ..()
if(pin)
@@ -93,8 +90,6 @@
to_chat(user, "It has [pin] installed.")
else
to_chat(user, "It doesn't have a firing pin installed, and won't fire.")
if(unique_reskin && !current_skin)
to_chat(user, "<span class='notice'>Alt-click it to reskin it.</span>")
//called after the gun has successfully fired its chambered ammo.
/obj/item/weapon/gun/proc/process_chamber()
@@ -400,26 +395,6 @@
if(alight)
alight.Remove(user)
/obj/item/weapon/gun/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(unique_reskin && !current_skin && loc == user)
reskin_gun(user)
/obj/item/weapon/gun/proc/reskin_gun(mob/M)
var/choice = input(M,"Warning, you can only reskin your weapon once!","Reskin Gun") in options
if(src && choice && !current_skin && !M.incapacitated() && in_range(M,src))
if(options[choice] == null)
return
current_skin = options[choice]
to_chat(M, "Your gun is now skinned as [choice]. Say hello to your new friend.")
update_icon()
/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
if(!ishuman(user) || !ishuman(target))
return
@@ -465,7 +440,7 @@
/datum/action/toggle_scope_zoom
name = "Toggle Scope"
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING
button_icon_state = "sniper_zoom"
var/obj/item/weapon/gun/gun = null
@@ -507,12 +482,14 @@
if(WEST)
_x = -zoom_amt
user.client.view = zoom_out_amt
user.client.pixel_x = world.icon_size*_x
user.client.pixel_y = world.icon_size*_y
else
user.client.view = world.view
user.client.pixel_x = 0
user.client.pixel_y = 0
return zoomed
//Proc, so that gun accessories/scopes/etc. can easily add zooming.
/obj/item/weapon/gun/proc/build_zooming()