to_chat replacing stream operator

This commit is contained in:
Arokha Sieyes
2020-02-17 13:14:08 -05:00
committed by Leshana
parent 5aaba55222
commit 5b15917d32
712 changed files with 4250 additions and 4220 deletions
+11 -11
View File
@@ -18,17 +18,17 @@
if(!attached_lock.controller_lock)
if(!attached_lock.stored_dna && !(M.dna in attached_lock.stored_dna))
M << "<span class='warning'>\The [src] buzzes and displays a symbol showing the gun already contains your DNA.</span>"
to_chat(M, "<span class='warning'>\The [src] buzzes and displays a symbol showing the gun already contains your DNA.</span>")
return 0
else
attached_lock.stored_dna += M.dna
M << "<span class='notice'>\The [src] pings and a needle flicks out from the grip, taking a DNA sample from you.</span>"
to_chat(M, "<span class='notice'>\The [src] pings and a needle flicks out from the grip, taking a DNA sample from you.</span>")
if(!attached_lock.controller_dna)
attached_lock.controller_dna = M.dna
M << "<span class='notice'>\The [src] processes the dna sample and pings, acknowledging you as the primary controller.</span>"
to_chat(M, "<span class='notice'>\The [src] processes the dna sample and pings, acknowledging you as the primary controller.</span>")
return 1
else
M << "<span class='warning'>\The [src] buzzes and displays a locked symbol. It is not allowing DNA samples at this time.</span>"
to_chat(M, "<span class='warning'>\The [src] buzzes and displays a locked symbol. It is not allowing DNA samples at this time.</span>")
return 0
/obj/item/weapon/gun/verb/give_dna()
@@ -41,19 +41,19 @@
var/mob/living/M = user
if(!attached_lock.controller_lock)
if(!authorized_user(M))
M << "<span class='warning'>\The [src] buzzes and displays an invalid user symbol.</span>"
to_chat(M, "<span class='warning'>\The [src] buzzes and displays an invalid user symbol.</span>")
return 0
else
attached_lock.stored_dna -= user.dna
M << "<span class='notice'>\The [src] beeps and clears the DNA it has stored.</span>"
to_chat(M, "<span class='notice'>\The [src] beeps and clears the DNA it has stored.</span>")
if(M.dna == attached_lock.controller_dna)
attached_lock.controller_dna = null
M << "<span class='notice'>\The [src] beeps and removes you as the primary controller.</span>"
to_chat(M, "<span class='notice'>\The [src] beeps and removes you as the primary controller.</span>")
if(attached_lock.controller_lock)
attached_lock.controller_lock = 0
return 1
else
M << "<span class='warning'>\The [src] buzzes and displays a locked symbol. It is not allowing DNA modifcation at this time.</span>"
to_chat(M, "<span class='warning'>\The [src] buzzes and displays a locked symbol. It is not allowing DNA modifcation at this time.</span>")
return 0
/obj/item/weapon/gun/verb/remove_dna()
@@ -67,12 +67,12 @@
if(authorized_user(M) && user.dna == attached_lock.controller_dna)
if(!attached_lock.controller_lock)
attached_lock.controller_lock = 1
M << "<span class='notice'>\The [src] beeps and displays a locked symbol, informing you it will no longer allow DNA samples.</span>"
to_chat(M, "<span class='notice'>\The [src] beeps and displays a locked symbol, informing you it will no longer allow DNA samples.</span>")
else
attached_lock.controller_lock = 0
M << "<span class='notice'>\The [src] beeps and displays an unlocked symbol, informing you it will now allow DNA samples.</span>"
to_chat(M, "<span class='notice'>\The [src] beeps and displays an unlocked symbol, informing you it will now allow DNA samples.</span>")
else
M << "<span class='warning'>\The [src] buzzes and displays an invalid user symbol.</span>"
to_chat(M, "<span class='warning'>\The [src] buzzes and displays an invalid user symbol.</span>")
/obj/item/weapon/gun/verb/allow_dna()
set name = "Toggle DNA Samples Allowance"
+5 -5
View File
@@ -109,12 +109,12 @@
/obj/item/weapon/gun/energy/proc/load_ammo(var/obj/item/C, mob/user)
if(istype(C, /obj/item/weapon/cell))
if(self_recharge || battery_lock)
user << "<span class='notice'>[src] does not have a battery port.</span>"
to_chat(user, "<span class='notice'>[src] does not have a battery port.</span>")
return
if(istype(C, accept_cell_type))
var/obj/item/weapon/cell/P = C
if(power_supply)
user << "<span class='notice'>[src] already has a power cell.</span>"
to_chat(user, "<span class='notice'>[src] already has a power cell.</span>")
else
user.visible_message("[user] is reloading [src].", "<span class='notice'>You start to insert [P] into [src].</span>")
if(do_after(user, 5 * P.w_class))
@@ -126,12 +126,12 @@
update_icon()
update_held_icon()
else
user << "<span class='notice'>This cell is not fitted for [src].</span>"
to_chat(user, "<span class='notice'>This cell is not fitted for [src].</span>")
return
/obj/item/weapon/gun/energy/proc/unload_ammo(mob/user)
if(self_recharge || battery_lock)
user << "<span class='notice'>[src] does not have a battery port.</span>"
to_chat(user, "<span class='notice'>[src] does not have a battery port.</span>")
return
if(power_supply)
user.put_in_hands(power_supply)
@@ -142,7 +142,7 @@
update_icon()
update_held_icon()
else
user << "<span class='notice'>[src] does not have a power cell.</span>"
to_chat(user, "<span class='notice'>[src] does not have a power cell.</span>")
/obj/item/weapon/gun/energy/attackby(var/obj/item/A as obj, mob/user as mob)
..()
@@ -234,7 +234,7 @@
/obj/item/weapon/gun/energy/lasertag/special_check(var/mob/living/carbon/human/M)
if(ishuman(M))
if(!istype(M.wear_suit, required_vest))
M << "<span class='warning'>You need to be wearing your laser tag vest!</span>"
to_chat(M, "<span class='warning'>You need to be wearing your laser tag vest!</span>")
return 0
return ..()
@@ -26,7 +26,7 @@
charge_cost = 120
/obj/item/weapon/gun/energy/pulse_rifle/destroyer/attack_self(mob/living/user as mob)
user << "<span class='warning'>[src.name] has three settings, and they are all DESTROY.</span>"
to_chat(user, "<span class='warning'>[src.name] has three settings, and they are all DESTROY.</span>")
//WHY?
/obj/item/weapon/gun/energy/pulse_rifle/M1911
+1 -1
View File
@@ -15,7 +15,7 @@
//Override this to avoid a runtime with suicide handling.
/obj/item/weapon/gun/launcher/handle_suicide(mob/living/user)
user << "<font color='red'>Shooting yourself with \a [src] is pretty tricky. You can't seem to manage it.</font>"
to_chat(user, "<font color='red'>Shooting yourself with \a [src] is pretty tricky. You can't seem to manage it.</font>")
return
/obj/item/weapon/gun/launcher/proc/update_release_force(obj/item/projectile)
@@ -40,7 +40,7 @@
/obj/item/weapon/arrow/rod/removed(mob/user)
if(throwforce == 15) // The rod has been superheated - we don't want it to be useable when removed from the bow.
user << "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow."
to_chat(user , "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow.")
var/obj/item/weapon/material/shard/shrapnel/S = new()
S.loc = get_turf(src)
qdel(src)
@@ -68,7 +68,7 @@
/obj/item/weapon/gun/launcher/crossbow/consume_next_projectile(mob/user=null)
if(tension <= 0)
user << "<span class='warning'>\The [src] is not drawn back!</span>"
to_chat(user, "<span class='warning'>\The [src] is not drawn back!</span>")
return null
return bolt
@@ -96,7 +96,7 @@
/obj/item/weapon/gun/launcher/crossbow/proc/draw(var/mob/user as mob)
if(!bolt)
user << "You don't have anything nocked to [src]."
to_chat(user, "You don't have anything nocked to [src].")
return
if(user.restrained())
@@ -122,7 +122,7 @@
if(tension >= max_tension)
tension = max_tension
usr << "[src] clunks as you draw the string to its maximum tension!"
to_chat(usr, "[src] clunks as you draw the string to its maximum tension!")
return
user.visible_message("[usr] draws back the string of [src]!","<span class='notice'>You continue drawing back the string of [src]!</span>")
@@ -157,20 +157,20 @@
user.drop_item()
cell = W
cell.loc = src
user << "<span class='notice'>You jam [cell] into [src] and wire it to the firing coil.</span>"
to_chat(user, "<span class='notice'>You jam [cell] into [src] and wire it to the firing coil.</span>")
superheat_rod(user)
else
user << "<span class='notice'>[src] already has a cell installed.</span>"
to_chat(user, "<span class='notice'>[src] already has a cell installed.</span>")
else if(W.is_screwdriver())
if(cell)
var/obj/item/C = cell
C.loc = get_turf(user)
user << "<span class='notice'>You jimmy [cell] out of [src] with [W].</span>"
to_chat(user, "<span class='notice'>You jimmy [cell] out of [src] with [W].</span>")
playsound(src, W.usesound, 50, 1)
cell = null
else
user << "<span class='notice'>[src] doesn't have a cell installed.</span>"
to_chat(user, "<span class='notice'>[src] doesn't have a cell installed.</span>")
else
..()
@@ -181,7 +181,7 @@
if(bolt.throwforce >= 15) return
if(!istype(bolt,/obj/item/weapon/arrow/rod)) return
user << "<span class='notice'>[bolt] plinks and crackles as it begins to glow red-hot.</span>"
to_chat(user, "<span class='notice'>[bolt] plinks and crackles as it begins to glow red-hot.</span>")
bolt.throwforce = 15
bolt.icon_state = "metal-rod-superheated"
cell.use(500)
@@ -210,22 +210,27 @@
/obj/item/weapon/crossbowframe/examine(mob/user)
..(user)
switch(buildstate)
if(1) user << "It has a loose rod frame in place."
if(2) user << "It has a steel backbone welded in place."
if(3) user << "It has a steel backbone and a cell mount installed."
if(4) user << "It has a steel backbone, plastic lath and a cell mount installed."
if(5) user << "It has a steel cable loosely strung across the lath."
if(1)
to_chat(user, "It has a loose rod frame in place.")
if(2)
to_chat(user, "It has a steel backbone welded in place.")
if(3)
to_chat(user, "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.")
if(5)
to_chat(user, "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))
if(buildstate == 0)
var/obj/item/stack/rods/R = W
if(R.use(3))
user << "<span class='notice'>You assemble a backbone of rods around the wooden stock.</span>"
to_chat(user, "<span class='notice'>You assemble a backbone of rods around the wooden stock.</span>")
buildstate++
update_icon()
else
user << "<span class='notice'>You need at least three rods to complete this task.</span>"
to_chat(user, "<span class='notice'>You need at least three rods to complete this task.</span>")
return
else if(istype(W, /obj/item/weapon/weldingtool))
if(buildstate == 1)
@@ -233,7 +238,7 @@
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 50, 1)
user << "<span class='notice'>You weld the rods into place.</span>"
to_chat(user, "<span class='notice'>You weld the rods into place.</span>")
buildstate++
update_icon()
return
@@ -241,33 +246,33 @@
var/obj/item/stack/cable_coil/C = W
if(buildstate == 2)
if(C.use(5))
user << "<span class='notice'>You wire a crude cell mount into the top of the crossbow.</span>"
to_chat(user, "<span class='notice'>You wire a crude cell mount into the top of the crossbow.</span>")
buildstate++
update_icon()
else
user << "<span class='notice'>You need at least five segments of cable coil to complete this task.</span>"
to_chat(user, "<span class='notice'>You need at least five segments of cable coil to complete this task.</span>")
return
else if(buildstate == 4)
if(C.use(5))
user << "<span class='notice'>You string a steel cable across the crossbow's lath.</span>"
to_chat(user, "<span class='notice'>You string a steel cable across the crossbow's lath.</span>")
buildstate++
update_icon()
else
user << "<span class='notice'>You need at least five segments of cable coil to complete this task.</span>"
to_chat(user, "<span class='notice'>You need at least five segments of cable coil to complete this task.</span>")
return
else if(istype(W,/obj/item/stack/material) && W.get_material_name() == "plastic")
if(buildstate == 3)
var/obj/item/stack/material/P = W
if(P.use(3))
user << "<span class='notice'>You assemble and install a heavy plastic lath onto the crossbow.</span>"
to_chat(user, "<span class='notice'>You assemble and install a heavy plastic lath onto the crossbow.</span>")
buildstate++
update_icon()
else
user << "<span class='notice'>You need at least three plastic sheets to complete this task.</span>"
to_chat(user, "<span class='notice'>You need at least three plastic sheets to complete this task.</span>")
return
else if(W.is_screwdriver())
if(buildstate == 5)
user << "<span class='notice'>You secure the crossbow's various parts.</span>"
to_chat(user, "<span class='notice'>You secure the crossbow's various parts.</span>")
playsound(src, W.usesound, 50, 1)
new /obj/item/weapon/gun/launcher/crossbow(get_turf(src))
qdel(src)
@@ -30,29 +30,29 @@
if(next)
grenades -= next //Remove grenade from loaded list.
chambered = next
M << "<span class='warning'>You pump [src], loading \a [next] into the chamber.</span>"
to_chat(M, "<span class='warning'>You pump [src], loading \a [next] into the chamber.</span>")
else
M << "<span class='warning'>You pump [src], but the magazine is empty.</span>"
to_chat(M, "<span class='warning'>You pump [src], but the magazine is empty.</span>")
update_icon()
/obj/item/weapon/gun/launcher/grenade/examine(mob/user)
if(..(user, 2))
var/grenade_count = grenades.len + (chambered? 1 : 0)
user << "Has [grenade_count] grenade\s remaining."
to_chat(user, "Has [grenade_count] grenade\s remaining.")
if(chambered)
user << "\A [chambered] is chambered."
to_chat(user, "\A [chambered] is chambered.")
/obj/item/weapon/gun/launcher/grenade/proc/load(obj/item/weapon/grenade/G, mob/user)
if(G.loadable)
if(grenades.len >= max_grenades)
user << "<span class='warning'>[src] is full.</span>"
to_chat(user, "<span class='warning'>[src] is full.</span>")
return
user.remove_from_mob(G)
G.loc = src
grenades.Insert(1, G) //add to the head of the list, so that it is loaded on the next pump
user.visible_message("[user] inserts \a [G] into [src].", "<span class='notice'>You insert \a [G] into [src].</span>")
return
user << "<span class='warning'>[G] doesn't seem to fit in the [src]!</span>"
to_chat(user, "<span class='warning'>[G] doesn't seem to fit in the [src]!</span>")
/obj/item/weapon/gun/launcher/grenade/proc/unload(mob/user)
if(grenades.len)
@@ -62,7 +62,7 @@
user.visible_message("[user] removes \a [G] from [src].", "<span class='notice'>You remove \a [G] from [src].</span>")
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
else
user << "<span class='warning'>[src] is empty.</span>"
to_chat(user, "<span class='warning'>[src] is empty.</span>")
/obj/item/weapon/gun/launcher/grenade/attack_self(mob/user)
pump(user)
@@ -105,14 +105,14 @@
/obj/item/weapon/gun/launcher/grenade/underslung/load(obj/item/weapon/grenade/G, mob/user)
if(G.loadable)
if(chambered)
user << "<span class='warning'>[src] is already loaded.</span>"
to_chat(user, "<span class='warning'>[src] is already loaded.</span>")
return
user.remove_from_mob(G)
G.loc = src
chambered = G
user.visible_message("[user] load \a [G] into [src].", "<span class='notice'>You load \a [G] into [src].</span>")
return
user << "<span class='warning'>[G] doesn't seem to fit in the [src]!</span>"
to_chat(user, "<span class='warning'>[G] doesn't seem to fit in the [src]!</span>")
/obj/item/weapon/gun/launcher/grenade/underslung/unload(mob/user)
if(chambered)
@@ -121,4 +121,4 @@
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
chambered = null
else
user << "<span class='warning'>[src] is empty.</span>"
to_chat(user, "<span class='warning'>[src] is empty.</span>")
@@ -35,14 +35,14 @@
var/N = input("Percentage of tank used per shot:","[src]") as null|anything in possible_pressure_amounts
if (N)
pressure_setting = N
usr << "You dial the pressure valve to [pressure_setting]%."
to_chat(usr, "You dial the pressure valve to [pressure_setting]%.")
/obj/item/weapon/gun/launcher/pneumatic/proc/eject_tank(mob/user) //Remove the tank.
if(!tank)
user << "There's no tank in [src]."
to_chat(user, "There's no tank in [src].")
return
user << "You twist the valve and pop the tank out of [src]."
to_chat(user, "You twist the valve and pop the tank out of [src].")
user.put_in_hands(tank)
tank = null
update_icon()
@@ -52,10 +52,10 @@
var/obj/item/removing = item_storage.contents[item_storage.contents.len]
item_storage.remove_from_storage(removing, src.loc)
user.put_in_hands(removing)
user << "You remove [removing] from the hopper."
to_chat(user, "You remove [removing] from the hopper.")
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
else
user << "There is nothing to remove in \the [src]."
to_chat(user, "There is nothing to remove in \the [src].")
/obj/item/weapon/gun/launcher/pneumatic/attack_hand(mob/user as mob)
if(user.get_inactive_hand() == src)
@@ -79,7 +79,7 @@
if(!item_storage.contents.len)
return null
if (!tank)
user << "There is no gas tank in [src]!"
to_chat(user, "There is no gas tank in [src]!")
return null
var/environment_pressure = 10
@@ -91,7 +91,7 @@
fire_pressure = (tank.air_contents.return_pressure() - environment_pressure)*pressure_setting/100
if(fire_pressure < 10)
user << "There isn't enough gas in the tank to fire [src]."
to_chat(user, "There isn't enough gas in the tank to fire [src].")
return null
var/obj/item/launched = item_storage.contents[1]
@@ -101,11 +101,11 @@
/obj/item/weapon/gun/launcher/pneumatic/examine(mob/user)
if(!..(user, 2))
return
user << "The valve is dialed to [pressure_setting]%."
to_chat(user, "The valve is dialed to [pressure_setting]%.")
if(tank)
user << "The tank dial reads [tank.air_contents.return_pressure()] kPa."
to_chat(user, "The tank dial reads [tank.air_contents.return_pressure()] kPa.")
else
user << "Nothing is attached to the tank valve!"
to_chat(user, "Nothing is attached to the tank valve!")
/obj/item/weapon/gun/launcher/pneumatic/update_release_force(obj/item/projectile)
if(tank)
@@ -152,18 +152,23 @@
/obj/item/weapon/cannonframe/examine(mob/user)
..(user)
switch(buildstate)
if(1) user << "It has a pipe segment installed."
if(2) user << "It has a pipe segment welded in place."
if(3) user << "It has an outer chassis installed."
if(4) user << "It has an outer chassis welded in place."
if(5) user << "It has a transfer valve installed."
if(1)
to_chat(user, "It has a pipe segment installed.")
if(2)
to_chat(user, "It has a pipe segment welded in place.")
if(3)
to_chat(user, "It has an outer chassis installed.")
if(4)
to_chat(user, "It has an outer chassis welded in place.")
if(5)
to_chat(user, "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))
if(buildstate == 0)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You secure the piping inside the frame.</span>"
to_chat(user, "<span class='notice'>You secure the piping inside the frame.</span>")
buildstate++
update_icon()
return
@@ -171,17 +176,17 @@
if(buildstate == 2)
var/obj/item/stack/material/M = W
if(M.use(5))
user << "<span class='notice'>You assemble a chassis around the cannon frame.</span>"
to_chat(user, "<span class='notice'>You assemble a chassis around the cannon frame.</span>")
buildstate++
update_icon()
else
user << "<span class='notice'>You need at least five metal sheets to complete this task.</span>"
to_chat(user, "<span class='notice'>You need at least five metal sheets to complete this task.</span>")
return
else if(istype(W,/obj/item/device/transfer_valve))
if(buildstate == 4)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You install the transfer valve and connect it to the piping.</span>"
to_chat(user, "<span class='notice'>You install the transfer valve and connect it to the piping.</span>")
buildstate++
update_icon()
return
@@ -191,7 +196,7 @@
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 100, 1)
user << "<span class='notice'>You weld the pipe into place.</span>"
to_chat(user, "<span class='notice'>You weld the pipe into place.</span>")
buildstate++
update_icon()
if(buildstate == 3)
@@ -199,7 +204,7 @@
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 100, 1)
user << "<span class='notice'>You weld the metal chassis together.</span>"
to_chat(user, "<span class='notice'>You weld the metal chassis together.</span>")
buildstate++
update_icon()
if(buildstate == 5)
@@ -207,7 +212,7 @@
if(T.remove_fuel(0,user))
if(!src || !T.isOn()) return
playsound(src, W.usesound, 100, 1)
user << "<span class='notice'>You weld the valve into place.</span>"
to_chat(user, "<span class='notice'>You weld the valve into place.</span>")
new /obj/item/weapon/gun/launcher/pneumatic(get_turf(src))
qdel(src)
return
@@ -19,7 +19,7 @@
/obj/item/weapon/gun/launcher/rocket/examine(mob/user)
if(!..(user, 2))
return
user << "<font color='blue'>[rockets.len] / [max_rockets] rockets.</font>"
to_chat(user, "<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))
@@ -27,10 +27,10 @@
user.drop_item()
I.loc = src
rockets += I
user << "<font color='blue'>You put the rocket in [src].</font>"
user << "<font color='blue'>[rockets.len] / [max_rockets] rockets.</font>"
to_chat(user, "<font color='blue'>You put the rocket in [src].</font>")
to_chat(user, "<font color='blue'>[rockets.len] / [max_rockets] rockets.</font>")
else
usr << "<font color='red'>[src] cannot hold more rockets.</font>"
to_chat(usr, "<font color='red'>[src] cannot hold more rockets.</font>")
/obj/item/weapon/gun/launcher/rocket/consume_next_projectile()
if(rockets.len)
@@ -20,7 +20,7 @@
/obj/item/weapon/syringe_cartridge/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/reagent_containers/syringe))
syringe = I
user << "<span class='notice'>You carefully insert [syringe] into [src].</span>"
to_chat(user, "<span class='notice'>You carefully insert [syringe] into [src].</span>")
user.remove_from_mob(syringe)
syringe.loc = src
sharp = 1
@@ -29,7 +29,7 @@
/obj/item/weapon/syringe_cartridge/attack_self(mob/user)
if(syringe)
user << "<span class='notice'>You remove [syringe] from [src].</span>"
to_chat(user, "<span class='notice'>You remove [syringe] from [src].</span>")
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
user.put_in_hands(syringe)
syringe = null
@@ -105,10 +105,10 @@
/obj/item/weapon/gun/launcher/syringe/attack_hand(mob/living/user as mob)
if(user.get_inactive_hand() == src)
if(!darts.len)
user << "<span class='warning'>[src] is empty.</span>"
to_chat(user, "<span class='warning'>[src] is empty.</span>")
return
if(next)
user << "<span class='warning'>[src]'s cover is locked shut.</span>"
to_chat(user, "<span class='warning'>[src]'s cover is locked shut.</span>")
return
var/obj/item/weapon/syringe_cartridge/C = darts[1]
darts -= C
@@ -122,7 +122,7 @@
if(istype(A, /obj/item/weapon/syringe_cartridge))
var/obj/item/weapon/syringe_cartridge/C = A
if(darts.len >= max_darts)
user << "<span class='warning'>[src] is full!</span>"
to_chat(user, "<span class='warning'>[src] is full!</span>")
return
user.remove_from_mob(C)
C.loc = src
+9 -9
View File
@@ -106,12 +106,12 @@
if(istype(A, /obj/item/ammo_magazine))
var/obj/item/ammo_magazine/AM = A
if(!(load_method & AM.mag_type) || caliber != AM.caliber || allowed_magazines && !is_type_in_list(A, allowed_magazines))
user << "<span class='warning'>[AM] won't load into [src]!</span>"
to_chat(user, "<span class='warning'>[AM] won't load into [src]!</span>")
return
switch(AM.mag_type)
if(MAGAZINE)
if(ammo_magazine)
user << "<span class='warning'>[src] already has a magazine loaded.</span>" //already a magazine here
to_chat(user, "<span class='warning'>[src] already has a magazine loaded.</span>") //already a magazine here
return
user.remove_from_mob(AM)
AM.loc = src
@@ -120,7 +120,7 @@
playsound(src.loc, 'sound/weapons/flipblade.ogg', 50, 1)
if(SPEEDLOADER)
if(loaded.len >= max_shells)
user << "<span class='warning'>[src] is full!</span>"
to_chat(user, "<span class='warning'>[src] is full!</span>")
return
var/count = 0
for(var/obj/item/ammo_casing/C in AM.stored_ammo)
@@ -140,7 +140,7 @@
if(!(load_method & SINGLE_CASING) || caliber != C.caliber)
return //incompatible
if(loaded.len >= max_shells)
user << "<span class='warning'>[src] is full.</span>"
to_chat(user, "<span class='warning'>[src] is full.</span>")
return
user.remove_from_mob(C)
@@ -154,7 +154,7 @@
if(!(load_method & SINGLE_CASING))
return //incompatible
user << "<span class='notice'>You start loading \the [src].</span>"
to_chat(user, "<span class='notice'>You start loading \the [src].</span>")
sleep(1 SECOND)
for(var/obj/item/ammo_casing/ammo in storage.contents)
if(caliber != ammo.caliber)
@@ -163,7 +163,7 @@
load_ammo(ammo, user)
if(loaded.len >= max_shells)
user << "<span class='warning'>[src] is full.</span>"
to_chat(user, "<span class='warning'>[src] is full.</span>")
break
sleep(1 SECOND)
@@ -196,7 +196,7 @@
user.visible_message("[user] removes \a [C] from [src].", "<span class='notice'>You remove \a [C] from [src].</span>")
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
else
user << "<span class='warning'>[src] is empty.</span>"
to_chat(user, "<span class='warning'>[src] is empty.</span>")
update_icon()
/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob)
@@ -232,8 +232,8 @@
/obj/item/weapon/gun/projectile/examine(mob/user)
..(user)
if(ammo_magazine)
user << "It has \a [ammo_magazine] loaded."
user << "Has [getAmmo()] round\s remaining."
to_chat(user, "It has \a [ammo_magazine] loaded.")
to_chat(user, "Has [getAmmo()] round\s remaining.")
return
/obj/item/weapon/gun/projectile/proc/getAmmo()
@@ -188,9 +188,9 @@
/obj/item/weapon/gun/projectile/automatic/z8/examine(mob/user)
..()
if(launcher.chambered)
user << "\The [launcher] has \a [launcher.chambered] loaded."
to_chat(user, "\The [launcher] has \a [launcher.chambered] loaded.")
else
user << "\The [launcher] is empty."
to_chat(user, "\The [launcher] is empty.")
/obj/item/weapon/gun/projectile/automatic/l6_saw
name = "light machine gun"
@@ -230,13 +230,13 @@
/obj/item/weapon/gun/projectile/automatic/l6_saw/special_check(mob/user)
if(cover_open)
user << "<span class='warning'>[src]'s cover is open! Close it before firing!</span>"
to_chat(user, "<span class='warning'>[src]'s cover is open! Close it before firing!</span>")
return 0
return ..()
/obj/item/weapon/gun/projectile/automatic/l6_saw/proc/toggle_cover(mob/user)
cover_open = !cover_open
user << "<span class='notice'>You [cover_open ? "open" : "close"] [src]'s cover.</span>"
to_chat(user, "<span class='notice'>You [cover_open ? "open" : "close"] [src]'s cover.</span>")
update_icon()
update_held_icon()
@@ -263,13 +263,13 @@
/obj/item/weapon/gun/projectile/automatic/l6_saw/load_ammo(var/obj/item/A, mob/user)
if(!cover_open)
user << "<span class='warning'>You need to open the cover to load [src].</span>"
to_chat(user, "<span class='warning'>You need to open the cover to load [src].</span>")
return
..()
/obj/item/weapon/gun/projectile/automatic/l6_saw/unload_ammo(mob/user, var/allow_dump=1)
if(!cover_open)
user << "<span class='warning'>You need to open the cover to unload [src].</span>"
to_chat(user, "<span class='warning'>You need to open the cover to unload [src].</span>")
return
..()
@@ -27,7 +27,7 @@
// Stole hacky terrible code from doublebarrel shotgun. -Spades
/obj/item/weapon/gun/projectile/shotgun/pump/rifle/ceremonial/attackby(var/obj/item/A as obj, mob/user as mob)
if(istype(A, /obj/item/weapon/surgical/circular_saw) || istype(A, /obj/item/weapon/melee/energy) || istype(A, /obj/item/weapon/pickaxe/plasmacutter) && w_class != ITEMSIZE_NORMAL)
user << "<span class='notice'>You begin to shorten the barrel and stock of \the [src].</span>"
to_chat(user, "<span class='notice'>You begin to shorten the barrel and stock of \the [src].</span>")
if(loaded.len)
afterattack(user, user)
playsound(user, fire_sound, 50, 1)
@@ -105,25 +105,25 @@
// return
..()
if (beakers.len)
user << "<font color='blue'>[src] contains:</font>"
to_chat(user, "<font color='blue'>[src] contains:</font>")
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)
user << "<font color='blue'>[R.volume] units of [R.name]</font>"
to_chat(user, "<font color='blue'>[R.volume] units of [R.name]</font>")
/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))
if(!istype(I, container_type))
user << "<font color='blue'>[I] doesn't seem to fit into [src].</font>"
to_chat(user, "<font color='blue'>[I] doesn't seem to fit into [src].</font>")
return
if(beakers.len >= max_beakers)
user << "<font color='blue'>[src] already has [max_beakers] beakers in it - another one isn't going to fit!</font>"
to_chat(user, "<font color='blue'>[src] already has [max_beakers] beakers in it - another one isn't going to fit!</font>")
return
var/obj/item/weapon/reagent_containers/glass/beaker/B = I
user.drop_item()
B.loc = src
beakers += B
user << "<font color='blue'>You slot [B] into [src].</font>"
to_chat(user, "<font color='blue'>You slot [B] into [src].</font>")
src.updateUsrDialog()
return 1
..()
@@ -194,7 +194,7 @@
if(index <= beakers.len)
if(beakers[index])
var/obj/item/weapon/reagent_containers/glass/beaker/B = beakers[index]
usr << "You remove [B] from [src]."
to_chat(usr, "You remove [B] from [src].")
mixing -= B
beakers -= B
B.loc = get_turf(src)
@@ -35,14 +35,14 @@
if(!M.mind) return 0
var/job = M.mind.assigned_role
if(job != "Detective" && job != "Security Officer" && job != "Warden" && job != "Head of Security")
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
to_chat(M, "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>")
return 0
var/input = sanitizeSafe(input("What do you want to name the gun?", ,""), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input
M << "You name the gun [input]. Say hello to your new friend."
to_chat(M, "You name the gun [input]. Say hello to your new friend.")
return 1
/obj/item/weapon/gun/projectile/colt/detective/verb/reskin_gun()
@@ -65,7 +65,7 @@
if(src && choice && !M.stat && in_range(M,src))
icon_state = options[choice]
unique_reskin = options[choice]
M << "Your gun is now sprited as [choice]. Say hello to your new friend."
to_chat(M, "Your gun is now sprited as [choice]. Say hello to your new friend.")
return 1
/*//apart of reskins that have two sprites, touching may result in frustration and breaks
@@ -200,7 +200,7 @@
if(!user.item_is_in_hands(src))
..()
return
user << "<span class='notice'>You unscrew [silenced] from [src].</span>"
to_chat(user, "<span class='notice'>You unscrew [silenced] from [src].</span>")
user.put_in_hands(silenced)
silenced = 0
w_class = ITEMSIZE_SMALL
@@ -211,10 +211,10 @@
/obj/item/weapon/gun/projectile/pistol/attackby(obj/item/I as obj, mob/living/user as mob)
if(istype(I, /obj/item/weapon/silencer))
if(!user.item_is_in_hands(src)) //if we're not in his hands
user << "<span class='notice'>You'll need [src] in your hands to do that.</span>"
to_chat(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>"
to_chat(user, "<span class='notice'>You screw [I] onto [src].</span>")
silenced = I //dodgy?
w_class = ITEMSIZE_NORMAL
I.loc = src //put the silencer into the gun
@@ -56,14 +56,14 @@
var/mob/M = usr
if(!M.mind) return 0
if(!M.mind.assigned_role == "Detective")
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
to_chat(M, "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>")
return 0
var/input = sanitizeSafe(input("What do you want to name the gun?", ,""), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input
M << "You name the gun [input]. Say hello to your new friend."
to_chat(M, "You name the gun [input]. Say hello to your new friend.")
return 1
/obj/item/weapon/gun/projectile/revolver/detective45
@@ -85,14 +85,14 @@ obj/item/weapon/gun/projectile/revolver/detective45/verb/rename_gun()
if(!M.mind) return 0
var/job = M.mind.assigned_role
if(job != "Detective")
M << "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>"
to_chat(M, "<span class='notice'>You don't feel cool enough to name this gun, chump.</span>")
return 0
var/input = sanitizeSafe(input("What do you want to name the gun?", ,""), MAX_NAME_LEN)
if(src && input && !M.stat && in_range(M,src))
name = input
M << "You name the gun [input]. Say hello to your new friend."
to_chat(M, "You name the gun [input]. Say hello to your new friend.")
return 1
/obj/item/weapon/gun/projectile/revolver/detective45/verb/reskin_gun()
@@ -114,7 +114,7 @@ obj/item/weapon/gun/projectile/revolver/detective45/verb/rename_gun()
var/choice = input(M,"Choose your sprite!","Resprite Gun") in options
if(src && choice && !M.stat && in_range(M,src))
icon_state = options[choice]
M << "Your gun is now sprited as [choice]. Say hello to your new friend."
to_chat(M, "Your gun is now sprited as [choice]. Say hello to your new friend.")
return 1
@@ -104,7 +104,7 @@
//this is largely hacky and bad :( -Pete
/obj/item/weapon/gun/projectile/shotgun/doublebarrel/attackby(var/obj/item/A as obj, mob/user as mob)
if(istype(A, /obj/item/weapon/surgical/circular_saw) || istype(A, /obj/item/weapon/melee/energy) || istype(A, /obj/item/weapon/pickaxe/plasmacutter))
user << "<span class='notice'>You begin to shorten the barrel of \the [src].</span>"
to_chat(user, "<span class='notice'>You begin to shorten the barrel of \the [src].</span>")
if(loaded.len)
var/burstsetting = burst
burst = 2
@@ -32,21 +32,21 @@
bolt_open = !bolt_open
if(bolt_open)
if(chambered)
user << "<span class='notice'>You work the bolt open, ejecting [chambered]!</span>"
to_chat(user, "<span class='notice'>You work the bolt open, ejecting [chambered]!</span>")
chambered.loc = get_turf(src)
loaded -= chambered
chambered = null
else
user << "<span class='notice'>You work the bolt open.</span>"
to_chat(user, "<span class='notice'>You work the bolt open.</span>")
else
user << "<span class='notice'>You work the bolt closed.</span>"
to_chat(user, "<span class='notice'>You work the bolt closed.</span>")
bolt_open = 0
add_fingerprint(user)
update_icon()
/obj/item/weapon/gun/projectile/heavysniper/special_check(mob/user)
if(bolt_open)
user << "<span class='warning'>You can't fire [src] while the bolt is open!</span>"
to_chat(user, "<span class='warning'>You can't fire [src] while the bolt is open!</span>")
return 0
return ..()
@@ -92,10 +92,10 @@
else
new_mob.key = M.key
new_mob << "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>"
to_chat(new_mob, "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>")
qdel(M)
return
else
M << "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>"
to_chat(M, "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>")
return
@@ -72,7 +72,7 @@
else
return
owner << "<span class='[use_span]'>[aiming_at ? "\The [aiming_at] is" : "Your targets are"] [message].</span>"
to_chat(owner, "<span class='[use_span]'>[aiming_at ? "The [aiming_at] is" : "Your targets are"] [message].</span>")
if(aiming_at)
to_chat(aiming_at, "<span class='[use_span]'>You are [message].</span>")
@@ -21,7 +21,7 @@
return
owner.setClickCooldown(5) // Spam prevention, essentially.
if(owner.a_intent == I_HELP && owner.is_preference_enabled(/datum/client_preference/safefiring))
owner << "<span class='warning'>You refrain from firing \the [aiming_with] as your intent is set to help.</span>"
to_chat(owner, "<span class='warning'>You refrain from firing \the [aiming_with] as your intent is set to help.</span>")
return
owner.visible_message("<span class='danger'>\The [owner] pulls the trigger reflexively!</span>")
var/obj/item/weapon/gun/G = aiming_with