Funny-character-bus-code

This little pull is litterally a pull for a single character I'd like to bus, basicly a walking chem dispenser, so lets go!
This commit is contained in:
Chemlight
2020-11-09 23:03:12 -08:00
parent c7bc366210
commit 8c0f1756a1
8 changed files with 475 additions and 2 deletions
@@ -76,3 +76,26 @@
if(S.emptrig == TRUE)
var/obj/item/projectile/bullet/dart/syringe/dart/D = BB
D.emptrig = TRUE
//Chemlight was here, adding dumb bussing things
/obj/item/ammo_casing/chemgun_debug
name = "dart synthesiser"
desc = "A high-power spring, linked to an energy-based dart synthesiser."
projectile_type = /obj/item/projectile/bullet/dart/syringe/debug
firing_effect_type = null
/obj/item/ammo_casing/chemgun_debug/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
if(!BB)
return
if(istype(loc, /obj/item/gun/chem/debug))
var/obj/item/gun/chem/debug/CGD = loc
if(CGD.syringes_left <= 0)
return
if(!CGD.infinite)
CGD.reagents.trans_to(BB, 10)
else
CGD.reagents.copy_to(BB, 10)
BB.name = "chemical dart"
CGD.syringes_left--
..()
+60 -1
View File
@@ -43,4 +43,63 @@
syringes_left++
if(chambered && !chambered.BB)
chambered.newshot()
last_synth = world.time
last_synth = world.time
//Chemlight was here, adding dumb busing things
/obj/item/gun/chem/debug
name = "experimental reagent gun"
desc = "a reagent gun seemingly made to be a part of the user, suggesting the individual generates reagents in their body for it to work."
icon_state = "syringe_pistol"
item_state = "gun" //Smaller inhand
suppressed = TRUE //Softer fire sound
can_unsuppress = FALSE //Permanently silenced
time_per_syringe = 150
syringes_left = 6
max_syringes = 6
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/infinite = FALSE
/obj/item/gun/chem/debug/Initialize()
. = ..()
chambered = new /obj/item/ammo_casing/chemgun_debug(src)
START_PROCESSING(SSobj, src)
create_reagents(100, OPENCONTAINER | NO_REACT)
/obj/item/gun/chem/debug/Destroy()
. = ..()
STOP_PROCESSING(SSobj, src)
/obj/item/gun/chem/debug/attack_self(mob/user)
var/list/reagent_ids = sortList(GLOB.chemical_reagents_list)
var/choose_operation = input(user, "Select an option", "Reagent fabricator", "cancel") in list("Select reagent", "Enable production", "Cancel")
if (choose_operation == "Select reagent")
reagents.clear_reagents()
var/chosen_reagent
switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID"))
if("Enter ID")
var/valid_id
while(!valid_id)
chosen_reagent = stripped_input(usr, "Enter the ID of the reagent you want to add to your syringes.")
if(!chosen_reagent) //Get me out of here!
break
for(var/ID in reagent_ids)
if(ID == chosen_reagent)
valid_id = 1
if(!valid_id)
to_chat(usr, "<span class='warning'>A reagent with that ID doesn't exist!</span>")
if("Choose ID")
chosen_reagent = input(usr, "Choose a reagent to add to your syringes.", "Choose a reagent.") as null|anything in reagent_ids
if(chosen_reagent)
reagents.add_reagent(chosen_reagent, 100, null)
else if (choose_operation == "Enable production")
if(!infinite)
infinite = TRUE
to_chat(user, "Now constantly generating reagents.")
else
infinite = FALSE
to_chat(user, "Reagents generation now off.")
else
return
@@ -79,3 +79,10 @@
target.visible_message("<span class='danger'>\The [src] fails to land on target!</span>")
return TRUE
//Chemlight was here, adding dumb bussing things
/obj/item/projectile/bullet/dart/syringe/debug
name = "syringe"
icon_state = "syringeproj"
damage = 0