Files
CHOMPStation2/code/modules/projectiles/guns/energy/protector_vr.dm
Repede e44e346352 Release Update
Merge branch 'release' of https://github.com/VOREStation/VOREStation into voreupdate

# Conflicts:
#	code/__defines/machinery.dm
#	code/controllers/configuration.dm
#	code/game/jobs/jobs.dm
#	code/game/machinery/doors/blast_door.dm
#	code/game/machinery/pipe/pipe_recipes.dm
#	code/game/objects/items/devices/radio/radio_vr.dm
#	code/modules/client/preferences_vr.dm
#	code/modules/clothing/glasses/hud_vr.dm
#	code/modules/clothing/under/accessories/accessory_vr.dm
#	code/modules/events/event_container_vr.dm
#	code/modules/gamemaster/actions/planet_weather_change.dm
#	code/modules/projectiles/guns/energy/netgun_vr.dm
#	code/modules/projectiles/guns/energy/protector_vr.dm
#	code/modules/vore/appearance/sprite_accessories_taur_vr.dm
#	code/modules/vore/appearance/sprite_accessories_vr.dm
#	code/modules/vore/fluffstuff/custom_guns_vr.dm
#	icons/obj/power.dmi
#	vorestation.dme
2020-04-16 21:07:33 -04:00

107 lines
4.0 KiB
Plaintext

// -------------- Protector -------------
/obj/item/weapon/gun/energy/gun/protector
name = "small energy gun"
desc = "The WT-98a 'Protector' is a common sidearm developed by Ward-Takahashi GMC. It features a powerful stun mode, and \
an alert-level-locked lethal mode, only usable when the connected jurisdiction allows. It also features an integrated flashlight!"
catalogue_data = list(/datum/category_item/catalogue/information/organization/ward_takahashi)
description_info = "This gun can only be fired in lethal mode while on higher security alert levels. It is legal for sec to carry for this reason, since it cannot be used for lethal force until SOP allows it, in essence."
description_fluff = "One of the few sidearms developed by Ward-Takahashi, this gun has a wireless connection to the computer's datacore to ensure it can't be used without authorization from heads of staff who have raised the alert level. Until then, *click*!"
description_antag = "The gun can be emagged to remove the lethal security level restriction, allowing it to be fired on lethal mode at all times."
icon = 'icons/vore/custom_guns_vr.dmi'
icon_state = "prot"
icon_override = 'icons/vore/custom_guns_vr.dmi'
item_state = "gun"
fire_sound = 'sound/weapons/Taser.ogg'
projectile_type = /obj/item/projectile/beam/stun
modifystate = "stun"
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 3, TECH_MAGNET = 2)
charge_sections = 3 //For the icon
ammo_x_offset = 2
ammo_y_offset = 0
can_flashlight = TRUE
light_state = "prot_light"
flight_x_offset = 0
flight_y_offset = 0
w_class = ITEMSIZE_SMALL
firemodes = list(
list(mode_name="stun", projectile_type=/obj/item/projectile/beam/stun/med, modifystate="stun", charge_cost = 400),
list(mode_name="lethal", projectile_type=/obj/item/projectile/beam, modifystate="kill", charge_cost = 800),
)
var/emagged = FALSE
/obj/item/weapon/gun/energy/gun/protector/special_check(mob/user)
if(!emagged && mode_name == "lethal" && get_security_level() == "green")
to_chat(user,"<span class='warning'>The trigger refuses to depress while on the lethal setting under security level green!</span>")
return FALSE
return ..()
/obj/item/weapon/gun/energy/gun/protector/emag_act(var/remaining_charges,var/mob/user)
..()
if(!emagged)
emagged = TRUE
to_chat(user,"<span class='warning'>You disable the alert level locking mechanism on \the [src]!</span>")
return TRUE
//Update icons from /tg/, so fancy! Use this more!
/obj/item/weapon/gun/energy/gun/protector/update_icon()
overlays.Cut()
var/ratio = 0
/* Don't have one for this gun
var/itemState = null
if(!initial(item_state))
itemState = icon_state
*/
var/iconState = "[icon_state]_charge"
if (modifystate)
overlays += "[icon_state]_[modifystate]"
iconState += "_[modifystate]"
/* Don't have one for this gun
if(itemState)
itemState += "[modifystate]"
*/
if(power_supply)
ratio = CEILING(((power_supply.charge / power_supply.maxcharge) * charge_sections), 1)
if(power_supply.charge < charge_cost)
overlays += "[icon_state]_empty"
else
if(!shaded_charge)
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
for(var/i = ratio, i >= 1, i--)
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
overlays += charge_overlay
else
overlays += "[icon_state]_[modifystate][ratio]"
if(can_flashlight & gun_light)
var/mutable_appearance/flashlight_overlay = mutable_appearance(icon, light_state)
flashlight_overlay.pixel_x = flight_x_offset
flashlight_overlay.pixel_y = flight_y_offset
overlays += flashlight_overlay
/* Don't have one for this gun
if(itemState)
itemState += "[ratio]"
item_state = itemState
*/
/obj/item/weapon/gun/energy/gun/protector/unlocked
emagged = TRUE
name = "small energy gun"
desc = "The LAEP95 'Protector' is another firearm from Lawson Arms and "+TSC_HEPH+", unlike the Perun this is designed for issue to non-security staff. It contains a detachable cell. It also features an integrated flashlight!"