Merge remote-tracking branch 'citadel/master' into small_guncode_refactor

This commit is contained in:
kevinz000
2020-02-04 03:47:01 -07:00
812 changed files with 46627 additions and 7896 deletions
@@ -34,6 +34,11 @@
setDir(pick(GLOB.alldirs))
update_icon()
/obj/item/ammo_casing/Destroy()
if(BB)
QDEL_NULL(BB)
return ..()
/obj/item/ammo_casing/update_icon()
..()
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
@@ -0,0 +1,39 @@
/obj/item/ammo_casing/caseless/magnetic
desc = "A large ferromagnetic slug intended to be launched out of a compatible weapon."
caliber = "mag"
icon_state = "mag-casing-live"
click_cooldown_override = 2.5
delay = 3
var/energy_cost = 200
/obj/item/ammo_casing/caseless/magnetic
projectile_type = /obj/item/projectile/bullet/magnetic
/obj/item/ammo_casing/caseless/magnetic/disabler
desc = "A large, specialized ferromagnetic slug designed with a less-than-lethal payload."
projectile_type = /obj/item/projectile/bullet/magnetic/disabler
/obj/item/ammo_casing/caseless/magnetic/weak
desc = "A ferromagnetic slug intended to be launched out of a compatible weapon."
projectile_type = /obj/item/projectile/bullet/magnetic/weak
energy_cost = 125
/obj/item/ammo_casing/caseless/magnetic/weak/disabler
desc = "A specialized ferromagnetic slug designed with a less-than-lethal payload."
projectile_type = /obj/item/projectile/bullet/magnetic/weak/disabler
energy_cost = 125
/obj/item/ammo_casing/caseless/magnetic/hyper
desc = "A large block of speciallized ferromagnetic material designed to be fired out of the experimental Hyper-Burst Rifle."
caliber = "hypermag"
icon_state = "hyper-casing-live"
projectile_type = /obj/item/projectile/bullet/magnetic/hyper
pellets = 8
variance = 30
energy_cost = 1500
/obj/item/ammo_casing/caseless/magnetic/hyper/inferno
projectile_type = /obj/item/projectile/bullet/incendiary/mag_inferno
pellets = 1
variance = 0
@@ -63,3 +63,8 @@
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/riot
icon_state = "foamdart_riot"
materials = list(MAT_METAL = 1125)
/obj/item/ammo_casing/caseless/foam_dart/mag
name = "magfoam dart"
desc = "A foam dart with fun light-up projectiles powered by magnets!"
projectile_type = /obj/item/projectile/bullet/reusable/foam_dart/mag
@@ -62,6 +62,14 @@
/obj/item/ammo_casing/energy/laser/redtag/hitscan/holy
projectile_type = /obj/item/projectile/beam/lasertag/redtag/hitscan/holy
/obj/item/ammo_casing/energy/laser/magtag
projectile_type = /obj/item/projectile/beam/lasertag/mag
select_name = "magtag"
pellets = 3
variance = 30
e_cost = 1000
fire_sound = 'sound/weapons/magburst.ogg'
/obj/item/ammo_casing/energy/xray
projectile_type = /obj/item/projectile/beam/xray
e_cost = 50
@@ -87,7 +87,14 @@
max_ammo = 40
materials = list(MAT_METAL = 500)
/obj/item/ammo_box/foambox/mag
name = "ammo box (Magnetic Foam Darts)"
icon = 'icons/obj/guns/toy.dmi'
icon_state = "foambox"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/mag
max_ammo = 42
/obj/item/ammo_box/foambox/riot
icon_state = "foambox_riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
materials = list(MAT_METAL = 50000)
materials = list(MAT_METAL = 50000)
@@ -0,0 +1,34 @@
/obj/item/ammo_box/magazine/mmag
icon_state = "mediummagmag"
ammo_type = /obj/item/ammo_casing/caseless/magnetic/disabler
caliber = "mag"
max_ammo = 24
multiple_sprites = 2
/obj/item/ammo_box/magazine/mmag/lethal
name = "magrifle magazine (lethal)"
ammo_type = /obj/item/ammo_casing/caseless/magnetic
/obj/item/ammo_box/magazine/mmag/small
name = "magpistol magazine (non-lethal disabler)"
icon_state = "smallmagmag"
ammo_type = /obj/item/ammo_casing/caseless/magnetic/weak/disabler
max_ammo = 15
/obj/item/ammo_box/magazine/mmag/small/lethal
name = "magpistol magazine (lethal)"
ammo_type = /obj/item/ammo_casing/caseless/magnetic/weak
/obj/item/ammo_box/magazine/mhyper
name = "hyper-burst rifle magazine"
icon_state = "hypermag"
ammo_type = /obj/item/ammo_casing/caseless/magnetic/hyper
caliber = "hypermag"
desc = "A magazine for the Hyper-Burst Rifle. Loaded with a special slug that fragments into 6 smaller shards which can absolutely puncture anything, but has rather short effective range."
max_ammo = 4
multiple_sprites = 4
/obj/item/ammo_box/magazine/mhyper/inferno
name = "hyper-burst rifle magazine (inferno)"
ammo_type = /obj/item/ammo_casing/caseless/magnetic/hyper/inferno
desc = "A magazine for the Hyper-Burst Rifle. Loaded with a special slug that violently reacts with whatever surface it strikes, generating massive amount of heat and light."
@@ -57,3 +57,11 @@
/obj/item/ammo_box/magazine/toy/m762/riot
icon_state = "a762-riot"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
/obj/item/ammo_box/magazine/toy/foamag
name = "foam force magrifle magazine"
icon_state = "foamagmag"
max_ammo = 24
multiple_sprites = 2
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/mag
materials = list(MAT_METAL = 200)
@@ -5,3 +5,7 @@
/obj/item/ammo_box/magazine/internal/shot/toy/crossbow
max_ammo = 5
/obj/item/ammo_box/magazine/internal/shot/toy/mag
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/mag
max_ammo = 14
+7
View File
@@ -85,6 +85,13 @@
if(zoomable)
azoom = new (src)
/obj/item/gun/Destroy()
QDEL_NULL(pin)
QDEL_NULL(gun_light)
QDEL_NULL(bayonet)
QDEL_NULL(chambered)
return ..()
/obj/item/gun/CheckParts(list/parts_list)
..()
var/obj/item/gun/G = locate(/obj/item/gun) in contents
+1 -1
View File
@@ -163,7 +163,7 @@
user.visible_message("<span class='suicide'>[user] blows [user.p_their()] brain[user.p_s()] out with [src]!</span>")
playsound(src, 'sound/weapons/dink.ogg', 30, 1)
var/turf/target = get_ranged_target_turf(user, turn(user.dir, 180), BRAINS_BLOWN_THROW_RANGE)
B.Remove(user)
B.Remove()
B.forceMove(T)
if(iscarbon(user))
var/mob/living/carbon/C = user
@@ -0,0 +1,103 @@
/obj/item/gun/ballistic/automatic/magrifle
name = "\improper Magnetic Rifle"
desc = "A simple upscalling of the technologies used in the magpistol, the magrifle is capable of firing slightly larger slugs in bursts. Compatible with the magpistol's slugs."
icon_state = "magrifle"
item_state = "arg"
force = 10
slot_flags = NONE
mag_type = /obj/item/ammo_box/magazine/mmag
fire_sound = 'sound/weapons/magrifle.ogg'
can_suppress = FALSE
burst_size = 1
actions_types = null
fire_delay = 3
spread = 0
recoil = 0.1
casing_ejector = FALSE
inaccuracy_modifier = 0.5
dualwield_spread_mult = 1.4
weapon_weight = WEAPON_MEDIUM
var/obj/item/stock_parts/cell/cell
var/cell_type = /obj/item/stock_parts/cell/magnetic
/obj/item/gun/ballistic/automatic/magrifle/Initialize()
. = ..()
if(cell_type)
cell = new cell_type(src)
else
cell = new(src)
/obj/item/gun/ballistic/automatic/magrifle/examine(mob/user)
. = ..()
if(cell)
. += "<span class='notice'>[src]'s cell is [round(cell.charge / cell.maxcharge, 0.1) * 100]% full.</span>"
else
. += "<span class='notice'>[src] doesn't seem to have a cell!</span>"
/obj/item/gun/ballistic/automatic/magrifle/can_shoot()
if(QDELETED(cell))
return 0
var/obj/item/ammo_casing/caseless/magnetic/shot = chambered
if(!shot)
return 0
if(cell.charge < shot.energy_cost * burst_size)
return 0
. = ..()
/obj/item/gun/ballistic/automatic/magrifle/shoot_live_shot()
var/obj/item/ammo_casing/caseless/magnetic/shot = chambered
cell.use(shot.energy_cost)
. = ..()
/obj/item/gun/ballistic/automatic/magrifle/emp_act(severity)
. = ..()
if(!(. & EMP_PROTECT_CONTENTS))
cell.use(round(cell.charge / severity))
/obj/item/gun/ballistic/automatic/magrifle/get_cell()
return cell
/obj/item/gun/ballistic/automatic/magrifle/nopin
pin = null
spawnwithmagazine = FALSE
cell_type = /obj/item/stock_parts/cell/magnetic/empty
/obj/item/gun/ballistic/automatic/magrifle/hyperburst
name = "\improper Hyper-Burst Rifle"
desc = "An extremely beefed up version of a stolen Nanotrasen weapon prototype, this 'rifle' is more like a cannon, with an extremely large bore barrel capable of generating several smaller magnetic 'barrels' to simultaneously launch multiple projectiles at once."
icon_state = "hyperburst"
item_state = "arg"
mag_type = /obj/item/ammo_box/magazine/mhyper
fire_sound = 'sound/weapons/magburst.ogg'
fire_delay = 40
recoil = 2
weapon_weight = WEAPON_HEAVY
/obj/item/gun/ballistic/automatic/magrifle/hyperburst/update_icon()
..()
icon_state = "hyperburst[magazine ? "-[get_ammo()]" : ""][chambered ? "" : "-e"]"
///magpistol///
/obj/item/gun/ballistic/automatic/magrifle/pistol
name = "magpistol"
desc = "A handgun utilizing maglev technologies to propel a ferromagnetic slug to extreme velocities."
icon_state = "magpistol"
fire_sound = 'sound/weapons/magpistol.ogg'
mag_type = /obj/item/ammo_box/magazine/mmag/small
fire_delay = 2
inaccuracy_modifier = 0.25
cell_type = /obj/item/stock_parts/cell/magnetic/pistol
/obj/item/gun/ballistic/automatic/magrifle/pistol/update_icon()
..()
cut_overlays()
if(magazine)
add_overlay("magpistol-magazine")
icon_state = "[initial(icon_state)][chambered ? "" : "-e"]"
/obj/item/gun/ballistic/automatic/magrifle/pistol/nopin
pin = null
spawnwithmagazine = FALSE
cell_type = /obj/item/stock_parts/cell/magnetic/pistol/empty
@@ -109,3 +109,36 @@
/obj/item/gun/ballistic/automatic/l6_saw/toy/unrestricted/riot
mag_type = /obj/item/ammo_box/magazine/toy/m762/riot
/obj/item/gun/ballistic/automatic/toy/magrifle
name = "foamag rifle"
desc = "A foam launching magnetic rifle. Ages 8 and up."
icon_state = "foamagrifle"
obj_flags = NONE
mag_type = /obj/item/ammo_box/magazine/toy/foamag
fire_sound = 'sound/weapons/magrifle.ogg'
burst_size = 1
actions_types = null
fire_delay = 3
spread = 60
recoil = 0.1
can_suppress = FALSE
inaccuracy_modifier = 0.5
weapon_weight = WEAPON_MEDIUM
dualwield_spread_mult = 1.4
w_class = WEIGHT_CLASS_BULKY
/obj/item/gun/ballistic/shotgun/toy/mag
name = "foam force magpistol"
desc = "A fancy toy sold alongside light-up foam force darts. Ages 8 and up."
icon_state = "toymag"
item_state = "gun"
mag_type = /obj/item/ammo_box/magazine/internal/shot/toy/mag
fire_sound = 'sound/weapons/magpistol.ogg'
fire_delay = 2
recoil = 0.1
inaccuracy_modifier = 0.25
dualwield_spread_mult = 1.4
slot_flags = SLOT_BELT
w_class = WEIGHT_CLASS_NORMAL
weapon_weight = WEAPON_MEDIUM
+1
View File
@@ -66,6 +66,7 @@
/obj/item/gun/energy/Destroy()
QDEL_NULL(cell)
QDEL_LIST(ammo_type)
STOP_PROCESSING(SSobj, src)
return ..()
@@ -22,6 +22,11 @@
var/list/fired = list()
var/countdown_length = 10
var/countdown_step = 0
var/static/next_id = 1
var/id
/datum/duel/New()
id = next_id++
/datum/duel/proc/try_begin()
//Check if both guns are held and if so begin.
@@ -157,6 +162,13 @@
setting_overlay = mutable_appearance(icon,setting_iconstate())
add_overlay(setting_overlay)
/obj/item/gun/energy/dueling/examine(mob/user)
. = ..()
if(duel)
. += "Its linking number is [duel.id]."
else
. += "ERROR: No linking number on gun."
/obj/item/gun/energy/dueling/proc/setting_iconstate()
switch(setting)
if(DUEL_SETTING_A)
@@ -316,7 +328,7 @@
if(DUEL_HUGBOX_NONE)
var/obj/item/bodypart/B = L.get_bodypart(BODY_ZONE_HEAD)
B.dismember()
qdel(B)
QDEL_IN(B, 1)
if(DUEL_HUGBOX_LETHAL)
L.adjustBruteLoss(180)
L.death() //Die, powergamers.
@@ -370,6 +382,8 @@
/obj/item/storage/lockbox/dueling/hugbox
gun_type = /obj/item/gun/energy/dueling/hugbox
req_access = list(ACCESS_ARMORY)
/obj/item/storage/lockbox/dueling/hugbox/stamina
gun_type = /obj/item/gun/energy/dueling/hugbox/stamina
req_access = null
@@ -297,7 +297,7 @@
/obj/item/borg/upgrade/modkit/proc/install(obj/item/gun/energy/kinetic_accelerator/KA, mob/user)
. = TRUE
if(src in KA.modkits) // Sanity check to prevent installing the same modkit twice thanks to occasional click/lag delays.
return
return FALSE
if(minebot_upgrade)
if(minebot_exclusive && !istype(KA.loc, /mob/living/simple_animal/hostile/mining_drone))
to_chat(user, "<span class='notice'>The modkit you're trying to install is only rated for minebot use.</span>")
@@ -317,7 +317,7 @@
if(KA.get_remaining_mod_capacity() >= cost)
if(.)
if(!user.transferItemToLoc(src, KA))
return
return FALSE
to_chat(user, "<span class='notice'>You install the modkit.</span>")
playsound(loc, 'sound/items/screwdriver.ogg', 100, 1)
KA.modkits += src
@@ -382,7 +382,7 @@
var/old = KA.overheat_time
KA.overheat_time = max(0, KA.overheat_time - modifier)
decreased = old - KA.overheat_time
/obj/item/borg/upgrade/modkit/cooldown/uninstall(obj/item/gun/energy/kinetic_accelerator/KA)
KA.overheat_time += decreased
@@ -16,6 +16,19 @@
clumsy_check = 0
item_flags = NONE
/obj/item/gun/energy/laser/practice/hyperburst
name = "toy hyper-burst launcher"
desc = "A toy laser with a unique beam shaping lens that projects harmless bolts capable of going through objects. Compatible with existing laser tag systems."
ammo_type = list(/obj/item/ammo_casing/energy/laser/magtag)
icon_state = "toyburst"
obj_flags = NONE
fire_delay = 40
weapon_weight = WEAPON_HEAVY
selfcharge = EGUN_SELFCHARGE
charge_delay = 2
recoil = 2
cell_type = /obj/item/stock_parts/cell/toymagburst
/obj/item/gun/energy/laser/retro
name ="retro laser gun"
icon_state = "retro"
@@ -105,13 +105,15 @@
/obj/item/gun/energy/kinetic_accelerator/crossbow/large
name = "energy crossbow"
desc = "A reverse engineered weapon using syndicate technology."
desc = "A reverse engineered weapon using syndicate technology. This thing seems incredibly unwieldly, and seems to be using similar internals to the Proto-Kinetic Accelerator. It might not play nice when brought near weapons similar to it."
icon_state = "crossbowlarge"
w_class = WEIGHT_CLASS_NORMAL
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_METAL=4000)
suppressed = null
ammo_type = list(/obj/item/ammo_casing/energy/bolt/large)
weapon_weight = WEAPON_HEAVY
pin = null
unique_frequency = FALSE
/obj/item/gun/energy/plasmacutter
name = "plasma cutter"
+2 -2
View File
@@ -643,11 +643,11 @@
Bump(original)
/obj/item/projectile/Destroy()
STOP_PROCESSING(SSprojectiles, src)
if(hitscan)
finalize_hitscan_and_generate_tracers()
STOP_PROCESSING(SSprojectiles, src)
cleanup_beam_segments()
qdel(trajectory)
QDEL_NULL(trajectory)
return ..()
/obj/item/projectile/proc/cleanup_beam_segments()
@@ -146,6 +146,15 @@
if(M.wear_suit.type in suit_types)
M.adjustStaminaLoss(34)
/obj/item/projectile/beam/lasertag/mag //the projectile, compatible with regular laser tag armor
icon_state = "magjectile-toy"
name = "lasertag magbolt"
movement_type = FLYING | UNSTOPPABLE //for penetration memes
range = 5 //so it isn't super annoying
light_range = 2
light_color = LIGHT_COLOR_YELLOW
eyeblur = 0
/obj/item/projectile/beam/lasertag/redtag
icon_state = "laser"
suit_types = list(/obj/item/clothing/suit/bluetag)
@@ -0,0 +1,49 @@
/obj/item/projectile/bullet/magnetic
icon_state = "magjectile"
damage = 20
armour_penetration = 20
light_range = 3
speed = 0.6
range = 35
light_color = LIGHT_COLOR_RED
/obj/item/projectile/bullet/magnetic/disabler
icon_state = "magjectile-nl" //nl stands for non-lethal
damage = 2
armour_penetration = 10
stamina = 20
light_color = LIGHT_COLOR_BLUE
/obj/item/projectile/bullet/magnetic/weak
damage = 15
armour_penetration = 10
light_range = 2
range = 25
/obj/item/projectile/bullet/magnetic/weak/disabler
damage = 2
stamina = 20
/obj/item/projectile/bullet/magnetic/hyper
damage = 10
armour_penetration = 20
stamina = 10
movement_type = FLYING | UNSTOPPABLE
range = 6
light_range = 1
light_color = LIGHT_COLOR_RED
/obj/item/projectile/bullet/incendiary/mag_inferno
icon_state = "magjectile-large"
damage = 10
armour_penetration = 20
movement_type = FLYING | UNSTOPPABLE
range = 20
speed = 0.8
light_range = 4
light_color = LIGHT_COLOR_RED
/obj/item/projectile/bullet/incendiary/mag_inferno/on_hit(atom/target, blocked = FALSE)
..()
explosion(target, -1, 0, 0, 1, 2, flame_range = 2)
return BULLET_ACT_HIT
@@ -1,12 +1,14 @@
/obj/item/projectile/energy/bolt //ebow bolts
name = "bolt"
icon_state = "cbbolt"
damage = 8
damage = 15
damage_type = TOX
nodamage = 0
knockdown = 100
stutter = 5
drowsy = 50
eyeblur = 10
slur = 5
knockdown = 160
stamina = 60
knockdown_stamoverride = 0
/obj/item/projectile/energy/bolt/halloween
name = "candy corn"
@@ -39,3 +39,10 @@
icon_state = "foamdart_riot_proj"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot
stamina = 25
/obj/item/projectile/bullet/reusable/foam_dart/mag
name = "magfoam dart"
icon_state = "magjectile-toy"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart/mag
light_range = 2
light_color = LIGHT_COLOR_YELLOW