Upgrade able Medical bot and Floor bot as well! + Clean bot fix! (#12112)

* Misstake are now

* Still dosnt all work

* no more range upgrade it just dosnt work

* bithell

* a this
This commit is contained in:
Trilbyspaceclone
2020-05-20 22:03:20 -04:00
committed by GitHub
parent 861734d119
commit fcb2b58664
5 changed files with 174 additions and 19 deletions
@@ -20,9 +20,7 @@
weather_immunities = list("lava","ash")
var/clean_time = 50 //How long do we take to clean?
var/broom = FALSE //Do we have an speed buff from a broom?
var/adv_mop = FALSE //Do we have a cleaning buff from a better mop?
var/upgrades = 0
var/blood = 1
var/trash = 0
@@ -79,26 +77,38 @@
if(open)
to_chat(user, "<span class='warning'>Please close the access panel before locking it.</span>")
else
to_chat(user, "<span class='notice'>\The [src] doesn't seem to respect your authority.</span>")
to_chat(user, "<span class='notice'>The [src] doesn't seem to respect your authority.</span>")
if(istype(W, /obj/item/mop/advanced))
if(bot_core.allowed(user) && open && adv_mop == TRUE)
else if(istype(W, /obj/item/mop/advanced))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_CLEANER_ADVANCED_MOP))
to_chat(user, "<span class='notice'>You replace \the [src] old mop with a new better one!</span>")
adv_mop = TRUE
upgrades |= UPGRADE_CLEANER_ADVANCED_MOP
clean_time = 20 //2.5 the speed!
window_name = "Automatic Station Cleaner v2.1 BETA" //New!
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannle is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>\the [src] already has this mop!</span>")
to_chat(user, "<span class='notice'>The [src] already has this mop!</span>")
if(istype(W, /obj/item/twohanded/broom))
if(bot_core.allowed(user) && open && broom == TRUE)
else if(istype(W, /obj/item/twohanded/broom))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_CLEANER_BROOM))
to_chat(user, "<span class='notice'>You add to \the [src] a broom speeding it up!</span>")
broom = TRUE
upgrades |= UPGRADE_CLEANER_BROOM
base_speed = 1 //2x faster!
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannel is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>\the [src] already has a broom!</span>")
to_chat(user, "<span class='notice'>The [src] already has a broom!</span>")
else
return ..()
@@ -33,6 +33,8 @@
var/oldloc = null
var/toolbox = /obj/item/storage/toolbox/mechanical
var/upgrades = 0
#define HULL_BREACH 1
#define LINE_SPACE_MODE 2
#define FIX_TILE 3
@@ -120,6 +122,36 @@
to_chat(user, "<span class='notice'>You load [loaded] tiles into the floorbot. It now contains [specialtiles] tiles.</span>")
else
to_chat(user, "<span class='warning'>You need at least one floor tile to put into [src]!</span>")
else if(istype(W, /obj/item/storage/toolbox/artistic))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_FLOOR_ARTBOX))
to_chat(user, "<span class='notice'>You upgrade \the [src] case to hold more!</span>")
upgrades |= UPGRADE_FLOOR_ARTBOX
maxtiles += 100 //Double the storage!
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannle is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has a upgraded case!</span>")
else if(istype(W, /obj/item/storage/toolbox/syndicate))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_FLOOR_SYNDIBOX))
to_chat(user, "<span class='notice'>You upgrade \the [src] case to hold more!</span>")
upgrades |= UPGRADE_FLOOR_SYNDIBOX
maxtiles += 200 //Double bse storage
base_speed = 1 //2x faster!
qdel(W)
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has a upgraded case!</span>")
else
..()
@@ -42,6 +42,7 @@
var/declare_crit = 1 //If active, the bot will transmit a critical patient alert to MedHUD users.
var/declare_cooldown = 0 //Prevents spam of critical patient alerts.
var/stationary_mode = 0 //If enabled, the Medibot will not move automatically.
var/injection_time = 30 //How long we take to inject someone
//Setting which reagents to use to treat what by default. By id.
var/treatment_brute_avoid = /datum/reagent/medicine/tricordrazine
var/treatment_brute = /datum/reagent/medicine/bicaridine
@@ -51,19 +52,25 @@
var/treatment_fire = /datum/reagent/medicine/kelotane
var/treatment_tox_avoid = /datum/reagent/medicine/tricordrazine
var/treatment_tox = /datum/reagent/medicine/charcoal
var/treatment_tox_toxlover = /datum/reagent/toxin
var/treatment_tox_toxlover = /datum/reagent/toxin //Injects toxins into people that heal via toxins
var/treatment_virus_avoid = null
var/treatment_virus = /datum/reagent/medicine/spaceacillin
var/treat_virus = 1 //If on, the bot will attempt to treat viral infections, curing them if possible.
var/shut_up = 0 //self explanatory :)
var/upgrades = 0
var/upgraded_dispenser_1 //Do we have the nicer chemicals? - replaces dex with salbutamol
var/upgraded_dispenser_2 //Do we have the nicer chemicals? - replaces kep with oxandrolone
var/upgraded_dispenser_3 //Do we have the nicer chemicals? - replaces bic with sal acid
var/upgraded_dispenser_4 //Do we have the nicer chemicals? - replaces charcoal/toxin with pentetic acid / pentetic jelly
/mob/living/simple_animal/bot/medbot/mysterious
name = "\improper Mysterious Medibot"
desc = "International Medibot of mystery."
skin = "bezerk"
treatment_brute = /datum/reagent/medicine/tricordrazine
treatment_fire = /datum/reagent/medicine/tricordrazine
treatment_tox = /datum/reagent/medicine/tricordrazine
treatment_brute = /datum/reagent/medicine/regen_jelly
treatment_fire = /datum/reagent/medicine/regen_jelly
treatment_tox = /datum/reagent/medicine/regen_jelly
/mob/living/simple_animal/bot/medbot/derelict
name = "\improper Old Medibot"
@@ -220,7 +227,6 @@
/mob/living/simple_animal/bot/medbot/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/reagent_containers/glass))
. = 1 //no afterattack
if(locked)
to_chat(user, "<span class='warning'>You cannot insert a beaker because the panel is locked!</span>")
return
@@ -234,6 +240,97 @@
to_chat(user, "<span class='notice'>You insert [W].</span>")
show_controls(user)
else if(istype(W, /obj/item/reagent_containers/syringe/piercing))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_PIERERCING))
to_chat(user, "<span class='notice'>You replace \the [src] syringe with a diamond-tipped one!</span>")
upgrades |= UPGRADE_MEDICAL_PIERERCING
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannel is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has a diamond-tipped syringe!</span>")
else if(istype(W, /obj/item/hypospray/mkii))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_HYPOSPRAY))
to_chat(user, "<span class='notice'>You replace \the [src] syringe base with a DeForest Medical MK.II Hypospray!</span>")
upgrades |= UPGRADE_MEDICAL_HYPOSPRAY
injection_time = 15 //Half the time half the death!
window_name = "Automatic Medical Unit v2.4 ALPHA"
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannel is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has a DeForest Medical Hypospray base!</span>")
else if(istype(W, /obj/item/circuitboard/machine/chem_dispenser))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_CHEM_BOARD))
to_chat(user, "<span class='notice'>You add in the board upgrading \the [src] reagent banks!</span>")
upgrades |= UPGRADE_MEDICAL_CHEM_BOARD
treatment_oxy = /datum/reagent/medicine/salbutamol //Replaces Dex with salbutamol "better" healing of o2
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannel is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has this upgrade!</span>")
else if(istype(W, /obj/item/circuitboard/machine/cryo_tube))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_CRYO_BOARD))
to_chat(user, "<span class='notice'>You add in the board upgrading \the [src] reagent banks!</span>")
upgrades |= UPGRADE_MEDICAL_CRYO_BOARD
treatment_fire = /datum/reagent/medicine/oxandrolone //Replaces Kep with oxandrolone "better" healing of burns
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannel is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has this upgrade!</span>")
else if(istype(W, /obj/item/circuitboard/machine/chem_master))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_CHEM_MASTER))
to_chat(user, "<span class='notice'>You add in the board upgrading \the [src] reagent banks!</span>")
upgrades |= UPGRADE_MEDICAL_CHEM_MASTER
treatment_brute = /datum/reagent/medicine/sal_acid //Replaces Bic with Sal Acid "better" healing of brute
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>the [src] access pannel is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>the [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>the [src] already has this upgrade!</span>")
else if(istype(W, /obj/item/circuitboard/machine/sleeper))
if(bot_core.allowed(user) && open && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_SLEEP_BOARD))
to_chat(user, "<span class='notice'>You add in the board upgrading \the [src] reagent banks!</span>")
upgrades |= UPGRADE_MEDICAL_SLEEP_BOARD
treatment_tox = /datum/reagent/medicine/pen_acid //replaces charcoal with pen acid a "better" healing of toxins
treatment_tox_toxlover = /datum/reagent/medicine/pen_acid/pen_jelly //Injects pen jelly into people that heal via toxins
qdel(W)
if(!open)
to_chat(user, "<span class='notice'>The [src] access pannle is not open!</span>")
return
if(!bot_core.allowed(user))
to_chat(user, "<span class='notice'>The [src] access pannel locked off to you!</span>")
return
else
to_chat(user, "<span class='notice'>The [src] already has this upgrade!</span>")
else
var/current_health = health
..()
@@ -249,6 +346,8 @@
audible_message("<span class='danger'>[src] buzzes oddly!</span>")
flick("medibot_spark", src)
playsound(src, "sparks", 75, 1)
if(!CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_PIERERCING))
upgrades |= UPGRADE_MEDICAL_PIERERCING //Jabs even harder through the clothing!
if(user)
oldpatient = user
@@ -361,7 +460,7 @@
if(ishuman(C))
var/mob/living/carbon/human/H = C
if (H.wear_suit && H.head && istype(H.wear_suit, /obj/item/clothing) && istype(H.head, /obj/item/clothing))
if (H.wear_suit && H.head && istype(H.wear_suit, /obj/item/clothing) && istype(H.head, /obj/item/clothing) && !CHECK_BITFIELD(upgrades,UPGRADE_MEDICAL_PIERERCING))
var/obj/item/clothing/CS = H.wear_suit
var/obj/item/clothing/CH = H.head
if (CS.clothing_flags & CH.clothing_flags & THICKMATERIAL)
@@ -504,7 +603,7 @@
"<span class='userdanger'>[src] is trying to inject you!</span>")
var/failed = FALSE
if(do_mob(src, patient, 30)) //Is C == patient? This is so confusing
if(do_mob(src, patient, injection_time)) //Is C == patient? This is so confusing
if((get_dist(src, patient) <= 1) && (on) && assess_patient(patient))
if(reagent_id == "internal_beaker")
if(use_beaker && reagent_glass && reagent_glass.reagents.total_volume)