diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 561a583bc7c..96bbfb32c56 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -266,6 +266,15 @@ var/list/uplink_items = list() excludefrom = list(/datum/game_mode/nuclear,/datum/game_mode/gang) cost = 12 +/datum/uplink_item/dangerous/sniper + name = "Sniper Rifle" + desc = "Ranged fury, syndicate style. guaranteed to cause shock and awe or your TC back!" + item = /obj/item/weapon/gun/projectile/sniper_rifle/syndicate + cost = 16 + gamemodes = list(/datum/game_mode/nuclear) + surplus = 25 + + // AMMUNITION /datum/uplink_item/ammo @@ -362,6 +371,26 @@ var/list/uplink_items = list() cost = 2 surplus = 0 +/datum/uplink_item/ammo/sniper + name = "Sniper Magazine - .50" + desc = "An additional 6-round .50 magazine for use in the syndicate sniper rifle." + item = /obj/item/ammo_box/magazine/sniper_rounds + cost = 4 //70dmg rounds are no joke + gamemodes = list(/datum/game_mode/nuclear) + +/datum/uplink_item/ammo/sniper/soporific + name = "Sniper Magazine - Soporific Rounds" + desc = "A 3-round magazine of soporific ammo designed for use in the syndicate sniper rifle, put your enemies to sleep today!" + item = /obj/item/ammo_box/magazine/sniper_rounds/soporific + cost = 6 + +/datum/uplink_item/ammo/sniper/haemorrhage + name = "Sniper Magazine - Haemorrhage Rounds" + desc = "A 5-round magazine of haemorrhage ammo designed for use in the syndicate sniper rifle, causes heavy bleeding in the target." + item = /obj/item/ammo_box/magazine/sniper_rounds/haemorrhage + + + // STEALTHY WEAPONS /datum/uplink_item/stealthy_weapons diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index d64258b66af..2c5dcaf5023 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -55,11 +55,21 @@ var/flight_x_offset = 0 var/flight_y_offset = 0 + //Zooming + 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/datum/action/toggle_scope_zoom/azoom + + /obj/item/weapon/gun/New() ..() if(pin) pin = new pin(src) + build_zooming() + + /obj/item/weapon/gun/CheckParts() var/obj/item/weapon/gun/G = locate(/obj/item/weapon/gun) in contents if(G) @@ -334,13 +344,17 @@ if(F.on) user.AddLuminosity(F.brightness_on) SetLuminosity(0) + if(azoom) + azoom.Grant(user) /obj/item/weapon/gun/dropped(mob/user) if(F) if(F.on) user.AddLuminosity(-F.brightness_on) SetLuminosity(F.brightness_on) - + zoom(user,FALSE) + if(azoom) + azoom.Remove(user) /obj/item/weapon/gun/attack_hand(mob/user) if(unique_reskin && !reskinned && loc == user) @@ -407,3 +421,69 @@ chambered.BB.damage *= 5 process_fire(target, user, 1, params) + + +///////////// +// ZOOMING // +///////////// + +/datum/action/toggle_scope_zoom + name = "Toggle Scope" + check_flags = AB_CHECK_ALIVE|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING + button_icon_state = "sniper_zoom" + var/obj/item/weapon/gun/gun = null + +/datum/action/toggle_scope_zoom/Trigger() + gun.zoom(owner) + +/datum/action/toggle_scope_zoom/IsAvailable() + . = ..() + if(!. && gun) + gun.zoom(owner, FALSE) + +/datum/action/toggle_scope_zoom/Remove(mob/living/L) + gun.zoom(L, FALSE) + ..() + + + +/obj/item/weapon/gun/proc/zoom(mob/living/user, forced_zoom) + if(!user || !user.client) + return + + switch(forced_zoom) + if(FALSE) + zoomed = FALSE + if(TRUE) + zoomed = TRUE + else + zoomed = !zoomed + + if(zoomed) + var/_x = 0 + var/_y = 0 + switch(user.dir) + if(NORTH) + _y = zoom_amt + if(EAST) + _x = zoom_amt + if(SOUTH) + _y = -zoom_amt + if(WEST) + _x = -zoom_amt + + user.client.pixel_x = world.icon_size*_x + user.client.pixel_y = world.icon_size*_y + else + user.client.pixel_x = 0 + user.client.pixel_y = 0 + + +//Proc, so that gun accessories/scopes/etc. can easily add zooming. +/obj/item/weapon/gun/proc/build_zooming() + if(azoom) + return + + if(zoomable) + azoom = new() + azoom.gun = src \ No newline at end of file diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm new file mode 100644 index 00000000000..4cfff29784c --- /dev/null +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -0,0 +1,112 @@ + +/obj/item/weapon/gun/projectile/sniper_rifle + name = "sniper rifle" + desc = "the kind of gun that will leave you crying for mummy before you even realise your leg's missing" + icon_state = "moistnugget" + item_state = "moistnugget" + recoil = 2 + heavy_weapon = 1 + mag_type = /obj/item/ammo_box/magazine/sniper_rounds + fire_delay = 40 + origin_tech = "combat=8" + can_unsuppress = 1 + can_suppress = 1 + w_class = 3 + zoomable = TRUE + zoom_amt = 7 //Long range, enough to see in front of you, but no tiles behind you. + + +/obj/item/weapon/gun/projectile/sniper_rifle/syndicate + name = "syndicate sniper rifle" + desc = "syndicate flavoured sniper rifle, it packs quite a punch, a punch to your face" + pin = /obj/item/device/firing_pin/implant/pindicate + origin_tech = "combat=8;syndicate=4" + + + + + +//Normal Boolets +/obj/item/ammo_box/magazine/sniper_rounds + name = "sniper rounds (.50)" + icon_state = ".50" + origin_tech = "combat=6;syndicate=2" + ammo_type = /obj/item/ammo_casing/point50 + max_ammo = 6 + caliber = ".50" + +/obj/item/ammo_casing/point50 + desc = "A .50 bullet casing." + caliber = ".50" + projectile_type = /obj/item/projectile/bullet/sniper + +/obj/item/projectile/bullet/sniper + damage = 70 + stun = 5 + weaken = 5 + var/breakthings = TRUE + +/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0, hit_zone) + if((blocked != 100) && (!ismob(target) && breakthings)) + target.ex_act(rand(1,2)) + + return ..() + + +//Sleepy ammo +/obj/item/ammo_box/magazine/sniper_rounds/soporific + name = "sniper rounds (Zzzzz)" + desc = "Soporific sniper rounds, designed for happy days and dead quiet nights..." + icon_state = "soporific" + origin_tech = "combat=6;syndicate=3" + ammo_type = /obj/item/ammo_casing/soporific + max_ammo = 3 + caliber = ".50" + +/obj/item/ammo_casing/soporific + desc = "A .50 bullet casing, specialised in sending the target to sleep, instead of hell." + caliber = ".50" + projectile_type = /obj/item/projectile/bullet/sniper/soporific + +/obj/item/projectile/bullet/sniper/soporific + nodamage = 1 + stun = 0 + weaken = 0 + breakthings = FALSE + +/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone) + if((blocked != 100) && istype(target, /mob/living)) + var/mob/living/L = target + L.SetSleeping(20) + + return ..() + + + +//hemorrhage ammo +/obj/item/ammo_box/magazine/sniper_rounds/haemorrhage + name = "sniper rounds (Bleed)" + desc = "Haemorrhage sniper rounds, leaves your target in a pool of crimson pain" + icon_state = "haemorrhage" + origin_tech = "combat=7;syndicate=5" + ammo_type = /obj/item/ammo_casing/haemorrhage + max_ammo = 5 + caliber = ".50" + +/obj/item/ammo_casing/haemorrhage + desc = "A .50 bullet casing, specialised in causing massive bloodloss" + caliber = ".50" + projectile_type = /obj/item/projectile/bullet/sniper/haemorrhage + +/obj/item/projectile/bullet/sniper/haemorrhage + damage = 15 + stun = 0 + weaken = 0 + breakthings = FALSE + +/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone) + if((blocked != 100) && istype(target, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = target + H.drip(100) + + return ..() \ No newline at end of file diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index ac3b0ff7a01..cb410366fe5 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ diff --git a/icons/obj/ammo.dmi b/icons/obj/ammo.dmi index 0387a71bc26..38c50c644be 100644 Binary files a/icons/obj/ammo.dmi and b/icons/obj/ammo.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 4e691e43f47..8c72aa916b8 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1478,6 +1478,7 @@ #include "code\modules\projectiles\guns\projectile\pistol.dm" #include "code\modules\projectiles\guns\projectile\revolver.dm" #include "code\modules\projectiles\guns\projectile\shotgun.dm" +#include "code\modules\projectiles\guns\projectile\sniper.dm" #include "code\modules\projectiles\guns\projectile\toy.dm" #include "code\modules\projectiles\projectile\beams.dm" #include "code\modules\projectiles\projectile\bullets.dm"