mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-27 23:28:10 +01:00
Merge branch 'master' into pol-moved
This commit is contained in:
@@ -51,9 +51,9 @@
|
||||
icon_state = "[initial(icon_state)]-spent"
|
||||
|
||||
/obj/item/ammo_casing/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if (!BB)
|
||||
to_chat(user, "This one is spent.")
|
||||
. += "This one is spent."
|
||||
|
||||
//Gun loading types
|
||||
#define SINGLE_CASING 1 //The gun only accepts ammo_casings. ammo_magazines should never have this as their mag_type.
|
||||
@@ -183,8 +183,8 @@
|
||||
icon_state = (new_state)? new_state : initial(icon_state)
|
||||
|
||||
/obj/item/ammo_magazine/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "There [(stored_ammo.len == 1)? "is" : "are"] [stored_ammo.len] round\s left!")
|
||||
. = ..()
|
||||
. += "There [(stored_ammo.len == 1)? "is" : "are"] [stored_ammo.len] round\s left!"
|
||||
|
||||
//magazine icon state caching
|
||||
/var/global/list/magazine_icondata_keys = list()
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
|
||||
/obj/item/weapon/magnetic_ammo/examine(mob/user)
|
||||
. = ..()
|
||||
to_chat(user, "There [(remaining == 1)? "is" : "are"] [remaining] flechette\s left!")
|
||||
. += "There [(remaining == 1)? "is" : "are"] [remaining] flechette\s left!"
|
||||
@@ -287,6 +287,14 @@
|
||||
projectile_type = /obj/item/projectile/bullet/rifle/a145
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 1250)
|
||||
|
||||
/obj/item/ammo_casing/a145/highvel
|
||||
desc = "A 14.5mm sabot shell."
|
||||
projectile_type = /obj/item/projectile/bullet/rifle/a145
|
||||
|
||||
/obj/item/ammo_casing/a145/spent/Initialize()
|
||||
..()
|
||||
expend()
|
||||
|
||||
/*
|
||||
* 5.45mm
|
||||
*/
|
||||
|
||||
@@ -50,12 +50,12 @@
|
||||
produce()
|
||||
|
||||
/obj/item/ammo_magazine/smart/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
if(attached_cell)
|
||||
to_chat(user, "<span class='notice'>\The [src] is loaded with a [attached_cell.name]. It is [round(attached_cell.percent())]% charged.</span>")
|
||||
. += "<span class='notice'>\The [src] is loaded with a [attached_cell.name]. It is [round(attached_cell.percent())]% charged.</span>"
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [src] does not appear to have a power source installed.</span>")
|
||||
. += "<span class='warning'>\The [src] does not appear to have a power source installed.</span>"
|
||||
|
||||
/obj/item/ammo_magazine/smart/update_icon()
|
||||
if(attached_cell)
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
|
||||
/obj/item/weapon/broken_gun
|
||||
desc = "The remains of an unfortunate firearm."
|
||||
|
||||
var/obj/item/weapon/gun/my_guntype = null
|
||||
|
||||
// Materials needed for repair. Associative list, path - number of items
|
||||
var/list/material_needs
|
||||
|
||||
var/do_rotation = TRUE
|
||||
|
||||
/obj/item/weapon/broken_gun/New(var/newloc, var/path)
|
||||
..()
|
||||
if(path)
|
||||
if(!setup_gun(path))
|
||||
qdel(src)
|
||||
return
|
||||
setup_repair_needs()
|
||||
|
||||
/obj/item/weapon/broken_gun/Initialize()
|
||||
..()
|
||||
spawn(30 SECONDS)
|
||||
if(!my_guntype && !QDELETED(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/broken_gun/examine(mob/user)
|
||||
. = ..()
|
||||
spawn()
|
||||
if(get_dist(get_turf(user),get_turf(src)) <= 1)
|
||||
to_chat(user, "<span class='notice'>You begin inspecting \the [src].</span>")
|
||||
|
||||
if(do_after(user, 5 SECONDS))
|
||||
to_chat(user, "<span class='notice'>\The [src] can possibly be restored with:</span>")
|
||||
for(var/resource in material_needs)
|
||||
if(material_needs[resource] > 0)
|
||||
to_chat(user, "<span class='notice'>- [bicon(resource)] x [material_needs[resource]] [resource]</span>")
|
||||
|
||||
/obj/item/weapon/broken_gun/proc/setup_gun(var/obj/item/weapon/gun/path)
|
||||
if(ispath(path))
|
||||
name = "[pick("busted", "broken", "shattered", "scrapped")] [initial(path.name)]"
|
||||
icon = initial(path.icon)
|
||||
icon_state = initial(path.icon_state)
|
||||
|
||||
my_guntype = path
|
||||
|
||||
w_class = initial(path.w_class)
|
||||
|
||||
if(do_rotation)
|
||||
adjust_rotation(rand() * pick(-1,1) * rand(0, 45))
|
||||
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/broken_gun/proc/setup_repair_needs()
|
||||
if(!LAZYLEN(material_needs))
|
||||
material_needs = list()
|
||||
|
||||
if(prob(40))
|
||||
var/chosen_mat = pick(/obj/item/stack/material/plastic, /obj/item/stack/material/plasteel, /obj/item/stack/material/glass)
|
||||
material_needs[chosen_mat] = rand(1, 3)
|
||||
|
||||
if(prob(30))
|
||||
var/component_needed = pick(/obj/item/weapon/stock_parts/gear,/obj/item/weapon/stock_parts/spring,/obj/item/weapon/stock_parts/manipulator)
|
||||
material_needs[component_needed] = rand(1,3)
|
||||
|
||||
if(ispath(my_guntype, /obj/item/weapon/gun/energy) && prob(25))
|
||||
var/component_needed = pick(/obj/item/stack/cable_coil, /obj/item/weapon/stock_parts/scanning_module,/obj/item/weapon/stock_parts/capacitor)
|
||||
material_needs[component_needed] = rand(1,3)
|
||||
|
||||
if(ispath(my_guntype, /obj/item/weapon/gun/launcher) && prob(50))
|
||||
var/component_needed = pick(/obj/item/weapon/tape_roll, /obj/item/weapon/material/wirerod)
|
||||
material_needs[component_needed] = 1
|
||||
|
||||
if(ispath(my_guntype, /obj/item/weapon/gun/magnetic) && prob(70))
|
||||
var/component_needed = pick(/obj/item/weapon/smes_coil, /obj/item/device/assembly/prox_sensor, /obj/item/weapon/module/power_control)
|
||||
material_needs[component_needed] = 1
|
||||
|
||||
material_needs[/obj/item/stack/material/steel] = rand(1,5)
|
||||
|
||||
/obj/item/weapon/broken_gun/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(can_repair_with(W, user))
|
||||
if(do_after(user, (rand() * 10 SECONDS) + 5 SECONDS))
|
||||
repair_with(W, user)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/broken_gun/proc/can_repair_with(obj/item/I, mob/user)
|
||||
for(var/path in material_needs)
|
||||
if(ispath(path) && istype(I, path))
|
||||
if(material_needs[path] > 0)
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
if(S.can_use(material_needs[path]))
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You do not have enough [path] to continue repairs.</span>")
|
||||
else
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/broken_gun/proc/repair_with(obj/item/I, mob/user)
|
||||
for(var/path in material_needs)
|
||||
if(ispath(path) && istype(I, path))
|
||||
if(material_needs[path] > 0)
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
if(S.can_use(material_needs[path]))
|
||||
S.use(material_needs[path])
|
||||
material_needs[path] = 0
|
||||
to_chat(user, "<span class='notice'>You repair some damage on \the [src] with \the [S].</span>")
|
||||
else
|
||||
material_needs[path] = max(0, material_needs[path] - 1)
|
||||
user.drop_from_inventory(I)
|
||||
to_chat(user, "<span class='notice'>You repair some damage on \the [src] with \the [I].</span>")
|
||||
qdel(I)
|
||||
|
||||
check_complete_repair(user)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/weapon/broken_gun/proc/check_complete_repair(mob/user)
|
||||
var/fully_repaired = TRUE
|
||||
for(var/resource in material_needs)
|
||||
if(material_needs[resource] > 0)
|
||||
fully_repaired = FALSE
|
||||
break
|
||||
|
||||
if(fully_repaired)
|
||||
my_guntype = new my_guntype(get_turf(src))
|
||||
my_guntype.name = "[pick("salvaged", "repaired", "old")] [initial(my_guntype.name)]"
|
||||
to_chat(user, "<span class='notice'>You finish your repairs on \the [my_guntype].</span>")
|
||||
qdel(src)
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
/obj/item/weapon/broken_gun/laserrifle/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/energy/laser/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/laser_retro/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/energy/retro/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/ionrifle/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/energy/ionrifle/empty)
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
/obj/item/weapon/broken_gun/grenadelauncher/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/launcher/grenade)
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
/obj/item/weapon/broken_gun/flechette/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/magnetic/railgun/flechette)
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
/obj/item/weapon/broken_gun/c20r/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/projectile/automatic/c20r/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/silenced45/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/projectile/silenced/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/pumpshotgun/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/projectile/shotgun/pump/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/pumpshotgun_combat/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/projectile/shotgun/pump/combat/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/z8/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/projectile/automatic/z8/empty)
|
||||
|
||||
/obj/item/weapon/broken_gun/dartgun/New(var/newloc)
|
||||
..(newloc, /obj/item/weapon/gun/projectile/dartgun)
|
||||
@@ -710,7 +710,7 @@
|
||||
. = ..()
|
||||
if(firemodes.len > 1)
|
||||
var/datum/firemode/current_mode = firemodes[sel_mode]
|
||||
to_chat(user, "The fire selector is set to [current_mode.name].")
|
||||
. += "The fire selector is set to [current_mode.name]."
|
||||
|
||||
/obj/item/weapon/gun/proc/switch_firemodes(mob/user)
|
||||
if(firemodes.len <= 1)
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
var/start_nutrition = H.nutrition
|
||||
var/end_nutrition = 0
|
||||
|
||||
H.nutrition -= rechargeamt / 15
|
||||
H.adjust_nutrition(-rechargeamt / 15)
|
||||
|
||||
end_nutrition = H.nutrition
|
||||
|
||||
@@ -178,12 +178,11 @@
|
||||
if(power_supply)
|
||||
if(charge_cost)
|
||||
var/shots_remaining = round(power_supply.charge / max(1, charge_cost)) // Paranoia
|
||||
to_chat(user, "Has [shots_remaining] shot\s remaining.")
|
||||
. += "Has [shots_remaining] shot\s remaining."
|
||||
else
|
||||
to_chat(user, "Has infinite shots remaining.")
|
||||
. += "Has infinite shots remaining."
|
||||
else
|
||||
to_chat(user, "Does not have a power cell.")
|
||||
return
|
||||
. += "Does not have a power cell."
|
||||
|
||||
/obj/item/weapon/gun/energy/update_icon(var/ignore_inhands)
|
||||
if(power_supply == null)
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
list(mode_name="suppressive", fire_delay=5, projectile_type=/obj/item/projectile/beam/weaklaser, charge_cost = 60),
|
||||
)
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/empty
|
||||
cell_type = null
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted
|
||||
self_recharge = 1
|
||||
use_external_power = 1
|
||||
@@ -175,7 +178,7 @@
|
||||
force = 10
|
||||
w_class = ITEMSIZE_HUGE // So it can't fit in a backpack.
|
||||
accuracy = -45 //shooting at the hip
|
||||
scoped_accuracy = 0
|
||||
scoped_accuracy = 50
|
||||
one_handed_penalty = 60 // The weapon itself is heavy, and the long barrel makes it hard to hold steady with just one hand.
|
||||
|
||||
/obj/item/weapon/gun/energy/sniperrifle/ui_action_click()
|
||||
@@ -192,7 +195,8 @@
|
||||
name = "antique mono-rifle"
|
||||
desc = "An old laser rifle. This one can only fire once before requiring recharging."
|
||||
description_fluff = "Modeled after ancient hunting rifles, this rifle was dubbed the 'Rainy Day Special' by some, due to its use as some barmens' fight-stopper of choice. One shot is all it takes, or so they say."
|
||||
icon_state = "eshotgun"
|
||||
icon = 'icons/obj/energygun.dmi'
|
||||
icon_state = "mono"
|
||||
item_state = "shotgun"
|
||||
origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 4, TECH_POWER = 3)
|
||||
projectile_type = /obj/item/projectile/beam/sniper
|
||||
@@ -204,6 +208,7 @@
|
||||
w_class = ITEMSIZE_LARGE
|
||||
accuracy = 10
|
||||
scoped_accuracy = 15
|
||||
charge_meter = FALSE
|
||||
var/scope_multiplier = 1.5
|
||||
|
||||
/obj/item/weapon/gun/energy/monorifle/ui_action_click()
|
||||
@@ -220,7 +225,7 @@
|
||||
name = "combat mono-rifle"
|
||||
desc = "A modernized version of the mono-rifle. This one can fire twice before requiring recharging."
|
||||
description_fluff = "A modern design produced by a company once working from Saint Columbia, based on the antique mono-rifle 'Rainy Day Special' design."
|
||||
icon_state = "ecshotgun"
|
||||
icon_state = "cmono"
|
||||
item_state = "cshotgun"
|
||||
charge_cost = 1000
|
||||
force = 12
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
|
||||
..(max(severity, 4)) //so it doesn't EMP itself, I guess
|
||||
|
||||
/obj/item/weapon/gun/energy/ionrifle/empty
|
||||
cell_type = null
|
||||
|
||||
/obj/item/weapon/gun/energy/ionrifle/pistol
|
||||
name = "ion pistol"
|
||||
desc = "The NT Mk63 EW Pan is a man portable anti-armor weapon designed to disable mechanical threats, produced by NT. This model sacrifices capacity for portability."
|
||||
|
||||
@@ -208,18 +208,18 @@
|
||||
icon_state = "crossbowframe[buildstate]"
|
||||
|
||||
/obj/item/weapon/crossbowframe/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
switch(buildstate)
|
||||
if(1)
|
||||
to_chat(user, "It has a loose rod frame in place.")
|
||||
. += "It has a loose rod frame in place."
|
||||
if(2)
|
||||
to_chat(user, "It has a steel backbone welded in place.")
|
||||
. += "It has a steel backbone welded in place."
|
||||
if(3)
|
||||
to_chat(user, "It has a steel backbone and a cell mount installed.")
|
||||
. += "It has a steel backbone and a cell mount installed."
|
||||
if(4)
|
||||
to_chat(user, "It has a steel backbone, plastic lath and a cell mount installed.")
|
||||
. += "It has a steel backbone, plastic lath and a cell mount installed."
|
||||
if(5)
|
||||
to_chat(user, "It has a steel cable loosely strung across the lath.")
|
||||
. += "It has a steel cable loosely strung across the lath."
|
||||
|
||||
/obj/item/weapon/crossbowframe/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack/rods))
|
||||
|
||||
@@ -36,11 +36,12 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/launcher/grenade/examine(mob/user)
|
||||
if(..(user, 2))
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 2)
|
||||
var/grenade_count = grenades.len + (chambered? 1 : 0)
|
||||
to_chat(user, "Has [grenade_count] grenade\s remaining.")
|
||||
. += "Has [grenade_count] grenade\s remaining."
|
||||
if(chambered)
|
||||
to_chat(user, "\A [chambered] is chambered.")
|
||||
. += "\A [chambered] is chambered."
|
||||
|
||||
/obj/item/weapon/gun/launcher/grenade/proc/load(obj/item/weapon/grenade/G, mob/user)
|
||||
if(G.loadable)
|
||||
|
||||
@@ -99,13 +99,13 @@
|
||||
return launched
|
||||
|
||||
/obj/item/weapon/gun/launcher/pneumatic/examine(mob/user)
|
||||
if(!..(user, 2))
|
||||
return
|
||||
to_chat(user, "The valve is dialed to [pressure_setting]%.")
|
||||
if(tank)
|
||||
to_chat(user, "The tank dial reads [tank.air_contents.return_pressure()] kPa.")
|
||||
else
|
||||
to_chat(user, "Nothing is attached to the tank valve!")
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 2)
|
||||
. += "The valve is dialed to [pressure_setting]%."
|
||||
if(tank)
|
||||
. += "The tank dial reads [tank.air_contents.return_pressure()] kPa."
|
||||
else
|
||||
. += "Nothing is attached to the tank valve!"
|
||||
|
||||
/obj/item/weapon/gun/launcher/pneumatic/update_release_force(obj/item/projectile)
|
||||
if(tank)
|
||||
@@ -150,18 +150,18 @@
|
||||
icon_state = "pneumatic[buildstate]"
|
||||
|
||||
/obj/item/weapon/cannonframe/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
switch(buildstate)
|
||||
if(1)
|
||||
to_chat(user, "It has a pipe segment installed.")
|
||||
. += "It has a pipe segment installed."
|
||||
if(2)
|
||||
to_chat(user, "It has a pipe segment welded in place.")
|
||||
. += "It has a pipe segment welded in place."
|
||||
if(3)
|
||||
to_chat(user, "It has an outer chassis installed.")
|
||||
. += "It has an outer chassis installed."
|
||||
if(4)
|
||||
to_chat(user, "It has an outer chassis welded in place.")
|
||||
. += "It has an outer chassis welded in place."
|
||||
if(5)
|
||||
to_chat(user, "It has a transfer valve installed.")
|
||||
. += "It has a transfer valve installed."
|
||||
|
||||
/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/pipe))
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
var/list/rockets = new/list()
|
||||
|
||||
/obj/item/weapon/gun/launcher/rocket/examine(mob/user)
|
||||
if(!..(user, 2))
|
||||
return
|
||||
to_chat(user, "<font color='blue'>[rockets.len] / [max_rockets] rockets.</font>")
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 2)
|
||||
. += "<font color='blue'>[rockets.len] / [max_rockets] rockets.</font>"
|
||||
|
||||
/obj/item/weapon/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/ammo_casing/rocket))
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
/obj/item/weapon/gun/magnetic/matfed/examine(mob/user)
|
||||
. = ..()
|
||||
show_ammo(user)
|
||||
var/ammotext = show_ammo()
|
||||
if(ammotext)
|
||||
. += ammotext
|
||||
|
||||
/obj/item/weapon/gun/magnetic/matfed/update_icon()
|
||||
var/list/overlays_to_add = list()
|
||||
@@ -69,9 +71,9 @@
|
||||
/obj/item/weapon/gun/magnetic/matfed/use_ammo()
|
||||
mat_storage -= mat_cost
|
||||
|
||||
/obj/item/weapon/gun/magnetic/matfed/show_ammo(var/mob/user)
|
||||
/obj/item/weapon/gun/magnetic/matfed/show_ammo()
|
||||
if(mat_storage)
|
||||
to_chat(user, "<span class='notice'>It has [mat_storage] out of [max_mat_storage] units of [ammo_material] loaded.</span>")
|
||||
return list("<span class='notice'>It has [mat_storage] out of [max_mat_storage] units of [ammo_material] loaded.</span>")
|
||||
|
||||
/obj/item/weapon/gun/magnetic/matfed/attackby(var/obj/item/thing, var/mob/user)
|
||||
if(removable_components)
|
||||
|
||||
@@ -65,14 +65,14 @@
|
||||
Tank.air_contents.remove(moles_to_pull)
|
||||
|
||||
/obj/item/weapon/gun/magnetic/gasthrower/show_ammo(var/mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
if(loaded)
|
||||
var/obj/item/weapon/tank/T = loaded
|
||||
to_chat(user, "<span class='notice'>\The [T]'s pressure meter shows: [T.air_contents.return_pressure()] kpa.</span>")
|
||||
. += "<span class='notice'>\The [T]'s pressure meter shows: [T.air_contents.return_pressure()] kpa.</span>"
|
||||
|
||||
switch(check_ammo())
|
||||
if(TRUE)
|
||||
to_chat(user, "<span class='notice'>\The [src]'s display registers a proper fuel mixture.</span>")
|
||||
. += "<span class='notice'>\The [src]'s display registers a proper fuel mixture.</span>"
|
||||
if(FALSE)
|
||||
to_chat(user, "<span class='warning'>\The [src]'s display registers an improper fuel mixture.</span>")
|
||||
. += "<span class='warning'>\The [src]'s display registers an improper fuel mixture.</span>"
|
||||
|
||||
@@ -66,28 +66,30 @@
|
||||
overlays = overlays_to_add
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/magnetic/proc/show_ammo(var/mob/user)
|
||||
/obj/item/weapon/gun/magnetic/proc/show_ammo()
|
||||
var/list/ammotext = list()
|
||||
if(loaded)
|
||||
to_chat(user, "<span class='notice'>It has \a [loaded] loaded.</span>")
|
||||
ammotext += "<span class='notice'>It has \a [loaded] loaded.</span>"
|
||||
|
||||
return ammotext
|
||||
|
||||
/obj/item/weapon/gun/magnetic/examine(var/mob/user)
|
||||
. = ..(user, 2)
|
||||
if(.)
|
||||
show_ammo(user)
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 2)
|
||||
. += show_ammo()
|
||||
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>The installed [cell.name] has a charge level of [round((cell.charge/cell.maxcharge)*100)]%.</span>")
|
||||
. += "<span class='notice'>The installed [cell.name] has a charge level of [round((cell.charge/cell.maxcharge)*100)]%.</span>"
|
||||
if(capacitor)
|
||||
to_chat(user, "<span class='notice'>The installed [capacitor.name] has a charge level of [round((capacitor.charge/capacitor.max_charge)*100)]%.</span>")
|
||||
. += "<span class='notice'>The installed [capacitor.name] has a charge level of [round((capacitor.charge/capacitor.max_charge)*100)]%.</span>"
|
||||
|
||||
if(!cell || !capacitor)
|
||||
to_chat(user, "<span class='notice'>The capacitor charge indicator is blinking <font color ='[COLOR_RED]'>red</font>. Maybe you should check the cell or capacitor.</span>")
|
||||
. += "<span class='notice'>The capacitor charge indicator is blinking <font color ='[COLOR_RED]'>red</font>. Maybe you should check the cell or capacitor.</span>"
|
||||
else
|
||||
if(capacitor.charge < power_cost)
|
||||
to_chat(user, "<span class='notice'>The capacitor charge indicator is <font color ='[COLOR_ORANGE]'>amber</font>.</span>")
|
||||
. += "<span class='notice'>The capacitor charge indicator is <font color ='[COLOR_ORANGE]'>amber</font>.</span>"
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The capacitor charge indicator is <font color ='[COLOR_GREEN]'>green</font>.</span>")
|
||||
return TRUE
|
||||
. += "<span class='notice'>The capacitor charge indicator is <font color ='[COLOR_GREEN]'>green</font>.</span>"
|
||||
|
||||
/obj/item/weapon/gun/magnetic/attackby(var/obj/item/thing, var/mob/user)
|
||||
|
||||
|
||||
@@ -88,22 +88,22 @@
|
||||
icon_state = "coilgun_construction_[construction_stage]"
|
||||
|
||||
/obj/item/weapon/coilgun_assembly/examine(var/mob/user)
|
||||
. = ..(user,2)
|
||||
if(.)
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 2)
|
||||
switch(construction_stage)
|
||||
if(2)
|
||||
to_chat(user, "<span class='notice'>It has a metal frame loosely shaped around the stock.</span>")
|
||||
. += "<span class='notice'>It has a metal frame loosely shaped around the stock.</span>"
|
||||
if(3)
|
||||
to_chat(user, "<span class='notice'>It has a metal frame duct-taped to the stock.</span>")
|
||||
. += "<span class='notice'>It has a metal frame duct-taped to the stock.</span>"
|
||||
if(4)
|
||||
to_chat(user, "<span class='notice'>It has a length of pipe attached to the body.</span>")
|
||||
. += "<span class='notice'>It has a length of pipe attached to the body.</span>"
|
||||
if(4)
|
||||
to_chat(user, "<span class='notice'>It has a length of pipe welded to the body.</span>")
|
||||
. += "<span class='notice'>It has a length of pipe welded to the body.</span>"
|
||||
if(6)
|
||||
to_chat(user, "<span class='notice'>It has a cable mount and capacitor jack wired to the frame.</span>")
|
||||
. += "<span class='notice'>It has a cable mount and capacitor jack wired to the frame.</span>"
|
||||
if(7)
|
||||
to_chat(user, "<span class='notice'>It has a single superconducting coil threaded onto the barrel.</span>")
|
||||
. += "<span class='notice'>It has a single superconducting coil threaded onto the barrel.</span>"
|
||||
if(8)
|
||||
to_chat(user, "<span class='notice'>It has a pair of superconducting coils threaded onto the barrel.</span>")
|
||||
. += "<span class='notice'>It has a pair of superconducting coils threaded onto the barrel.</span>"
|
||||
if(9)
|
||||
to_chat(user, "<span class='notice'>It has three superconducting coils attached to the body, waiting to be secured.</span>")
|
||||
. += "<span class='notice'>It has three superconducting coils attached to the body, waiting to be secured.</span>"
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
|
||||
// Not going to check type repeatedly, if you code or varedit
|
||||
// load_type and get runtime errors, don't come crying to me.
|
||||
/obj/item/weapon/gun/magnetic/railgun/show_ammo(var/mob/user)
|
||||
/obj/item/weapon/gun/magnetic/railgun/show_ammo()
|
||||
var/obj/item/weapon/rcd_ammo/ammo = loaded
|
||||
if (ammo)
|
||||
to_chat(user, "<span class='notice'>There are [ammo.remaining] shot\s remaining in \the [loaded].</span>")
|
||||
return list("<span class='notice'>There are [ammo.remaining] shot\s remaining in \the [loaded].</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There is nothing loaded.</span>")
|
||||
return list("<span class='notice'>There is nothing loaded.</span>")
|
||||
|
||||
/obj/item/weapon/gun/magnetic/railgun/check_ammo()
|
||||
var/obj/item/weapon/rcd_ammo/ammo = loaded
|
||||
@@ -77,9 +77,9 @@
|
||||
)
|
||||
|
||||
/obj/item/weapon/gun/magnetic/railgun/automatic/examine(var/mob/user)
|
||||
. = ..(user,1)
|
||||
if(.)
|
||||
to_chat(user, "<span class='notice'>Someone has scratched <i>Ultima Ratio Regum</i> onto the side of the barrel.</span>")
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
. += "<span class='notice'>Someone has scratched <i>Ultima Ratio Regum</i> onto the side of the barrel.</span>"
|
||||
|
||||
/obj/item/weapon/gun/magnetic/railgun/flechette
|
||||
name = "flechette gun"
|
||||
|
||||
@@ -230,11 +230,10 @@
|
||||
update_icon() //make sure to do this after unsetting ammo_magazine
|
||||
|
||||
/obj/item/weapon/gun/projectile/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
if(ammo_magazine)
|
||||
to_chat(user, "It has \a [ammo_magazine] loaded.")
|
||||
to_chat(user, "Has [getAmmo()] round\s remaining.")
|
||||
return
|
||||
. += "It has \a [ammo_magazine] loaded."
|
||||
. += "It has [getAmmo()] round\s remaining."
|
||||
|
||||
/obj/item/weapon/gun/projectile/proc/getAmmo()
|
||||
var/bullets = 0
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
|
||||
// one_handed_penalty = 15
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/empty
|
||||
magazine_type = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r/update_icon()
|
||||
..()
|
||||
if(ammo_magazine)
|
||||
@@ -186,11 +189,14 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/z8/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(launcher.chambered)
|
||||
to_chat(user, "\The [launcher] has \a [launcher.chambered] loaded.")
|
||||
. += "\The [launcher] has \a [launcher.chambered] loaded."
|
||||
else
|
||||
to_chat(user, "\The [launcher] is empty.")
|
||||
. += "\The [launcher] is empty."
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/z8/empty
|
||||
magazine_type = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw
|
||||
name = "light machine gun"
|
||||
|
||||
@@ -100,16 +100,13 @@
|
||||
fill_dart(dart)
|
||||
|
||||
/obj/item/weapon/gun/projectile/dartgun/examine(mob/user)
|
||||
//update_icon()
|
||||
//if (!..(user, 2))
|
||||
// return
|
||||
..()
|
||||
if (beakers.len)
|
||||
to_chat(user, "<font color='blue'>[src] contains:</font>")
|
||||
. = ..()
|
||||
if(beakers.len)
|
||||
. += "<span class='notice'>[src] contains:</span>"
|
||||
for(var/obj/item/weapon/reagent_containers/glass/beaker/B in beakers)
|
||||
if(B.reagents && B.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in B.reagents.reagent_list)
|
||||
to_chat(user, "<font color='blue'>[R.volume] units of [R.name]</font>")
|
||||
. += "<span class='notice'>[R.volume] units of [R.name]</span>"
|
||||
|
||||
/obj/item/weapon/gun/projectile/dartgun/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
|
||||
@@ -125,6 +125,9 @@
|
||||
allowed_magazines = list(/obj/item/ammo_magazine/m45)
|
||||
projectile_type = /obj/item/projectile/bullet/pistol/medium
|
||||
|
||||
/obj/item/weapon/gun/projectile/silenced/empty
|
||||
magazine_type = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle
|
||||
name = "desert eagle"
|
||||
desc = "The perfect handgun for shooters with a need to hit targets through a wall and behind a fridge in your neighbor's house. Uses .44 rounds."
|
||||
|
||||
@@ -249,14 +249,14 @@ obj/item/weapon/gun/projectile/revolver/detective45/verb/rename_gun()
|
||||
chamber_offset = rand(0,max_shells - loaded.len)
|
||||
|
||||
/obj/item/weapon/gun/projectile/revolver/lemat/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(secondary_loaded)
|
||||
var/to_print
|
||||
for(var/round in secondary_loaded)
|
||||
to_print += round
|
||||
to_chat(user, "\The [src] has a secondary barrel loaded with \a [to_print]")
|
||||
. += "It has a secondary barrel loaded with \a [to_print]"
|
||||
else
|
||||
to_chat(user, "\The [src] has a secondary barrel that is empty.")
|
||||
. += "It has a secondary barrel that is empty."
|
||||
|
||||
|
||||
//Ported from Bay
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
else
|
||||
icon_state = "[icon_state]-empty"
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/pump/empty
|
||||
ammo_type = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/pump/slug
|
||||
ammo_type = /obj/item/ammo_casing/a12g
|
||||
|
||||
@@ -67,6 +70,9 @@
|
||||
ammo_type = /obj/item/ammo_casing/a12g
|
||||
load_method = SINGLE_CASING|SPEEDLOADER
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/pump/combat/empty
|
||||
ammo_type = null
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/doublebarrel
|
||||
name = "double-barreled shotgun"
|
||||
desc = "A truely classic weapon. No need to change what works. Uses 12g rounds."
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/launcher/spikethrower/examine(mob/user)
|
||||
..(user)
|
||||
to_chat(user, "It has [spikes] spike\s remaining.")
|
||||
. = ..()
|
||||
. += "It has [spikes] spike\s remaining."
|
||||
|
||||
/obj/item/weapon/gun/launcher/spikethrower/update_icon()
|
||||
icon_state = "spikethrower[spikes]"
|
||||
|
||||
@@ -216,6 +216,16 @@
|
||||
armor_penetration = 80
|
||||
hitscan = 1 //so the PTR isn't useless as a sniper weapon
|
||||
|
||||
icon_state = "bullet_alt"
|
||||
tracer_type = /obj/effect/projectile/tracer/cannon
|
||||
|
||||
/obj/item/projectile/bullet/rifle/a145/highvel
|
||||
damage = 50
|
||||
stun = 1
|
||||
weaken = 0
|
||||
penetrating = 15
|
||||
armor_penetration = 90
|
||||
|
||||
/* Miscellaneous */
|
||||
|
||||
/obj/item/projectile/bullet/suffocationbullet//How does this even work?
|
||||
|
||||
@@ -101,6 +101,19 @@
|
||||
|
||||
combustion = FALSE
|
||||
|
||||
/obj/item/projectile/energy/excavate
|
||||
name = "kinetic blast"
|
||||
icon_state = "kinetic_blast"
|
||||
fire_sound = 'sound/weapons/pulse3.ogg'
|
||||
damage_type = BRUTE
|
||||
damage = 30
|
||||
armor_penetration = 60
|
||||
excavation_amount = 200
|
||||
check_armour = "melee"
|
||||
|
||||
vacuum_traversal = 0
|
||||
combustion = FALSE
|
||||
|
||||
/obj/item/projectile/energy/dart
|
||||
name = "dart"
|
||||
icon_state = "toxin"
|
||||
|
||||
@@ -197,11 +197,11 @@
|
||||
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
|
||||
|
||||
/obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0)
|
||||
var/mob/M = target
|
||||
var/mob/living/M = target
|
||||
if(ishuman(target)) //These rays make plantmen fat.
|
||||
var/mob/living/carbon/human/H = M
|
||||
if((H.species.flags & IS_PLANT) && (M.nutrition < 500))
|
||||
M.nutrition += 30
|
||||
M.adjust_nutrition(30)
|
||||
else if (istype(target, /mob/living/carbon/))
|
||||
M.show_message("<font color='blue'>The radiation beam dissipates harmlessly through your body.</font>")
|
||||
else
|
||||
@@ -277,9 +277,9 @@
|
||||
light_power = 3
|
||||
light_color = "#3300ff"
|
||||
|
||||
muzzle_type = /obj/effect/projectile/tungsten/muzzle
|
||||
tracer_type = /obj/effect/projectile/tungsten/tracer
|
||||
impact_type = /obj/effect/projectile/tungsten/impact
|
||||
muzzle_type = /obj/effect/projectile/muzzle/tungsten
|
||||
tracer_type = /obj/effect/projectile/tracer/tungsten
|
||||
impact_type = /obj/effect/projectile/impact/tungsten
|
||||
|
||||
/obj/item/projectile/beam/tungsten/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(isliving(target))
|
||||
|
||||
Reference in New Issue
Block a user