Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virology and other fixes #297

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions code/game/objects/items/weapons/storage/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,15 @@
name = "vial storage box"
w_class = ITEM_SIZE_NORMAL
max_w_class = ITEM_SIZE_TINY
storage_slots = 12
storage_slots = 6

key_type = /obj/item/weapon/reagent_containers/glass/beaker/vial
startswith = list(/obj/item/weapon/reagent_containers/glass/beaker/vial = 12)
startswith = list(/obj/item/weapon/reagent_containers/glass/beaker/vial = 6)

/obj/item/weapon/storage/fancy/vials/update_icon()
var/key_count = count_by_type(contents, key_type)
src.icon_state = "[initial(icon_state)][Floor(key_count/2)]"
src.icon_state = "[initial(icon_state)][key_count]"

/*
* Not actually a "fancy" storage...
*/
/obj/item/weapon/storage/lockbox/vials
name = "secure vial storage box"
desc = "A locked box for keeping things away from children."
Expand All @@ -311,16 +308,17 @@
w_class = ITEM_SIZE_NORMAL
max_w_class = ITEM_SIZE_TINY
max_storage_space = null
storage_slots = 12
storage_slots = 6
req_access = list(access_virology)
can_hold = list("/obj/item/weapon/reagent_containers/glass/beaker/vial")

/obj/item/weapon/storage/lockbox/vials/New()
..()
update_icon()

/obj/item/weapon/storage/lockbox/vials/update_icon()
var/total_contents = count_by_type(contents, /obj/item/weapon/reagent_containers/glass/beaker/vial)
src.icon_state = "vialbox[Floor(total_contents/2)]"
src.icon_state = "vialbox[Floor(total_contents)]"
src.overlays.Cut()
if (!broken)
overlays += image(icon, src, "led[locked]")
Expand Down
24 changes: 23 additions & 1 deletion code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ var/global/floorIsLava = 0
if(11)
dat+={"
<B>[GLOB.using_map.company_name] D-Notice Handler</B><HR>
<FONT SIZE=1>A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the [station_name()]'s
<FONT SIZE=1>A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the [station_name()]s
morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed
stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.</FONT><HR>
"}
Expand Down Expand Up @@ -1073,6 +1073,28 @@ var/global/floorIsLava = 0
new /obj/effect/vine(get_turf(usr), plant_controller.seeds[seedtype])
log_admin("[key_name(usr)] spawned [seedtype] vines at ([usr.x],[usr.y],[usr.z])")

/datum/admins/proc/spawn_debug_template()
set category = "Debug"
set name = "#Spawn Debug Template"

if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_SPAWN))
return

//jump to loc
var/x = 156
var/y = 84
var/z = 2
var/turf/T = locate(x, y, z)
if(!T)
return
if (!usr)
return
usr.forceMove(T)

//spawn items
new /obj/item/weapon/reagent_containers/syringe(locate(x+1, y, z))


/datum/admins/proc/spawn_atom(var/object as text)
set category = "Debug"
set desc = "(atom path) Spawn an atom"
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ var/list/admin_verbs_spawn = list(
/datum/admins/proc/check_custom_items,
/datum/admins/proc/spawn_plant,
/datum/admins/proc/spawn_atom, // allows us to spawn instances,
/datum/admins/proc/spawn_debug_template,
/client/proc/respawn_character,
/client/proc/virus2_editor,
/client/proc/spawn_chemdisp_cartridge
Expand Down
15 changes: 11 additions & 4 deletions code/modules/reagents/reagent_containers/syringes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,20 @@
handleBodyBag(target, user)
return

if(user.a_intent == I_HURT)
if(ismob(target))
syringestab(target, user)
return
if(reagents && reagents.total_volume)
to_chat(user, "<span class='notice'>You spurt out the contents of \the [src] onto [target].</span>") //They are on harm intent, aka wanting to spill it.
reagents.splash(target, reagents.total_volume)
mode = SYRINGE_DRAW
update_icon()
return

if(!target.reagents)
return

if(user.a_intent == I_HURT && ismob(target))
syringestab(target, user)
return

handleTarget(target, user)

/obj/item/weapon/reagent_containers/syringe/update_icon()
Expand Down
20 changes: 14 additions & 6 deletions code/modules/virus2/dishincubator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
data["analysed"] = dish && dish.analysed ? 1 : 0
data["can_breed_virus"] = null
data["blood_already_infected"] = null
data["virus_blood_match_species"] = null
data["beaker_has_no_blood"] =null

if (beaker)
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in beaker.reagents.reagent_list
data["can_breed_virus"] = dish && dish.virus2 && B

if (B)
if (!B.data["virus2"])
Expand All @@ -81,6 +82,16 @@
var/list/virus = B.data["virus2"]
for (var/ID in virus)
data["blood_already_infected"] = virus[ID]
if (dish && dish.analysed)
var/beaker_species = B.data["species"]
for (var/S in dish.virus2.affected_species)
if (beaker_species == S)
data["can_breed_virus"] = dish && dish.virus2
data["virus_blood_match_species"] = TRUE
break
else
data["beaker_has_no_blood"] = TRUE


ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
Expand Down Expand Up @@ -129,11 +140,8 @@

if(beaker)
if(foodsupply < 100 && beaker.reagents.remove_reagent(/datum/reagent/nutriment/virus_food,5))
if(foodsupply + 10 <= 100)
foodsupply += 10
else
beaker.reagents.add_reagent(/datum/reagent/nutriment/virus_food,(100 - foodsupply)/2)
foodsupply = 100
if(foodsupply + 5<= 100)
foodsupply += 5
GLOB.nanomanager.update_uis(src)

if (locate(/datum/reagent/toxin) in beaker.reagents.reagent_list && toxins < 100)
Expand Down
Binary file modified icons/obj/chemical.dmi
Binary file not shown.
Binary file modified icons/obj/reagentfillings.dmi
Binary file not shown.
Binary file modified icons/obj/virology.dmi
Binary file not shown.
7 changes: 6 additions & 1 deletion nano/templates/dish_incubator.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@
</div>
<div class='itemContent'>
<span class='{{:data.can_breed_virus ? "good" : "average"}}'>
{{:!data.dish_inserted ? 'N/A' : data.can_breed_virus ? 'Suitable' : 'No hemolytic samples detected'}}
{{:!data.dish_inserted ? 'No virus dish' : data.can_breed_virus ? 'Suitable' : data.beaker_has_no_blood ? 'No blood sample detected' : !data.analysed ? 'Unknown virus breeding enviroment' : 'Invalid'}}
</span>
{{if data.blood_already_infected}}
<br/>
<span class='bad'><i>CAUTION: Viral infection detected in blood sample.</i></span>
{{/if}}
{{if data.analysed && !data.beaker_has_no_blood && !data.virus_blood_match_species}}
<br/>
<span class='bad'><i>ERROR: This virus can't be breed in this blood sample.</i></span>
{{/if}}

</div>
</div>
{{else}}
Expand Down