mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-17 05:31:53 +00:00
Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12 into guntest
Conflicts: code/WorkInProgress/Cib/amorph/amorph_hud.dm code/game/objects/structures/window.dm code/modules/mob/living/blob/blob.dm code/modules/mob/living/simple_animal/friendly/corgi.dm code/modules/mob/mob_defines.dm code/modules/mob/screen.dm code/modules/projectiles/gun.dm code/modules/projectiles/guns/projectile/automatic.dm maps/tgstation.2.0.9.1.dmm
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
name = "speed loader (.38)"
|
||||
icon_state = "38"
|
||||
ammo_type = "/obj/item/ammo_casing/c38"
|
||||
max_ammo = 7
|
||||
max_ammo = 6
|
||||
multiple_sprites = 1
|
||||
|
||||
|
||||
@@ -32,6 +32,16 @@
|
||||
multiple_sprites = 1
|
||||
|
||||
|
||||
/obj/item/ammo_magazine/mc9mm
|
||||
name = "magazine (9mm)"
|
||||
icon_state = "9x19p"
|
||||
origin_tech = "combat=2"
|
||||
ammo_type = "/obj/item/ammo_casing/c9mm"
|
||||
max_ammo = 8
|
||||
multiple_sprites = 1
|
||||
|
||||
/obj/item/ammo_magazine/mc9mm/empty
|
||||
max_ammo = 0
|
||||
|
||||
/obj/item/ammo_magazine/c9mm
|
||||
name = "Ammunition Box (9mm)"
|
||||
@@ -92,3 +102,18 @@
|
||||
icon_state = "75"
|
||||
ammo_type = "/obj/item/ammo_casing/a75"
|
||||
max_ammo = 0
|
||||
|
||||
/obj/item/ammo_magazine/a762
|
||||
name = "magazine (a762)"
|
||||
icon_state = "a762"
|
||||
origin_tech = "combat=2"
|
||||
ammo_type = "/obj/item/ammo_casing/a762"
|
||||
max_ammo = 50
|
||||
multiple_sprites = 1
|
||||
|
||||
/obj/item/ammo_magazine/a762/empty
|
||||
name = "magazine (a762)"
|
||||
icon_state = "a762"
|
||||
ammo_type = "/obj/item/ammo_casing/a762"
|
||||
max_ammo = 0
|
||||
multiple_sprites = 1
|
||||
@@ -35,7 +35,7 @@
|
||||
/obj/item/ammo_casing/c9mm
|
||||
desc = "A 9mm bullet casing."
|
||||
caliber = "9mm"
|
||||
projectile_type = "/obj/item/projectile/bullet/weakbullet"
|
||||
projectile_type = "/obj/item/projectile/bullet/midbullet2"
|
||||
|
||||
|
||||
/obj/item/ammo_casing/c45
|
||||
@@ -88,4 +88,9 @@
|
||||
desc = "A dart for use in shotguns."
|
||||
icon_state = "dart"
|
||||
projectile_type = "/obj/item/projectile/energy/dart"
|
||||
m_amt = 12500
|
||||
m_amt = 12500
|
||||
|
||||
/obj/item/ammo_casing/a762
|
||||
desc = "A 7.62 bullet casing."
|
||||
caliber = "a762"
|
||||
projectile_type = "/obj/item/projectile/bullet"
|
||||
|
||||
@@ -32,13 +32,6 @@
|
||||
//1 for keep shooting until aim is lowered
|
||||
|
||||
proc/load_into_chamber()
|
||||
return
|
||||
|
||||
proc/special_check(var/mob/M)
|
||||
return
|
||||
|
||||
|
||||
load_into_chamber()
|
||||
return 0
|
||||
|
||||
//Removing the lock and the buttons.
|
||||
@@ -53,7 +46,7 @@
|
||||
del(user.gun_run_icon)
|
||||
return ..()
|
||||
|
||||
special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
|
||||
proc/special_check(var/mob/M) //Placeholder for any special checks, like detective's revolver.
|
||||
return 1
|
||||
|
||||
|
||||
@@ -74,6 +67,9 @@
|
||||
//Clicking gun will still lower aim for guns that don't overwrite this
|
||||
attack_self()
|
||||
lower_aim()
|
||||
afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, flag, params)//TODO: go over this
|
||||
if(flag) return //we're placing gun on a table or in backpack
|
||||
if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this?
|
||||
|
||||
verb/toggle_firerate()
|
||||
set name = "Toggle Firerate"
|
||||
@@ -209,13 +205,12 @@
|
||||
usr.dir = dir_to_fire
|
||||
|
||||
proc/Fire(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, params, reflex = 0)//TODO: go over this
|
||||
|
||||
//Exclude lasertag guns from the CLUMSY check.
|
||||
if(src.clumsy_check)
|
||||
if(clumsy_check)
|
||||
if(istype(user, /mob/living))
|
||||
var/mob/living/M = user
|
||||
if ((CLUMSY in M.mutations) && prob(50))
|
||||
M << "\red The [src.name] blows up in your face!"
|
||||
M << "<span class='danger'>[src] blows up in your face.</span>"
|
||||
M.take_organ_damage(0,20)
|
||||
M.drop_item()
|
||||
del(src)
|
||||
@@ -229,6 +224,10 @@
|
||||
if (HULK in M.mutations)
|
||||
M << "\red Your meaty finger is much too large for the trigger guard!"
|
||||
return
|
||||
if(ishuman(user))
|
||||
if(user.dna && user.dna.mutantrace == "adamantine")
|
||||
user << "\red Your metal fingers don't fit in the trigger guard!"
|
||||
return
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -243,6 +242,7 @@
|
||||
user.visible_message("*click click*", "\red <b>*click*</b>")
|
||||
for(var/mob/K in viewers(usr))
|
||||
K << 'empty.ogg'
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
return
|
||||
|
||||
if(!in_chamber)
|
||||
@@ -265,14 +265,16 @@
|
||||
playsound(user, fire_sound, 10, 1)
|
||||
else
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.visible_message("<span class='warning'>[user] fires [src]!</span>", "<span class='warning'>You fire [src]!</span>", "You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
||||
if(reflex)
|
||||
user.visible_message("\red \The [user] fires \the [src] by reflex!", "\red You reflex fire \the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
||||
else
|
||||
user.visible_message("\red \The [user] fires \the [src]!", "\red You fire \the [src]!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
||||
|
||||
in_chamber.original = targloc
|
||||
in_chamber.original = target
|
||||
in_chamber.loc = get_turf(user)
|
||||
in_chamber.starting = get_turf(user)
|
||||
in_chamber.shot_from = src
|
||||
user.next_move = world.time + 4
|
||||
in_chamber.silenced = silenced
|
||||
in_chamber.current = curloc
|
||||
@@ -293,7 +295,11 @@
|
||||
in_chamber = null
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(user.hand)
|
||||
user.update_inv_l_hand()
|
||||
else
|
||||
user.update_inv_r_hand()
|
||||
|
||||
//Aiming at the target mob.
|
||||
proc/Aim(var/mob/M)
|
||||
@@ -309,8 +315,6 @@
|
||||
else
|
||||
usr.visible_message("\red <b>[usr] aims \a [src] at [M]!</b>")
|
||||
M.Targeted(src)
|
||||
|
||||
|
||||
//HE MOVED, SHOOT HIM!
|
||||
proc/TargetActed(var/mob/living/T)
|
||||
var/mob/living/M = loc
|
||||
|
||||
@@ -39,9 +39,6 @@
|
||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||
ratio = round(ratio, 0.25) * 100
|
||||
if(modifystate)
|
||||
icon_state = text("[][]", modifystate, ratio)
|
||||
icon_state = "[modifystate][ratio]"
|
||||
else
|
||||
icon_state = text("[][]", initial(icon_state), ratio)
|
||||
|
||||
|
||||
|
||||
icon_state = "[initial(icon_state)][ratio]"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/obj/item/weapon/gun/energy/gun
|
||||
icon_state = "energystun100"
|
||||
name = "energy gun"
|
||||
desc = "A basic energy-based gun with two settings: Stun and kill."
|
||||
icon_state = "energystun100"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
fire_sound = 'sound/weapons/Taser.ogg'
|
||||
|
||||
charge_cost = 100 //How much energy is needed to fire.
|
||||
@@ -29,16 +30,15 @@
|
||||
projectile_type = "/obj/item/projectile/energy/electrode"
|
||||
modifystate = "energystun"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/nuclear
|
||||
name = "Advanced Energy Gun"
|
||||
desc = "An energy gun with an experimental miniaturized reactor."
|
||||
icon_state = "nucgun"
|
||||
origin_tech = "combat=3;materials=5;powerstorage=3"
|
||||
var/lightfail = 0
|
||||
icon_state = "nucgun"
|
||||
var/charge_tick = 0
|
||||
|
||||
New()
|
||||
@@ -93,7 +93,7 @@
|
||||
return
|
||||
var/ratio = power_supply.charge / power_supply.maxcharge
|
||||
ratio = round(ratio, 0.25) * 100
|
||||
overlays += text("nucgun-[]", ratio)
|
||||
overlays += "nucgun-[ratio]"
|
||||
|
||||
|
||||
update_reactor()
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
|
||||
update_icon()
|
||||
overlays = null
|
||||
overlays.Cut()
|
||||
update_charge()
|
||||
update_reactor()
|
||||
update_mode()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
name = "pulse rifle"
|
||||
desc = "A heavy-duty, pulse-based energy weapon, preferred by front-line combat personnel."
|
||||
icon_state = "pulse"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
force = 10
|
||||
fire_sound = 'sound/weapons/pulse.ogg'
|
||||
charge_cost = 200
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/ion"
|
||||
|
||||
isHandgun()
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
|
||||
if(severity <= 2)
|
||||
power_supply.use(round(power_supply.maxcharge / severity))
|
||||
@@ -20,7 +17,6 @@
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
/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."
|
||||
@@ -30,9 +26,6 @@
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/energy/declone"
|
||||
|
||||
isHandgun()
|
||||
return 0
|
||||
|
||||
obj/item/weapon/gun/energy/staff
|
||||
name = "staff of change"
|
||||
desc = "An artefact that spits bolts of coruscating energy which cause the target's very form to reshape itself"
|
||||
@@ -66,11 +59,15 @@ obj/item/weapon/gun/energy/staff
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
power_supply.give(200)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
isHandgun()
|
||||
return 0
|
||||
update_icon()
|
||||
return
|
||||
/obj/item/weapon/gun/energy/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."
|
||||
projectile_type = "/obj/item/projectile/animate"
|
||||
charge_cost = 100
|
||||
|
||||
/obj/item/weapon/gun/energy/floragun
|
||||
name = "floral somatoray"
|
||||
@@ -160,4 +157,12 @@ obj/item/weapon/gun/energy/staff
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "pen"
|
||||
item_state = "pen"
|
||||
w_class = 1
|
||||
w_class = 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/mindflayer
|
||||
name = "mind flayer"
|
||||
desc = "A prototype weapon recovered from the ruins of Research-Station Epsilon."
|
||||
icon_state = "xray"
|
||||
projectile_type = "/obj/item/projectile/beam/mindflayer"
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
name = "taser gun"
|
||||
desc = "A small, low capacity gun used for non-lethal takedowns."
|
||||
icon_state = "taser"
|
||||
item_state = null //so the human update icon uses the icon_state instead.
|
||||
fire_sound = 'sound/weapons/Taser.ogg'
|
||||
charge_cost = 100
|
||||
projectile_type = "/obj/item/projectile/energy/electrode"
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
user.machine = src
|
||||
user.set_machine(src)
|
||||
var/temp_text = ""
|
||||
if(temperature > (T0C - 50))
|
||||
temp_text = "<FONT color=black>[temperature] ([round(temperature-T0C)]°C) ([round(temperature*1.8-459.67)]°F)</FONT>"
|
||||
@@ -43,7 +43,7 @@
|
||||
Topic(href, href_list)
|
||||
if (..())
|
||||
return
|
||||
usr.machine = src
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/item/weapon/gun/projectile/automatic //Hopefully someone will find a way to make these fire in bursts or something. --Superxpdude
|
||||
name = "Submachine Gun"
|
||||
name = "submachine gun"
|
||||
desc = "A lightweight, fast firing gun. Uses 9mm rounds."
|
||||
icon_state = "saber"
|
||||
icon_state = "saber" //ugly
|
||||
w_class = 3.0
|
||||
max_shells = 18
|
||||
caliber = "9mm"
|
||||
@@ -14,11 +14,11 @@
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/mini_uzi
|
||||
name = "Mini-Uzi"
|
||||
name = "Uzi"
|
||||
desc = "A lightweight, fast firing gun, for when you want someone dead. Uses .45 rounds."
|
||||
icon_state = "mini-uzi"
|
||||
w_class = 3.0
|
||||
max_shells = 20
|
||||
max_shells = 16
|
||||
caliber = " .45"
|
||||
origin_tech = "combat=5;materials=2;syndicate=8"
|
||||
ammo_type = "/obj/item/ammo_casing/c45"
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/c20r
|
||||
name = "C-20r SMG"
|
||||
name = "\improper C-20r SMG"
|
||||
desc = "A lightweight, fast firing gun, for when you REALLY need someone dead. Uses 12mm rounds. Has a 'Scarborough Arms - Per falcis, per pravitas' buttstamp"
|
||||
icon_state = "c20r"
|
||||
item_state = "c20r"
|
||||
@@ -60,7 +60,85 @@
|
||||
|
||||
update_icon()
|
||||
..()
|
||||
overlays = null
|
||||
if(empty_mag)
|
||||
overlays += "c20r-[round(loaded.len,4)]"
|
||||
icon_state = "c20r-[round(loaded.len,4)]"
|
||||
else
|
||||
icon_state = "c20r"
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw
|
||||
name = "\improper L6 SAW"
|
||||
desc = "A rather traditionally made light machine gun with a pleasantly lacquered wooden pistol grip. Has 'Aussec Armoury- 2531' engraved on the reciever"
|
||||
icon_state = "l6closed100"
|
||||
item_state = "l6closedmag"
|
||||
w_class = 4
|
||||
slot_flags = 0
|
||||
max_shells = 50
|
||||
caliber = "a762"
|
||||
origin_tech = "combat=5;materials=1;syndicate=2"
|
||||
ammo_type = "/obj/item/ammo_casing/a762"
|
||||
fire_sound = 'sound/weapons/Gunshot_smg.ogg'
|
||||
load_method = 2
|
||||
var/cover_open = 0
|
||||
var/mag_inserted = 1
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/attack_self(mob/user as mob)
|
||||
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"][mag_inserted ? round(loaded.len, 25) : "-empty"]"
|
||||
|
||||
|
||||
/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='notice'>[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 as mob)
|
||||
if(loc != user)
|
||||
..()
|
||||
return //let them pick it up
|
||||
if(!cover_open || (cover_open && !mag_inserted))
|
||||
..()
|
||||
else if(cover_open && mag_inserted)
|
||||
//drop the mag
|
||||
empty_mag = new /obj/item/ammo_magazine/a762(src)
|
||||
empty_mag.stored_ammo = loaded
|
||||
empty_mag.icon_state = "a762-[round(loaded.len, 10)]"
|
||||
empty_mag.desc = "There are [loaded.len] shells left!"
|
||||
empty_mag.loc = get_turf(src.loc)
|
||||
user.put_in_hands(empty_mag)
|
||||
empty_mag = null
|
||||
mag_inserted = 0
|
||||
loaded = list()
|
||||
update_icon()
|
||||
user << "<span class='notice'>You remove the magazine from [src].</span>"
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/l6_saw/attackby(var/obj/item/A as obj, mob/user as mob)
|
||||
if(!cover_open)
|
||||
user << "<span class='notice'>[src]'s cover is closed! You can't insert a new mag!</span>"
|
||||
return
|
||||
else if(cover_open && mag_inserted)
|
||||
user << "<span class='notice'>[src] already has a magazine inserted!</span>"
|
||||
return
|
||||
else if(cover_open && !mag_inserted)
|
||||
mag_inserted = 1
|
||||
user << "<span class='notice'>You insert the magazine!</span>"
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
|
||||
/* The thing I found with guns in ss13 is that they don't seem to simulate the rounds in the magazine in the gun.
|
||||
Afaik, since projectile.dm features a revolver, this would make sense since the magazine is part of the gun.
|
||||
However, it looks like subsequent guns that use removable magazines don't take that into account and just get
|
||||
around simulating a removable magazine by adding the casings into the loaded list and spawning an empty magazine
|
||||
when the gun is out of rounds. Which means you can't eject magazines with rounds in them. The below is a very
|
||||
rough and poor attempt at making that happen. -Ausops */
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/item/weapon/gun/projectile/silenced
|
||||
name = "Silenced Pistol"
|
||||
name = "silenced pistol"
|
||||
desc = "A small, quiet, easily concealable gun. Uses .45 rounds."
|
||||
icon_state = "silenced_pistol"
|
||||
w_class = 3.0
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle
|
||||
name = "Desert Eagle"
|
||||
name = "desert eagle"
|
||||
desc = "A robust handgun that uses .50 AE ammo"
|
||||
icon_state = "deagle"
|
||||
force = 14.0
|
||||
@@ -37,7 +37,6 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle/gold
|
||||
name = "Desert Eagle"
|
||||
desc = "A gold plated gun folded over a million times by superior martian gunsmiths. Uses .50 AE ammo."
|
||||
icon_state = "deagleg"
|
||||
item_state = "deagleg"
|
||||
@@ -45,7 +44,6 @@
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/deagle/camo
|
||||
name = "Desert Eagle"
|
||||
desc = "A Deagle brand Deagle for operators operating operationally. Uses .50 AE ammo."
|
||||
icon_state = "deaglecamo"
|
||||
item_state = "deagleg"
|
||||
@@ -53,7 +51,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/gyropistol
|
||||
name = "Gyrojet Pistol"
|
||||
name = "gyrojet pistol"
|
||||
desc = "A bulky pistol designed to fire self propelled rounds"
|
||||
icon_state = "gyropistol"
|
||||
max_shells = 8
|
||||
@@ -84,4 +82,71 @@
|
||||
icon_state = "gyropistolloaded"
|
||||
else
|
||||
icon_state = "gyropistol"
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/pistol
|
||||
name = "\improper Stechtkin pistol"
|
||||
desc = "A small, easily concealable gun. Uses 9mm rounds."
|
||||
icon_state = "pistol"
|
||||
w_class = 2
|
||||
max_shells = 8
|
||||
caliber = "9mm"
|
||||
silenced = 0
|
||||
origin_tech = "combat=2;materials=2;syndicate=2"
|
||||
ammo_type = "/obj/item/ammo_casing/c9mm"
|
||||
load_method = 2
|
||||
|
||||
/obj/item/weapon/gun/projectile/pistol/New()
|
||||
..()
|
||||
empty_mag = new /obj/item/ammo_magazine/mc9mm/empty(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/pistol/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)
|
||||
..()
|
||||
if(!loaded.len && empty_mag)
|
||||
empty_mag.loc = get_turf(src.loc)
|
||||
empty_mag = null
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/projectile/pistol/attack_hand(mob/user as mob)
|
||||
if(loc == user)
|
||||
if(silenced)
|
||||
if(user.l_hand != src && user.r_hand != src)
|
||||
..()
|
||||
return
|
||||
user << "<span class='notice'>You unscrew [silenced] from [src].</span>"
|
||||
user.put_in_hands(silenced)
|
||||
silenced = 0
|
||||
w_class = 2
|
||||
update_icon()
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/pistol/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/silencer))
|
||||
if(user.l_hand != src && user.r_hand != src) //if we're not in his hands
|
||||
user << "<span class='notice'>You'll need [src] in your hands to do that.</span>"
|
||||
return
|
||||
user.drop_item()
|
||||
user << "<span class='notice'>You screw [I] onto [src].</span>"
|
||||
silenced = I //dodgy?
|
||||
w_class = 3
|
||||
I.loc = src //put the silencer into the gun
|
||||
update_icon()
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/projectile/pistol/update_icon()
|
||||
..()
|
||||
if(silenced)
|
||||
icon_state = "pistol-silencer"
|
||||
else
|
||||
icon_state = "pistol"
|
||||
|
||||
/obj/item/weapon/silencer
|
||||
name = "silencer"
|
||||
desc = "a silencer"
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "silencer"
|
||||
w_class = 2
|
||||
@@ -2,19 +2,22 @@
|
||||
desc = "A cheap Martian knock-off of a Smith & Wesson Model 10. Uses .38-Special rounds."
|
||||
name = "revolver"
|
||||
icon_state = "detective"
|
||||
max_shells = 6
|
||||
caliber = "38"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
ammo_type = "/obj/item/ammo_casing/c38"
|
||||
|
||||
/*
|
||||
|
||||
special_check(var/mob/living/carbon/human/M)
|
||||
if(ishuman(M))
|
||||
if(istype(M.w_uniform, /obj/item/clothing/under/det) && istype(M.head, /obj/item/clothing/head/det_hat) && \
|
||||
(istype(M.wear_suit, /obj/item/clothing/suit/det_suit) || istype(M.wear_suit, /obj/item/clothing/suit/armor/det_suit)))
|
||||
return 1
|
||||
M << "\red You just don't feel cool enough to use this gun looking like that."
|
||||
return 0
|
||||
*/
|
||||
if(caliber == initial(caliber))
|
||||
return 1
|
||||
if(prob(70 - (loaded.len * 10))) //minimum probability of 10, maximum of 60
|
||||
M << "<span class='danger'>[src] blows up in your face.</span>"
|
||||
M.take_organ_damage(0,20)
|
||||
M.drop_item()
|
||||
del(src)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
verb/rename_gun()
|
||||
set name = "Name Gun"
|
||||
@@ -24,7 +27,7 @@
|
||||
var/mob/M = usr
|
||||
if(!M.mind) return 0
|
||||
if(!M.mind.assigned_role == "Detective")
|
||||
M << "\red You don't feel cool enough to name this gun, chump."
|
||||
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
|
||||
return 0
|
||||
|
||||
var/input = stripped_input(usr,"What do you want to name the gun?", ,"", MAX_NAME_LEN)
|
||||
@@ -34,11 +37,44 @@
|
||||
M << "You name the gun [input]. Say hello to your new friend."
|
||||
return 1
|
||||
|
||||
attackby(var/obj/item/A as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(A, /obj/item/weapon/screwdriver))
|
||||
if(caliber == "38")
|
||||
user << "<span class='notice'>You begin to reinforce the barrel of [src].</span>"
|
||||
if(loaded.len)
|
||||
afterattack(user, user) //you know the drill
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='danger'>[src] goes off in your face!</span>")
|
||||
return
|
||||
if(do_after(user, 30))
|
||||
if(loaded.len)
|
||||
user << "<span class='notice'>You can't modify it!</span>"
|
||||
return
|
||||
caliber = "357"
|
||||
desc = "The barrel and chamber assembly seems to have been modified."
|
||||
user << "<span class='warning'>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(loaded.len)
|
||||
afterattack(user, user) //and again
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.visible_message("<span class='danger'>[src] goes off!</span>", "<span class='danger'>[src] goes off in your face!</span>")
|
||||
return
|
||||
if(do_after(user, 30))
|
||||
if(loaded.len)
|
||||
user << "<span class='notice'>You can't modify it!</span>"
|
||||
return
|
||||
caliber = "38"
|
||||
desc = initial(desc)
|
||||
user << "<span class='warning'>You remove the modifications on [src]! Now it will fire .38 rounds.</span>"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/projectile/mateba
|
||||
name = "mateba"
|
||||
desc = "When you absolutely, positively need a 10mm hole in the other guy. Uses .357 ammo."
|
||||
desc = "When you absolutely, positively need a 10mm hole in the other guy. Uses .357 ammo." //>10mm hole >.357
|
||||
icon_state = "mateba"
|
||||
origin_tech = "combat=2;materials=2"
|
||||
|
||||
@@ -47,7 +83,7 @@
|
||||
|
||||
/obj/item/weapon/gun/projectile/russian
|
||||
name = "Russian Revolver"
|
||||
desc = "A Russian made revolver. Uses 357 ammo. It has a single slot in it's chamber for a bullet."
|
||||
desc = "A Russian made revolver. Uses .357 ammo. It has a single slot in it's chamber for a bullet."
|
||||
max_shells = 6
|
||||
origin_tech = "combat=2;materials=2"
|
||||
|
||||
@@ -89,9 +125,9 @@
|
||||
A.update_icon()
|
||||
|
||||
if(num_loaded)
|
||||
user.visible_message("[user] loads a single bullet into the revolver and spins the chamber.", "You load a single bullet into the chamber and spin it.")
|
||||
user.visible_message("<span class='warning'>[user] loads a single bullet into the revolver and spins the chamber.</span>", "<span class='warning'>You load a single bullet into the chamber and spin it.</span>")
|
||||
else
|
||||
user.visible_message("[user] spins the chamber of the revolver.", "You spin the revolver's chamber.")
|
||||
user.visible_message("<span class='warning'>[user] spins the chamber of the revolver.</span>", "<span class='warning'>You spin the revolver's chamber.</span>")
|
||||
if(getAmmo() > 0)
|
||||
Spin()
|
||||
update_icon()
|
||||
@@ -99,7 +135,7 @@
|
||||
|
||||
/obj/item/weapon/gun/projectile/russian/attack_self(mob/user as mob)
|
||||
|
||||
user.visible_message("[user] spins the chamber of the revolver.", "You spin the revolver's chamber.")
|
||||
user.visible_message("<span class='warning'>[user] spins the chamber of the revolver.</span>", "<span class='warning'>You spin the revolver's chamber.</span>")
|
||||
if(getAmmo() > 0)
|
||||
Spin()
|
||||
|
||||
@@ -107,6 +143,7 @@
|
||||
|
||||
if(!loaded.len)
|
||||
user.visible_message("\red *click*", "\red *click*")
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
return
|
||||
|
||||
if(isliving(target) && isliving(user))
|
||||
@@ -117,12 +154,13 @@
|
||||
var/obj/item/ammo_casing/AC = loaded[1]
|
||||
if(!load_into_chamber())
|
||||
user.visible_message("\red *click*", "\red *click*")
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
return
|
||||
if(!in_chamber)
|
||||
return
|
||||
var/obj/item/projectile/P = new AC.projectile_type
|
||||
playsound(user, fire_sound, 50, 1)
|
||||
user.visible_message("\red [user.name] fires the [src.name] at his head!", "\red You fire the [src.name] at your head!", "\blue You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
||||
user.visible_message("<span class='danger'>[user.name] fires [src] at \his head!</span>", "<span class='danger'>You fire [src] at your head!</span>", "You hear a [istype(in_chamber, /obj/item/projectile/beam) ? "laser blast" : "gunshot"]!")
|
||||
if(!P.nodamage)
|
||||
user.apply_damage(300, BRUTE, affecting) // You are dead, dead, dead.
|
||||
return
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
var/yo = null
|
||||
var/xo = null
|
||||
var/current = null
|
||||
var/turf/original = null // the original turf clicked
|
||||
var/obj/shot_from = null // the object which shot us
|
||||
var/atom/original = null // the original target clicked
|
||||
var/turf/starting = null // the projectile's starting turf
|
||||
var/list/permutated = list() // we've passed through these atoms, don't try to hit them again
|
||||
|
||||
@@ -36,7 +37,7 @@
|
||||
var/damage = 10
|
||||
var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE are the only things that should be in here
|
||||
var/nodamage = 0 //Determines if the projectile will skip any damage inflictions
|
||||
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb
|
||||
var/flag = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb //Cael - bio and rad are also valid
|
||||
var/projectile_type = "/obj/item/projectile"
|
||||
var/kill_count = 50 //This will de-increment every process(). When 0, it will delete the projectile.
|
||||
//Effects
|
||||
@@ -72,9 +73,9 @@
|
||||
Bump(atom/A as mob|obj|turf|area)
|
||||
if(A == firer)
|
||||
loc = A.loc
|
||||
return //cannot shoot yourself
|
||||
return 0 //cannot shoot yourself
|
||||
|
||||
if(bumped) return
|
||||
if(bumped) return 0
|
||||
var/forcedodge = 0 // force the projectile to pass
|
||||
|
||||
bumped = 1
|
||||
@@ -82,35 +83,33 @@
|
||||
var/mob/M = A
|
||||
if(!istype(A, /mob/living))
|
||||
loc = A.loc
|
||||
return // nope.avi
|
||||
return 0// nope.avi
|
||||
|
||||
// check for dodge (i can't place in bullet_act because then things get wonky)
|
||||
if(!M.stat && !M.lying && (REFLEXES in M.augmentations) && prob(85))
|
||||
var/message = pick("[M] skillfully dodges the [name]!", "[M] ducks, dodging the [name]!", "[M] effortlessly jumps out of the way of the [name]!", "[M] dodges the [name] in one graceful movement!", "[M] leans back, dodging the [name] narrowly!", "[M] sidesteps, avoiding the [name] narrowly.", "[M] barely weaves out of the way of the [name].")
|
||||
M.visible_message("\red <B>[message]</B>")
|
||||
forcedodge = 1
|
||||
var/distance = get_dist(original,loc)
|
||||
//Lower accurancy/longer range tradeoff. Distance matters a lot here, so at
|
||||
// close distance, actually RAISE the chance to hit.
|
||||
def_zone = get_zone_with_miss_chance(def_zone, M, -30 + 8*distance)
|
||||
|
||||
if(silenced)
|
||||
if(def_zone)
|
||||
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
|
||||
else
|
||||
var/distance = get_dist(original,loc)
|
||||
def_zone = ran_zone(def_zone, 100-(5*distance)) //Lower accurancy/longer range tradeoff.
|
||||
if(!def_zone)
|
||||
visible_message("\The [src] misses [M] narrowly.")
|
||||
del(src)
|
||||
return
|
||||
if(silenced)
|
||||
M << "\red You've been shot in the [def_zone] by the [src.name]!"
|
||||
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
|
||||
else
|
||||
visible_message("\red [A.name] is hit by the [src.name] in the [def_zone]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
|
||||
|
||||
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
|
||||
if(istype(firer, /mob))
|
||||
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
|
||||
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]</font>")
|
||||
|
||||
log_admin("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]")
|
||||
msg_admin_attack("ATTACK: [firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
|
||||
log_attack("<font color='red'>[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
|
||||
else
|
||||
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
|
||||
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src]</font>")
|
||||
|
||||
log_admin("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src]")
|
||||
msg_admin_attack("ATTACK: UNKNOWN shot [M] ([M.ckey]) with a [src]") //BS12 EDIT ALG
|
||||
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a [src.type]</font>")
|
||||
|
||||
spawn(0)
|
||||
if(A)
|
||||
@@ -122,7 +121,7 @@
|
||||
else
|
||||
loc = A.loc
|
||||
permutated.Add(A)
|
||||
return
|
||||
return 0
|
||||
|
||||
if(istype(A,/turf))
|
||||
for(var/obj/O in A)
|
||||
@@ -133,7 +132,7 @@
|
||||
density = 0
|
||||
invisibility = 101
|
||||
del(src)
|
||||
return
|
||||
return 1
|
||||
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
@@ -157,12 +156,11 @@
|
||||
return
|
||||
step_towards(src, current)
|
||||
sleep(1)
|
||||
if(!bumped)
|
||||
if(loc == original)
|
||||
for(var/mob/living/M in original)
|
||||
if(!(M in permutated))
|
||||
Bump(M)
|
||||
sleep(1)
|
||||
if(!bumped && !isturf(original))
|
||||
if(loc == get_turf(original))
|
||||
if(!(original in permutated))
|
||||
Bump(original)
|
||||
sleep(1)
|
||||
return
|
||||
|
||||
proc/fired()
|
||||
|
||||
13
code/modules/projectiles/projectile/animate.dm
Normal file
13
code/modules/projectiles/projectile/animate.dm
Normal file
@@ -0,0 +1,13 @@
|
||||
/obj/item/projectile/animate
|
||||
name = "bolt of animation"
|
||||
icon_state = "ice_1"
|
||||
damage = 0
|
||||
damage_type = BURN
|
||||
nodamage = 1
|
||||
flag = "energy"
|
||||
|
||||
/obj/item/projectile/animate/Bump(var/atom/change)
|
||||
. = ..()
|
||||
if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects))
|
||||
var/obj/O = change
|
||||
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
|
||||
@@ -108,7 +108,7 @@ var/list/beam_master = list()
|
||||
/obj/item/projectile/beam/emitter
|
||||
name = "emitter beam"
|
||||
icon_state = "emitter"
|
||||
|
||||
damage = 30
|
||||
|
||||
|
||||
/obj/item/projectile/beam/lastertag/blue
|
||||
|
||||
@@ -43,4 +43,7 @@
|
||||
damage = 5
|
||||
stun = 10
|
||||
weaken = 10
|
||||
stutter = 10
|
||||
stutter = 10
|
||||
|
||||
/obj/item/projectile/bullet/a762
|
||||
damage = 25
|
||||
@@ -16,7 +16,7 @@
|
||||
M.monkeyizing = 1
|
||||
M.canmove = 0
|
||||
M.icon = null
|
||||
M.overlays = null
|
||||
M.overlays.Cut()
|
||||
M.invisibility = 101
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot))
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
var/mob/living/new_mob
|
||||
|
||||
var/randomize = pick("monkey","robot","metroid","xeno","human")
|
||||
var/randomize = pick("monkey","robot","slime","xeno","human")
|
||||
switch(randomize)
|
||||
if("monkey")
|
||||
new_mob = new /mob/living/carbon/monkey(M.loc)
|
||||
@@ -46,9 +46,9 @@
|
||||
var/mob/living/silicon/robot/Robot = new_mob
|
||||
Robot.mmi = new /obj/item/device/mmi(new_mob)
|
||||
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
|
||||
if("metroid")
|
||||
if(prob(50)) new_mob = new /mob/living/carbon/metroid/adult(M.loc)
|
||||
else new_mob = new /mob/living/carbon/metroid(M.loc)
|
||||
if("slime")
|
||||
if(prob(50)) new_mob = new /mob/living/carbon/slime/adult(M.loc)
|
||||
else new_mob = new /mob/living/carbon/slime(M.loc)
|
||||
new_mob.universal_speak = 1
|
||||
if("xeno")
|
||||
var/alien_caste = pick("Hunter","Sentinel","Drone","Larva")
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = new_mob
|
||||
if(H.dna)
|
||||
H.dna.mutantrace = pick("skrell","tajaran","lizard","golem","metroid","plant",4;"")
|
||||
H.dna.mutantrace = pick("lizard","tajaran","skrell","golem","slime","plant",4;"")
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
damage = 20
|
||||
|
||||
|
||||
/obj/item/projectile/energy/neurotoxin
|
||||
name = "neuro"
|
||||
icon_state = "neurotoxin"
|
||||
damage = 5
|
||||
damage_type = TOX
|
||||
weaken = 5
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -124,4 +124,14 @@
|
||||
else if (istype(target, /mob/living/carbon/))
|
||||
M.show_message("\blue The radiation beam dissipates harmlessly through your body.")
|
||||
else
|
||||
return 1
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/projectile/beam/mindflayer
|
||||
name = "flayer ray"
|
||||
|
||||
on_hit(var/atom/target, var/blocked = 0)
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/M = target
|
||||
M.adjustBrainLoss(20)
|
||||
M.hallucination += 20
|
||||
|
||||
Reference in New Issue
Block a user