Xenobiology consoles can now scan slimes and apply potions (#34748)

* Xenobiology consoles can now scan slimes and apply potions

* no smack
This commit is contained in:
XDTM
2018-01-29 10:59:13 +01:00
committed by AnturK
parent b3505e1276
commit 3ecf74f1fd
8 changed files with 108 additions and 43 deletions
+1 -1
View File
@@ -55,7 +55,7 @@
new /datum/data/mining_equipment("Drone Melee Upgrade", /obj/item/device/mine_bot_ugprade, 400),
new /datum/data/mining_equipment("Drone Health Upgrade", /obj/item/device/mine_bot_ugprade/health, 400),
new /datum/data/mining_equipment("Drone Ranged Upgrade", /obj/item/device/mine_bot_ugprade/cooldown, 600),
new /datum/data/mining_equipment("Drone AI Upgrade", /obj/item/slimepotion/sentience/mining, 1000),
new /datum/data/mining_equipment("Drone AI Upgrade", /obj/item/slimepotion/slime/sentience/mining, 1000),
new /datum/data/mining_equipment("Jump Boots", /obj/item/clothing/shoes/bhop, 2500),
)
+1 -1
View File
@@ -255,7 +255,7 @@
//AI
/obj/item/slimepotion/sentience/mining
/obj/item/slimepotion/slime/sentience/mining
name = "minebot AI upgrade"
desc = "Can be used to grant sentience to minebots."
icon_state = "door_electronics"
@@ -194,7 +194,7 @@
required_other = 1
/datum/chemical_reaction/slime/slimestabilizer/on_reaction(datum/reagents/holder)
new /obj/item/slimepotion/stabilizer(get_turf(holder.my_atom))
new /obj/item/slimepotion/slime/stabilizer(get_turf(holder.my_atom))
..()
/datum/chemical_reaction/slime/slimefoam
@@ -326,7 +326,7 @@
required_other = 1
/datum/chemical_reaction/slime/slimepsteroid/on_reaction(datum/reagents/holder)
new /obj/item/slimepotion/steroid(get_turf(holder.my_atom))
new /obj/item/slimepotion/slime/steroid(get_turf(holder.my_atom))
..()
/datum/chemical_reaction/slime/slimeregen
@@ -358,7 +358,7 @@
required_other = 1
/datum/chemical_reaction/slime/slimemutator/on_reaction(datum/reagents/holder)
new /obj/item/slimepotion/mutator(get_turf(holder.my_atom))
new /obj/item/slimepotion/slime/mutator(get_turf(holder.my_atom))
..()
/datum/chemical_reaction/slime/slimebloodlust
@@ -394,7 +394,7 @@
required_other = 1
/datum/chemical_reaction/slime/docility/on_reaction(datum/reagents/holder)
new /obj/item/slimepotion/docility(get_turf(holder.my_atom))
new /obj/item/slimepotion/slime/docility(get_turf(holder.my_atom))
..()
/datum/chemical_reaction/slime/gender
@@ -465,7 +465,7 @@
required_other = 1
/datum/chemical_reaction/slime/slimepotion2/on_reaction(datum/reagents/holder)
new /obj/item/slimepotion/sentience(get_turf(holder.my_atom))
new /obj/item/slimepotion/slime/sentience(get_turf(holder.my_atom))
..()
//Adamantine
@@ -26,8 +26,11 @@
var/datum/action/innate/slime_pick_up/slime_up_action = new
var/datum/action/innate/feed_slime/feed_slime_action = new
var/datum/action/innate/monkey_recycle/monkey_recycle_action = new
var/datum/action/innate/slime_scan/scan_action = new
var/datum/action/innate/feed_potion/potion_action = new
var/list/stored_slimes = list()
var/obj/item/slimepotion/slime/current_potion
var/max_slimes = 5
var/monkeys = 0
@@ -66,6 +69,16 @@
monkey_recycle_action.Grant(user)
actions += monkey_recycle_action
if(scan_action)
scan_action.target = src
scan_action.Grant(user)
actions += scan_action
if(potion_action)
potion_action.target = src
potion_action.Grant(user)
actions += potion_action
/obj/machinery/computer/camera_advanced/xenobio/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/reagent_containers/food/snacks/monkeycube))
monkeys++
@@ -83,6 +96,16 @@
if (loaded)
to_chat(user, "<span class='notice'>You fill [src] with the monkey cubes stored in [O]. [src] now has [monkeys] monkey cubes stored.</span>")
return
else if(istype(O, /obj/item/slimepotion/slime))
var/replaced = FALSE
if(user && !user.transferItemToLoc(O, src))
return
if(!QDELETED(current_potion))
current_potion.forceMove(drop_location())
replaced = TRUE
current_potion = O
to_chat(user, "<span class='notice'>You load [O] in the console's potion slot[replaced ? ", replacing the one that was there before" : ""].</span>")
return
..()
/datum/action/innate/slime_place
@@ -173,3 +196,44 @@
qdel(M)
else
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
/datum/action/innate/slime_scan
name = "Scan Slime"
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "slime_scan"
/datum/action/innate/slime_scan/Activate()
if(!target || !isliving(owner))
return
var/mob/living/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
for(var/mob/living/simple_animal/slime/S in remote_eye.loc)
slime_scan(S, C)
else
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
/datum/action/innate/feed_potion
name = "Apply Potion"
icon_icon = 'icons/mob/actions/actions_silicon.dmi'
button_icon_state = "slime_potion"
/datum/action/innate/feed_potion/Activate()
if(!target || !isliving(owner))
return
var/mob/living/C = owner
var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control
var/obj/machinery/computer/camera_advanced/xenobio/X = target
if(QDELETED(X.current_potion))
to_chat(owner, "<span class='notice'>No potion loaded.</span>")
return
if(GLOB.cameranet.checkTurfVis(remote_eye.loc))
for(var/mob/living/simple_animal/slime/S in remote_eye.loc)
X.current_potion.attack(S, C)
break
else
to_chat(owner, "<span class='notice'>Target is not near a camera. Cannot proceed.</span>")
@@ -327,7 +327,7 @@
/obj/item/slime_extract/lightpink/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type)
switch(activation_type)
if(SLIME_ACTIVATE_MINOR)
var/obj/item/slimepotion/docility/O = new(null, 1)
var/obj/item/slimepotion/slime/docility/O = new(null, 1)
if(!user.put_in_active_hand(O))
O.forceMove(user.drop_location())
playsound(user, 'sound/effects/splat.ogg', 50, 1)
@@ -335,7 +335,7 @@
return 150
if(SLIME_ACTIVATE_MAJOR)
var/obj/item/slimepotion/sentience/O = new(null, 1)
var/obj/item/slimepotion/slime/sentience/O = new(null, 1)
if(!user.put_in_active_hand(O))
O.forceMove(user.drop_location())
playsound(user, 'sound/effects/splat.ogg', 50, 1)
@@ -539,19 +539,19 @@
to_chat(user, "<span class='notice'>You cannot transfer [src] to [target]! It appears the potion must be given directly to a slime to absorb.</span>" )
return
/obj/item/slimepotion/docility
/obj/item/slimepotion/slime/docility
name = "docility potion"
desc = "A potent chemical mix that nullifies a slime's hunger, causing it to become docile and tame."
icon = 'icons/obj/chemical.dmi'
icon_state = "potsilver"
/obj/item/slimepotion/docility/attack(mob/living/simple_animal/slime/M, mob/user)
/obj/item/slimepotion/slime/docility/attack(mob/living/simple_animal/slime/M, mob/user)
if(!isslime(M))
to_chat(user, "<span class='warning'>The potion only works on slimes!</span>")
return ..()
if(M.stat)
to_chat(user, "<span class='warning'>The slime is dead!</span>")
return ..()
return
M.docile = 1
M.nutrition = 700
@@ -565,33 +565,31 @@
M.real_name = newname
qdel(src)
/obj/item/slimepotion/sentience
/obj/item/slimepotion/slime/sentience
name = "intelligence potion"
desc = "A miraculous chemical mix that grants human like intelligence to living beings."
icon = 'icons/obj/chemical.dmi'
icon_state = "potpink"
var/list/not_interested = list()
var/being_used = 0
var/being_used = FALSE
var/sentience_type = SENTIENCE_ORGANIC
/obj/item/slimepotion/sentience/afterattack(mob/living/M, mob/user)
if(being_used || !ismob(M) || !user.Adjacent(M))
/obj/item/slimepotion/slime/sentience/attack(mob/living/M, mob/user)
if(being_used || !ismob(M))
return
if(!isanimal(M) || M.ckey) //only works on animals that aren't player controlled
to_chat(user, "<span class='warning'>[M] is already too intelligent for this to work!</span>")
return ..()
return
if(M.stat)
to_chat(user, "<span class='warning'>[M] is dead!</span>")
return ..()
return
var/mob/living/simple_animal/SM = M
if(SM.sentience_type != sentience_type)
to_chat(user, "<span class='warning'>[src] won't work on [SM].</span>")
return ..()
return
to_chat(user, "<span class='notice'>You offer [src] to [SM]...</span>")
being_used = 1
being_used = TRUE
var/list/candidates = pollCandidatesForMob("Do you want to play as [SM.name]?", ROLE_ALIEN, null, ROLE_ALIEN, 50, SM, POLL_IGNORE_SENTIENCE_POTION) // see poll_ignore.dm
var/mob/dead/observer/theghost = null
@@ -608,17 +606,17 @@
qdel(src)
else
to_chat(user, "<span class='notice'>[SM] looks interested for a moment, but then looks back down. Maybe you should try again later.</span>")
being_used = 0
being_used = FALSE
..()
/obj/item/slimepotion/sentience/proc/after_success(mob/living/user, mob/living/simple_animal/SM)
/obj/item/slimepotion/slime/sentience/proc/after_success(mob/living/user, mob/living/simple_animal/SM)
return
/obj/item/slimepotion/sentience/nuclear
/obj/item/slimepotion/slime/sentience/nuclear
name = "syndicate intelligence potion"
desc = "A miraculous chemical mix that grants human like intelligence to living beings. It has been modified with Syndicate technology to also grant an internal radio implant to the target and authenticate with identification systems."
/obj/item/slimepotion/sentience/nuclear/after_success(mob/living/user, mob/living/simple_animal/SM)
/obj/item/slimepotion/slime/sentience/nuclear/after_success(mob/living/user, mob/living/simple_animal/SM)
var/obj/item/implant/radio/imp = new(src)
imp.implant(SM, user)
@@ -667,25 +665,25 @@
SM.name = "[SM.name] as [user.real_name]"
qdel(src)
/obj/item/slimepotion/steroid
/obj/item/slimepotion/slime/steroid
name = "slime steroid"
desc = "A potent chemical mix that will cause a baby slime to generate more extract."
icon = 'icons/obj/chemical.dmi'
icon_state = "potred"
/obj/item/slimepotion/steroid/attack(mob/living/simple_animal/slime/M, mob/user)
/obj/item/slimepotion/slime/steroid/attack(mob/living/simple_animal/slime/M, mob/user)
if(!isslime(M))//If target is not a slime.
to_chat(user, "<span class='warning'>The steroid only works on baby slimes!</span>")
return ..()
if(M.is_adult) //Can't steroidify adults
to_chat(user, "<span class='warning'>Only baby slimes can use the steroid!</span>")
return ..()
return
if(M.stat)
to_chat(user, "<span class='warning'>The slime is dead!</span>")
return ..()
return
if(M.cores >= 5)
to_chat(user, "<span class='warning'>The slime already has the maximum amount of extract!</span>")
return ..()
return
to_chat(user, "<span class='notice'>You feed the slime the steroid. It will now produce one more extract.</span>")
M.cores++
@@ -697,46 +695,46 @@
icon = 'icons/obj/chemical.dmi'
icon_state = "potpurple"
/obj/item/slimepotion/stabilizer
/obj/item/slimepotion/slime/stabilizer
name = "slime stabilizer"
desc = "A potent chemical mix that will reduce the chance of a slime mutating."
icon = 'icons/obj/chemical.dmi'
icon_state = "potcyan"
/obj/item/slimepotion/stabilizer/attack(mob/living/simple_animal/slime/M, mob/user)
/obj/item/slimepotion/slime/stabilizer/attack(mob/living/simple_animal/slime/M, mob/user)
if(!isslime(M))
to_chat(user, "<span class='warning'>The stabilizer only works on slimes!</span>")
return ..()
if(M.stat)
to_chat(user, "<span class='warning'>The slime is dead!</span>")
return ..()
return
if(M.mutation_chance == 0)
to_chat(user, "<span class='warning'>The slime already has no chance of mutating!</span>")
return ..()
return
to_chat(user, "<span class='notice'>You feed the slime the stabilizer. It is now less likely to mutate.</span>")
M.mutation_chance = CLAMP(M.mutation_chance-15,0,100)
qdel(src)
/obj/item/slimepotion/mutator
/obj/item/slimepotion/slime/mutator
name = "slime mutator"
desc = "A potent chemical mix that will increase the chance of a slime mutating."
icon = 'icons/obj/chemical.dmi'
icon_state = "potgreen"
/obj/item/slimepotion/mutator/attack(mob/living/simple_animal/slime/M, mob/user)
/obj/item/slimepotion/slime/mutator/attack(mob/living/simple_animal/slime/M, mob/user)
if(!isslime(M))
to_chat(user, "<span class='warning'>The mutator only works on slimes!</span>")
return ..()
if(M.stat)
to_chat(user, "<span class='warning'>The slime is dead!</span>")
return ..()
return
if(M.mutator_used)
to_chat(user, "<span class='warning'>This slime has already consumed a mutator, any more would be far too unstable!</span>")
return ..()
return
if(M.mutation_chance == 100)
to_chat(user, "<span class='warning'>The slime is already guaranteed to mutate!</span>")
return ..()
return
to_chat(user, "<span class='notice'>You feed the slime the mutator. It is now more likely to mutate.</span>")
M.mutation_chance = CLAMP(M.mutation_chance+12,0,100)
+2 -2
View File
@@ -1061,7 +1061,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
/datum/uplink_item/device_tools/potion
name = "Syndicate Sentience Potion"
item = /obj/item/slimepotion/sentience/nuclear
item = /obj/item/slimepotion/slime/sentience/nuclear
desc = "A potion recovered at great risk by undercover syndicate operatives and then subsequently modified with syndicate technology. Using it will make any animal sentient, and bound to serve you, as well as implanting an internal radio for communication and an internal ID card for opening doors."
cost = 4
include_modes = list(/datum/game_mode/nuclear)
@@ -1372,7 +1372,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
exclude_modes = list(/datum/game_mode/nuclear)
cant_discount = TRUE
var/starting_crate_value = 50
/datum/uplink_item/badass/surplus/super
name = "Super Surplus Crate"
desc = "A dusty SUPER-SIZED from the back of the Syndicate warehouse. Rumored to contain a valuable assortment of items, \