mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-26 13:39:16 +01:00
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
This file contains:
|
||||
|
||||
|
||||
Manual Injector:
|
||||
Manually injects chemicals into a xenobiological creature from a linked machine.
|
||||
|
||||
|
||||
*/
|
||||
/obj/machinery/xenobio2/manualinjector
|
||||
name = "biological injector"
|
||||
@@ -16,7 +16,7 @@
|
||||
var/mob/living/occupant
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker
|
||||
var/obj/machinery/computer/xenobio2/computer
|
||||
|
||||
|
||||
circuit = /obj/item/weapon/circuitboard/xenobioinjectormachine
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/New()
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/map/New()
|
||||
..()
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/bottle(src)
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
circuit = new circuit(src)
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
@@ -35,7 +35,7 @@
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
RefreshParts()
|
||||
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/update_icon()
|
||||
if(beaker)
|
||||
if(occupant)
|
||||
@@ -44,12 +44,12 @@
|
||||
icon_state = "biogen-work"
|
||||
else
|
||||
icon_state = "biogen-empty"
|
||||
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.restrained())
|
||||
return
|
||||
move_into_injector(user,target)
|
||||
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/proc/move_into_injector(var/mob/user,var/mob/living/victim)
|
||||
if(src.occupant)
|
||||
user << "<span class='danger'>The injector is full, empty it first!</span>"
|
||||
@@ -68,14 +68,22 @@
|
||||
victim.client.eye = src
|
||||
victim.forceMove(src)
|
||||
src.occupant = victim
|
||||
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/proc/eject_contents()
|
||||
for(var/obj/thing in (contents - component_parts - circuit))
|
||||
for(var/obj/thing in (contents - component_parts - circuit - beaker))
|
||||
thing.forceMove(loc)
|
||||
if(occupant)
|
||||
occupant.forceMove(loc)
|
||||
occupant = null
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/proc/eject_beaker()
|
||||
if(beaker)
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B = beaker
|
||||
B.loc = loc
|
||||
beaker = null
|
||||
return
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/proc/inject_reagents()
|
||||
if(!occupant)
|
||||
return
|
||||
@@ -84,18 +92,25 @@
|
||||
beaker.reagents.trans_to_holder(X.reagents, computer.transfer_amount, 1, 0)
|
||||
else
|
||||
beaker.reagents.trans_to_mob(occupant, computer.transfer_amount)
|
||||
|
||||
|
||||
/obj/machinery/xenobio2/manualinjector/attackby(var/obj/item/W, var/mob/user)
|
||||
|
||||
//Let's try to deconstruct first.
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, W)
|
||||
return
|
||||
|
||||
|
||||
if(istype(W, /obj/item/weapon/crowbar) && !occupant)
|
||||
default_deconstruction_crowbar(user, W)
|
||||
return
|
||||
|
||||
//are you smashing a beaker in me? Well then insert that shit!
|
||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
beaker = W
|
||||
user.drop_from_inventory(W)
|
||||
W.loc = src
|
||||
return
|
||||
|
||||
//Did you want to link it?
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/P = W
|
||||
@@ -109,12 +124,12 @@
|
||||
user << "<span class='warning'> You store the [src] in the [P]'s buffer!</span>"
|
||||
P.connectable = src
|
||||
return
|
||||
|
||||
|
||||
if(panel_open)
|
||||
user << "<span class='warning'>Close the panel first!</span>"
|
||||
|
||||
var/obj/item/weapon/grab/G = W
|
||||
|
||||
|
||||
if(!istype(G))
|
||||
return ..()
|
||||
|
||||
@@ -123,11 +138,11 @@
|
||||
return
|
||||
|
||||
move_into_injector(user,G.affecting)
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/circuitboard/xenobioinjectormachine
|
||||
name = T_BOARD("biological injector")
|
||||
build_path = "/obj/machinery/xenobio2/manualinjector"
|
||||
board_type = "machine"
|
||||
origin_tech = list() //To be filled,
|
||||
req_components = list() //To be filled,
|
||||
req_components = list() //To be filled,
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
This file contains:
|
||||
|
||||
|
||||
Manual Injector:
|
||||
Manually injects chemicals into a xenobiological creature from a linked machine.
|
||||
|
||||
|
||||
*/
|
||||
/obj/machinery/computer/xenobio2
|
||||
name = "injector control console"
|
||||
@@ -17,11 +17,17 @@
|
||||
circuit = /obj/item/weapon/circuitboard/xenobio2computer
|
||||
var/obj/machinery/xenobio2/manualinjector/injector
|
||||
var/transfer_amount
|
||||
|
||||
var/active
|
||||
|
||||
/obj/machinery/computer/xenobio2/Destroy()
|
||||
..()
|
||||
injector.computer = null
|
||||
|
||||
|
||||
/obj/machinery/computer/xenobio2/attack_hand(mob/user)
|
||||
if(..())
|
||||
return 1
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/xenobio2/attackby(var/obj/item/W, var/mob/user)
|
||||
|
||||
//Did you want to link it?
|
||||
@@ -37,25 +43,41 @@
|
||||
user << "<span class='warning'> You store the [src] in the [P]'s buffer!</span>"
|
||||
P.connectable = src
|
||||
return
|
||||
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/xenobio2/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(!user)
|
||||
return
|
||||
if(!injector)
|
||||
return
|
||||
|
||||
var/list/data = list()
|
||||
|
||||
data["activity"] = active
|
||||
if(isxeno(occupant))
|
||||
var/mob/living/simple_animal/xeno/X = occupant
|
||||
data["beaker"] = injector.beaker
|
||||
if(isxeno(injector.occupant))
|
||||
var/mob/living/simple_animal/xeno/X = injector.occupant
|
||||
data["instability"] = (X.mut_level / X.mut_max)
|
||||
else
|
||||
data["instability"] = null
|
||||
|
||||
data["reagentamount"] = beaker.reagents.total_volume
|
||||
data["reagentmax"] = beaker.reagents.max_volume
|
||||
|
||||
|
||||
if(injector.beaker)
|
||||
data["reagentAmount"] = injector.beaker.reagents.total_volume
|
||||
data["reagentMax"] = injector.beaker.reagents.maximum_volume
|
||||
data["reagentMin"] = 0
|
||||
else
|
||||
data["reagentAmount"] = null
|
||||
data["reagentMax"] = 1
|
||||
data["reagentMin"] = 0
|
||||
|
||||
if(injector.occupant)
|
||||
data["occupantHealth"] = injector.occupant.health
|
||||
data["occupantHealthMax"] = injector.occupant.maxHealth
|
||||
else
|
||||
data["occupantHealth"] = null
|
||||
data["occupantHealthMax"] = null
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "xenobio_computer.tmpl", "Injector Control Console UI", 470, 450)
|
||||
@@ -73,15 +95,17 @@
|
||||
spawn(5)
|
||||
injector.inject_reagents()
|
||||
active = 0
|
||||
if(href_list["eject"])
|
||||
if(href_list["eject_occupant"])
|
||||
injector.eject_contents()
|
||||
|
||||
|
||||
if(href_list["eject_beaker"])
|
||||
injector.eject_beaker()
|
||||
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
/obj/item/weapon/circuitboard/xenobio2computer
|
||||
name = T_BOARD("injector control console")
|
||||
build_path = "/obj/item/weapon/circuitboard/xenobio2computer"
|
||||
board_type = "computer"
|
||||
origin_tech = list() //To be filled,
|
||||
|
||||
origin_tech = list() //To be filled,
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
.uiIcon16.icon-pin-s { background-position: -144px -144px; }
|
||||
.uiIcon16.icon-phone { background-position: -160px -144px; }
|
||||
.uiIcon16.icon-list { background-position: -176px -144px; }
|
||||
.uiIcon16.icon-syringe { background-position: -192px -144px; }
|
||||
.uiIcon16.icon-play { background-position: 0 -160px; }
|
||||
.uiIcon16.icon-pause { background-position: -16px -160px; }
|
||||
.uiIcon16.icon-seek-next { background-position: -32px -160px; }
|
||||
|
||||
+43
-1
@@ -366,7 +366,7 @@ div.notice {
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
.displayBarText {
|
||||
.displayBarText, .displayBarVerticalText, .displayBarBeakerText{
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
left: 5px;
|
||||
@@ -384,6 +384,48 @@ div.notice {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.displayBarVertical {
|
||||
position: relative;
|
||||
width: 16px;
|
||||
height: 200px;
|
||||
border: 1px solid #666666;
|
||||
float: left;
|
||||
margin: 0 5px 0 0;
|
||||
overflow: hidden;
|
||||
background: #40628a;
|
||||
}
|
||||
|
||||
.displayBarVerticalFill {
|
||||
width: 100%;
|
||||
height: 0%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
/*used in xenobio2 computer*/
|
||||
|
||||
.displayBarBeaker {
|
||||
position: relative;
|
||||
width: 100px;
|
||||
height: 110px;
|
||||
border-right: 2px solid rgb(102, 179, 255);
|
||||
border-left: 2px solid rgb(102, 179, 255);
|
||||
border-bottom: 2px solid rgb(102, 179, 255);
|
||||
float: left;
|
||||
margin: 0 5px 0 0;
|
||||
overflow: hidden;
|
||||
background: #40628a;
|
||||
}
|
||||
|
||||
.displayBarBeakerFill {
|
||||
width: 100%;
|
||||
height: 0%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
background: rgba(153, 204, 255, 0.3);
|
||||
}
|
||||
|
||||
.displayBarFill.alignRight {
|
||||
float: right;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -91,8 +91,8 @@ NanoBaseHelpers = function ()
|
||||
capitalizeFirstLetter: function(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
},
|
||||
// Display a bar. Used to show health, capacity, etc.
|
||||
displayBar: function(value, rangeMin, rangeMax, styleClass, showText) {
|
||||
// Display a bar. Used to show health, capacity, etc. Use difClass if the entire display bar class should be different
|
||||
displayBar: function(value, rangeMin, rangeMax, styleClass, showText, difClass) {
|
||||
|
||||
if (rangeMin < rangeMax)
|
||||
{
|
||||
@@ -126,10 +126,15 @@ NanoBaseHelpers = function ()
|
||||
{
|
||||
showText = '';
|
||||
}
|
||||
|
||||
if (typeof difClass == 'undefined' || !difClass)
|
||||
{
|
||||
return '<div class="displayBar ' + styleClass + '"><div class="displayBarFill ' + styleClass + '" style="width: ' + percentage + '%;"></div><div class="displayBarText ' + styleClass + '">' + showText + '</div></div>';
|
||||
}
|
||||
|
||||
var percentage = Math.round((value - rangeMin) / (rangeMax - rangeMin) * 100);
|
||||
|
||||
return '<div class="displayBar ' + styleClass + '"><div class="displayBarFill ' + styleClass + '" style="width: ' + percentage + '%;"></div><div class="displayBarText ' + styleClass + '">' + showText + '</div></div>';
|
||||
return '<div class="' + difClass + ' ' + styleClass + '"><div class="' + difClass + 'Fill ' + styleClass + '" style="height: ' + percentage + '%;"></div><div class="' + difClass + 'Text ' + styleClass + '">' + showText + '</div></div>';
|
||||
},
|
||||
// Display DNA Blocks (for the DNA Modifier UI)
|
||||
displayDNABlocks: function(dnaString, selectedBlock, selectedSubblock, blockSize, paramKey) {
|
||||
|
||||
@@ -6,24 +6,45 @@ Used In File(s): \code\modules\xenobio2\machines\injector_computer.dm
|
||||
{{if data.activity}}
|
||||
Scanning...
|
||||
{{else}}
|
||||
<h3>Injector Sensor Readings: </h3>
|
||||
<div class="item">
|
||||
{{if data.instability}}
|
||||
<div class="itemLabel">
|
||||
<div class="itemContent" style="text-align: center; width: 100px">
|
||||
{{if data.beaker}}
|
||||
{{:data.reagentAmount}}u / {{:data.reagentMax}}u
|
||||
{{:helper.displayBar(data.reagentAmount, data.reagentMax, data.reagentMin, 'good', null, 'displayBarBeaker')}}
|
||||
{{else}}
|
||||
<span class='bad'><b>ERRR%</b></span>
|
||||
{{:helper.displayBar(data.reagentAmount, data.reagentMax, data.reagentMin, 'good', null, 'displayBarBeaker')}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div style="padding-left: 110px;">
|
||||
<h3 style="clear: none;">Sensor Readings:</h3>
|
||||
<div class="itemGroup floatLeft" style="clear: none;">
|
||||
<div class="itemLabel">
|
||||
Instability:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
Instability: <br>
|
||||
{{:data.instability}}%
|
||||
{{if data.instability}}
|
||||
{{:data.instability}}%
|
||||
{{else}}
|
||||
<span class='bad'><b>ERRR%</b></span> Please contact your local technician for assistance.
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="itemLabel">
|
||||
Occupant Health:
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
{{if data.occupantHealth}}
|
||||
{{:data.occupantHealth}}/{{:data.occupantHealthMax}}
|
||||
{{else}}
|
||||
<span class='bad'><b>ERRR%</b></span> Please contact your local technician for assistance.
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="itemLabel">
|
||||
<div class="itemContent">
|
||||
Instability: <br>
|
||||
<font = '#FF0000'><b>ERRR</b></font>% <br>Please contact your local technician for assistance.
|
||||
</div>
|
||||
</div><br>
|
||||
{{/if}}
|
||||
</div>
|
||||
<h3> Controls </h3>
|
||||
<div class="item">
|
||||
<h3 style="clear: none;">Controls:</h3>
|
||||
<div class="floatLeft">
|
||||
{{:helper.link('Eject Beaker', 'eject', {'eject_beaker' : 1})}} {{:helper.link('Eject Occupant', 'eject', {'eject_occupant' : 1})}} {{:helper.link('Inject Occupant', 'syringe', {'inject_target' : 1})}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/if}}
|
||||
Reference in New Issue
Block a user