Sniper Rifle fix.

You have no HUD when zoomed.  None, I'm unable to move every HUD element while zoomed in so you lose it.  Consider it part of your concentration while zoomed in.

If you move while zoomed in you automatically zoom out, you lose concentration.

If the rifle isn't in your active hand you can't zoom in.

Conflicts:
	code/modules/projectiles/guns/energy/special.dm
This commit is contained in:
Ccomp5950
2014-01-28 23:30:02 -05:00
committed by ZomgPonies
parent 6dfa08040c
commit b79edf513c
3 changed files with 59 additions and 37 deletions
+7 -1
View File
@@ -187,6 +187,12 @@
if(L.incorporeal_move)//Move though walls
Process_Incorpmove(direct)
return
if(mob.client)
if(mob.client.view != world.view)
if(locate(/obj/item/weapon/gun/energy/sniperrifle, mob.contents)) // If mob moves while zoomed in with sniper rifle, unzoom them.
var/obj/item/weapon/gun/energy/sniperrifle/s = locate() in mob
if(s.zoom)
s.zoom()
if(Process_Grab()) return
@@ -450,4 +456,4 @@
prob_slip = 0 // Changing this to zero to make it line up with the comment.
prob_slip = round(prob_slip)
return(prob_slip)
return(prob_slip)
+33 -28
View File
@@ -163,40 +163,45 @@ obj/item/weapon/gun/energy/staff/focus
projectile_type = "/obj/item/projectile/energy/plasma"
/obj/item/weapon/gun/energy/sniperrifle
name = "L.W.A.P. Sniper Rifle"
desc = "A rifle constructed of lightweight materials, fitted with a SMART aiming-system scope."
icon = 'icons/obj/gun.dmi'
icon_state = "sniper"
fire_sound = 'sound/weapons/marauder.ogg'
origin_tech = "combat=6;materials=5;powerstorage=4"
projectile_type = "/obj/item/projectile/beam/sniper"
slot_flags = SLOT_BACK
charge_cost = 250
fire_delay = 35
w_class = 4.0
var/zoom = 0
name = "L.W.A.P. Sniper Rifle"
desc = "A rifle constructed of lightweight materials, fitted with a SMART aiming-system scope."
icon = 'icons/obj/gun.dmi'
icon_state = "sniper"
fire_sound = 'sound/weapons/marauder.ogg'
origin_tech = "combat=6;materials=5;powerstorage=4"
projectile_type = "/obj/item/projectile/beam/sniper"
slot_flags = SLOT_BACK
charge_cost = 250
fire_delay = 35
w_class = 4.0
var/zoom = 0
/obj/item/weapon/gun/energy/sniperrifle/dropped(mob/user)
user.client.view = world.view
zoom = 0
/obj/item/weapon/gun/energy/sniperrifle/verb/zoom()
set category = "Object"
set name = "Zoom"
set popup_menu = 0
if(usr.stat || !(istype(usr,/mob/living/carbon/human)))
usr << "No."
return
set category = "Object"
set name = "Use Sniper Scope"
set popup_menu = 0
if(usr.stat || !(istype(usr,/mob/living/carbon/human)))
usr << "You are unable to focus down the scope of the rifle."
return
if(!zoom && usr.get_active_hand() != src)
usr << "You are too distracted to look down the scope, perhaps if it was in your active hand this might work better"
return
src.zoom = !src.zoom
usr << ("<font color='[src.zoom?"blue":"red"]'>Zoom mode [zoom?"en":"dis"]abled.</font>")
if(zoom)
usr.client.view = 12
usr << sound('sound/mecha/imag_enh.ogg',volume=50)
else
usr.client.view = world.view//world.view - default mob view size
return
if(usr.client.view == world.view)
if(!usr.hud_used.hud_shown)
usr.button_pressed_F12(1) // If the user has already limited their HUD this avoids them having a HUD when they zoom in
usr.button_pressed_F12(1)
usr.client.view = 12
zoom = 1
else
usr.client.view = world.view
if(!usr.hud_used.hud_shown)
usr.button_pressed_F12(1)
zoom = 0
usr << "<font color='[zoom?"blue":"red"]'>Zoom mode [zoom?"en":"dis"]abled.</font>"
/obj/item/weapon/gun/energy/kinetic_accelerator