mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-04 14:33:30 +00:00
to_chat replacing stream operator
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user