initial commit - cross reference with 5th port - obviously has compile errors
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
/obj/item/weapon/gun/energy
|
||||
icon_state = "energy"
|
||||
name = "energy gun"
|
||||
desc = "A basic energy-based gun."
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
|
||||
var/obj/item/weapon/stock_parts/cell/power_supply //What type of power cell this uses
|
||||
var/cell_type = /obj/item/weapon/stock_parts/cell
|
||||
var/modifystate = 0
|
||||
var/list/ammo_type = list(/obj/item/ammo_casing/energy)
|
||||
var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next.
|
||||
var/can_charge = 1 //Can it be charged in a recharger?
|
||||
var/charge_sections = 4
|
||||
ammo_x_offset = 2
|
||||
var/shaded_charge = 0 //if this gun uses a stateful charge bar for more detail
|
||||
var/selfcharge = 0
|
||||
var/charge_tick = 0
|
||||
var/charge_delay = 4
|
||||
|
||||
/obj/item/weapon/gun/energy/emp_act(severity)
|
||||
power_supply.use(round(power_supply.charge / severity))
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/New()
|
||||
..()
|
||||
if(cell_type)
|
||||
power_supply = new cell_type(src)
|
||||
else
|
||||
power_supply = new(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
var/obj/item/ammo_casing/energy/shot
|
||||
for (var/i = 1, i <= ammo_type.len, i++)
|
||||
var/shottype = ammo_type[i]
|
||||
shot = new shottype(src)
|
||||
ammo_type[i] = shot
|
||||
shot = ammo_type[select]
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
if(selfcharge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/process()
|
||||
if(selfcharge)
|
||||
charge_tick++
|
||||
if(charge_tick < charge_delay)
|
||||
return
|
||||
charge_tick = 0
|
||||
if(!power_supply)
|
||||
return
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/attack_self(mob/living/user as mob)
|
||||
if(ammo_type.len > 1)
|
||||
select_fire(user)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
|
||||
newshot() //prepare a new shot
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/can_shoot()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
return power_supply.charge >= shot.e_cost
|
||||
|
||||
/obj/item/weapon/gun/energy/newshot()
|
||||
if (!ammo_type || !power_supply)
|
||||
return
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
if(power_supply.charge >= shot.e_cost) //if there's enough power in the power_supply cell...
|
||||
chambered = shot //...prepare a new shot based on the current ammo type selected
|
||||
chambered.newshot()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
var/obj/item/ammo_casing/energy/shot = chambered
|
||||
power_supply.use(shot.e_cost)//... drain the power_supply cell
|
||||
chambered = null //either way, released the prepared shot
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/select_fire(mob/living/user)
|
||||
select++
|
||||
if (select > ammo_type.len)
|
||||
select = 1
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
fire_sound = shot.fire_sound
|
||||
fire_delay = shot.delay
|
||||
if (shot.select_name)
|
||||
user << "<span class='notice'>[src] is now set to [shot.select_name].</span>"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/update_icon()
|
||||
cut_overlays()
|
||||
var/ratio = Ceiling((power_supply.charge / power_supply.maxcharge) * charge_sections)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
var/iconState = "[icon_state]_charge"
|
||||
var/itemState = null
|
||||
if(!initial(item_state))
|
||||
itemState = icon_state
|
||||
if (modifystate)
|
||||
add_overlay("[icon_state]_[shot.select_name]")
|
||||
iconState += "_[shot.select_name]"
|
||||
if(itemState)
|
||||
itemState += "[shot.select_name]"
|
||||
if(power_supply.charge < shot.e_cost)
|
||||
add_overlay("[icon_state]_empty")
|
||||
else
|
||||
if(!shaded_charge)
|
||||
for(var/i = ratio, i >= 1, i--)
|
||||
add_overlay(image(icon = icon, icon_state = iconState, pixel_x = ammo_x_offset * (i -1)))
|
||||
else
|
||||
add_overlay(image(icon = icon, icon_state = "[icon_state]_charge[ratio]"))
|
||||
if(F && can_flashlight)
|
||||
var/iconF = "flight"
|
||||
if(F.on)
|
||||
iconF = "flight_on"
|
||||
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
|
||||
if(itemState)
|
||||
itemState += "[ratio]"
|
||||
item_state = itemState
|
||||
|
||||
/obj/item/weapon/gun/energy/ui_action_click()
|
||||
toggle_gunlight()
|
||||
|
||||
/obj/item/weapon/gun/energy/suicide_act(mob/user)
|
||||
if (src.can_shoot())
|
||||
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
|
||||
sleep(25)
|
||||
if(user.l_hand == src || user.r_hand == src)
|
||||
user.visible_message("<span class='suicide'>[user] melts \his face off with the [src.name]!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
power_supply.use(shot.e_cost)
|
||||
update_icon()
|
||||
return(FIRELOSS)
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] panics and starts choking to death!</span>")
|
||||
return(OXYLOSS)
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [src.name]! It looks like \he's trying to commit suicide!</b></span>")
|
||||
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
|
||||
return (OXYLOSS)
|
||||
|
||||
/obj/item/weapon/gun/energy/proc/robocharge()
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
|
||||
if(R.cell.use(shot.e_cost)) //Take power from the borg...
|
||||
power_supply.give(shot.e_cost) //... to recharge the shot
|
||||
|
||||
/obj/item/weapon/gun/energy/on_varedit(modified_var)
|
||||
if(modified_var == "selfcharge")
|
||||
if(selfcharge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/burn()
|
||||
if(power_supply)
|
||||
qdel(power_supply)
|
||||
.=..()
|
||||
@@ -0,0 +1,128 @@
|
||||
/obj/item/weapon/gun/energy/laser
|
||||
name = "laser gun"
|
||||
desc = "A basic energy-based laser gun that fires concentrated beams of light which pass through glass and thin metal."
|
||||
icon_state = "laser"
|
||||
item_state = "laser"
|
||||
w_class = 3
|
||||
materials = list(MAT_METAL=2000)
|
||||
origin_tech = "combat=4;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/lasergun)
|
||||
ammo_x_offset = 1
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/practice
|
||||
name = "practice laser gun"
|
||||
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/retro
|
||||
name ="retro laser gun"
|
||||
icon_state = "retro"
|
||||
desc = "An older model of the basic lasergun, no longer used by Nanotrasen's private security or military forces. Nevertheless, it is still quite deadly and easy to maintain, making it a favorite amongst pirates and other outlaws."
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain
|
||||
name = "antique laser gun"
|
||||
icon_state = "caplaser"
|
||||
item_state = "caplaser"
|
||||
desc = "This is an antique laser gun. All craftsmanship is of the highest quality. It is decorated with assistant leather and chrome. The object menaces with spikes of energy. On the item is an image of Space Station 13. The station is exploding."
|
||||
force = 10
|
||||
origin_tech = null
|
||||
ammo_x_offset = 3
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/captain/scattershot
|
||||
name = "scatter shot laser rifle"
|
||||
icon_state = "lasercannon"
|
||||
item_state = "laser"
|
||||
desc = "An industrial-grade heavy-duty laser rifle with a modified laser lense to scatter its shot into multiple smaller lasers. The inner-core can self-charge for theorically infinite use."
|
||||
origin_tech = "combat=5;materials=4;powerstorage=4"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg
|
||||
can_charge = 0
|
||||
desc = "An energy-based laser gun that draws power from the cyborg's internal energy cell directly. So this is what freedom looks like?"
|
||||
origin_tech = null
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg/newshot()
|
||||
..()
|
||||
robocharge()
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/cyborg/emp_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/scatter
|
||||
name = "scatter laser gun"
|
||||
desc = "A laser gun equipped with a refraction kit that spreads bolts."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/scatter, /obj/item/ammo_casing/energy/laser)
|
||||
|
||||
///Laser Cannon
|
||||
|
||||
/obj/item/weapon/gun/energy/lasercannon
|
||||
name = "accelerator laser cannon"
|
||||
desc = "An advanced laser cannon that does more damage the farther away the target is."
|
||||
icon_state = "lasercannon"
|
||||
item_state = "laser"
|
||||
w_class = 4
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "combat=4;magnets=4;powerstorage=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/accelerator)
|
||||
pin = null
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/ammo_casing/energy/laser/accelerator
|
||||
projectile_type = /obj/item/projectile/beam/laser/accelerator
|
||||
select_name = "accelerator"
|
||||
fire_sound = 'sound/weapons/lasercannonfire.ogg'
|
||||
|
||||
/obj/item/projectile/beam/laser/accelerator
|
||||
name = "accelerator laser"
|
||||
icon_state = "scatterlaser"
|
||||
range = 255
|
||||
damage = 6
|
||||
|
||||
/obj/item/projectile/beam/laser/accelerator/Range()
|
||||
..()
|
||||
damage += 7
|
||||
transform *= TransformUsingVariable(20 , 100, 1)
|
||||
|
||||
/obj/item/weapon/gun/energy/xray
|
||||
name = "xray laser gun"
|
||||
desc = "A high-power laser gun capable of expelling concentrated xray blasts that pass through multiple soft targets and heavier materials"
|
||||
icon_state = "xray"
|
||||
item_state = null
|
||||
origin_tech = "combat=6;materials=4;magnets=4;syndicate=1"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/xray)
|
||||
pin = null
|
||||
ammo_x_offset = 3
|
||||
|
||||
////////Laser Tag////////////////////
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/bluetag
|
||||
name = "laser tag gun"
|
||||
icon_state = "bluetag"
|
||||
desc = "A retro laser gun modified to fire harmless blue beams of light. Sound effects included!"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/bluetag)
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
pin = /obj/item/device/firing_pin/tag/blue
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/redtag
|
||||
name = "laser tag gun"
|
||||
icon_state = "redtag"
|
||||
desc = "A retro laser gun modified to fire harmless beams red of light. Sound effects included!"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag)
|
||||
origin_tech = "combat=2;magnets=2"
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
pin = /obj/item/device/firing_pin/tag/red
|
||||
ammo_x_offset = 2
|
||||
selfcharge = 1
|
||||
@@ -0,0 +1,81 @@
|
||||
/obj/item/weapon/gun/energy/gun
|
||||
name = "energy gun"
|
||||
desc = "A basic hybrid energy gun with two settings: disable and kill."
|
||||
icon_state = "energy"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser)
|
||||
origin_tech = "combat=4;magnets=3"
|
||||
modifystate = 2
|
||||
can_flashlight = 1
|
||||
ammo_x_offset = 3
|
||||
flight_x_offset = 15
|
||||
flight_y_offset = 10
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/mini
|
||||
name = "miniature energy gun"
|
||||
desc = "A small, pistol-sized energy gun with a built-in flashlight. It has two settings: stun and kill."
|
||||
icon_state = "mini"
|
||||
item_state = "gun"
|
||||
w_class = 2
|
||||
cell_type = /obj/item/weapon/stock_parts/cell{charge = 600; maxcharge = 600}
|
||||
ammo_x_offset = 2
|
||||
charge_sections = 3
|
||||
can_flashlight = 0 // Can't attach or detach the flashlight, and override it's icon update
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/mini/New()
|
||||
F = new /obj/item/device/flashlight/seclite(src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/mini/update_icon()
|
||||
..()
|
||||
if(F && F.on)
|
||||
add_overlay("mini-light")
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/hos
|
||||
name = "\improper X-01 MultiPhase Energy Gun"
|
||||
desc = "This is an expensive, modern recreation of an antique laser gun. This gun has several unique firemodes, but lacks the ability to recharge over time."
|
||||
icon_state = "hoslaser"
|
||||
origin_tech = null
|
||||
force = 10
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode/hos, /obj/item/ammo_casing/energy/laser/hos, /obj/item/ammo_casing/energy/disabler)
|
||||
ammo_x_offset = 4
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/dragnet
|
||||
name = "\improper DRAGnet"
|
||||
desc = "The \"Dynamic Rapid-Apprehension of the Guilty\" net is a revolution in law enforcement technology."
|
||||
icon_state = "dragnet"
|
||||
origin_tech = "combat=4;magnets=3;bluespace=4"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/net, /obj/item/ammo_casing/energy/trap)
|
||||
can_flashlight = 0
|
||||
ammo_x_offset = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/dragnet/snare
|
||||
name = "Energy Snare Launcher"
|
||||
desc = "Fires an energy snare that slows the target down"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/trap)
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/turret
|
||||
name = "hybrid turret gun"
|
||||
desc = "A heavy hybrid energy cannon with two settings: Stun and kill."
|
||||
icon_state = "turretlaser"
|
||||
item_state = "turretlaser"
|
||||
slot_flags = null
|
||||
w_class = 5
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
can_flashlight = 0
|
||||
trigger_guard = TRIGGER_GUARD_NONE
|
||||
ammo_x_offset = 2
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/nuclear
|
||||
name = "advanced energy gun"
|
||||
desc = "An energy gun with an experimental miniaturized nuclear reactor that automatically charges the internal power cell."
|
||||
icon_state = "nucgun"
|
||||
item_state = "nucgun"
|
||||
origin_tech = "combat=4;magnets=4;powerstorage=4"
|
||||
charge_delay = 5
|
||||
pin = null
|
||||
can_charge = 0
|
||||
ammo_x_offset = 1
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/disabler)
|
||||
selfcharge = 1
|
||||
@@ -0,0 +1,81 @@
|
||||
/obj/item/weapon/gun/energy/pulse
|
||||
name = "pulse rifle"
|
||||
desc = "A heavy-duty, multifaceted energy rifle with three modes. Preferred by front-line combat personnel."
|
||||
icon_state = "pulse"
|
||||
item_state = null
|
||||
w_class = 4
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse, /obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser)
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/New()
|
||||
. = ..()
|
||||
poi_list |= src
|
||||
var/msg = "A pulse rifle prize has been created at ([x],[y],[z] - (\
|
||||
<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>\
|
||||
JMP</a>)"
|
||||
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
notify_ghosts("Someone won a pulse rifle as a prize!", source = src,
|
||||
action = NOTIFY_ORBIT)
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/prize/Destroy()
|
||||
poi_list -= src
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine
|
||||
name = "pulse carbine"
|
||||
desc = "A compact variant of the pulse rifle with less firepower but easier storage."
|
||||
w_class = 3
|
||||
slot_flags = SLOT_BELT
|
||||
icon_state = "pulse_carbine"
|
||||
item_state = "pulse"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/carbine"
|
||||
can_flashlight = 1
|
||||
flight_x_offset = 18
|
||||
flight_y_offset = 12
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/carbine/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol
|
||||
name = "pulse pistol"
|
||||
desc = "A pulse rifle in an easily concealed handgun package with low capacity."
|
||||
w_class = 2
|
||||
slot_flags = SLOT_BELT
|
||||
icon_state = "pulse_pistol"
|
||||
item_state = "gun"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/pulse/pistol"
|
||||
can_charge = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/loyalpin
|
||||
pin = /obj/item/device/firing_pin/implant/mindshield
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/destroyer
|
||||
name = "pulse destroyer"
|
||||
desc = "A heavy-duty energy rifle built for pure destruction."
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/pulse)
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/destroyer/attack_self(mob/living/user)
|
||||
user << "<span class='danger'>[src.name] has three settings, and they are all DESTROY.</span>"
|
||||
|
||||
/obj/item/weapon/gun/energy/pulse/pistol/m1911
|
||||
name = "\improper M1911-P"
|
||||
desc = "A compact pulse core in a classic handgun frame for Nanotrasen officers. It's not the size of the gun, it's the size of the hole it puts through people."
|
||||
icon_state = "m1911"
|
||||
item_state = "gun"
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/infinite"
|
||||
@@ -0,0 +1,410 @@
|
||||
/obj/item/weapon/gun/energy/ionrifle
|
||||
name = "ion rifle"
|
||||
desc = "A man-portable anti-armor weapon designed to disable mechanical threats at range."
|
||||
icon_state = "ionrifle"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
origin_tech = "combat=4;magnets=4"
|
||||
can_flashlight = 1
|
||||
w_class = 5
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/ion)
|
||||
ammo_x_offset = 3
|
||||
flight_x_offset = 17
|
||||
flight_y_offset = 9
|
||||
|
||||
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/ionrifle/carbine
|
||||
name = "ion carbine"
|
||||
desc = "The MK.II Prototype Ion Projector is a lightweight carbine version of the larger ion rifle, built to be ergonomic and efficient."
|
||||
icon_state = "ioncarbine"
|
||||
w_class = 3
|
||||
slot_flags = SLOT_BELT
|
||||
pin = null
|
||||
ammo_x_offset = 2
|
||||
flight_x_offset = 18
|
||||
flight_y_offset = 11
|
||||
|
||||
/obj/item/weapon/gun/energy/decloner
|
||||
name = "biological demolecularisor"
|
||||
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
|
||||
icon_state = "decloner"
|
||||
origin_tech = "combat=4;materials=4;biotech=5;plasmatech=6"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/declone)
|
||||
pin = null
|
||||
ammo_x_offset = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/decloner/update_icon()
|
||||
..()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
if(power_supply.charge > shot.e_cost)
|
||||
add_overlay("decloner_spin")
|
||||
|
||||
/obj/item/weapon/gun/energy/floragun
|
||||
name = "floral somatoray"
|
||||
desc = "A tool that discharges controlled radiation which induces mutation in plant cells."
|
||||
icon_state = "flora"
|
||||
item_state = "gun"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/flora/yield, /obj/item/ammo_casing/energy/flora/mut)
|
||||
origin_tech = "materials=2;biotech=4"
|
||||
modifystate = 1
|
||||
ammo_x_offset = 1
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/meteorgun
|
||||
name = "meteor gun"
|
||||
desc = "For the love of god, make sure you're aiming this the right way!"
|
||||
icon_state = "riotgun"
|
||||
item_state = "c20r"
|
||||
w_class = 4
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/meteor)
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/potato"
|
||||
clumsy_check = 0 //Admin spawn only, might as well let clowns use it.
|
||||
selfcharge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/meteorgun/pen
|
||||
name = "meteor pen"
|
||||
desc = "The pen is mightier than the sword."
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
w_class = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/mindflayer
|
||||
name = "\improper Mind Flayer"
|
||||
desc = "A prototype weapon recovered from the ruins of Research-Station Epsilon."
|
||||
icon_state = "xray"
|
||||
item_state = null
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/mindflayer)
|
||||
ammo_x_offset = 2
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator
|
||||
name = "proto-kinetic accelerator"
|
||||
desc = "In the year 2544, only a year after the discovery of a potentially \
|
||||
world-changing substance, now colloquially referred to as plasma, the \
|
||||
Nanotrasen-UEG mining conglomerate introduced a prototype of a gun-like \
|
||||
device intended for quick, effective mining of plasma in the low \
|
||||
pressures of the solar system. Included in this presentation were \
|
||||
demonstrations of the gun being fired at collections of rocks contained \
|
||||
in vacuumed environments, obliterating them instantly while maintaining \
|
||||
the structure of the ores buried within them. Additionally, volunteers \
|
||||
were called from the crowd to have the gun used on them, only proving that \
|
||||
the gun caused little harm to objects in standard pressure. \n\
|
||||
An official from an unnamed, now long dissipated company observed this \
|
||||
presentation and offered to share their self-recharger cells, powered \
|
||||
by the user's bioelectrical field, another new and unknown technology. \
|
||||
They warned that the cells were incredibly experimental and several times \
|
||||
had injured workers, but the scientists as Nanotrasen were unable to resist \
|
||||
the money-saving potential of self recharging cells. Upon accepting this \
|
||||
offer, it took only a matter of days to prove the volatility of these cells, \
|
||||
as they exploded left and right whenever inserted into the prototype devices, \
|
||||
only throwing more money in the bin. \n\
|
||||
Whenever the Nanotrasen scientists were on the edge of giving up, a \
|
||||
breakthrough was made by head researcher Miles Parks McCollum, who \
|
||||
demonstrated that the cells could be stabilized when exposed to radium \
|
||||
then cooled with cryostylane. After this discovery, the low pressure gun, \
|
||||
now named the Kinetic Accelerator, was hastily completed and made compatible \
|
||||
with the self-recharging cells. As a result of poor testing, the currently \
|
||||
used guns lose their charge when not in use, and when two Kinetic Accelerators \
|
||||
come in proximity of one another, they will interfere with each other. Despite \
|
||||
this, the shoddy guns still see use in the mining of plasma to this day."
|
||||
icon_state = "kineticgun"
|
||||
item_state = "kineticgun"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/kinetic)
|
||||
cell_type = /obj/item/weapon/stock_parts/cell/emproof
|
||||
// Apparently these are safe to carry? I'm sure goliaths would disagree.
|
||||
needs_permit = 0
|
||||
unique_rename = 1
|
||||
origin_tech = "combat=3;powerstorage=3;engineering=3"
|
||||
weapon_weight = WEAPON_LIGHT
|
||||
can_flashlight = 1
|
||||
flight_x_offset = 15
|
||||
flight_y_offset = 9
|
||||
var/overheat_time = 16
|
||||
var/holds_charge = FALSE
|
||||
var/unique_frequency = FALSE // modified by KA modkits
|
||||
var/overheat = FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/super
|
||||
name = "super-kinetic accelerator"
|
||||
desc = "An upgraded, superior version of the proto-kinetic accelerator."
|
||||
icon_state = "kineticgun_u"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/super)
|
||||
overheat_time = 15
|
||||
origin_tech = "materials=5;powerstorage=3;engineering=4;magnets=3;combat=3"
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/hyper
|
||||
name = "hyper-kinetic accelerator"
|
||||
desc = "An upgraded, even more superior version of the proto-kinetic accelerator."
|
||||
icon_state = "kineticgun_h"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/hyper)
|
||||
overheat_time = 14
|
||||
origin_tech = "materials=6;powerstorage=4;engineering=4;magnets=4;combat=4"
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg
|
||||
holds_charge = TRUE
|
||||
unique_frequency = TRUE
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/hyper/cyborg
|
||||
holds_charge = TRUE
|
||||
unique_frequency = TRUE
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/New()
|
||||
. = ..()
|
||||
if(!holds_charge)
|
||||
empty()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/shoot_live_shot()
|
||||
. = ..()
|
||||
attempt_reload()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/equipped(mob/user)
|
||||
. = ..()
|
||||
if(!can_shoot())
|
||||
attempt_reload()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/dropped()
|
||||
. = ..()
|
||||
if(!holds_charge)
|
||||
// Put it on a delay because moving item from slot to hand
|
||||
// calls dropped().
|
||||
sleep(1)
|
||||
if(!ismob(loc))
|
||||
empty()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
|
||||
power_supply.use(500)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload()
|
||||
if(overheat)
|
||||
return
|
||||
overheat = TRUE
|
||||
|
||||
var/carried = 0
|
||||
if(!unique_frequency)
|
||||
for(var/obj/item/weapon/gun/energy/kinetic_accelerator/K in \
|
||||
loc.GetAllContents())
|
||||
|
||||
carried++
|
||||
|
||||
carried = max(carried, 1)
|
||||
else
|
||||
carried = 1
|
||||
|
||||
addtimer(src, "reload", overheat_time * carried)
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/emp_act(severity)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
|
||||
power_supply.give(500)
|
||||
if(!suppressed)
|
||||
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
|
||||
else
|
||||
loc << "<span class='warning'>[src] silently charges up.<span>"
|
||||
update_icon()
|
||||
overheat = FALSE
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/update_icon()
|
||||
cut_overlays()
|
||||
if(!can_shoot())
|
||||
add_overlay("kineticgun_empty")
|
||||
|
||||
if(F && can_flashlight)
|
||||
var/iconF = "flight"
|
||||
if(F.on)
|
||||
iconF = "flight_on"
|
||||
add_overlay(image(icon = icon, icon_state = iconF, pixel_x = flight_x_offset, pixel_y = flight_y_offset))
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
|
||||
name = "mini energy crossbow"
|
||||
desc = "A weapon favored by syndicate stealth specialists."
|
||||
icon_state = "crossbow"
|
||||
item_state = "crossbow"
|
||||
w_class = 2
|
||||
materials = list(MAT_METAL=2000)
|
||||
origin_tech = "combat=4;magnets=4;syndicate=5"
|
||||
suppressed = 1
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/bolt)
|
||||
weapon_weight = WEAPON_LIGHT
|
||||
unique_rename = 0
|
||||
overheat_time = 20
|
||||
holds_charge = TRUE
|
||||
unique_frequency = TRUE
|
||||
can_flashlight = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large
|
||||
name = "energy crossbow"
|
||||
desc = "A reverse engineered weapon using syndicate technology."
|
||||
icon_state = "crossbowlarge"
|
||||
w_class = 3
|
||||
materials = list(MAT_METAL=4000)
|
||||
origin_tech = "combat=4;magnets=4;syndicate=2"
|
||||
suppressed = 0
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/bolt/large)
|
||||
pin = null
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/suicide_act(mob/user)
|
||||
if(!suppressed)
|
||||
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
|
||||
user.visible_message("<span class='suicide'>[user] cocks the [src.name] and pretends to blow \his brains out! It looks like \he's trying to commit suicide!</b></span>")
|
||||
shoot_live_shot()
|
||||
return (OXYLOSS)
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter
|
||||
name = "plasma cutter"
|
||||
desc = "A mining tool capable of expelling concentrated plasma bursts. You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
icon_state = "plasmacutter"
|
||||
item_state = "plasmacutter"
|
||||
modifystate = -1
|
||||
origin_tech = "combat=1;materials=3;magnets=2;plasmatech=3;engineering=1"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/plasma)
|
||||
flags = CONDUCT | OPENCONTAINER
|
||||
attack_verb = list("attacked", "slashed", "cut", "sliced")
|
||||
force = 12
|
||||
sharpness = IS_SHARP
|
||||
can_charge = 0
|
||||
heat = 3800
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter/examine(mob/user)
|
||||
..()
|
||||
if(power_supply)
|
||||
user <<"<span class='notice'>[src] is [round(power_supply.percent())]% charged.</span>"
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter/attackby(obj/item/A, mob/user)
|
||||
if(istype(A, /obj/item/stack/sheet/mineral/plasma))
|
||||
var/obj/item/stack/sheet/S = A
|
||||
S.use(1)
|
||||
power_supply.give(1000)
|
||||
user << "<span class='notice'>You insert [A] in [src], recharging it.</span>"
|
||||
else if(istype(A, /obj/item/weapon/ore/plasma))
|
||||
qdel(A)
|
||||
power_supply.give(500)
|
||||
user << "<span class='notice'>You insert [A] in [src], recharging it.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter/adv
|
||||
name = "advanced plasma cutter"
|
||||
icon_state = "adv_plasmacutter"
|
||||
origin_tech = "combat=3;materials=4;magnets=3;plasmatech=4;engineering=2"
|
||||
force = 15
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/plasma/adv)
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector
|
||||
name = "bluespace wormhole projector"
|
||||
desc = "A projector that emits high density quantum-coupled bluespace beams."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/wormhole, /obj/item/ammo_casing/energy/wormhole/orange)
|
||||
item_state = null
|
||||
icon_state = "wormhole_projector"
|
||||
origin_tech = "combat=4;bluespace=6;plasmatech=4;engineering=4"
|
||||
var/obj/effect/portal/blue
|
||||
var/obj/effect/portal/orange
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/update_icon()
|
||||
icon_state = "[initial(icon_state)][select]"
|
||||
item_state = icon_state
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/process_chamber()
|
||||
..()
|
||||
select_fire()
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/portal_destroyed(obj/effect/portal/P)
|
||||
if(P.icon_state == "portal")
|
||||
blue = null
|
||||
if(orange)
|
||||
orange.target = null
|
||||
else
|
||||
orange = null
|
||||
if(blue)
|
||||
blue.target = null
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector/proc/create_portal(obj/item/projectile/beam/wormhole/W)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(W), null, src)
|
||||
P.precision = 0
|
||||
if(W.name == "bluespace beam")
|
||||
qdel(blue)
|
||||
blue = P
|
||||
else
|
||||
qdel(orange)
|
||||
P.icon_state = "portal1"
|
||||
orange = P
|
||||
if(orange && blue)
|
||||
blue.target = get_turf(orange)
|
||||
orange.target = get_turf(blue)
|
||||
|
||||
|
||||
/* 3d printer 'pseudo guns' for borgs */
|
||||
|
||||
/obj/item/weapon/gun/energy/printer
|
||||
name = "cyborg lmg"
|
||||
desc = "A machinegun that fires 3d-printed flachettes slowly regenerated using a cyborg's internal power source."
|
||||
icon_state = "l6closed0"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/secborg"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/c3dbullet)
|
||||
can_charge = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/printer/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/printer/emp_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/printer/newshot()
|
||||
..()
|
||||
robocharge()
|
||||
|
||||
/obj/item/weapon/gun/energy/temperature
|
||||
name = "temperature gun"
|
||||
icon_state = "freezegun"
|
||||
desc = "A gun that changes temperatures."
|
||||
origin_tech = "combat=4;materials=4;powerstorage=3;magnets=2"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/temp, /obj/item/ammo_casing/energy/temp/hot)
|
||||
cell_type = "/obj/item/weapon/stock_parts/cell/high"
|
||||
pin = null
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/instakill
|
||||
name = "instakill rifle"
|
||||
icon_state = "instagib"
|
||||
item_state = "instagib"
|
||||
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit."
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/instakill)
|
||||
force = 60
|
||||
origin_tech = "combat=7;magnets=6"
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/instakill/red
|
||||
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit. This one has a red design."
|
||||
icon_state = "instagibred"
|
||||
item_state = "instagibred"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/instakill/red)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/instakill/blue
|
||||
desc = "A specialized ASMD laser-rifle, capable of flat-out disintegrating most targets in a single hit. This one has a blue design."
|
||||
icon_state = "instagibblue"
|
||||
item_state = "instagibblue"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/instakill/blue)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/instakill/emp_act() //implying you could stop the instagib
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/gravity_gun
|
||||
name = "one-point bluespace-gravitational manipulator"
|
||||
icon_state = "gravity_gun"
|
||||
item_state = "gravity_gun"
|
||||
desc = "An experimental, multi-mode device that fires bolts of Zero-Point Energy, causing local distortions in gravity"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/gravityrepulse, /obj/item/ammo_casing/energy/gravityattract, /obj/item/ammo_casing/energy/gravitychaos)
|
||||
origin_tech = "combat=4;magnets=4;materials=6;powerstorage=4;bluespace=4"
|
||||
item_state = null
|
||||
icon_state = "gravity_gun"
|
||||
var/power = 4
|
||||
@@ -0,0 +1,54 @@
|
||||
/obj/item/weapon/gun/energy/taser
|
||||
name = "taser gun"
|
||||
desc = "A low-capacity, energy-based stun gun used by security teams to subdue targets at range."
|
||||
icon_state = "taser"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
|
||||
origin_tech = "combat=3"
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/shock_revolver
|
||||
name = "tesla gun"
|
||||
desc = "An experimental gun based on an experimental engine, it's about as likely to kill it's operator as it is the target."
|
||||
icon_state = "tesla"
|
||||
item_state = "tesla"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/shock_revolver)
|
||||
origin_tech = "combat=4;materials=4;powerstorage=4"
|
||||
can_flashlight = 0
|
||||
pin = null
|
||||
shaded_charge = 1
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/advtaser
|
||||
name = "hybrid taser"
|
||||
desc = "A dual-mode taser designed to fire both short-range high-power electrodes and long-range disabler beams."
|
||||
icon_state = "advtaser"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/disabler)
|
||||
origin_tech = "combat=4"
|
||||
ammo_x_offset = 2
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/advtaser/cyborg
|
||||
name = "cyborg taser"
|
||||
desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
can_flashlight = 0
|
||||
can_charge = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/advtaser/cyborg/newshot()
|
||||
..()
|
||||
robocharge()
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler
|
||||
name = "disabler"
|
||||
desc = "A self-defense weapon that exhausts organic targets, weakening them until they collapse."
|
||||
icon_state = "disabler"
|
||||
item_state = "combat=3"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/disabler)
|
||||
ammo_x_offset = 3
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg
|
||||
name = "cyborg disabler"
|
||||
desc = "An integrated disabler that draws from a cyborg's power cell. This weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
can_charge = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg/newshot()
|
||||
..()
|
||||
robocharge()
|
||||
@@ -0,0 +1,53 @@
|
||||
/obj/item/weapon/gun/grenadelauncher
|
||||
name = "grenade launcher"
|
||||
desc = "a terrible, terrible thing. it's really awful!"
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "riotgun"
|
||||
item_state = "riotgun"
|
||||
w_class = 4
|
||||
throw_speed = 2
|
||||
throw_range = 7
|
||||
force = 5
|
||||
var/list/grenades = new/list()
|
||||
var/max_grenades = 3
|
||||
materials = list(MAT_METAL=2000)
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/examine(mob/user)
|
||||
..()
|
||||
user << "[grenades.len] / [max_grenades] grenades loaded."
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/attackby(obj/item/I, mob/user, params)
|
||||
|
||||
if((istype(I, /obj/item/weapon/grenade)))
|
||||
if(grenades.len < max_grenades)
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
I.loc = src
|
||||
grenades += I
|
||||
user << "<span class='notice'>You put the grenade in the grenade launcher.</span>"
|
||||
user << "<span class='notice'>[grenades.len] / [max_grenades] Grenades.</span>"
|
||||
else
|
||||
usr << "<span class='danger'>The grenade launcher cannot hold more grenades.</span>"
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/afterattack(obj/target, mob/user , flag)
|
||||
if(target == user)
|
||||
return
|
||||
|
||||
if(grenades.len)
|
||||
fire_grenade(target,user)
|
||||
else
|
||||
usr << "<span class='danger'>The grenade launcher is empty.</span>"
|
||||
|
||||
/obj/item/weapon/gun/grenadelauncher/proc/fire_grenade(atom/target, mob/user)
|
||||
user.visible_message("<span class='danger'>[user] fired a grenade!</span>", \
|
||||
"<span class='danger'>You fire the grenade launcher!</span>")
|
||||
var/obj/item/weapon/grenade/chem_grenade/F = grenades[1] //Now with less copypasta!
|
||||
grenades -= F
|
||||
F.loc = user.loc
|
||||
F.throw_at_fast(target, 30, 2,user)
|
||||
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
|
||||
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
|
||||
F.active = 1
|
||||
F.icon_state = initial(icon_state) + "_active"
|
||||
playsound(user.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
|
||||
addtimer(F, "prime", 15)
|
||||
@@ -0,0 +1,81 @@
|
||||
/obj/item/weapon/gun/magic
|
||||
name = "staff of nothing"
|
||||
desc = "This staff is boring to watch because even though it came first you've seen everything it can do in other staves for years."
|
||||
icon = 'icons/obj/guns/magic.dmi'
|
||||
icon_state = "staffofnothing"
|
||||
item_state = "staff"
|
||||
fire_sound = 'sound/weapons/emitter.ogg'
|
||||
flags = CONDUCT
|
||||
w_class = 5
|
||||
var/max_charges = 6
|
||||
var/charges = 0
|
||||
var/recharge_rate = 4
|
||||
var/charge_tick = 0
|
||||
var/can_charge = 1
|
||||
var/ammo_type
|
||||
var/no_den_usage
|
||||
origin_tech = null
|
||||
clumsy_check = 0
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead
|
||||
pin = /obj/item/device/firing_pin/magic
|
||||
|
||||
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands
|
||||
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
|
||||
/obj/item/weapon/gun/magic/afterattack(atom/target, mob/living/user, flag)
|
||||
newshot()
|
||||
if(no_den_usage)
|
||||
var/area/A = get_area(user)
|
||||
if(istype(A, /area/wizard_station))
|
||||
user << "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>"
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/can_shoot()
|
||||
return charges
|
||||
|
||||
/obj/item/weapon/gun/magic/newshot()
|
||||
if (charges && chambered)
|
||||
chambered.newshot()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
charges--//... drain a charge
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/New()
|
||||
..()
|
||||
charges = max_charges
|
||||
chambered = new ammo_type(src)
|
||||
if(can_charge)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/Destroy()
|
||||
if(can_charge)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/process()
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_rate || charges >= max_charges)
|
||||
return 0
|
||||
charge_tick = 0
|
||||
charges++
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/magic/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
user << "<span class='warning'>The [name] whizzles quietly.<span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is twisting the [src.name] above \his head, releasing a magical blast! It looks like \he's trying to commit suicide.</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
return (FIRELOSS)
|
||||
@@ -0,0 +1,61 @@
|
||||
/obj/item/weapon/gun/magic/staff/
|
||||
slot_flags = SLOT_BACK
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/change
|
||||
name = "staff of change"
|
||||
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
||||
fire_sound = "sound/magic/Staff_Change.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/change
|
||||
icon_state = "staffofchange"
|
||||
item_state = "staffofchange"
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/animate
|
||||
name = "staff of animation"
|
||||
desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
|
||||
fire_sound = "sound/magic/Staff_animation.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/animate
|
||||
icon_state = "staffofanimation"
|
||||
item_state = "staffofanimation"
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/healing
|
||||
name = "staff of healing"
|
||||
desc = "An artefact that spits bolts of restoring magic which can remove ailments of all kinds and even raise the dead."
|
||||
fire_sound = "sound/magic/Staff_Healing.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/heal
|
||||
icon_state = "staffofhealing"
|
||||
item_state = "staffofhealing"
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/healing/handle_suicide() //Stops people trying to commit suicide to heal themselves
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/chaos
|
||||
name = "staff of chaos"
|
||||
desc = "An artefact that spits bolts of chaotic magic that can potentially do anything."
|
||||
fire_sound = "sound/magic/Staff_Chaos.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/chaos
|
||||
icon_state = "staffofchaos"
|
||||
item_state = "staffofchaos"
|
||||
max_charges = 10
|
||||
recharge_rate = 2
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/door
|
||||
name = "staff of door creation"
|
||||
desc = "An artefact that spits bolts of transformative magic that can create doors in walls."
|
||||
fire_sound = "sound/magic/Staff_Door.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/door
|
||||
icon_state = "staffofdoor"
|
||||
item_state = "staffofdoor"
|
||||
max_charges = 10
|
||||
recharge_rate = 2
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/staff/honk
|
||||
name = "staff of the honkmother"
|
||||
desc = "Honk"
|
||||
fire_sound = "sound/items/airhorn.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/honk
|
||||
icon_state = "honker"
|
||||
item_state = "honker"
|
||||
max_charges = 4
|
||||
recharge_rate = 8
|
||||
@@ -0,0 +1,168 @@
|
||||
/obj/item/weapon/gun/magic/wand/
|
||||
name = "wand of nothing"
|
||||
desc = "It's not just a stick, it's a MAGIC stick!"
|
||||
ammo_type = /obj/item/ammo_casing/magic
|
||||
icon_state = "nothingwand"
|
||||
item_state = "wand"
|
||||
w_class = 2
|
||||
can_charge = 0
|
||||
max_charges = 100 //100, 50, 50, 34 (max charge distribution by 25%ths)
|
||||
var/variable_charges = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/New()
|
||||
if(prob(75) && variable_charges) //25% chance of listed max charges, 50% chance of 1/2 max charges, 25% chance of 1/3 max charges
|
||||
if(prob(33))
|
||||
max_charges = Ceiling(max_charges / 3)
|
||||
else
|
||||
max_charges = Ceiling(max_charges / 2)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/examine(mob/user)
|
||||
..()
|
||||
user << "Has [charges] charge\s remaining."
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/update_icon()
|
||||
icon_state = "[initial(icon_state)][charges ? "" : "-drained"]"
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/attack(atom/target, mob/living/user)
|
||||
if(target == user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/afterattack(atom/target, mob/living/user)
|
||||
if(!charges)
|
||||
shoot_with_empty_chamber(user)
|
||||
return
|
||||
if(target == user)
|
||||
if(no_den_usage)
|
||||
var/area/A = get_area(user)
|
||||
if(istype(A, /area/wizard_station))
|
||||
user << "<span class='warning'>You know better than to violate the security of The Den, best wait until you leave to use [src].<span>"
|
||||
return
|
||||
else
|
||||
no_den_usage = 0
|
||||
zap_self(user)
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/proc/zap_self(mob/living/user)
|
||||
user.visible_message("<span class='danger'>[user] zaps \himself with [src].</span>")
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> zapped \himself with a <b>[src]</b>"
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF DEATH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death
|
||||
name = "wand of death"
|
||||
desc = "This deadly wand overwhelms the victim's body with pure energy, slaying them without fail."
|
||||
fire_sound = "sound/magic/WandoDeath.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/death
|
||||
icon_state = "deathwand"
|
||||
max_charges = 3 //3, 2, 2, 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/death/zap_self(mob/living/user)
|
||||
var/message ="<span class='warning'>You irradiate yourself with pure energy! "
|
||||
message += pick("Do not pass go. Do not collect 200 zorkmids.</span>","You feel more confident in your spell casting skills.</span>","You Die...</span>","Do you want your possessions identified?</span>")
|
||||
user << message
|
||||
user.adjustOxyLoss(500)
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF HEALING
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection
|
||||
name = "wand of healing"
|
||||
desc = "This wand uses healing magics to heal and revive. They are rarely utilized within the Wizard Federation for some reason."
|
||||
ammo_type = /obj/item/ammo_casing/magic/heal
|
||||
fire_sound = "sound/magic/Staff_Healing.ogg"
|
||||
icon_state = "revivewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/resurrection/zap_self(mob/living/user)
|
||||
user.revive(full_heal = 1)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.regenerate_limbs()
|
||||
user << "<span class='notice'>You feel great!</span>"
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF POLYMORPH
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph
|
||||
name = "wand of polymorph"
|
||||
desc = "This wand is attuned to chaos and will radically alter the victim's form."
|
||||
ammo_type = /obj/item/ammo_casing/magic/change
|
||||
icon_state = "polywand"
|
||||
fire_sound = "sound/magic/Staff_Change.ogg"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/polymorph/zap_self(mob/living/user)
|
||||
..() //because the user mob ceases to exists by the time wabbajack fully resolves
|
||||
wabbajack(user)
|
||||
charges--
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF TELEPORTATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport
|
||||
name = "wand of teleportation"
|
||||
desc = "This wand will wrench targets through space and time to move them somewhere else."
|
||||
ammo_type = /obj/item/ammo_casing/magic/teleport
|
||||
fire_sound = "sound/magic/Wand_Teleport.ogg"
|
||||
icon_state = "telewand"
|
||||
max_charges = 10 //10, 5, 5, 4
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
|
||||
if(do_teleport(user, user, 10))
|
||||
var/datum/effect_system/smoke_spread/smoke = new
|
||||
smoke.set_up(3, user.loc)
|
||||
smoke.start()
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF DOOR CREATION
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door
|
||||
name = "wand of door creation"
|
||||
desc = "This particular wand can create doors in any wall for the unscrupulous wizard who shuns teleportation magics."
|
||||
ammo_type = /obj/item/ammo_casing/magic/door
|
||||
icon_state = "doorwand"
|
||||
fire_sound = "sound/magic/Staff_Door.ogg"
|
||||
max_charges = 20 //20, 10, 10, 7
|
||||
no_den_usage = 1
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/door/zap_self(mob/living/user)
|
||||
user << "<span class='notice'>You feel vaguely more open with your feelings.</span>"
|
||||
charges--
|
||||
..()
|
||||
|
||||
/////////////////////////////////////
|
||||
//WAND OF FIREBALL
|
||||
/////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball
|
||||
name = "wand of fireball"
|
||||
desc = "This wand shoots scorching balls of fire that explode into destructive flames."
|
||||
fire_sound = "sound/magic/Fireball.ogg"
|
||||
ammo_type = /obj/item/ammo_casing/magic/fireball
|
||||
icon_state = "firewand"
|
||||
max_charges = 8 //8, 4, 4, 3
|
||||
|
||||
/obj/item/weapon/gun/magic/wand/fireball/zap_self(mob/living/user)
|
||||
explosion(user.loc, -1, 0, 2, 3, 0, flame_range = 2)
|
||||
charges--
|
||||
..()
|
||||
@@ -0,0 +1,127 @@
|
||||
/obj/item/weapon/gun/medbeam
|
||||
name = "Medical Beamgun"
|
||||
desc = "Delivers medical nanites in a focused beam."
|
||||
icon = 'icons/obj/chronos.dmi'
|
||||
icon_state = "chronogun"
|
||||
item_state = "chronogun"
|
||||
w_class = 3.0
|
||||
|
||||
var/mob/living/current_target
|
||||
var/last_check = 0
|
||||
var/check_delay = 10 //Check los as often as possible, max resolution is SSobj tick though
|
||||
var/max_range = 8
|
||||
var/active = 0
|
||||
var/datum/beam/current_beam = null
|
||||
var/mounted = 0 //Denotes if this is a handheld or mounted version
|
||||
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
|
||||
/obj/item/weapon/gun/medbeam/New()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/weapon/gun/medbeam/dropped(mob/user)
|
||||
..()
|
||||
LoseTarget()
|
||||
|
||||
/obj/item/weapon/gun/medbeam/equipped(mob/user)
|
||||
..()
|
||||
LoseTarget()
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/LoseTarget()
|
||||
if(active)
|
||||
qdel(current_beam)
|
||||
active = 0
|
||||
on_beam_release(current_target)
|
||||
current_target = null
|
||||
|
||||
/obj/item/weapon/gun/medbeam/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override)
|
||||
if(isliving(user))
|
||||
add_fingerprint(user)
|
||||
|
||||
if(current_target)
|
||||
LoseTarget()
|
||||
if(!isliving(target))
|
||||
return
|
||||
|
||||
current_target = target
|
||||
active = 1
|
||||
current_beam = new(user,current_target,time=6000,beam_icon_state="medbeam",btype=/obj/effect/ebeam/medical)
|
||||
addtimer(current_beam, "Start", 0)
|
||||
|
||||
feedback_add_details("gun_fired","[src.type]")
|
||||
|
||||
/obj/item/weapon/gun/medbeam/process()
|
||||
|
||||
var/source = loc
|
||||
if(!mounted && !ishuman(source))
|
||||
LoseTarget()
|
||||
return
|
||||
|
||||
if(!current_target)
|
||||
LoseTarget()
|
||||
return
|
||||
|
||||
if(world.time <= last_check+check_delay)
|
||||
return
|
||||
|
||||
last_check = world.time
|
||||
|
||||
if(get_dist(source, current_target)>max_range || !los_check(source, current_target))
|
||||
LoseTarget()
|
||||
if(ishuman(source))
|
||||
source << "<span class='warning'>You lose control of the beam!</span>"
|
||||
return
|
||||
|
||||
if(current_target)
|
||||
on_beam_tick(current_target)
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/los_check(atom/movable/user, mob/target)
|
||||
var/turf/user_turf = user.loc
|
||||
if(mounted)
|
||||
user_turf = get_turf(user)
|
||||
else if(!istype(user_turf))
|
||||
return 0
|
||||
var/obj/dummy = new(user_turf)
|
||||
dummy.pass_flags |= PASSTABLE|PASSGLASS|PASSGRILLE //Grille/Glass so it can be used through common windows
|
||||
for(var/turf/turf in getline(user_turf,target))
|
||||
if(mounted && turf == user_turf)
|
||||
continue //Mechs are dense and thus fail the check
|
||||
if(turf.density)
|
||||
qdel(dummy)
|
||||
return 0
|
||||
for(var/atom/movable/AM in turf)
|
||||
if(!AM.CanPass(dummy,turf,1))
|
||||
qdel(dummy)
|
||||
return 0
|
||||
for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams!
|
||||
if(B.owner != current_beam)
|
||||
explosion(B.loc,0,3,5,8)
|
||||
qdel(dummy)
|
||||
return 0
|
||||
qdel(dummy)
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/on_beam_hit(var/mob/living/target)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/on_beam_tick(var/mob/living/target)
|
||||
if(target.health != target.maxHealth)
|
||||
PoolOrNew(/obj/effect/overlay/temp/heal, list(get_turf(target), "#80F5FF"))
|
||||
target.adjustBruteLoss(-4)
|
||||
target.adjustFireLoss(-4)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/medbeam/proc/on_beam_release(var/mob/living/target)
|
||||
return
|
||||
|
||||
/obj/effect/ebeam/medical
|
||||
name = "medical beam"
|
||||
|
||||
//////////////////////////////Mech Version///////////////////////////////
|
||||
/obj/item/weapon/gun/medbeam/mech
|
||||
mounted = 1
|
||||
|
||||
/obj/item/weapon/gun/medbeam/mech/New()
|
||||
..()
|
||||
STOP_PROCESSING(SSobj, src) //Mech mediguns do not process until installed, and are controlled by the holder obj
|
||||
@@ -0,0 +1,28 @@
|
||||
/obj/item/weapon/gun/energy/gun/advtaser/mounted
|
||||
name = "mounted taser"
|
||||
desc = "An arm mounted dual-mode weapon that fires electrodes and disabler shots."
|
||||
icon = 'icons/obj/items_cyborg.dmi'
|
||||
icon_state = "taser"
|
||||
item_state = "armcannonstun4"
|
||||
force = 5
|
||||
selfcharge = 1
|
||||
can_flashlight = 0
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
|
||||
..()
|
||||
src.loc = null//send it to nullspace to get retrieved by the implant later on. gotta cover those edge cases.
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted
|
||||
name = "mounted laser"
|
||||
desc = "An arm mounted cannon that fires lethal lasers."
|
||||
icon = 'icons/obj/items_cyborg.dmi'
|
||||
icon_state = "laser"
|
||||
item_state = "armcannonlase"
|
||||
force = 5
|
||||
selfcharge = 1
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted/dropped()
|
||||
..()
|
||||
src.loc = null
|
||||
@@ -0,0 +1,208 @@
|
||||
/obj/item/weapon/gun/projectile
|
||||
desc = "Now comes in flavors like GUN. Uses 10mm ammo, for some reason"
|
||||
name = "projectile gun"
|
||||
icon_state = "pistol"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
w_class = 3
|
||||
|
||||
var/mag_type = /obj/item/ammo_box/magazine/m10mm //Removes the need for max_ammo and caliber info
|
||||
var/obj/item/ammo_box/magazine/magazine
|
||||
|
||||
/obj/item/weapon/gun/projectile/New()
|
||||
..()
|
||||
if (!magazine)
|
||||
magazine = new mag_type(src)
|
||||
chamber_round()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/projectile/update_icon()
|
||||
..()
|
||||
if(current_skin)
|
||||
icon_state = "[current_skin][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
|
||||
else
|
||||
icon_state = "[initial(icon_state)][suppressed ? "-suppressed" : ""][sawn_state ? "-sawn" : ""]"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/process_chamber(eject_casing = 1, empty_chamber = 1)
|
||||
// if(in_chamber)
|
||||
// return 1
|
||||
var/obj/item/ammo_casing/AC = chambered //Find chambered round
|
||||
if(isnull(AC) || !istype(AC))
|
||||
chamber_round()
|
||||
return
|
||||
if(eject_casing)
|
||||
AC.loc = get_turf(src) //Eject casing onto ground.
|
||||
AC.SpinAnimation(10, 1) //next gen special effects
|
||||
|
||||
if(empty_chamber)
|
||||
chambered = null
|
||||
chamber_round()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/proc/chamber_round()
|
||||
if (chambered || !magazine)
|
||||
return
|
||||
else if (magazine.ammo_count())
|
||||
chambered = magazine.get_round()
|
||||
chambered.loc = src
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/can_shoot()
|
||||
if(!magazine || !magazine.ammo_count(0))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if (istype(A, /obj/item/ammo_box/magazine))
|
||||
var/obj/item/ammo_box/magazine/AM = A
|
||||
if (!magazine && istype(AM, mag_type))
|
||||
user.remove_from_mob(AM)
|
||||
magazine = AM
|
||||
magazine.loc = src
|
||||
user << "<span class='notice'>You load a new magazine into \the [src].</span>"
|
||||
chamber_round()
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
return 1
|
||||
else if (magazine)
|
||||
user << "<span class='notice'>There's already a magazine in \the [src].</span>"
|
||||
if(istype(A, /obj/item/weapon/suppressor))
|
||||
var/obj/item/weapon/suppressor/S = A
|
||||
if(can_suppress)
|
||||
if(!suppressed)
|
||||
if(!user.unEquip(A))
|
||||
return
|
||||
user << "<span class='notice'>You screw [S] onto [src].</span>"
|
||||
suppressed = A
|
||||
S.oldsound = fire_sound
|
||||
S.initial_w_class = w_class
|
||||
fire_sound = 'sound/weapons/Gunshot_silenced.ogg'
|
||||
w_class = 3 //so pistols do not fit in pockets when suppressed
|
||||
A.loc = src
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
user << "<span class='warning'>[src] already has a suppressor!</span>"
|
||||
return
|
||||
else
|
||||
user << "<span class='warning'>You can't seem to figure out how to fit [S] on [src]!</span>"
|
||||
return
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/attack_hand(mob/user)
|
||||
if(loc == user)
|
||||
if(suppressed && can_unsuppress)
|
||||
var/obj/item/weapon/suppressor/S = suppressed
|
||||
if(user.l_hand != src && user.r_hand != src)
|
||||
..()
|
||||
return
|
||||
user << "<span class='notice'>You unscrew [suppressed] from [src].</span>"
|
||||
user.put_in_hands(suppressed)
|
||||
fire_sound = S.oldsound
|
||||
w_class = S.initial_w_class
|
||||
suppressed = 0
|
||||
update_icon()
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/attack_self(mob/living/user)
|
||||
var/obj/item/ammo_casing/AC = chambered //Find chambered round
|
||||
if(magazine)
|
||||
magazine.loc = get_turf(src.loc)
|
||||
user.put_in_hands(magazine)
|
||||
magazine.update_icon()
|
||||
magazine = null
|
||||
user << "<span class='notice'>You pull the magazine out of \the [src].</span>"
|
||||
else if(chambered)
|
||||
AC.loc = get_turf(src)
|
||||
AC.SpinAnimation(10, 1)
|
||||
chambered = null
|
||||
user << "<span class='notice'>You unload the round from \the [src]'s chamber.</span>"
|
||||
else
|
||||
user << "<span class='notice'>There's no magazine in \the [src].</span>"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/examine(mob/user)
|
||||
..()
|
||||
user << "Has [get_ammo()] round\s remaining."
|
||||
|
||||
/obj/item/weapon/gun/projectile/proc/get_ammo(countchambered = 1)
|
||||
var/boolets = 0 //mature var names for mature people
|
||||
if (chambered && countchambered)
|
||||
boolets++
|
||||
if (magazine)
|
||||
boolets += magazine.ammo_count()
|
||||
return boolets
|
||||
|
||||
/obj/item/weapon/gun/projectile/suicide_act(mob/user)
|
||||
if (src.chambered && src.chambered.BB && !src.chambered.BB.nodamage)
|
||||
user.visible_message("<span class='suicide'>[user] is putting the barrel of the [src.name] in \his mouth. It looks like \he's trying to commit suicide.</span>")
|
||||
sleep(25)
|
||||
if(user.l_hand == src || user.r_hand == src)
|
||||
process_fire(user, user, 0, zone_override = "head")
|
||||
user.visible_message("<span class='suicide'>[user] blows \his brains out with the [src.name]!</span>")
|
||||
return(BRUTELOSS)
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] panics and starts choking to death!</span>")
|
||||
return(OXYLOSS)
|
||||
else
|
||||
user.visible_message("<span class='suicide'>[user] is pretending to blow \his brains out with the [src.name]! It looks like \he's trying to commit suicide!</b></span>")
|
||||
playsound(loc, 'sound/weapons/empty.ogg', 50, 1, -1)
|
||||
return (OXYLOSS)
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/proc/sawoff(mob/user)
|
||||
if(sawn_state == SAWN_OFF)
|
||||
user << "<span class='warning'>\The [src] is already shortened!</span>"
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.visible_message("[user] begins to shorten \the [src].", "<span class='notice'>You begin to shorten \the [src]...</span>")
|
||||
|
||||
//if there's any live ammo inside the gun, makes it go off
|
||||
if(blow_up(user))
|
||||
user.visible_message("<span class='danger'>\The [src] goes off!</span>", "<span class='danger'>\The [src] goes off in your face!</span>")
|
||||
return
|
||||
|
||||
if(do_after(user, 30, target = src))
|
||||
if(sawn_state == SAWN_OFF)
|
||||
return
|
||||
user.visible_message("[user] shortens \the [src]!", "<span class='notice'>You shorten \the [src].</span>")
|
||||
name = "sawn-off [src.name]"
|
||||
desc = sawn_desc
|
||||
w_class = 3
|
||||
item_state = "gun"//phil235 is it different with different skin?
|
||||
slot_flags &= ~SLOT_BACK //you can't sling it on your back
|
||||
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
|
||||
sawn_state = SAWN_OFF
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
// Sawing guns related proc
|
||||
/obj/item/weapon/gun/projectile/proc/blow_up(mob/user)
|
||||
. = 0
|
||||
for(var/obj/item/ammo_casing/AC in magazine.stored_ammo)
|
||||
if(AC.BB)
|
||||
process_fire(user, user,0)
|
||||
. = 1
|
||||
|
||||
|
||||
/obj/item/weapon/suppressor
|
||||
name = "suppressor"
|
||||
desc = "A universal syndicate small-arms suppressor for maximum espionage."
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "suppressor"
|
||||
w_class = 2
|
||||
var/oldsound = null
|
||||
var/initial_w_class = null
|
||||
|
||||
|
||||
/obj/item/weapon/suppressor/specialoffer
|
||||
name = "cheap suppressor"
|
||||
desc = "A foreign knock-off suppressor, it feels flimsy, cheap, and brittle. Still fits all weapons."
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "suppressor"
|
||||
|
||||
@@ -0,0 +1,409 @@
|
||||
/obj/item/weapon/gun/projectile/automatic
|
||||
origin_tech = "combat=4;materials=2"
|
||||
w_class = 3
|
||||
var/alarmed = 0
|
||||
var/select = 1
|
||||
can_suppress = 1
|
||||
burst_size = 3
|
||||
fire_delay = 2
|
||||
actions_types = list(/datum/action/item_action/toggle_firemode)
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/proto
|
||||
name = "\improper NanoTrasen Saber SMG"
|
||||
desc = "A prototype three-round burst 9mm submachine gun, designated 'SABR'. Has a threaded barrel for suppressors."
|
||||
icon_state = "saber"
|
||||
mag_type = /obj/item/ammo_box/magazine/smgm9mm
|
||||
pin = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/proto/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
if(!select)
|
||||
add_overlay("[initial(icon_state)]semi")
|
||||
if(select == 1)
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
icon_state = "[initial(icon_state)][magazine ? "-[magazine.max_ammo]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(istype(A, /obj/item/ammo_box/magazine))
|
||||
var/obj/item/ammo_box/magazine/AM = A
|
||||
if(istype(AM, mag_type))
|
||||
if(magazine)
|
||||
user << "<span class='notice'>You perform a tactical reload on \the [src], replacing the magazine.</span>"
|
||||
magazine.loc = get_turf(src.loc)
|
||||
magazine.update_icon()
|
||||
magazine = null
|
||||
else
|
||||
user << "<span class='notice'>You insert the magazine into \the [src].</span>"
|
||||
user.remove_from_mob(AM)
|
||||
magazine = AM
|
||||
magazine.loc = src
|
||||
chamber_round()
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/ui_action_click()
|
||||
burst_select()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/proc/burst_select()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
select = !select
|
||||
if(!select)
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
user << "<span class='notice'>You switch to semi-automatic.</span>"
|
||||
else
|
||||
burst_size = initial(burst_size)
|
||||
fire_delay = initial(fire_delay)
|
||||
user << "<span class='notice'>You switch to [burst_size]-rnd burst.</span>"
|
||||
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
update_icon()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/can_shoot()
|
||||
return get_ammo()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/proc/empty_alarm()
|
||||
if(!chambered && !get_ammo() && !alarmed)
|
||||
playsound(src.loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
|
||||
update_icon()
|
||||
alarmed = 1
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r
|
||||
name = "\improper C-20r SMG"
|
||||
desc = "A bullpup two-round burst .45 SMG, designated 'C-20r'. Has a 'Scarborough Arms - Per falcis, per pravitas' buttstamp."
|
||||
icon_state = "c20r"
|
||||
item_state = "c20r"
|
||||
origin_tech = "combat=5;materials=2;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/smgm45
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
fire_delay = 2
|
||||
burst_size = 2
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/New()
|
||||
..()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/afterattack()
|
||||
..()
|
||||
empty_alarm()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/update_icon()
|
||||
..()
|
||||
icon_state = "c20r[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/wt550
|
||||
name = "security auto rifle"
|
||||
desc = "An outdated personal defence weapon. Uses 4.6x30mm rounds and is designated the WT-550 Automatic Rifle."
|
||||
icon_state = "wt550"
|
||||
item_state = "arg"
|
||||
mag_type = /obj/item/ammo_box/magazine/wt550m9
|
||||
fire_delay = 2
|
||||
can_suppress = 0
|
||||
burst_size = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/wt550/update_icon()
|
||||
..()
|
||||
icon_state = "wt550[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/mini_uzi
|
||||
name = "\improper 'Type U3' Uzi"
|
||||
desc = "A lightweight, burst-fire submachine gun, for when you really want someone dead. Uses 9mm rounds."
|
||||
icon_state = "mini-uzi"
|
||||
origin_tech = "combat=4;materials=2;syndicate=4"
|
||||
mag_type = /obj/item/ammo_box/magazine/uzim9mm
|
||||
burst_size = 2
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/m90
|
||||
name = "\improper M-90gl Carbine"
|
||||
desc = "A three-round burst 5.56 toploading carbine, designated 'M-90gl'. Has an attached underbarrel grenade launcher which can be toggled on and off."
|
||||
icon_state = "m90"
|
||||
item_state = "m90"
|
||||
origin_tech = "combat=5;materials=2;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
var/obj/item/weapon/gun/projectile/revolver/grenadelauncher/underbarrel
|
||||
burst_size = 3
|
||||
fire_delay = 2
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/New()
|
||||
..()
|
||||
underbarrel = new /obj/item/weapon/gun/projectile/revolver/grenadelauncher(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/unrestricted/New()
|
||||
..()
|
||||
underbarrel = new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/unrestricted(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(select == 2)
|
||||
underbarrel.afterattack(target, user, flag, params)
|
||||
else
|
||||
..()
|
||||
return
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/attackby(obj/item/A, mob/user, params)
|
||||
if(istype(A, /obj/item/ammo_casing))
|
||||
if(istype(A, underbarrel.magazine.ammo_type))
|
||||
underbarrel.attack_self()
|
||||
underbarrel.attackby(A, user, params)
|
||||
else
|
||||
..()
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
switch(select)
|
||||
if(0)
|
||||
add_overlay("[initial(icon_state)]semi")
|
||||
if(1)
|
||||
add_overlay("[initial(icon_state)]burst")
|
||||
if(2)
|
||||
add_overlay("[initial(icon_state)]gren")
|
||||
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
|
||||
return
|
||||
/obj/item/weapon/gun/projectile/automatic/m90/burst_select()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
switch(select)
|
||||
if(0)
|
||||
select = 1
|
||||
burst_size = initial(burst_size)
|
||||
fire_delay = initial(fire_delay)
|
||||
user << "<span class='notice'>You switch to [burst_size]-rnd burst.</span>"
|
||||
if(1)
|
||||
select = 2
|
||||
user << "<span class='notice'>You switch to grenades.</span>"
|
||||
if(2)
|
||||
select = 0
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
user << "<span class='notice'>You switch to semi-auto.</span>"
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/tommygun
|
||||
name = "\improper Thompson SMG"
|
||||
desc = "Based on the classic 'Chicago Typewriter'."
|
||||
icon_state = "tommygun"
|
||||
item_state = "shotgun"
|
||||
w_class = 5
|
||||
slot_flags = 0
|
||||
origin_tech = "combat=5;materials=1;syndicate=3"
|
||||
mag_type = /obj/item/ammo_box/magazine/tommygunm45
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 4
|
||||
fire_delay = 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/ar
|
||||
name = "\improper NT-ARG 'Boarder'"
|
||||
desc = "A robust assault rile used by Nanotrasen fighting forces."
|
||||
icon_state = "arg"
|
||||
item_state = "arg"
|
||||
slot_flags = 0
|
||||
origin_tech = "combat=6;engineering=4"
|
||||
mag_type = /obj/item/ammo_box/magazine/m556
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 3
|
||||
fire_delay = 1
|
||||
|
||||
|
||||
|
||||
// Bulldog shotgun //
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog
|
||||
name = "\improper 'Bulldog' Shotgun"
|
||||
desc = "A semi-auto, mag-fed shotgun for combat in narrow corridors, nicknamed 'Bulldog' by boarding parties. Compatible only with specialized 8-round drum magazines."
|
||||
icon_state = "bulldog"
|
||||
item_state = "bulldog"
|
||||
w_class = 3
|
||||
origin_tech = "combat=6;materials=4;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/m12g
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/New()
|
||||
..()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/proc/update_magazine()
|
||||
if(magazine)
|
||||
src.overlays = 0
|
||||
add_overlay("[magazine.icon_state]")
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/update_icon()
|
||||
src.overlays = 0
|
||||
update_magazine()
|
||||
icon_state = "bulldog[chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/afterattack()
|
||||
..()
|
||||
empty_alarm()
|
||||
return
|
||||
|
||||
|
||||
|
||||
// L6 SAW //
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw
|
||||
name = "\improper L6 SAW"
|
||||
desc = "A heavily modified 5.56x45mm light machine gun, designated 'L6 SAW'. Has 'Aussec Armoury - 2531' engraved on the receiver below the designation."
|
||||
icon_state = "l6closed100"
|
||||
item_state = "l6closedmag"
|
||||
w_class = 5
|
||||
slot_flags = 0
|
||||
origin_tech = "combat=6;engineering=3;syndicate=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/mm556x45
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
var/cover_open = 0
|
||||
can_suppress = 0
|
||||
burst_size = 3
|
||||
fire_delay = 1
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_self(mob/user)
|
||||
cover_open = !cover_open
|
||||
user << "<span class='notice'>You [cover_open ? "open" : "close"] [src]'s cover.</span>"
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/update_icon()
|
||||
icon_state = "l6[cover_open ? "open" : "closed"][magazine ? Ceiling(get_ammo(0)/12.5)*25 : "-empty"][suppressed ? "-suppressed" : ""]"
|
||||
item_state = "l6[cover_open ? "openmag" : "closedmag"]"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params) //what I tried to do here is just add a check to see if the cover is open or not and add an icon_state change because I can't figure out how c-20rs do it with overlays
|
||||
if(cover_open)
|
||||
user << "<span class='warning'>[src]'s cover is open! Close it before firing!</span>"
|
||||
else
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_hand(mob/user)
|
||||
if(loc != user)
|
||||
..()
|
||||
return //let them pick it up
|
||||
if(!cover_open || (cover_open && !magazine))
|
||||
..()
|
||||
else if(cover_open && magazine)
|
||||
//drop the mag
|
||||
magazine.update_icon()
|
||||
magazine.loc = get_turf(src.loc)
|
||||
user.put_in_hands(magazine)
|
||||
magazine = null
|
||||
update_icon()
|
||||
user << "<span class='notice'>You remove the magazine from [src].</span>"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(!cover_open)
|
||||
user << "<span class='warning'>[src]'s cover is closed! You can't insert a new mag.</span>"
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
|
||||
// SNIPER //
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/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 = "sniper"
|
||||
item_state = "sniper"
|
||||
recoil = 2
|
||||
weapon_weight = WEAPON_MEDIUM
|
||||
mag_type = /obj/item/ammo_box/magazine/sniper_rounds
|
||||
fire_delay = 40
|
||||
burst_size = 1
|
||||
origin_tech = "combat=7"
|
||||
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.
|
||||
slot_flags = SLOT_BACK
|
||||
actions_types = list()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/sniper_rifle/update_icon()
|
||||
if(magazine)
|
||||
icon_state = "sniper-mag"
|
||||
else
|
||||
icon_state = "sniper"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/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=7;syndicate=6"
|
||||
|
||||
|
||||
|
||||
|
||||
// Laser rifle (rechargeable magazine) //
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/laser
|
||||
name = "laser rifle"
|
||||
desc = "Though sometimes mocked for the relatively weak firepower of their energy weapons, the logistic miracle of rechargable ammunition has given Nanotrasen a decisive edge over many a foe."
|
||||
icon_state = "oldrifle"
|
||||
item_state = "arg"
|
||||
mag_type = /obj/item/ammo_box/magazine/recharge
|
||||
fire_delay = 2
|
||||
can_suppress = 0
|
||||
burst_size = 0
|
||||
actions_types = list()
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/laser/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..() //we changed the default value of the first argument
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/laser/update_icon()
|
||||
..()
|
||||
icon_state = "oldrifle[magazine ? "-[Ceiling(get_ammo(0)/4)*4]" : ""]"
|
||||
return
|
||||
@@ -0,0 +1,153 @@
|
||||
|
||||
|
||||
//The ammo/gun is stored in a back slot item
|
||||
/obj/item/weapon/minigunpack
|
||||
name = "backpack power source"
|
||||
desc = "The massive external power source for the laser gatling gun"
|
||||
icon = 'icons/obj/guns/minigun.dmi'
|
||||
icon_state = "holstered"
|
||||
item_state = "backpack"
|
||||
slot_flags = SLOT_BACK
|
||||
w_class = 5
|
||||
var/obj/item/weapon/gun/projectile/minigun/gun = null
|
||||
var/armed = 0 //whether the gun is attached, 0 is attached, 1 is the gun is wielded.
|
||||
var/overheat = 0
|
||||
var/overheat_max = 40
|
||||
var/heat_diffusion = 1
|
||||
|
||||
/obj/item/weapon/minigunpack/New()
|
||||
gun = new(src)
|
||||
START_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/minigunpack/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/minigunpack/process()
|
||||
overheat = max(0, overheat - heat_diffusion)
|
||||
|
||||
/obj/item/weapon/minigunpack/attack_hand(var/mob/living/carbon/user)
|
||||
if(src.loc == user)
|
||||
if(!armed)
|
||||
if(user.get_item_by_slot(slot_back) == src)
|
||||
armed = 1
|
||||
if(!user.put_in_hands(gun))
|
||||
armed = 0
|
||||
user << "<span class='warning'>You need a free hand to hold the gun!</span>"
|
||||
return
|
||||
update_icon()
|
||||
gun.forceMove(user)
|
||||
user.update_inv_back()
|
||||
else
|
||||
user << "<span class='warning'>You are already holding the gun!</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/minigunpack/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W == gun) //Don't need armed check, because if you have the gun assume its armed.
|
||||
user.unEquip(gun,1)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/minigunpack/dropped(mob/user)
|
||||
if(armed)
|
||||
user.unEquip(gun,1)
|
||||
|
||||
/obj/item/weapon/minigunpack/MouseDrop(atom/over_object)
|
||||
if(armed)
|
||||
return
|
||||
if(iscarbon(usr))
|
||||
var/mob/M = usr
|
||||
|
||||
if(!over_object)
|
||||
return
|
||||
|
||||
if(!M.restrained() && !M.stat)
|
||||
|
||||
if(istype(over_object, /obj/screen/inventory/hand))
|
||||
var/obj/screen/inventory/hand/H = over_object
|
||||
if(!M.unEquip(src))
|
||||
return
|
||||
switch(H.slot_id)
|
||||
if(slot_r_hand)
|
||||
M.put_in_r_hand(src)
|
||||
if(slot_l_hand)
|
||||
M.put_in_l_hand(src)
|
||||
|
||||
|
||||
/obj/item/weapon/minigunpack/update_icon()
|
||||
if(armed)
|
||||
icon_state = "notholstered"
|
||||
else
|
||||
icon_state = "holstered"
|
||||
|
||||
/obj/item/weapon/minigunpack/proc/attach_gun(var/mob/user)
|
||||
if(!gun)
|
||||
gun = new(src)
|
||||
gun.forceMove(src)
|
||||
armed = 0
|
||||
if(user)
|
||||
user << "<span class='notice'>You attach the [gun.name] to the [name].</span>"
|
||||
else
|
||||
src.visible_message("<span class='warning'>The [gun.name] snaps back onto the [name]!</span>")
|
||||
update_icon()
|
||||
user.update_inv_back()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun
|
||||
name = "laser gatling gun"
|
||||
desc = "An advanced laser cannon with an incredible rate of fire. Requires a bulky backpack power source to use."
|
||||
icon = 'icons/obj/guns/minigun.dmi'
|
||||
icon_state = "minigun_spin"
|
||||
item_state = "minigun"
|
||||
origin_tech = "combat=6;powerstorage=5;magnets=4"
|
||||
flags = CONDUCT | HANDSLOW
|
||||
slowdown = 1
|
||||
slot_flags = null
|
||||
w_class = 5
|
||||
materials = list()
|
||||
burst_size = 3
|
||||
automatic = 0
|
||||
fire_delay = 1
|
||||
weapon_weight = WEAPON_HEAVY
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/minigun
|
||||
var/obj/item/weapon/minigunpack/ammo_pack
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/attack_self(mob/living/user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/dropped(mob/user)
|
||||
if(ammo_pack)
|
||||
ammo_pack.attach_gun(user)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
if(ammo_pack)
|
||||
if(ammo_pack.overheat < ammo_pack.overheat_max)
|
||||
. = ..()
|
||||
ammo_pack.overheat++
|
||||
else
|
||||
user << "The gun's heat sensor locked the trigger to prevent lens damage."
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/afterattack(atom/target, mob/living/user, flag, params)
|
||||
if(!ammo_pack || ammo_pack.loc != user)
|
||||
user << "You need the backpack power source to fire the gun!"
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/New()
|
||||
if(!ammo_pack)
|
||||
if(istype(loc,/obj/item/weapon/minigunpack)) //We should spawn inside a ammo pack so let's use that one.
|
||||
ammo_pack = loc
|
||||
else
|
||||
qdel(src)//No pack, no gun
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/dropped(mob/living/user)
|
||||
ammo_pack.attach_gun(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/minigun/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
//KEEP IN MIND: These are different from gun/grenadelauncher. These are designed to shoot premade rocket and grenade projectiles, not flashbangs or chemistry casings etc.
|
||||
//Put handheld rocket launchers here if someone ever decides to make something so hilarious ~Paprika
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/grenadelauncher//this is only used for underbarrel grenade launchers at the moment, but admins can still spawn it if they feel like being assholes
|
||||
desc = "A break-operated grenade launcher."
|
||||
name = "grenade launcher"
|
||||
icon_state = "dshotgun-sawn"
|
||||
item_state = "gun"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/grenadelauncher
|
||||
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
||||
w_class = 3
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
|
||||
chamber_round()
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg
|
||||
desc = "A 6-shot grenade launcher."
|
||||
name = "multi grenade launcher"
|
||||
icon = 'icons/mecha/mecha_equipment.dmi'
|
||||
icon_state = "mecha_grenadelnchr"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/grenademulti
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/gyropistol
|
||||
name = "gyrojet pistol"
|
||||
desc = "A prototype pistol designed to fire self propelled rockets."
|
||||
icon_state = "gyropistol"
|
||||
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
||||
origin_tech = "combat=5"
|
||||
mag_type = /obj/item/ammo_box/magazine/m75
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/gyropistol/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/gyropistol/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][magazine ? "loaded" : ""]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/speargun
|
||||
name = "kinetic speargun"
|
||||
desc = "A weapon favored by carp hunters. Fires specialized spears using kinetic energy."
|
||||
icon_state = "speargun"
|
||||
item_state = "speargun"
|
||||
w_class = 4
|
||||
origin_tech = "combat=4;engineering=4"
|
||||
force = 10
|
||||
can_suppress = 0
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/speargun
|
||||
fire_sound = 'sound/weapons/grenadelaunch.ogg'
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
select = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/speargun/update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/speargun/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/speargun/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/speargun/attackby(obj/item/A, mob/user, params)
|
||||
var/num_loaded = magazine.attackby(A, user, params, 1)
|
||||
if(num_loaded)
|
||||
user << "<span class='notice'>You load [num_loaded] spear\s into \the [src].</span>"
|
||||
update_icon()
|
||||
chamber_round()
|
||||
@@ -0,0 +1,58 @@
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol
|
||||
name = "stechkin pistol"
|
||||
desc = "A small, easily concealable 10mm handgun. Has a threaded barrel for suppressors."
|
||||
icon_state = "pistol"
|
||||
w_class = 2
|
||||
origin_tech = "combat=3;materials=2;syndicate=4"
|
||||
mag_type = /obj/item/ammo_box/magazine/m10mm
|
||||
can_suppress = 1
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"][suppressed ? "-suppressed" : ""]"
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/m1911
|
||||
name = "\improper M1911"
|
||||
desc = "A classic .45 handgun with a small magazine capacity."
|
||||
icon_state = "m1911"
|
||||
w_class = 3
|
||||
mag_type = /obj/item/ammo_box/magazine/m45
|
||||
can_suppress = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/deagle
|
||||
name = "desert eagle"
|
||||
desc = "A robust .50 AE handgun."
|
||||
icon_state = "deagle"
|
||||
force = 14
|
||||
mag_type = /obj/item/ammo_box/magazine/m50
|
||||
can_suppress = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][magazine ? "" : "-e"]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/gold
|
||||
desc = "A gold plated desert eagle folded over a million times by superior martian gunsmiths. Uses .50 AE ammo."
|
||||
icon_state = "deagleg"
|
||||
item_state = "deagleg"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/deagle/camo
|
||||
desc = "A Deagle brand Deagle for operators operating operationally. Uses .50 AE ammo."
|
||||
icon_state = "deaglecamo"
|
||||
item_state = "deagleg"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/APS
|
||||
name = "stechkin APS pistol"
|
||||
desc = "The original russian version of a widely used Syndicate sidearm. Uses 9mm ammo."
|
||||
icon_state = "aps"
|
||||
w_class = 3
|
||||
origin_tech = "combat=3;materials=2;syndicate=3"
|
||||
mag_type = /obj/item/ammo_box/magazine/pistolm9mm
|
||||
can_suppress = 0
|
||||
burst_size = 3
|
||||
fire_delay = 2
|
||||
actions_types = list(/datum/action/item_action/toggle_firemode)
|
||||
@@ -0,0 +1,373 @@
|
||||
/obj/item/weapon/gun/projectile/revolver
|
||||
name = "\improper .357 revolver"
|
||||
desc = "A suspicious revolver. Uses .357 ammo." //usually used by syndicates
|
||||
icon_state = "revolver"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder
|
||||
origin_tech = "combat=3;materials=2"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/New()
|
||||
..()
|
||||
if(!istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder))
|
||||
verbs -= /obj/item/weapon/gun/projectile/revolver/verb/spin
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/chamber_round(var/spin = 1)
|
||||
if(spin)
|
||||
chambered = magazine.get_round(1)
|
||||
else
|
||||
chambered = magazine.stored_ammo[1]
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
..()
|
||||
chamber_round(1)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/process_chamber()
|
||||
return ..(0, 1)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
var/num_loaded = magazine.attackby(A, user, params, 1)
|
||||
if(num_loaded)
|
||||
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src].</span>"
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
chamber_round(0)
|
||||
|
||||
if(unique_rename)
|
||||
if(istype(A, /obj/item/weapon/pen))
|
||||
rename_gun(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/attack_self(mob/living/user)
|
||||
var/num_unloaded = 0
|
||||
chambered = null
|
||||
while (get_ammo() > 0)
|
||||
var/obj/item/ammo_casing/CB
|
||||
CB = magazine.get_round(0)
|
||||
if(CB)
|
||||
CB.loc = get_turf(src.loc)
|
||||
CB.SpinAnimation(10, 1)
|
||||
CB.update_icon()
|
||||
num_unloaded++
|
||||
if (num_unloaded)
|
||||
user << "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>"
|
||||
else
|
||||
user << "<span class='warning'>[src] is empty!</span>"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/verb/spin()
|
||||
set name = "Spin Chamber"
|
||||
set category = "Object"
|
||||
set desc = "Click to spin your revolver's chamber."
|
||||
|
||||
var/mob/M = usr
|
||||
|
||||
if(M.stat || !in_range(M,src))
|
||||
return
|
||||
|
||||
if(istype(magazine, /obj/item/ammo_box/magazine/internal/cylinder))
|
||||
var/obj/item/ammo_box/magazine/internal/cylinder/C = magazine
|
||||
C.spin()
|
||||
chamber_round(0)
|
||||
usr.visible_message("[usr] spins [src]'s chamber.", "<span class='notice'>You spin [src]'s chamber.</span>")
|
||||
else
|
||||
verbs -= /obj/item/weapon/gun/projectile/revolver/verb/spin
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/can_shoot()
|
||||
return get_ammo(0,0)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/get_ammo(countchambered = 0, countempties = 1)
|
||||
var/boolets = 0 //mature var names for mature people
|
||||
if (chambered && countchambered)
|
||||
boolets++
|
||||
if (magazine)
|
||||
boolets += magazine.ammo_count(countempties)
|
||||
return boolets
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/examine(mob/user)
|
||||
..()
|
||||
user << "[get_ammo(0,0)] of those are live rounds."
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/detective
|
||||
name = "\improper .38 Mars Special"
|
||||
desc = "A cheap Martian knock-off of a classic law enforcement firearm. Uses .38-special rounds."
|
||||
icon_state = "detective"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38
|
||||
unique_rename = 1
|
||||
unique_reskin = 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/detective/New()
|
||||
..()
|
||||
options["Default"] = "detective"
|
||||
options["Leopard Spots"] = "detective_leopard"
|
||||
options["Black Panther"] = "detective_panther"
|
||||
options["Gold Trim"] = "detective_gold"
|
||||
options["The Peacemaker"] = "detective_peacemaker"
|
||||
options["Cancel"] = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/detective/process_fire(atom/target as mob|obj|turf, mob/living/user as mob|obj, message = 1, params, zone_override = "")
|
||||
if(magazine.caliber != initial(magazine.caliber))
|
||||
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user << "<span class='userdanger'>[src] blows up in your face!</span>"
|
||||
user.take_organ_damage(0,20)
|
||||
user.unEquip(src)
|
||||
return 0
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/detective/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/weapon/screwdriver))
|
||||
if(magazine.caliber == "38")
|
||||
user << "<span class='notice'>You begin to reinforce the barrel of [src]...</span>"
|
||||
if(magazine.ammo_count())
|
||||
afterattack(user, user) //you know the drill
|
||||
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
|
||||
return
|
||||
if(do_after(user, 30/A.toolspeed, target = src))
|
||||
if(magazine.ammo_count())
|
||||
user << "<span class='warning'>You can't modify it!</span>"
|
||||
return
|
||||
magazine.caliber = "357"
|
||||
desc = "The barrel and chamber assembly seems to have been modified."
|
||||
user << "<span class='notice'>You reinforce the barrel of [src]. Now it will fire .357 rounds.</span>"
|
||||
else
|
||||
user << "<span class='notice'>You begin to revert the modifications to [src]...</span>"
|
||||
if(magazine.ammo_count())
|
||||
afterattack(user, user) //and again
|
||||
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='userdanger'>[src] goes off in your face!</span>")
|
||||
return
|
||||
if(do_after(user, 30/A.toolspeed, target = src))
|
||||
if(magazine.ammo_count())
|
||||
user << "<span class='warning'>You can't modify it!</span>"
|
||||
return
|
||||
magazine.caliber = "38"
|
||||
desc = initial(desc)
|
||||
user << "<span class='notice'>You remove the modifications on [src]. Now it will fire .38 rounds.</span>"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/mateba
|
||||
name = "\improper Unica 6 auto-revolver"
|
||||
desc = "A retro high-powered autorevolver typically used by officers of the New Russia military. Uses .357 ammo."
|
||||
icon_state = "mateba"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/golden
|
||||
name = "\improper Golden revolver"
|
||||
desc = "This ain't no game, ain't never been no show, And I'll gladly gun down the oldest lady you know. Uses .357 ammo."
|
||||
icon_state = "goldrevolver"
|
||||
fire_sound = 'sound/weapons/resonator_blast.ogg'
|
||||
recoil = 8
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/nagant
|
||||
name = "nagant revolver"
|
||||
desc = "An old model of revolver that originated in Russia. Able to be suppressed. Uses 7.62x38mmR ammo."
|
||||
icon_state = "nagant"
|
||||
origin_tech = "combat=3"
|
||||
can_suppress = 1
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev762
|
||||
|
||||
|
||||
// A gun to play Russian Roulette!
|
||||
// You can spin the chamber to randomize the position of the bullet.
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian
|
||||
name = "\improper russian revolver"
|
||||
desc = "A Russian-made revolver for drinking games. Uses .357 ammo, and has a mechanism requiring you to spin the chamber before each trigger pull."
|
||||
origin_tech = "combat=2;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/rus357
|
||||
var/spun = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/New()
|
||||
..()
|
||||
Spin()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/proc/Spin()
|
||||
chambered = null
|
||||
var/random = rand(1, magazine.max_ammo)
|
||||
if(random <= get_ammo(0,0))
|
||||
chamber_round()
|
||||
spun = 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/attackby(obj/item/A, mob/user, params)
|
||||
var/num_loaded = ..()
|
||||
if(num_loaded)
|
||||
user.visible_message("[user] loads a single bullet into the revolver and spins the chamber.", "<span class='notice'>You load a single bullet into the chamber and spin it.</span>")
|
||||
else
|
||||
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
|
||||
if(get_ammo() > 0)
|
||||
Spin()
|
||||
update_icon()
|
||||
A.update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/attack_self(mob/user)
|
||||
if(!spun && can_shoot())
|
||||
user.visible_message("[user] spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>")
|
||||
Spin()
|
||||
else
|
||||
var/num_unloaded = 0
|
||||
while (get_ammo() > 0)
|
||||
var/obj/item/ammo_casing/CB
|
||||
CB = magazine.get_round()
|
||||
chambered = null
|
||||
CB.loc = get_turf(src.loc)
|
||||
CB.update_icon()
|
||||
num_unloaded++
|
||||
if (num_unloaded)
|
||||
user << "<span class='notice'>You unload [num_unloaded] shell\s from [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] is empty.</span>"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)
|
||||
if(flag)
|
||||
if(!(target in user.contents) && ismob(target))
|
||||
if(user.a_intent == "harm") // Flogging action
|
||||
return
|
||||
|
||||
if(isliving(user))
|
||||
if(!can_trigger_gun(user))
|
||||
return
|
||||
if(target != user)
|
||||
if(ismob(target))
|
||||
user << "<span class='warning'>A mechanism prevents you from shooting anyone but yourself!</span>"
|
||||
return
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!spun)
|
||||
user << "<span class='warning'>You need to spin the revolver's chamber first!</span>"
|
||||
return
|
||||
|
||||
spun = 0
|
||||
|
||||
if(chambered)
|
||||
var/obj/item/ammo_casing/AC = chambered
|
||||
if(AC.fire(user, user))
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
var/zone = check_zone(user.zone_selected)
|
||||
var/obj/item/bodypart/affecting = H.get_bodypart(zone)
|
||||
if(zone == "head" || zone == "eyes" || zone == "mouth")
|
||||
shoot_self(user, affecting)
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user.name] cowardly fires [src] at \his [affecting.name]!</span>", "<span class='userdanger'>You cowardly fire [src] at your [affecting.name]!</span>", "<span class='italics'>You hear a gunshot!</span>")
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>*click*</span>")
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head")
|
||||
user.apply_damage(300, BRUTE, affecting)
|
||||
user.visible_message("<span class='danger'>[user.name] fires [src] at \his head!</span>", "<span class='userdanger'>You fire [src] at your head!</span>", "<span class='italics'>You hear a gunshot!</span>")
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/soul
|
||||
name = "cursed russian revolver"
|
||||
desc = "To play with this revolver requires wagering your very soul."
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/russian/soul/shoot_self(mob/living/user)
|
||||
..()
|
||||
var/obj/item/device/soulstone/anybody/SS = new /obj/item/device/soulstone/anybody(get_turf(src))
|
||||
if(!SS.transfer_soul("FORCE", user)) //Something went wrong
|
||||
qdel(SS)
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfiet!</span>")
|
||||
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
// DOUBLE BARRELED SHOTGUN //
|
||||
/////////////////////////////
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel
|
||||
name = "double-barreled shotgun"
|
||||
desc = "A true classic."
|
||||
icon_state = "dshotgun"
|
||||
item_state = "shotgun"
|
||||
w_class = 4
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/dual
|
||||
sawn_desc = "Omar's coming!"
|
||||
unique_rename = 1
|
||||
unique_reskin = 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/New()
|
||||
..()
|
||||
options["Default"] = "dshotgun"
|
||||
options["Dark Red Finish"] = "dshotgun-d"
|
||||
options["Ash"] = "dshotgun-f"
|
||||
options["Faded Grey"] = "dshotgun-g"
|
||||
options["Maple"] = "dshotgun-l"
|
||||
options["Rosewood"] = "dshotgun-p"
|
||||
options["Cancel"] = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/ammo_box) || istype(A, /obj/item/ammo_casing))
|
||||
chamber_round()
|
||||
if(istype(A, /obj/item/weapon/melee/energy))
|
||||
var/obj/item/weapon/melee/energy/W = A
|
||||
if(W.active)
|
||||
sawoff(user)
|
||||
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
|
||||
sawoff(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/attack_self(mob/living/user)
|
||||
var/num_unloaded = 0
|
||||
while (get_ammo() > 0)
|
||||
var/obj/item/ammo_casing/CB
|
||||
CB = magazine.get_round(0)
|
||||
chambered = null
|
||||
CB.loc = get_turf(src.loc)
|
||||
CB.update_icon()
|
||||
num_unloaded++
|
||||
if (num_unloaded)
|
||||
user << "<span class='notice'>You break open \the [src] and unload [num_unloaded] shell\s.</span>"
|
||||
else
|
||||
user << "<span class='warning'>[src] is empty!</span>"
|
||||
|
||||
|
||||
|
||||
|
||||
// IMPROVISED SHOTGUN //
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
|
||||
name = "improvised shotgun"
|
||||
desc = "Essentially a tube that aims shotgun shells."
|
||||
icon_state = "ishotgun"
|
||||
item_state = "shotgun"
|
||||
w_class = 4
|
||||
force = 10
|
||||
slot_flags = null
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/improvised
|
||||
sawn_desc = "I'm just here for the gasoline."
|
||||
unique_rename = 0
|
||||
unique_reskin = 0
|
||||
var/slung = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/stack/cable_coil) && !sawn_state)
|
||||
var/obj/item/stack/cable_coil/C = A
|
||||
if(C.use(10))
|
||||
slot_flags = SLOT_BACK
|
||||
user << "<span class='notice'>You tie the lengths of cable to the shotgun, making a sling.</span>"
|
||||
slung = 1
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='warning'>You need at least ten lengths of cable if you want to make a sling!</span>"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/update_icon()
|
||||
..()
|
||||
if(slung)
|
||||
icon_state += "sling"
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/sawoff(mob/user)
|
||||
. = ..()
|
||||
if(. && slung) //sawing off the gun removes the sling
|
||||
new /obj/item/stack/cable_coil(get_turf(src), 10)
|
||||
slung = 0
|
||||
update_icon()
|
||||
@@ -0,0 +1,212 @@
|
||||
/obj/item/weapon/gun/projectile/shotgun
|
||||
name = "shotgun"
|
||||
desc = "A traditional shotgun with wood furniture and a four-shell capacity underneath."
|
||||
icon_state = "shotgun"
|
||||
item_state = "shotgun"
|
||||
w_class = 4
|
||||
force = 10
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
origin_tech = "combat=4;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot
|
||||
var/recentpump = 0 // to prevent spammage
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/attackby(obj/item/A, mob/user, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
var/num_loaded = magazine.attackby(A, user, params, 1)
|
||||
if(num_loaded)
|
||||
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/process_chamber()
|
||||
return ..(0, 0)
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/chamber_round()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/can_shoot()
|
||||
if(!chambered)
|
||||
return 0
|
||||
return (chambered.BB ? 1 : 0)
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/attack_self(mob/living/user)
|
||||
if(recentpump)
|
||||
return
|
||||
pump(user)
|
||||
recentpump = 1
|
||||
spawn(10)
|
||||
recentpump = 0
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/blow_up(mob/user)
|
||||
. = 0
|
||||
if(chambered && chambered.BB)
|
||||
process_fire(user, user,0)
|
||||
. = 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/proc/pump(mob/M)
|
||||
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
|
||||
pump_unload(M)
|
||||
pump_reload(M)
|
||||
update_icon() //I.E. fix the desc
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/proc/pump_unload(mob/M)
|
||||
if(chambered)//We have a shell in the chamber
|
||||
chambered.loc = get_turf(src)//Eject casing
|
||||
chambered.SpinAnimation(5, 1)
|
||||
chambered = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/proc/pump_reload(mob/M)
|
||||
if(!magazine.ammo_count())
|
||||
return 0
|
||||
var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing.
|
||||
chambered = AC
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/examine(mob/user)
|
||||
..()
|
||||
if (chambered)
|
||||
user << "A [chambered.BB ? "live" : "spent"] one is in the chamber."
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/lethal
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/lethal
|
||||
|
||||
// RIOT SHOTGUN //
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/riot //for spawn in the armory
|
||||
name = "riot shotgun"
|
||||
desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control."
|
||||
icon_state = "riotshotgun"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/riot
|
||||
sawn_desc = "Come with me if you want to live."
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/riot/attackby(obj/item/A, mob/user, params)
|
||||
..()
|
||||
if(istype(A, /obj/item/weapon/circular_saw) || istype(A, /obj/item/weapon/gun/energy/plasmacutter))
|
||||
sawoff(user)
|
||||
if(istype(A, /obj/item/weapon/melee/energy))
|
||||
var/obj/item/weapon/melee/energy/W = A
|
||||
if(W.active)
|
||||
sawoff(user)
|
||||
|
||||
///////////////////////
|
||||
// BOLT ACTION RIFLE //
|
||||
///////////////////////
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction
|
||||
name = "\improper Mosin Nagant"
|
||||
desc = "This piece of junk looks like something that could have been used 700 years ago. It feels slightly moist."
|
||||
icon_state = "moistnugget"
|
||||
item_state = "moistnugget"
|
||||
slot_flags = 0 //no SLOT_BACK sprite, alas
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/boltaction
|
||||
var/bolt_open = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/pump(mob/M)
|
||||
playsound(M, 'sound/weapons/shotgunpump.ogg', 60, 1)
|
||||
if(bolt_open)
|
||||
pump_reload(M)
|
||||
else
|
||||
pump_unload(M)
|
||||
bolt_open = !bolt_open
|
||||
update_icon() //I.E. fix the desc
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/attackby(obj/item/A, mob/user, params)
|
||||
if(!bolt_open)
|
||||
user << "<span class='notice'>The bolt is closed!</span>"
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/examine(mob/user)
|
||||
..()
|
||||
user << "The bolt is [bolt_open ? "open" : "closed"]."
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted
|
||||
name = "enchanted bolt action rifle"
|
||||
desc = "Careful not to lose your head."
|
||||
var/guns_left = 30
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/boltaction/enchanted
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/New()
|
||||
..()
|
||||
bolt_open = 1
|
||||
pump()
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/dropped()
|
||||
..()
|
||||
guns_left = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
..()
|
||||
if(guns_left)
|
||||
var/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/GUN = new
|
||||
GUN.guns_left = src.guns_left - 1
|
||||
user.drop_item()
|
||||
user.swap_hand()
|
||||
user.put_in_hands(GUN)
|
||||
else
|
||||
user.drop_item()
|
||||
src.throw_at_fast(pick(oview(7,get_turf(user))),1,1)
|
||||
user.visible_message("<span class='warning'>[user] tosses aside the spent rifle!</span>")
|
||||
|
||||
// Automatic Shotguns//
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/shoot_live_shot(mob/living/user as mob|obj)
|
||||
..()
|
||||
src.pump(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/combat
|
||||
name = "combat shotgun"
|
||||
desc = "A semi automatic shotgun with tactical furniture and a six-shell capacity underneath."
|
||||
icon_state = "cshotgun"
|
||||
origin_tech = "combat=6"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/com
|
||||
w_class = 5
|
||||
|
||||
//Dual Feed Shotgun
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube
|
||||
name = "cycler shotgun"
|
||||
desc = "An advanced shotgun with two separate magazine tubes, allowing you to quickly toggle between ammo types."
|
||||
icon_state = "cycler"
|
||||
origin_tech = "combat=4;materials=2"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/tube
|
||||
w_class = 5
|
||||
var/toggled = 0
|
||||
var/obj/item/ammo_box/magazine/internal/shot/alternate_magazine
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/New()
|
||||
..()
|
||||
if (!alternate_magazine)
|
||||
alternate_magazine = new mag_type(src)
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/attack_self(mob/living/user)
|
||||
if(!chambered && magazine.contents.len)
|
||||
pump()
|
||||
else
|
||||
toggle_tube(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/proc/toggle_tube(mob/living/user)
|
||||
var/current_mag = magazine
|
||||
var/alt_mag = alternate_magazine
|
||||
magazine = alt_mag
|
||||
alternate_magazine = current_mag
|
||||
toggled = !toggled
|
||||
if(toggled)
|
||||
user << "You switch to tube B."
|
||||
else
|
||||
user << "You switch to tube A."
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/automatic/dual_tube/AltClick(mob/living/user)
|
||||
if(user.incapacitated() || !Adjacent(user) || !istype(user))
|
||||
return
|
||||
pump()
|
||||
|
||||
|
||||
// DOUBLE BARRELED SHOTGUN and IMPROVISED SHOTGUN are in revolver.dm
|
||||
@@ -0,0 +1,108 @@
|
||||
/obj/item/weapon/gun/projectile/automatic/toy
|
||||
name = "foam force SMG"
|
||||
desc = "A prototype three-round burst toy submachine gun. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
icon_state = "saber"
|
||||
item_state = "gun"
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/smg
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
force = 0
|
||||
throwforce = 0
|
||||
burst_size = 3
|
||||
can_suppress = 0
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol
|
||||
name = "foam force pistol"
|
||||
desc = "A small, easily concealable toy handgun. Ages 8 and up."
|
||||
icon_state = "pistol"
|
||||
w_class = 2
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/pistol
|
||||
fire_sound = 'sound/weapons/Gunshot.ogg'
|
||||
can_suppress = 0
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol/update_icon()
|
||||
..()
|
||||
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/pistol/riot
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot/New()
|
||||
magazine = new /obj/item/ammo_box/magazine/toy/pistol/riot(src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol/riot/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/toy
|
||||
name = "foam force shotgun"
|
||||
desc = "A toy shotgun with wood furniture and a four-shell capacity underneath. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
force = 0
|
||||
throwforce = 0
|
||||
origin_tech = null
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy
|
||||
clumsy_check = 0
|
||||
needs_permit = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/toy/process_chamber()
|
||||
..()
|
||||
if(chambered && !chambered.BB)
|
||||
qdel(chambered)
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/toy/crossbow
|
||||
name = "foam force crossbow"
|
||||
desc = "A weapon favored by many overactive children. Ages 8 and up."
|
||||
icon = 'icons/obj/toy.dmi'
|
||||
icon_state = "foamcrossbow"
|
||||
item_state = "crossbow"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy/crossbow
|
||||
fire_sound = 'sound/items/syringeproj.ogg'
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = 2
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/toy
|
||||
name = "donksoft SMG"
|
||||
desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
can_suppress = 0
|
||||
needs_permit = 0
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/smgm45
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy
|
||||
name = "donksoft LMG"
|
||||
desc = "A heavily modified toy light machine gun, designated 'L6 SAW'. Ages 8 and up."
|
||||
icon = 'icons/obj/guns/toy.dmi'
|
||||
can_suppress = 0
|
||||
needs_permit = 0
|
||||
mag_type = /obj/item/ammo_box/magazine/toy/m762
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
@@ -0,0 +1,93 @@
|
||||
/obj/item/weapon/gun/syringe
|
||||
name = "syringe gun"
|
||||
desc = "A spring loaded rifle designed to fit syringes, used to incapacitate unruly patients from a distance."
|
||||
icon_state = "syringegun"
|
||||
item_state = "syringegun"
|
||||
w_class = 3
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
force = 4
|
||||
materials = list(MAT_METAL=2000)
|
||||
origin_tech = "combat=2;biotech=3"
|
||||
clumsy_check = 0
|
||||
fire_sound = 'sound/items/syringeproj.ogg'
|
||||
var/list/syringes = list()
|
||||
var/max_syringes = 1
|
||||
|
||||
/obj/item/weapon/gun/syringe/New()
|
||||
..()
|
||||
chambered = new /obj/item/ammo_casing/syringegun(src)
|
||||
|
||||
/obj/item/weapon/gun/syringe/newshot()
|
||||
if(!syringes.len) return
|
||||
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = syringes[1]
|
||||
|
||||
if(!S) return
|
||||
|
||||
chambered.BB = new S.projectile_type (src)
|
||||
|
||||
S.reagents.trans_to(chambered.BB, S.reagents.total_volume)
|
||||
chambered.BB.name = S.name
|
||||
syringes.Remove(S)
|
||||
|
||||
qdel(S)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/syringe/process_chamber()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/syringe/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
|
||||
if(target == loc)
|
||||
return
|
||||
newshot()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/syringe/examine(mob/user)
|
||||
..()
|
||||
user << "Can hold [max_syringes] syringe\s. Has [syringes.len] syringe\s remaining."
|
||||
|
||||
/obj/item/weapon/gun/syringe/attack_self(mob/living/user)
|
||||
if(!syringes.len)
|
||||
user << "<span class='warning'>[src] is empty!</span>"
|
||||
return 0
|
||||
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = syringes[syringes.len]
|
||||
|
||||
if(!S) return 0
|
||||
S.loc = user.loc
|
||||
|
||||
syringes.Remove(S)
|
||||
user << "<span class='notice'>You unload [S] from \the [src].</span>"
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = 1)
|
||||
if(istype(A, /obj/item/weapon/reagent_containers/syringe))
|
||||
if(syringes.len < max_syringes)
|
||||
if(!user.unEquip(A))
|
||||
return
|
||||
user << "<span class='notice'>You load [A] into \the [src].</span>"
|
||||
syringes.Add(A)
|
||||
A.loc = src
|
||||
return 1
|
||||
else
|
||||
usr << "<span class='warning'>[src] cannot hold more syringes!</span>"
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/gun/syringe/rapidsyringe
|
||||
name = "rapid syringe gun"
|
||||
desc = "A modification of the syringe gun design, using a rotating cylinder to store up to six syringes."
|
||||
icon_state = "rapidsyringegun"
|
||||
max_syringes = 6
|
||||
|
||||
/obj/item/weapon/gun/syringe/syndicate
|
||||
name = "dart pistol"
|
||||
desc = "A small spring-loaded sidearm that functions identically to a syringe gun."
|
||||
icon_state = "syringe_pistol"
|
||||
item_state = "gun" //Smaller inhand
|
||||
w_class = 2
|
||||
origin_tech = "combat=2;syndicate=2;biotech=3"
|
||||
force = 2 //Also very weak because it's smaller
|
||||
suppressed = 1 //Softer fire sound
|
||||
can_unsuppress = 0 //Permanently silenced
|
||||
Reference in New Issue
Block a user