mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
- Reagent code reorganization commit 3 (finalizing everything)
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4493 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -85,132 +85,15 @@
|
||||
Chemical things
|
||||
***********************************************************************/
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100)
|
||||
flags = FPRINT | TABLEPASS | OPENCONTAINER
|
||||
volume = 60
|
||||
var/reagent = ""
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline
|
||||
name = "internal inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle16"
|
||||
reagent = "inaprovaline"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("inaprovaline", 60)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin
|
||||
name = "internal anti-toxin bottle"
|
||||
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle17"
|
||||
reagent = "anti_toxin"
|
||||
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("anti_toxin", 60)
|
||||
return
|
||||
//Moved to modules/chemistry
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/robodropper
|
||||
name = "Industrial Dropper"
|
||||
desc = "A larger dropper. Transfers 10 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dropper0"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(1,2,3,4,5,6,7,8,9,10)
|
||||
volume = 10
|
||||
var/filled = 0
|
||||
|
||||
afterattack(obj/target, mob/user , flag)
|
||||
if(!target.reagents) return
|
||||
|
||||
if(filled)
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
user << "\red [target] is full."
|
||||
return
|
||||
|
||||
if(!target.is_open_container() && !ismob(target) && !istype(target,/obj/item/weapon/reagent_containers/food)) //You can inject humans and food but you cant remove the shit.
|
||||
user << "\red You cannot directly fill this object."
|
||||
return
|
||||
|
||||
|
||||
var/trans = 0
|
||||
|
||||
if(ismob(target))
|
||||
if(istype(target , /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/victim = target
|
||||
|
||||
var/obj/item/safe_thing = null
|
||||
if( victim.wear_mask )
|
||||
if ( victim.wear_mask.flags & MASKCOVERSEYES )
|
||||
safe_thing = victim.wear_mask
|
||||
if( victim.head )
|
||||
if ( victim.head.flags & MASKCOVERSEYES )
|
||||
safe_thing = victim.head
|
||||
if(victim.glasses)
|
||||
if ( !safe_thing )
|
||||
safe_thing = victim.glasses
|
||||
|
||||
if(safe_thing)
|
||||
if(!safe_thing.reagents)
|
||||
safe_thing.create_reagents(100)
|
||||
trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this)
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
O.show_message(text("\red <B>[] tries to squirt something into []'s eyes, but fails!</B>", user, target), 1)
|
||||
spawn(5)
|
||||
src.reagents.reaction(safe_thing, TOUCH)
|
||||
|
||||
|
||||
user << "\blue You transfer [trans] units of the solution."
|
||||
if (src.reagents.total_volume<=0)
|
||||
filled = 0
|
||||
icon_state = "dropper[filled]"
|
||||
return
|
||||
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
O.show_message(text("\red <B>[] squirts something into []'s eyes!</B>", user, target), 1)
|
||||
src.reagents.reaction(target, TOUCH)
|
||||
|
||||
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
user << "\blue You transfer [trans] units of the solution."
|
||||
if (src.reagents.total_volume<=0)
|
||||
filled = 0
|
||||
icon_state = "dropper[filled]"
|
||||
|
||||
else
|
||||
|
||||
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
|
||||
user << "\red You cannot directly remove reagents from [target]."
|
||||
return
|
||||
|
||||
if(!target.reagents.total_volume)
|
||||
user << "\red [target] is empty."
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
|
||||
user << "\blue You fill the dropper with [trans] units of the solution."
|
||||
|
||||
filled = 1
|
||||
icon_state = "dropper[filled]"
|
||||
|
||||
return
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
Chemical things
|
||||
RCD
|
||||
***********************************************************************/
|
||||
/obj/item/borg/rcd
|
||||
name = "robotic rapid-construction-device"
|
||||
|
||||
@@ -19,18 +19,6 @@ BIKE HORN
|
||||
M.Stun(4)
|
||||
M.Weaken(2)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/HasEntered(AM as mob|obj)
|
||||
if (istype(AM, /mob/living/carbon))
|
||||
var/mob/M = AM
|
||||
if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP))
|
||||
return
|
||||
|
||||
M.stop_pulling()
|
||||
M << "\blue You slipped on the [name]!"
|
||||
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
|
||||
M.Stun(8)
|
||||
M.Weaken(5)
|
||||
|
||||
/obj/item/weapon/soap/HasEntered(AM as mob|obj) //EXACTLY the same as bananapeel for now, so it makes sense to put it in the same dm -- Urist
|
||||
if (istype(AM, /mob/living/carbon))
|
||||
var/mob/M = AM
|
||||
|
||||
@@ -9,30 +9,6 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
|
||||
*/
|
||||
|
||||
|
||||
// Plant-B-Gone
|
||||
/obj/item/weapon/reagent_containers/spray/plantbgone // -- Skie
|
||||
name = "Plant-B-Gone"
|
||||
desc = "Kills those pesky weeds!"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "plantbgone"
|
||||
item_state = "plantbgone"
|
||||
volume = 100
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/plantbgone/New()
|
||||
..()
|
||||
reagents.add_reagent("plantbgone", 100)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/plantbgone/afterattack(atom/A as mob|obj, mob/user as mob)
|
||||
if (istype(A, /obj/machinery/hydroponics)) // We are targeting hydrotray
|
||||
return
|
||||
|
||||
if (istype(A, /obj/effect/blob)) // blob damage in blob code
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
|
||||
// Sunflower
|
||||
/obj/item/weapon/grown/sunflower/attack(mob/M as mob, mob/user as mob)
|
||||
@@ -114,22 +90,3 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
|
||||
new /obj/item/clothing/mask/pipe/cobpipe (user.loc)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/melee/energy))
|
||||
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
|
||||
new /obj/item/clothing/head/pumpkinhead (user.loc)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/cable_coil))
|
||||
if(W:amount >= 5)
|
||||
W:amount -= 5
|
||||
if(!W:amount) del(W)
|
||||
user << "<span class='notice'>You add some cable to the potato and slide it inside the battery encasing.</span>"
|
||||
new /obj/item/weapon/cell/potato(user.loc)
|
||||
del(src)
|
||||
return
|
||||
@@ -29,24 +29,6 @@
|
||||
if(0)
|
||||
usr << "The bag now picks up one plant at a time."
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
if (istype(O, /obj/item/weapon/plantbag))
|
||||
var/obj/item/weapon/plantbag/S = O
|
||||
if (S.mode == 1)
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(src.x,src.y,src.z))
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += G;
|
||||
else
|
||||
user << "\blue The plant bag is full."
|
||||
return
|
||||
user << "\blue You pick up all the plants."
|
||||
else
|
||||
if (S.contents.len < S.capacity)
|
||||
S.contents += src;
|
||||
else
|
||||
user << "\blue The plant bag is full."
|
||||
return
|
||||
|
||||
/obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user