Files
Polaris/code/modules/xenobio2/machinery/slime_replicator.dm
Aronai Sieyes 715de43f35 VChat: Redone chat output done in Vue.js (#6761)
* Better notifications

* Add buttons to del/move tabs in edit mode

* Add a <span> to emotes

* Fix duplicate IDs in VChat and add more logging

* VChat: Redone chat output in Vue.js

* Ported tg asset cache

* VChat DME Update

* Replace \image macro with bicon()

* NanoUI Subsystem Fixes

Don't do this, the asset subsystem does this for you

* Allow narrate/globalnarrate shenanigans

Allows HTML if your entire thing is HTML

* Disable bicon() icon object cache, and create text tag cache

* Ore Scanner is written incorrectly

Only revealed by vchat

* Fixes 2 VChat bugs

* Underline links in VChat

* Fix LOOC color

* VChat Improvements

Hopefully, anyway.
- Arbitrary font size setting
- Line height setting
- Multiple crush settings
- Rewrote how tabs work hopefully for performance
- Hidden messages are actually put elsewhere
- Attempts to correct chat backlog restore on rejoin

* Surgery steps to use <span>

* Some VChat Tweaks

- Chat remains between client reconnects if your client didn't close (so things like using the reconnect button, or autoreconnects at round end when that feels like working)
- The client doesn't send pings to the server, the server sends pings to the client. This fixes AFK measurements for AFK kick purposes.
- Turn latency indicator into a green/red indicator to show if you're connected, and when clicked will perform a one-time ping (and block doing it again for 10 seconds). It will display '?ms' if it never got a reply, or '999ms' if it did, but it was over 1s.

* Include date in filename for VChat log save

* Merge pull request #6767 from Cyantime/patch-2

Change chat export naming scheme

* Adds VChat tab saving

Saves every time you enter/exit edit mode. Persists between rounds, VChat reloads via verb, etc.

* Fix chat exporting when someone has used unicode

Only affects clients still using 512

* Use CLIENT_FROM_VAR for ease of code reading

* Update code/modules/client/asset_cache.dm

Co-Authored-By: Novacat <35587478+Novacat@users.noreply.github.com>

* Fix runtime when client disconnects before vchat loads

* Fix polaris version of command reports

* Fix LOOC color in oldchat

* Put some styles in various adminpm messages

* Round info and advanced who spans

* Fix missing tag-end

* Maybe fix images for linux and statpanel but also doom everyone

Co-authored-by: ShadowLarkens <ShadowLarkens@users.noreply.github.com>
Co-authored-by: Novacat <35587478+Novacat@users.noreply.github.com>
2020-03-27 14:07:28 -07:00

150 lines
4.0 KiB
Plaintext

/*
Here lives the slime replicator
This machine consumes cores to create a slime.
To create more of these cores, stick the slime core in the extractor.
*/
/obj/machinery/slime/replicator
name = "slime core growth apparatus"
desc = "A machine for creating slimes from cores. Amazing!"
icon = 'icons/obj/xenoarchaeology.dmi'
icon_state = "restruct_0"
density = 1
anchored = 1
circuit = /obj/item/weapon/circuitboard/slimereplicator
var/obj/item/xenoproduct/slime/core/core = null
var/inuse
var/occupiedcolor = "#22FF22"
var/emptycolor = "#FF2222"
var/operatingcolor = "#FFFF22"
/obj/machinery/slime/replicator/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
RefreshParts()
update_light_color()
/obj/machinery/slime/replicator/attackby(var/obj/item/W, var/mob/user)
//Let's try to deconstruct first.
if(W.is_screwdriver() && !inuse)
default_deconstruction_screwdriver(user, W)
return
if(W.is_crowbar())
default_deconstruction_crowbar(user, W)
return
var/obj/item/xenoproduct/slime/core/G = W
if(!istype(G))
return ..()
if(core)
to_chat(user, "<span class='warning'>[src] is already filled!</span>")
return
if(panel_open)
to_chat(user, "<span class='warning'>Close the panel first!</span>")
core = G
user.drop_from_inventory(G)
G.forceMove(src)
update_light_color()
/obj/machinery/slime/replicator/proc/update_light_color()
if(src.core && !(inuse))
set_light(2, 2, occupiedcolor)
else if(src.core)
set_light(2, 2, operatingcolor)
else
set_light(2, 2, emptycolor)
/obj/machinery/slime/replicator/proc/replicate_slime()
if(!src.core)
src.visible_message("[bicon(src)] [src] pings unhappily.")
else if(inuse)
return
inuse = 1
update_light_color()
icon_state = "restruct_1"
spawn(30)
var/mob/living/simple_animal/xeno/slime/S = new(src)
S.traitdat = new() //New instance, so that if the core is deleted, the slime retains a trait datum.
S.nameVar = core.nameVar
S.name = "[S.nameVar] baby slime"
core.traits.copy_traits(S.traitdat)
S.ProcessTraits()
spawn(30)
qdel(core)
core = null //If qdel's being a bit slow or acting up, let's just make sure we can't clone the core.
inuse = 0
eject_slime()
icon_state = "restruct_0"
update_light_color()
src.updateUsrDialog()
/obj/machinery/slime/replicator/proc/eject_slime()
for(var/mob/thing in contents)
thing.forceMove(loc)
/obj/machinery/slime/replicator/proc/eject_core()
if(core)
core.forceMove(loc)
core = null
/obj/machinery/slime/replicator/proc/eject_contents()
eject_slime()
eject_core()
//Here lies the UI
/obj/machinery/slime/replicator/attack_hand(mob/user as mob)
user.set_machine(src)
interact(user)
/obj/machinery/slime/replicator/interact(mob/user as mob)
var/dat = ""
if(!inuse)
dat = {"
<b>Slime core container holds:</b><br>
[core]<br>
"}
if (core && !(stat & (NOPOWER|BROKEN)))
dat += "<A href='?src=\ref[src];action=replicate'>Start the replication process</a><BR>"
if(core)
dat += "<A href='?src=\ref[src];action=eject'>Eject the core</a><BR>"
else
dat += "Please wait..."
var/datum/browser/popup = new(user, "Slime Replicator", "Slime Replicator", src)
popup.set_content(dat)
popup.open()
return
/obj/machinery/slime/replicator/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
switch(href_list["action"])
if ("replicate")
replicate_slime()
if("eject")
eject_core()
src.updateUsrDialog()
return
//Circuit board below,
/obj/item/weapon/circuitboard/slimereplicator
name = T_BOARD("Slime replicator")
build_path = "/obj/machinery/slime/replicator"
board_type = "machine"
origin_tech = list(TECH_DATA = 3, TECH_BIO = 3)
req_components = list(
/obj/item/weapon/stock_parts/manipulator = 2,
/obj/item/weapon/stock_parts/matter_bin = 1,
/obj/item/weapon/stock_parts/micro_laser = 1
)