mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 09:34:21 +01:00
more work
This commit is contained in:
@@ -1,11 +1,564 @@
|
||||
/var/global/spacevines_spawned = 0
|
||||
|
||||
/datum/event/spacevine
|
||||
announceWhen = 10
|
||||
//Types of usual mutations
|
||||
#define POSITIVE 1
|
||||
#define NEGATIVE 2
|
||||
#define MINOR_NEGATIVE 3
|
||||
|
||||
/datum/event/spacevine/start()
|
||||
spacevine_infestation()
|
||||
spacevines_spawned = 1
|
||||
var/list/turfs = list() //list of all the empty floor turfs in the hallway areas
|
||||
|
||||
/datum/event/spacevine/announce()
|
||||
command_announcement.Announce("Confirmed outbreak of level 7 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak7.ogg')
|
||||
var/obj/effect/spacevine/SV = new()
|
||||
|
||||
for(var/area/hallway/A in world)
|
||||
for(var/turf/F in A)
|
||||
if(F.Enter(SV))
|
||||
turfs += F
|
||||
|
||||
qdel(SV)
|
||||
|
||||
if(turfs.len) //Pick a turf to spawn at if we can
|
||||
var/turf/T = pick(turfs)
|
||||
new/obj/effect/spacevine_controller(T) //spawn a controller at turf
|
||||
|
||||
|
||||
/datum/spacevine_mutation
|
||||
var/name = ""
|
||||
var/severity = 1
|
||||
var/hue
|
||||
var/quality
|
||||
|
||||
/datum/spacevine_mutation/proc/add_mutation_to_vinepiece(obj/effect/spacevine/holder)
|
||||
holder.mutations |= src
|
||||
holder.color = hue
|
||||
|
||||
/datum/spacevine_mutation/proc/process_mutation(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/process_temperature(obj/effect/spacevine/holder, temp, volume)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_birth(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_grow(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_death(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_hit(obj/effect/spacevine/holder, mob/hitter, obj/item/I, expected_damage)
|
||||
. = expected_damage
|
||||
|
||||
/datum/spacevine_mutation/proc/on_cross(obj/effect/spacevine/holder, mob/crosser)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_chem(obj/effect/spacevine/holder, datum/reagent/R)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_eat(obj/effect/spacevine/holder, mob/living/eater)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_spread(obj/effect/spacevine/holder, turf/target)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_buckle(obj/effect/spacevine/holder, mob/living/buckled)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_explosion(severity)
|
||||
return
|
||||
|
||||
|
||||
/datum/spacevine_mutation/space_covering
|
||||
name = "space protective"
|
||||
hue = "#aa77aa"
|
||||
quality = POSITIVE
|
||||
|
||||
/turf/simulated/floor/vines
|
||||
color = "#aa77aa"
|
||||
icon_state = "vinefloor"
|
||||
broken_states = list()
|
||||
|
||||
|
||||
//All of this shit is useless for vines
|
||||
|
||||
/turf/simulated/floor/vines/attackby()
|
||||
return
|
||||
|
||||
/turf/simulated/floor/vines/burn_tile()
|
||||
return
|
||||
|
||||
/turf/simulated/floor/vines/break_tile()
|
||||
return
|
||||
|
||||
/turf/simulated/floor/vines/make_plating()
|
||||
return
|
||||
|
||||
/turf/simulated/floor/vines/break_tile_to_plating()
|
||||
return
|
||||
|
||||
/turf/simulated/floor/vines/ex_act(severity)
|
||||
if(severity < 3)
|
||||
ChangeTurf(baseturf)
|
||||
|
||||
/turf/simulated/floor/vines/narsie_act()
|
||||
if(prob(20))
|
||||
ChangeTurf(baseturf) //nar sie eats this shit
|
||||
|
||||
/turf/simulated/floor/vines/singularity_pull(S, current_size)
|
||||
if(current_size >= STAGE_FIVE)
|
||||
if(prob(50))
|
||||
ChangeTurf(baseturf)
|
||||
|
||||
/turf/simulated/floor/vines/ChangeTurf(turf/open/floor/T)
|
||||
for(var/obj/effect/spacevine/SV in src)
|
||||
qdel(SV)
|
||||
return ..()
|
||||
|
||||
/datum/spacevine_mutation/space_covering
|
||||
var/static/list/coverable_turfs
|
||||
|
||||
/datum/spacevine_mutation/space_covering/New()
|
||||
. = ..()
|
||||
if(!coverable_turfs)
|
||||
coverable_turfs = typecacheof(list(
|
||||
/turf/space
|
||||
))
|
||||
coverable_turfs -= typecacheof(list(
|
||||
/turf/space/transit
|
||||
))
|
||||
|
||||
/datum/spacevine_mutation/space_covering/on_grow(obj/effect/spacevine/holder)
|
||||
process_mutation(holder)
|
||||
|
||||
/datum/spacevine_mutation/space_covering/process_mutation(obj/effect/spacevine/holder)
|
||||
var/turf/T = get_turf(holder)
|
||||
if(is_type_in_typecache(T, coverable_turfs))
|
||||
var/currtype = T.type
|
||||
T.ChangeTurf(/turf/simulated/floor/vines)
|
||||
T.baseturf = currtype
|
||||
|
||||
/datum/spacevine_mutation/space_covering/on_death(obj/effect/spacevine/holder)
|
||||
var/turf/T = get_turf(holder)
|
||||
if(istype(T, /turf/simulated/floor/vines))
|
||||
T.ChangeTurf(T.baseturf)
|
||||
|
||||
/datum/spacevine_mutation/bluespace
|
||||
name = "bluespace"
|
||||
hue = "#3333ff"
|
||||
quality = MINOR_NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/bluespace/on_spread(obj/effect/spacevine/holder, turf/target)
|
||||
if(holder.energy > 1 && !locate(/obj/effect/spacevine) in target)
|
||||
holder.master.spawn_spacevine_piece(target, holder)
|
||||
|
||||
/datum/spacevine_mutation/light
|
||||
name = "light"
|
||||
hue = "#ffff00"
|
||||
quality = POSITIVE
|
||||
severity = 4
|
||||
|
||||
/datum/spacevine_mutation/light/on_grow(obj/effect/spacevine/holder)
|
||||
if(holder.energy)
|
||||
holder.set_light(severity)
|
||||
|
||||
/datum/spacevine_mutation/toxicity
|
||||
name = "toxic"
|
||||
hue = "#ff00ff"
|
||||
severity = 10
|
||||
quality = NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/toxicity/on_cross(obj/effect/spacevine/holder, mob/living/crosser)
|
||||
if(issilicon(crosser))
|
||||
return
|
||||
if(prob(severity) && istype(crosser) && !isvineimmune(crosser))
|
||||
crosser << "<span class='alert'>You accidently touch the vine and feel a strange sensation.</span>"
|
||||
crosser.adjustToxLoss(5)
|
||||
|
||||
/datum/spacevine_mutation/toxicity/on_eat(obj/effect/spacevine/holder, mob/living/eater)
|
||||
if(!isvineimmune(eater))
|
||||
eater.adjustToxLoss(5)
|
||||
|
||||
/datum/spacevine_mutation/explosive //OH SHIT IT CAN CHAINREACT RUN!!!
|
||||
name = "explosive"
|
||||
hue = "#ff0000"
|
||||
quality = NEGATIVE
|
||||
severity = 2
|
||||
|
||||
/datum/spacevine_mutation/explosive/on_explosion(explosion_severity)
|
||||
if(explosion_severity < 3)
|
||||
qdel(src)
|
||||
else
|
||||
. = 1
|
||||
spawn(5)
|
||||
qdel(src)
|
||||
|
||||
/datum/spacevine_mutation/explosive/on_death(obj/effect/spacevine/holder, mob/hitter, obj/item/I)
|
||||
explosion(holder.loc, 0, 0, severity, 0, 0)
|
||||
|
||||
/datum/spacevine_mutation/fire_proof
|
||||
name = "fire proof"
|
||||
hue = "#ff8888"
|
||||
quality = MINOR_NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/fire_proof/process_temperature(obj/effect/spacevine/holder, temp, volume)
|
||||
return 1
|
||||
|
||||
/datum/spacevine_mutation/fire_proof/on_hit(obj/effect/spacevine/holder, mob/hitter, obj/item/I, expected_damage)
|
||||
if(I && I.damtype == "fire")
|
||||
. = 0
|
||||
else
|
||||
. = expected_damage
|
||||
|
||||
/datum/spacevine_mutation/vine_eating
|
||||
name = "vine eating"
|
||||
hue = "#ff7700"
|
||||
quality = MINOR_NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/vine_eating/on_spread(obj/effect/spacevine/holder, turf/target)
|
||||
var/obj/effect/spacevine/prey = locate() in target
|
||||
if(prey && !prey.mutations.Find(src)) //Eat all vines that are not of the same origin
|
||||
qdel(prey)
|
||||
|
||||
/datum/spacevine_mutation/aggressive_spread //very OP, but im out of other ideas currently
|
||||
name = "aggressive spreading"
|
||||
hue = "#333333"
|
||||
severity = 3
|
||||
quality = NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/aggressive_spread/on_spread(obj/effect/spacevine/holder, turf/target)
|
||||
target.ex_act(severity, src) // vine immunity handled at /mob/ex_act
|
||||
|
||||
/datum/spacevine_mutation/aggressive_spread/on_buckle(obj/effect/spacevine/holder, mob/living/buckled)
|
||||
buckled.ex_act(severity, src)
|
||||
|
||||
/datum/spacevine_mutation/transparency
|
||||
name = "transparent"
|
||||
hue = ""
|
||||
quality = POSITIVE
|
||||
|
||||
/datum/spacevine_mutation/transparency/on_grow(obj/effect/spacevine/holder)
|
||||
holder.set_opacity(0)
|
||||
holder.alpha = 125
|
||||
|
||||
/datum/spacevine_mutation/thorns
|
||||
name = "thorny"
|
||||
hue = "#666666"
|
||||
severity = 10
|
||||
quality = NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/thorns/on_cross(obj/effect/spacevine/holder, mob/living/crosser)
|
||||
if(prob(severity) && istype(crosser) && !isvineimmune(holder))
|
||||
var/mob/living/M = crosser
|
||||
M.adjustBruteLoss(5)
|
||||
M << "<span class='alert'>You cut yourself on the thorny vines.</span>"
|
||||
|
||||
/datum/spacevine_mutation/thorns/on_hit(obj/effect/spacevine/holder, mob/living/hitter, obj/item/I, expected_damage)
|
||||
if(prob(severity) && istype(hitter) && !isvineimmune(holder))
|
||||
var/mob/living/M = hitter
|
||||
M.adjustBruteLoss(5)
|
||||
M << "<span class='alert'>You cut yourself on the thorny vines.</span>"
|
||||
. = expected_damage
|
||||
|
||||
/datum/spacevine_mutation/woodening
|
||||
name = "hardened"
|
||||
hue = "#997700"
|
||||
quality = NEGATIVE
|
||||
|
||||
/datum/spacevine_mutation/woodening/on_grow(obj/effect/spacevine/holder)
|
||||
if(holder.energy)
|
||||
holder.density = 1
|
||||
holder.maxhealth = 100
|
||||
holder.health = holder.maxhealth
|
||||
|
||||
/datum/spacevine_mutation/woodening/on_hit(obj/effect/spacevine/holder, mob/living/hitter, obj/item/I, expected_damage)
|
||||
if(is_sharp(I))
|
||||
. = expected_damage * 0.5
|
||||
else
|
||||
. = expected_damage
|
||||
|
||||
/datum/spacevine_mutation/flowering
|
||||
name = "flowering"
|
||||
hue = "#0A480D"
|
||||
quality = NEGATIVE
|
||||
severity = 10
|
||||
|
||||
/datum/spacevine_mutation/flowering/on_grow(obj/effect/spacevine/holder)
|
||||
if(holder.energy == 2 && prob(severity) && !locate(/obj/structure/alien/resin/flower_bud_enemy) in range(5,holder))
|
||||
var/obj/structure/alien/resin/flower_bud_enemy/FBE = new /obj/structure/alien/resin/flower_bud_enemy(get_turf(holder))
|
||||
FBE.layer = holder.layer+0.1
|
||||
|
||||
/datum/spacevine_mutation/flowering/on_cross(obj/effect/spacevine/holder, mob/living/crosser)
|
||||
if(prob(25))
|
||||
holder.entangle(crosser)
|
||||
|
||||
|
||||
// SPACE VINES (Note that this code is very similar to Biomass code)
|
||||
/obj/effect/spacevine
|
||||
name = "space vines"
|
||||
desc = "An extremely expansionistic species of vine."
|
||||
icon = 'icons/effects/spacevines.dmi'
|
||||
icon_state = "Light1"
|
||||
anchored = 1
|
||||
density = 0
|
||||
layer = MOB_LAYER + 0.8
|
||||
mouse_opacity = 2 //Clicking anywhere on the turf is good enough
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
var/health = 50
|
||||
var/maxhealth = 50
|
||||
var/energy = 0
|
||||
var/obj/effect/spacevine_controller/master = null
|
||||
var/list/mutations = list()
|
||||
|
||||
/obj/effect/spacevine/New()
|
||||
..()
|
||||
color = "#ffffff"
|
||||
|
||||
/obj/effect/spacevine/examine(mob/user)
|
||||
..()
|
||||
var/text = "This one is a"
|
||||
if(mutations.len)
|
||||
for(var/A in mutations)
|
||||
var/datum/spacevine_mutation/SM = A
|
||||
text += " [SM.name]"
|
||||
else
|
||||
text += " normal"
|
||||
text += " vine."
|
||||
user << text
|
||||
|
||||
/obj/effect/spacevine/Destroy()
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_death(src)
|
||||
if(master)
|
||||
master.vines -= src
|
||||
master.growth_queue -= src
|
||||
if(!master.vines.len)
|
||||
var/obj/item/seeds/kudzu/KZ = new(loc)
|
||||
KZ.mutations |= mutations
|
||||
KZ.potency = min(100, master.mutativeness * 10)
|
||||
KZ.production = (master.spread_cap / initial(master.spread_cap)) * 5
|
||||
mutations = list()
|
||||
set_opacity(0)
|
||||
if(has_buckled_mobs())
|
||||
unbuckle_all_mobs(force=1)
|
||||
return ..()
|
||||
|
||||
/obj/effect/spacevine/proc/on_chem_effect(datum/reagent/R)
|
||||
var/override = 0
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
override += SM.on_chem(src, R)
|
||||
if(!override && istype(R, /datum/reagent/atrazine))
|
||||
if(prob(50))
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/spacevine/proc/eat(mob/eater)
|
||||
var/override = 0
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
override += SM.on_eat(src, eater)
|
||||
if(!override)
|
||||
if(prob(10))
|
||||
eater.say("Nom")
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/spacevine/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if (!W || !user || !W.type)
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
var/force = W.force
|
||||
|
||||
if(istype(W, /obj/item/weapon/scythe))
|
||||
force = force * 4
|
||||
for(var/obj/effect/spacevine/B in orange(1,src))
|
||||
B.health = health - force
|
||||
if(B.health < 1)
|
||||
qdel(B)
|
||||
|
||||
health = health - force
|
||||
|
||||
if(health < 1)
|
||||
qdel(src)
|
||||
|
||||
return
|
||||
|
||||
if(is_sharp(W))
|
||||
force = force * 4
|
||||
|
||||
if(W && W.damtype == "fire")
|
||||
force = force * 4
|
||||
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
force = SM.on_hit(src, user, W, force) //on_hit now takes override damage as arg and returns new value for other mutations to permutate further
|
||||
|
||||
health = health - force
|
||||
if(health < 1)
|
||||
qdel(src)
|
||||
|
||||
..()
|
||||
|
||||
/obj/effect/spacevine/Crossed(mob/crosser)
|
||||
if(isliving(crosser))
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_cross(src, crosser)
|
||||
|
||||
/obj/effect/spacevine/attack_hand(mob/user)
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_hit(src, user)
|
||||
user_unbuckle_mob(user, user)
|
||||
|
||||
/obj/effect/spacevine/attack_alien(mob/living/user)
|
||||
eat(user)
|
||||
|
||||
/obj/effect/spacevine_controller
|
||||
invisibility = 101
|
||||
var/list/obj/effect/spacevine/vines = list()
|
||||
var/list/growth_queue = list()
|
||||
var/spread_multiplier = 5
|
||||
var/spread_cap = 30
|
||||
var/list/mutations_list = list()
|
||||
var/mutativeness = 1
|
||||
|
||||
/obj/effect/spacevine_controller/New(loc, list/muts, potency, production)
|
||||
color = "#ffffff"
|
||||
spawn_spacevine_piece(loc, , muts)
|
||||
processing_objects.Add(src)
|
||||
init_subtypes(/datum/spacevine_mutation/, mutations_list)
|
||||
if(potency != null)
|
||||
mutativeness = potency / 10
|
||||
if(production != null)
|
||||
spread_cap *= production / 5
|
||||
spread_multiplier /= production / 5
|
||||
..()
|
||||
|
||||
|
||||
/obj/effect/spacevine_controller/ex_act() //only killing all vines will end this suffering
|
||||
return
|
||||
|
||||
/obj/effect/spacevine_controller/singularity_act()
|
||||
return
|
||||
|
||||
/obj/effect/spacevine_controller/singularity_pull()
|
||||
return
|
||||
|
||||
/obj/effect/spacevine_controller/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/effect/spacevine_controller/proc/spawn_spacevine_piece(turf/location, obj/effect/spacevine/parent, list/muts)
|
||||
var/obj/effect/spacevine/SV = new(location)
|
||||
growth_queue += SV
|
||||
vines += SV
|
||||
SV.master = src
|
||||
if(muts && muts.len)
|
||||
for(var/datum/spacevine_mutation/M in muts)
|
||||
M.add_mutation_to_vinepiece(SV)
|
||||
return
|
||||
if(parent)
|
||||
SV.mutations |= parent.mutations
|
||||
SV.color = parent.color
|
||||
if(prob(mutativeness))
|
||||
var/datum/spacevine_mutation/randmut = pick(mutations_list - SV.mutations)
|
||||
randmut.add_mutation_to_vinepiece(SV)
|
||||
|
||||
for(var/datum/spacevine_mutation/SM in SV.mutations)
|
||||
SM.on_birth(SV)
|
||||
|
||||
/obj/effect/spacevine_controller/process()
|
||||
if(!vines)
|
||||
qdel(src) //space vines exterminated. Remove the controller
|
||||
return
|
||||
if(!growth_queue)
|
||||
qdel(src) //Sanity check
|
||||
return
|
||||
|
||||
var/length = 0
|
||||
|
||||
length = min( spread_cap , max( 1 , vines.len / spread_multiplier ) )
|
||||
var/i = 0
|
||||
var/list/obj/effect/spacevine/queue_end = list()
|
||||
|
||||
for(var/obj/effect/spacevine/SV in growth_queue)
|
||||
if(qdeleted(SV))
|
||||
continue
|
||||
i++
|
||||
queue_end += SV
|
||||
growth_queue -= SV
|
||||
for(var/datum/spacevine_mutation/SM in SV.mutations)
|
||||
SM.process_mutation(SV)
|
||||
if(SV.energy < 2) //If tile isn't fully grown
|
||||
if(prob(20))
|
||||
SV.grow()
|
||||
else //If tile is fully grown
|
||||
SV.entangle_mob()
|
||||
|
||||
//if(prob(25))
|
||||
SV.spread()
|
||||
if(i >= length)
|
||||
break
|
||||
|
||||
growth_queue = growth_queue + queue_end
|
||||
|
||||
/obj/effect/spacevine/proc/grow()
|
||||
if(!energy)
|
||||
icon_state = pick("Med1", "Med2", "Med3")
|
||||
energy = 1
|
||||
set_opacity(1)
|
||||
layer = 5
|
||||
else
|
||||
icon_state = pick("Hvy1", "Hvy2", "Hvy3")
|
||||
energy = 2
|
||||
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_grow(src)
|
||||
|
||||
/obj/effect/spacevine/proc/entangle_mob()
|
||||
if(!has_buckled_mobs() && prob(25))
|
||||
for(var/mob/living/V in loc)
|
||||
entangle(V)
|
||||
if(has_buckled_mobs())
|
||||
break //only capture one mob at a time
|
||||
|
||||
|
||||
/obj/effect/spacevine/proc/entangle(mob/living/V)
|
||||
if(!V || isvineimmune(V))
|
||||
return
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_buckle(src, V)
|
||||
if((V.stat != DEAD) && (V.buckled != src)) //not dead or captured
|
||||
V << "<span class='danger'>The vines [pick("wind", "tangle", "tighten")] around you!</span>"
|
||||
buckle_mob(V, 1)
|
||||
|
||||
/obj/effect/spacevine/proc/spread()
|
||||
var/direction = pick(cardinal)
|
||||
var/turf/stepturf = get_step(src,direction)
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_spread(src, stepturf)
|
||||
stepturf = get_step(src,direction) //in case turf changes, to make sure no runtimes happen
|
||||
if(!locate(/obj/effect/spacevine, stepturf))
|
||||
if(stepturf.Enter(src))
|
||||
if(master)
|
||||
master.spawn_spacevine_piece(stepturf, src)
|
||||
|
||||
/obj/effect/spacevine/ex_act(severity)
|
||||
var/i
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
i += SM.on_explosion(severity)
|
||||
if(!i && prob(100/severity))
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/spacevine/temperature_expose(null, temp, volume)
|
||||
var/override = 0
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
override += SM.process_temperature(src, temp, volume)
|
||||
if(!override)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/spacevine/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(isvineimmune(mover))
|
||||
. = TRUE
|
||||
else
|
||||
. = ..()
|
||||
|
||||
/proc/isvineimmune(atom/A)
|
||||
. = FALSE
|
||||
if(isliving(A))
|
||||
var/mob/living/M = A
|
||||
if(("vines" in M.faction) || ("plants" in M.faction))
|
||||
. = TRUE
|
||||
@@ -4,27 +4,29 @@
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "juicer1"
|
||||
layer = 2.9
|
||||
density = 0
|
||||
density = 1
|
||||
anchored = 0
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
pass_flags = PASSTABLE
|
||||
var/obj/item/weapon/reagent_containers/beaker = null
|
||||
var/global/list/allowed_items = list(
|
||||
var/global/list/allowed_items = list (
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = "tomatojuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = "carrotjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries = "berryjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes = "grapejuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes/green = "grapejuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = "banana",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato = "potato",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lemon = "lemonjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange = "orangejuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lime = "limejuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon = "watermelonjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = "watermelonjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown = "water",
|
||||
)
|
||||
|
||||
var/global/list/allowed_tags = list (
|
||||
"tomato" = "tomatojuice",
|
||||
"carrot" = "carrotjuice",
|
||||
"berries" = "berryjuice",
|
||||
"banana" = "banana",
|
||||
"potato" = "potato",
|
||||
"lemon" = "lemonjuice",
|
||||
"orange" = "orangejuice",
|
||||
"lime" = "limejuice",
|
||||
"poisonberries" = "poisonberryjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/poison = "poisonberryjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin = "pumpkinjuice",
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/blumpkin = "blumpkinjuice",
|
||||
)
|
||||
|
||||
/obj/machinery/juicer/New()
|
||||
@@ -135,23 +137,18 @@
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/juicer/proc/get_juice_id(var/obj/item/weapon/reagent_containers/food/snacks/O)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/watermelonslice))
|
||||
return "watermelonjuice"
|
||||
else if(istype(O, /obj.item/weapon/reagent_containers/food/snacks/grown))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
|
||||
for(var/i in allowed_tags)
|
||||
if(G.seed.kitchen_tag == allowed_tags[i])
|
||||
return allowed_tags[i]
|
||||
return "water"
|
||||
/obj/machinery/juicer/proc/get_juice_id(obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
for (var/i in allowed_items)
|
||||
if (istype(O, i))
|
||||
return allowed_items[i]
|
||||
|
||||
/obj/machinery/juicer/proc/get_juice_amount(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
if(!istype(O))
|
||||
/obj/machinery/juicer/proc/get_juice_amount(obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
if(!istype(O) || !O.seed)
|
||||
return 5
|
||||
else if(O.potency == -1)
|
||||
else if (O.seed.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(5*sqrt(O.potency))
|
||||
return round(5*sqrt(O.seed.potency))
|
||||
|
||||
/obj/machinery/juicer/proc/juice()
|
||||
power_change() //it is a portable machine
|
||||
@@ -167,19 +164,21 @@
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
|
||||
/obj/structure/closet/crate/juice
|
||||
New()
|
||||
..()
|
||||
new/obj/machinery/juicer(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
|
||||
/obj/structure/closet/crate/juice/New()
|
||||
..()
|
||||
new/obj/machinery/juicer(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/grapes(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/grapes(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
|
||||
new/obj/item/weapon/reagent_containers/food/snacks/grown/grapes(src)
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/biogenerator/ex_act(severity)
|
||||
..()
|
||||
if(beaker)
|
||||
beaker.ex_act(severity)
|
||||
..()
|
||||
|
||||
/obj/machinery/biogenerator/RefreshParts()
|
||||
var/E = 0
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
throw_range = 7
|
||||
|
||||
/obj/item/weapon/grown/corncob/attackby(obj/item/weapon/grown/W, mob/user, params)
|
||||
if(W.is_sharp())
|
||||
if(is_sharp(W))
|
||||
to_chat(user, "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>")
|
||||
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
|
||||
user.unEquip(src)
|
||||
|
||||
@@ -125,11 +125,9 @@
|
||||
log_game("[user] ([user.key ? user.key : "no key"]) primed a cherry bomb for detonation at [A] ([user.x],[user.y],[user.z]).")
|
||||
prime()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/deconstruct(disassembled = TRUE)
|
||||
if(!disassembled)
|
||||
prime()
|
||||
if(!qdeleted(src))
|
||||
qdel(src)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/burn()
|
||||
prime()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherry_bomb/ex_act(severity)
|
||||
qdel(src) //Ensuring that it's deleted by its own explosion. Also prevents mass chain reaction with piles of cherry bombs
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
origin_tech = "biotech=4;programming=5"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom/attack_self(mob/user)
|
||||
if(isspaceturf(user.loc))
|
||||
if(istype(user.loc, /turf/space))
|
||||
return
|
||||
var/mob/living/simple_animal/hostile/mushroom/M = new /mob/living/simple_animal/hostile/mushroom(user.loc)
|
||||
M.maxHealth += round(seed.endurance / 4)
|
||||
@@ -229,16 +229,15 @@
|
||||
desc = "<I>Mycena Bregprox</I>: This species of mushroom glows in the dark."
|
||||
icon_state = "glowshroom"
|
||||
filling_color = "#00FA9A"
|
||||
var/effect_path = /obj/structure/glowshroom
|
||||
var/effect_path = /obj/effect/glowshroom
|
||||
origin_tech = "biotech=4;plasmatech=6"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user)
|
||||
if(isspaceturf(user.loc))
|
||||
if(istype(user.loc, /turf/space))
|
||||
return
|
||||
var/obj/structure/glowshroom/planted = new effect_path(user.loc)
|
||||
var/obj/effect/glowshroom/planted = new effect_path(user.loc)
|
||||
planted.delay = planted.delay - seed.production * 100 //So the delay goes DOWN with better stats instead of up. :I
|
||||
planted.obj_integrity = seed.endurance
|
||||
planted.max_integrity = seed.endurance
|
||||
planted.endurance = seed.endurance
|
||||
planted.yield = seed.yield
|
||||
planted.potency = seed.potency
|
||||
to_chat(user, "<span class='notice'>You plant [src].</span>")
|
||||
@@ -266,5 +265,5 @@
|
||||
desc = "<I>Mycena Ruthenia</I>: This species of mushroom glows in the dark, but aren't bioluminescent. They're warm to the touch..."
|
||||
icon_state = "glowcap"
|
||||
filling_color = "#00FA9A"
|
||||
effect_path = /obj/structure/glowshroom/glowcap
|
||||
effect_path = /obj/effect/glowshroom/glowcap
|
||||
origin_tech = "biotech=4;powerstorage=6;plasmatech=4"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(W.is_sharp())
|
||||
if(is_sharp(W))
|
||||
to_chat(user, "<span class='notice'>You cut the potato into wedges with [W].</span>")
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/potato/wedges/Wedges = new /obj/item/weapon/reagent_containers/food/snacks/grown/potato/wedges
|
||||
if(!remove_item_from_storage(user))
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
bitesize_mod = 2
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(W.is_sharp())
|
||||
if(is_sharp(W))
|
||||
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
|
||||
new /obj/item/clothing/head/hardhat/pumpkinhead(user.loc)
|
||||
qdel(src)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
bitesize_mod = 2
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot/attackby(obj/item/I, mob/user, params)
|
||||
if(I.is_sharp())
|
||||
if(is_sharp(I))
|
||||
to_chat(user, "<span class='notice'>You sharpen the carrot into a shiv with [I].</span>")
|
||||
var/obj/item/weapon/kitchen/knife/carrotshiv/Shiv = new /obj/item/weapon/kitchen/knife/carrotshiv
|
||||
if(!remove_item_from_storage(user))
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato/killer/attack_self(mob/user)
|
||||
if(awakening || isspaceturf(user.loc))
|
||||
if(awakening || istype(user.loc, /turf/space))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin to awaken the Killer Tomato...</span>")
|
||||
awakening = 1
|
||||
|
||||
@@ -68,9 +68,6 @@
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
if(default_pry_open(I))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, I))
|
||||
return
|
||||
|
||||
@@ -830,8 +827,8 @@
|
||||
else if(anchored)
|
||||
user.visible_message("[user] begins to unwrench [src].", \
|
||||
"<span class='notice'>You begin to unwrench [src]...</span>")
|
||||
playsound(loc, O.usesound, 50, 1)
|
||||
if (do_after(user, 20*O.toolspeed, target = src))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if (do_after(user, 20, target = src))
|
||||
if(!anchored)
|
||||
return
|
||||
anchored = 0
|
||||
@@ -840,7 +837,7 @@
|
||||
|
||||
else if(istype(O, /obj/item/weapon/wirecutters) && unwrenchable)
|
||||
using_irrigation = !using_irrigation
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
playsound(src, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user.visible_message("<span class='notice'>[user] [using_irrigation ? "" : "dis"]connects [src]'s irrigation hoses.</span>", \
|
||||
"<span class='notice'>You [using_irrigation ? "" : "dis"]connect [src]'s irrigation hoses.</span>")
|
||||
for(var/obj/machinery/hydroponics/h in range(1,src))
|
||||
|
||||
@@ -70,9 +70,6 @@
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
|
||||
if(default_pry_open(O))
|
||||
return
|
||||
|
||||
if(default_unfasten_wrench(user, O))
|
||||
return
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
for(var/direction in shuffle(list(1,2,4,8,5,6,9,10)))
|
||||
var/step = get_step(src, direction)
|
||||
if(step)
|
||||
if(locate(/obj/effect/plant) in step)
|
||||
if(locate(/obj/effect/spacevine) in step)
|
||||
Move(step, get_dir(src, step))
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/handle_automated_action()
|
||||
@@ -47,11 +47,9 @@
|
||||
LoseTarget()
|
||||
src.visible_message("\blue [src] calms down.")
|
||||
|
||||
if(locate(/obj/effect/plant) in loc)
|
||||
var/obj/effect/plant/SV = locate(/obj/effect/plant) in loc
|
||||
qdel(SV)
|
||||
if(prob(10))
|
||||
say("Nom")
|
||||
var/obj/effect/spacevine/SV = locate(/obj/effect/spacevine) in loc
|
||||
if(SV)
|
||||
SV.eat(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/Life()
|
||||
. = ..()
|
||||
@@ -66,11 +64,9 @@
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/Move()
|
||||
..()
|
||||
if(!stat)
|
||||
if(locate(/obj/effect/plant) in loc)
|
||||
var/obj/effect/plant/SV = locate(/obj/effect/plant) in loc
|
||||
qdel(SV)
|
||||
if(prob(10))
|
||||
say("Nom")
|
||||
var/obj/effect/spacevine/SV = locate(/obj/effect/spacevine) in loc
|
||||
if(SV)
|
||||
SV.eat(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(stat == CONSCIOUS && istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#define BEE_TRAY_RECENT_VISIT 200 //How long in deciseconds until a tray can be visited by a bee again
|
||||
#define BEE_DEFAULT_COLOUR "#e5e500" //the colour we make the stripes of the bee if our reagent has no colour (or we have no reagent)
|
||||
|
||||
#define BEE_POLLINATE_YIELD_CHANCE 10
|
||||
#define BEE_POLLINATE_YIELD_CHANCE 33
|
||||
#define BEE_POLLINATE_PEST_CHANCE 33
|
||||
#define BEE_POLLINATE_POTENTCY_CHANCE 50
|
||||
#define BEE_POLLINATE_POTENCY_CHANCE 50
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees
|
||||
name = "bee"
|
||||
@@ -15,6 +15,7 @@
|
||||
icon_state = ""
|
||||
icon_living = ""
|
||||
icon = 'icons/mob/bees.dmi'
|
||||
gender = FEMALE
|
||||
speak_emote = list("buzzes")
|
||||
emote_hear = list("buzzes")
|
||||
turns_per_move = 0
|
||||
@@ -142,7 +143,7 @@
|
||||
if(beehome.bees)
|
||||
beehome.bees.Remove(src)
|
||||
beehome = null
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/death(gibbed)
|
||||
if(beehome)
|
||||
@@ -158,10 +159,10 @@
|
||||
to_chat(user, "<span class='warning'>This bee is homeless!</span>")
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/Found(atom/A)
|
||||
if(istype(A, /obj/machinery/portable_atmospherics/hydroponics))
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/Hydro = A
|
||||
if(Hydro.seed && !Hydro.dead && !Hydro.recent_bee_visit && !Hydro.closed_system)
|
||||
wanted_objects |= /obj/machinery/portable_atmospherics/hydroponics //so we only hunt them while they're alive/seeded/not visisted and uncovered
|
||||
if(istype(A, /obj/machinery/hydroponics))
|
||||
var/obj/machinery/hydroponics/Hydro = A
|
||||
if(Hydro.myseed && !Hydro.dead && !Hydro.recent_bee_visit)
|
||||
wanted_objects |= /obj/machinery/hydroponics //so we only hunt them while they're alive/seeded/not visisted
|
||||
return 1
|
||||
..()
|
||||
|
||||
@@ -175,24 +176,24 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/AttackingTarget()
|
||||
//Pollinate
|
||||
if(istype(target, /obj/machinery/portable_atmospherics/hydroponics))
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/Hydro = target
|
||||
if(istype(target, /obj/machinery/hydroponics))
|
||||
var/obj/machinery/hydroponics/Hydro = target
|
||||
pollinate(Hydro)
|
||||
else if(target == beehome)
|
||||
var/obj/structure/beebox/BB = target
|
||||
forceMove(BB)
|
||||
target = null
|
||||
wanted_objects.Remove(/obj/structure/beebox) //so we don't attack beeboxes when not going home
|
||||
wanted_objects -= /obj/structure/beebox //so we don't attack beeboxes when not going home
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/proc/pollinate(obj/machinery/portable_atmospherics/hydroponics/Hydro)
|
||||
if(!istype(Hydro) || !Hydro.seed || Hydro.dead || Hydro.recent_bee_visit || Hydro.closed_system)
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/proc/pollinate(obj/machinery/hydroponics/Hydro)
|
||||
if(!istype(Hydro) || !Hydro.myseed || Hydro.dead || Hydro.recent_bee_visit)
|
||||
target = null
|
||||
return
|
||||
|
||||
target = null //so we pick a new hydro tray next FindTarget(), instead of loving the same plant for eternity
|
||||
wanted_objects.Remove(/obj/machinery/portable_atmospherics/hydroponics) //so we only hunt them while they're alive/seeded/not visisted
|
||||
wanted_objects -= /obj/machinery/hydroponics //so we only hunt them while they're alive/seeded/not visisted
|
||||
Hydro.recent_bee_visit = TRUE
|
||||
spawn(BEE_TRAY_RECENT_VISIT)
|
||||
if(Hydro)
|
||||
@@ -200,23 +201,14 @@
|
||||
|
||||
var/growth = health //Health also means how many bees are in the swarm, roughly.
|
||||
//better healthier plants!
|
||||
Hydro.health += round(growth*0.5)
|
||||
Hydro.adjustHealth(growth*0.5)
|
||||
if(prob(BEE_POLLINATE_PEST_CHANCE))
|
||||
Hydro.pestlevel = max(0, --Hydro.pestlevel)
|
||||
if(prob(BEE_POLLINATE_YIELD_CHANCE)) //Yield mod is HELLA powerful, but quite rare
|
||||
if(!isnull(plant_controller.seeds[Hydro.seed.name]))
|
||||
Hydro.seed = Hydro.seed.diverge()
|
||||
else
|
||||
Hydro.seed.update_name_prefixes()
|
||||
var/seed_yield = Hydro.seed.get_trait(TRAIT_YIELD)
|
||||
Hydro.seed.set_trait(TRAIT_YIELD, seed_yield + 1, 10, 0)
|
||||
if(prob(BEE_POLLINATE_POTENTCY_CHANCE))
|
||||
if(!isnull(plant_controller.seeds[Hydro.seed.name]))
|
||||
Hydro.seed = Hydro.seed.diverge()
|
||||
else
|
||||
Hydro.seed.update_name_prefixes()
|
||||
var/seed_potency = Hydro.seed.get_trait(TRAIT_POTENCY)
|
||||
Hydro.seed.set_trait(TRAIT_POTENCY, seed_potency + 1, 200, 0)
|
||||
Hydro.adjustPests(-10)
|
||||
if(prob(BEE_POLLINATE_YIELD_CHANCE))
|
||||
Hydro.myseed.adjust_yield(1)
|
||||
Hydro.yieldmod = 2
|
||||
if(prob(BEE_POLLINATE_POTENCY_CHANCE))
|
||||
Hydro.myseed.adjust_potency(1)
|
||||
|
||||
if(beehome)
|
||||
beehome.bee_resources = min(beehome.bee_resources + growth, 100)
|
||||
@@ -234,7 +226,7 @@
|
||||
idle = max(0, --idle)
|
||||
if(idle <= BEE_IDLE_GOHOME && prob(BEE_PROB_GOHOME))
|
||||
if(!FindTarget())
|
||||
wanted_objects.Add(/obj/structure/beebox) //so we don't attack beeboxes when not going home
|
||||
wanted_objects += /obj/structure/beebox //so we don't attack beeboxes when not going home
|
||||
target = beehome
|
||||
if(!beehome) //add outselves to a beebox (of the same reagent) if we have no home
|
||||
for(var/obj/structure/beebox/BB in view(vision_range, src))
|
||||
@@ -304,6 +296,7 @@
|
||||
|
||||
/obj/item/queen_bee/Destroy()
|
||||
qdel(queen)
|
||||
queen = null
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
@@ -3,62 +3,84 @@
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "juicer1"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
var/inuse = 0
|
||||
pass_flags = PASSTABLE
|
||||
var/operating = 0
|
||||
var/obj/item/weapon/reagent_containers/beaker = null
|
||||
var/limit = 10
|
||||
|
||||
//IMPORTANT NOTE! A negative number is a multiplier, a positive number is a flat amount to add. 0 means equal to the amount of the original reagent
|
||||
var/list/blend_items = list (
|
||||
|
||||
//Sheets
|
||||
/obj/item/stack/sheet/mineral/plasma = list("plasma_dust" = 20),
|
||||
/obj/item/stack/sheet/mineral/uranium = list("uranium" = 20),
|
||||
/obj/item/stack/sheet/mineral/bananium = list("banana" = 20),
|
||||
/obj/item/stack/sheet/mineral/tranquillite = list("nothing" = 20),
|
||||
/obj/item/stack/sheet/mineral/silver = list("silver" = 20),
|
||||
/obj/item/stack/sheet/mineral/gold = list("gold" = 20),
|
||||
/obj/item/weapon/grown/novaflower = list("capsaicin" = 0),
|
||||
//Sheets
|
||||
/obj/item/stack/sheet/mineral/plasma = list("plasma" = 20),
|
||||
/obj/item/stack/sheet/metal = list("iron" = 20),
|
||||
/obj/item/stack/sheet/plasteel = list("iron" = 20, "plasma" = 20),
|
||||
/obj/item/stack/sheet/wood = list("carbon" = 20),
|
||||
/obj/item/stack/sheet/glass = list("silicon" = 20),
|
||||
/obj/item/stack/sheet/rglass = list("silicon" = 20, "iron" = 20),
|
||||
/obj/item/stack/sheet/mineral/uranium = list("uranium" = 20),
|
||||
/obj/item/stack/sheet/mineral/bananium = list("banana" = 20),
|
||||
/obj/item/stack/sheet/mineral/tranquillite = list("nothing" = 20),
|
||||
/obj/item/stack/sheet/mineral/silver = list("silver" = 20),
|
||||
/obj/item/stack/sheet/mineral/gold = list("gold" = 20),
|
||||
/obj/item/weapon/grown/nettle/basic = list("sacid" = 0),
|
||||
/obj/item/weapon/grown/nettle/death = list("facid" = 0, "sacid" = 0),
|
||||
/obj/item/weapon/grown/novaflower = list("capsaicin" = 0, "condensedcapsaicin" = 0),
|
||||
|
||||
//archaeology!
|
||||
///obj/item/weapon/rocksliver = list("ground_rock" = 50),
|
||||
//Blender Stuff
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans = list("soymilk" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list("ketchup" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/oat = list("flour" = -5),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries = list("cherryjelly" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/bluecherries = list("bluecherryjelly" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/egg = list("eggyolk" = -5),
|
||||
|
||||
//Grinder stuff, but only if dry
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0),
|
||||
|
||||
|
||||
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
|
||||
/obj/item/weapon/reagent_containers/food = list(),
|
||||
/obj/item/weapon/reagent_containers/honeycomb = list()
|
||||
)
|
||||
|
||||
var/list/blend_tags = list (
|
||||
"nettle" = list("sacid" = 0),
|
||||
"deathnettle" = list("facid" = 0),
|
||||
"soybeans" = list("soymilk" = 0),
|
||||
"tomato" = list("ketchup" = 0),
|
||||
"wheat" = list("flour" = -5),
|
||||
"rice" = list("rice" = -5),
|
||||
"cherries" = list("cherryjelly" = 0),
|
||||
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
|
||||
/obj/item/slime_extract = list(),
|
||||
/obj/item/weapon/reagent_containers/food = list(),
|
||||
/obj/item/weapon/reagent_containers/honeycomb = list()
|
||||
)
|
||||
|
||||
var/list/juice_items = list (
|
||||
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = list("watermelonjuice" = 0),
|
||||
|
||||
//Juicer Stuff
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/corn = list("corn_starch" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list("tomatojuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = list("carrotjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries = list("berryjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = list("banana" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/potato = list("potato" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lemon = list("lemonjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange = list("orangejuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/citrus/lime = list("limejuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon = list("watermelonjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = list("watermelonjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/poison = list("poisonberryjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin = list("pumpkinjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/blumpkin = list("blumpkinjuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/apple = list("applejuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes = list("grapejuice" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes/green = list("grapejuice" = 0),
|
||||
)
|
||||
|
||||
var/list/juice_tags = list (
|
||||
"tomato" = list("tomatojuice" = 0),
|
||||
"carrot" = list("carrotjuice" = 0),
|
||||
"berries" = list("berryjuice" = 0),
|
||||
"banana" = list("banana" = 0),
|
||||
"potato" = list("potato" = 0),
|
||||
"lemon" = list("lemonjuice" = 0),
|
||||
"orange" = list("orangejuice" = 0),
|
||||
"lime" = list("limejuice" = 0),
|
||||
"poisonberries" = list("poisonberryjuice" = 0),
|
||||
"grapes" = list("grapejuice" = 0),
|
||||
"corn" = list("cornoil" = 0),
|
||||
var/list/dried_items = list(
|
||||
//Grinder stuff, but only if dry,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee/robusta = list("coffeepowder" = 0, "morphine" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee = list("coffeepowder" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea/astra = list("teapowder" = 0, "salglu_solution" = 0),
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/tea = list("teapowder" = 0)
|
||||
)
|
||||
|
||||
var/list/holdingitems = list()
|
||||
@@ -68,348 +90,352 @@
|
||||
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
|
||||
return
|
||||
|
||||
/obj/machinery/reagentgrinder/Destroy()
|
||||
if(beaker)
|
||||
qdel(beaker)
|
||||
beaker = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/reagentgrinder/ex_act(severity)
|
||||
if(beaker)
|
||||
beaker.ex_act(severity)
|
||||
..()
|
||||
|
||||
/obj/machinery/reagentgrinder/update_icon()
|
||||
icon_state = "juicer"+num2text(!isnull(beaker))
|
||||
return
|
||||
if(beaker)
|
||||
icon_state = "juicer1"
|
||||
else
|
||||
icon_state = "juicer0"
|
||||
|
||||
/obj/machinery/reagentgrinder/attackby(obj/item/O, mob/user, params)
|
||||
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks/shaker))
|
||||
|
||||
if(beaker)
|
||||
return 1
|
||||
else
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>[O] is stuck to you!</span>")
|
||||
/obj/machinery/reagentgrinder/attackby(obj/item/I, mob/user, params)
|
||||
if(default_unfasten_wrench(user, I))
|
||||
return
|
||||
beaker = O
|
||||
O.forceMove(src)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return 0
|
||||
|
||||
if(holdingitems && holdingitems.len >= limit)
|
||||
to_chat(usr, "<span class='warning'>The machine cannot hold anymore items.</span>")
|
||||
return 1
|
||||
if (istype(I, /obj/item/weapon/reagent_containers) && (I.flags & OPENCONTAINER) )
|
||||
if (!beaker)
|
||||
if(!user.drop_item())
|
||||
return 1
|
||||
beaker = I
|
||||
beaker.loc = src
|
||||
update_icon()
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "<span class='warning'>There's already a container inside.</span>"
|
||||
return 1 //no afterattack
|
||||
|
||||
//Fill machine with a plantbag!
|
||||
if(istype(O, /obj/item/weapon/storage/bag/plants))
|
||||
var/obj/item/weapon/storage/bag/plants/PB = O
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in PB.contents)
|
||||
PB.remove_from_storage(G, src)
|
||||
holdingitems += G
|
||||
if(holdingitems && holdingitems.len >= limit) //Sanity checking so the blender doesn't overfill
|
||||
to_chat(user, "<span class='notice>You fill the All-In-One grinder to the brim.</span>")
|
||||
break
|
||||
if(is_type_in_list(I, dried_items))
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I
|
||||
if(!G.dry)
|
||||
user << "<span class='warning'>You must dry that first!</span>"
|
||||
return 1
|
||||
|
||||
if(!PB.contents.len)
|
||||
to_chat(user, "<span class='notice'>You empty [PB] into the All-In-One grinder.</span>")
|
||||
if(holdingitems && holdingitems.len >= limit)
|
||||
usr << "The machine cannot hold anymore items."
|
||||
return 1
|
||||
|
||||
updateUsrDialog()
|
||||
return 0
|
||||
//Fill machine with a bag!
|
||||
if(istype(I, /obj/item/weapon/storage/bag))
|
||||
var/obj/item/weapon/storage/bag/B = I
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in B.contents)
|
||||
B.remove_from_storage(G, src)
|
||||
holdingitems += G
|
||||
if(holdingitems && holdingitems.len >= limit) //Sanity checking so the blender doesn't overfill
|
||||
user << "<span class='notice'>You fill the All-In-One grinder to the brim.</span>"
|
||||
break
|
||||
|
||||
if(!I.contents.len)
|
||||
user << "<span class='notice'>You empty the plant bag into the All-In-One grinder.</span>"
|
||||
|
||||
if(!is_type_in_list(O, blend_items) && !is_type_in_list(O, juice_items))
|
||||
to_chat(user, "<span class='warning'>Cannot refine into a reagent.</span>")
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
return 1
|
||||
|
||||
user.unEquip(O)
|
||||
O.forceMove(src)
|
||||
holdingitems += O
|
||||
updateUsrDialog()
|
||||
return 0
|
||||
if (!is_type_in_list(I, blend_items) && !is_type_in_list(I, juice_items))
|
||||
if(user.a_intent == I_HARM)
|
||||
return ..()
|
||||
else
|
||||
user << "<span class='warning'>Cannot refine into a reagent!</span>"
|
||||
return 1
|
||||
|
||||
if(user.drop_item())
|
||||
I.loc = src
|
||||
holdingitems += I
|
||||
src.updateUsrDialog()
|
||||
return 0
|
||||
|
||||
/obj/machinery/reagentgrinder/attack_ai(mob/user)
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/obj/machinery/reagentgrinder/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/reagentgrinder/interact(mob/user) // The microwave Menu
|
||||
var/is_chamber_empty = 0
|
||||
var/is_beaker_ready = 0
|
||||
var/processing_chamber = ""
|
||||
var/beaker_contents = ""
|
||||
var/dat = ""
|
||||
var/is_chamber_empty = 0
|
||||
var/is_beaker_ready = 0
|
||||
var/processing_chamber = ""
|
||||
var/beaker_contents = ""
|
||||
var/dat = ""
|
||||
|
||||
if(!inuse)
|
||||
for(var/obj/item/O in holdingitems)
|
||||
processing_chamber += "\A [O.name]<BR>"
|
||||
if(!operating)
|
||||
for (var/obj/item/O in holdingitems)
|
||||
processing_chamber += "\A [O.name]<BR>"
|
||||
|
||||
if(!processing_chamber)
|
||||
is_chamber_empty = 1
|
||||
processing_chamber = "Nothing."
|
||||
if(!beaker)
|
||||
beaker_contents = "<B>No beaker attached.</B><br>"
|
||||
if (!processing_chamber)
|
||||
is_chamber_empty = 1
|
||||
processing_chamber = "Nothing."
|
||||
if (!beaker)
|
||||
beaker_contents = "<B>No beaker attached.</B><br>"
|
||||
else
|
||||
is_beaker_ready = 1
|
||||
beaker_contents = "<B>The beaker contains:</B><br>"
|
||||
var/anything = 0
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
anything = 1
|
||||
beaker_contents += "[R.volume] - [R.name]<br>"
|
||||
if(!anything)
|
||||
beaker_contents += "Nothing<br>"
|
||||
|
||||
|
||||
dat = {"
|
||||
<b>Processing chamber contains:</b><br>
|
||||
[processing_chamber]<br>
|
||||
[beaker_contents]<hr>
|
||||
"}
|
||||
if (is_beaker_ready && !is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
|
||||
dat += "<A href='?src=\ref[src];action=grind'>Grind the reagents</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];action=juice'>Juice the reagents</a><BR><BR>"
|
||||
if(holdingitems && holdingitems.len > 0)
|
||||
dat += "<A href='?src=\ref[src];action=eject'>Eject the reagents</a><BR>"
|
||||
if (beaker)
|
||||
dat += "<A href='?src=\ref[src];action=detach'>Detach the beaker</a><BR>"
|
||||
else
|
||||
is_beaker_ready = 1
|
||||
beaker_contents = "<B>The beaker contains:</B><br>"
|
||||
var/anything = 0
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
anything = 1
|
||||
beaker_contents += "[R.volume] - [R.name]<br>"
|
||||
if(!anything)
|
||||
beaker_contents += "Nothing<br>"
|
||||
dat += "Please wait..."
|
||||
|
||||
|
||||
dat = {"
|
||||
<b>Processing chamber contains:</b><br>
|
||||
[processing_chamber]<br>
|
||||
[beaker_contents]<hr>
|
||||
"}
|
||||
if(is_beaker_ready && !is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
|
||||
dat += "<A href='?src=[UID()];action=grind'>Grind the reagents</a><BR>"
|
||||
dat += "<A href='?src=[UID()];action=juice'>Juice the reagents</a><BR><BR>"
|
||||
if(holdingitems && holdingitems.len > 0)
|
||||
dat += "<A href='?src=[UID()];action=eject'>Eject the reagents</a><BR>"
|
||||
if(beaker)
|
||||
dat += "<A href='?src=[UID()];action=detach'>Detach the beaker</a><BR>"
|
||||
else
|
||||
dat += "Please wait..."
|
||||
user << browse("<HEAD><TITLE>All-In-One Grinder</TITLE></HEAD><TT>[dat]</TT>", "window=reagentgrinder")
|
||||
onclose(user, "reagentgrinder")
|
||||
return
|
||||
var/datum/browser/popup = new(user, "reagentgrinder", "All-In-One Grinder")
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open(1)
|
||||
return
|
||||
|
||||
/obj/machinery/reagentgrinder/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
if(operating)
|
||||
updateUsrDialog()
|
||||
return
|
||||
switch(href_list["action"])
|
||||
if("grind")
|
||||
if ("grind")
|
||||
grind()
|
||||
if("juice")
|
||||
juice()
|
||||
if("eject")
|
||||
eject()
|
||||
if("detach")
|
||||
if ("detach")
|
||||
detach()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/detach()
|
||||
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(!beaker)
|
||||
return
|
||||
beaker.forceMove(loc)
|
||||
beaker = null
|
||||
update_icon()
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (!beaker)
|
||||
return
|
||||
beaker.loc = src.loc
|
||||
beaker = null
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/eject()
|
||||
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(holdingitems && holdingitems.len == 0)
|
||||
return
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (holdingitems && holdingitems.len == 0)
|
||||
return
|
||||
|
||||
for(var/obj/item/O in holdingitems)
|
||||
O.forceMove(loc)
|
||||
holdingitems -= O
|
||||
holdingitems = list()
|
||||
for(var/obj/item/O in holdingitems)
|
||||
O.loc = src.loc
|
||||
holdingitems -= O
|
||||
holdingitems = list()
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/is_allowed(obj/item/weapon/reagent_containers/O)
|
||||
for(var/i in blend_items)
|
||||
if(istype(O, i))
|
||||
return 1
|
||||
return 0
|
||||
for (var/i in blend_items)
|
||||
if(istype(O, i))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_allowed_by_id(obj/item/weapon/grown/O)
|
||||
for(var/i in blend_items)
|
||||
if(istype(O, i))
|
||||
return blend_items[i]
|
||||
/obj/machinery/reagentgrinder/proc/get_allowed_by_id(obj/item/O)
|
||||
for (var/i in blend_items)
|
||||
if (istype(O, i))
|
||||
return blend_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_allowed_snack_by_id(obj/item/weapon/reagent_containers/food/snacks/O)
|
||||
for(var/i in blend_items)
|
||||
if(istype(O, i))
|
||||
return blend_items[i]
|
||||
for(var/i in blend_items)
|
||||
if(istype(O, i))
|
||||
return blend_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_allowed_juice_by_id(obj/item/weapon/reagent_containers/food/snacks/O)
|
||||
for(var/i in juice_items)
|
||||
if(istype(O, i))
|
||||
return juice_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_allowed_snack_by_tag(obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
for(var/i in blend_tags)
|
||||
if(O.seed.kitchen_tag == i)
|
||||
return blend_tags[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_allowed_juice_by_tag(obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
for(var/i in juice_tags)
|
||||
if(O.seed.kitchen_tag == i)
|
||||
return juice_tags[i]
|
||||
for(var/i in juice_items)
|
||||
if(istype(O, i))
|
||||
return juice_items[i]
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_grownweapon_amount(obj/item/weapon/grown/O)
|
||||
if(!istype(O))
|
||||
return 5
|
||||
else if(O.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(O.potency)
|
||||
if (!istype(O) || !O.seed)
|
||||
return 5
|
||||
else if (O.seed.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(O.seed.potency)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/get_juice_amount(obj/item/weapon/reagent_containers/food/snacks/grown/O)
|
||||
if(!istype(O))
|
||||
return 5
|
||||
else if(O.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(5*sqrt(O.potency))
|
||||
if (!istype(O) || !O.seed)
|
||||
return 5
|
||||
else if (O.seed.potency == -1)
|
||||
return 5
|
||||
else
|
||||
return round(5*sqrt(O.seed.potency))
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/remove_object(obj/item/O)
|
||||
holdingitems -= O
|
||||
qdel(O)
|
||||
holdingitems -= O
|
||||
qdel(O)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/juice()
|
||||
power_change()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
|
||||
return
|
||||
playsound(loc, 'sound/machines/juicer.ogg', 20, 1)
|
||||
var/offset = prob(50) ? -2 : 2
|
||||
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
|
||||
inuse = 1
|
||||
spawn(50)
|
||||
pixel_x = initial(pixel_x) //return to its spot after shaking
|
||||
inuse = 0
|
||||
interact(usr)
|
||||
//Snacks
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/O in holdingitems)
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
power_change()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
|
||||
return
|
||||
playsound(src.loc, 'sound/machines/juicer.ogg', 20, 1)
|
||||
var/offset = prob(50) ? -2 : 2
|
||||
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 250) //start shaking
|
||||
operating = 1
|
||||
updateUsrDialog()
|
||||
spawn(50)
|
||||
pixel_x = initial(pixel_x) //return to its spot after shaking
|
||||
operating = 0
|
||||
updateUsrDialog()
|
||||
|
||||
var/allowed = null
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
allowed = get_allowed_juice_by_tag(O)
|
||||
else
|
||||
allowed = get_allowed_juice_by_id(O)
|
||||
if(isnull(allowed))
|
||||
break
|
||||
//Snacks
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/O in holdingitems)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
|
||||
for(var/r_id in allowed)
|
||||
var/allowed = get_allowed_juice_by_id(O)
|
||||
if(isnull(allowed))
|
||||
break
|
||||
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = get_juice_amount(O)
|
||||
for (var/r_id in allowed)
|
||||
|
||||
beaker.reagents.add_reagent(r_id, min(amount, space))
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = get_juice_amount(O)
|
||||
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
beaker.reagents.add_reagent(r_id, min(amount, space))
|
||||
|
||||
remove_object(O)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
|
||||
remove_object(O)
|
||||
|
||||
/obj/machinery/reagentgrinder/proc/grind()
|
||||
|
||||
power_change()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
|
||||
return
|
||||
playsound(loc, 'sound/machines/blender.ogg', 50, 1)
|
||||
var/offset = prob(50) ? -2 : 2
|
||||
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
|
||||
inuse = 1
|
||||
spawn(60)
|
||||
pixel_x = initial(pixel_x) //return to its spot after shaking
|
||||
inuse = 0
|
||||
interact(usr)
|
||||
//Snacks and Plants
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/O in holdingitems)
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
power_change()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!beaker || (beaker && beaker.reagents.total_volume >= beaker.reagents.maximum_volume))
|
||||
return
|
||||
playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
|
||||
var/offset = prob(50) ? -2 : 2
|
||||
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 250) //start shaking
|
||||
operating = 1
|
||||
updateUsrDialog()
|
||||
spawn(60)
|
||||
pixel_x = initial(pixel_x) //return to its spot after shaking
|
||||
operating = 0
|
||||
updateUsrDialog()
|
||||
|
||||
var/allowed = null
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
allowed = get_allowed_snack_by_tag(O)
|
||||
else
|
||||
allowed = get_allowed_snack_by_id(O)
|
||||
if(isnull(allowed))
|
||||
break
|
||||
//Snacks and Plants
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/O in holdingitems)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
|
||||
for(var/r_id in allowed)
|
||||
var/allowed = get_allowed_snack_by_id(O)
|
||||
if(isnull(allowed))
|
||||
break
|
||||
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
if(amount <= 0) //Negative amounts are multipliers for the reagent amount (Example: "amount = -5" means "reagent_amount * 5")
|
||||
if(amount == 0)
|
||||
if(O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
if(O.reagents != null && O.reagents.has_reagent("plantmatter"))
|
||||
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("plantmatter"), space))
|
||||
O.reagents.remove_reagent("plantmatter", min(O.reagents.get_reagent_amount("plantmatter"), space))
|
||||
else
|
||||
if(O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
if(O.reagents != null && O.reagents.has_reagent("plantmatter"))
|
||||
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("plantmatter")*abs(amount)), space))
|
||||
O.reagents.remove_reagent("plantmatter", min(O.reagents.get_reagent_amount("plantmatter"), space))
|
||||
for (var/r_id in allowed)
|
||||
|
||||
else
|
||||
O.reagents.trans_id_to(beaker, r_id, min(amount, space))
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
if(amount <= 0)
|
||||
if(amount == 0)
|
||||
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
else
|
||||
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
|
||||
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
|
||||
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
|
||||
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
else
|
||||
O.reagents.trans_id_to(beaker, r_id, min(amount, space))
|
||||
|
||||
if(O.reagents.reagent_list.len == 0)
|
||||
remove_object(O)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
|
||||
//Sheets
|
||||
for(var/obj/item/stack/sheet/O in holdingitems)
|
||||
var/allowed = get_allowed_by_id(O)
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
for(var/i = 1; i <= round(O.amount, 1); i++)
|
||||
for(var/r_id in allowed)
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
beaker.reagents.add_reagent(r_id,min(amount, space))
|
||||
if(space < amount)
|
||||
break
|
||||
if(i == round(O.amount, 1))
|
||||
if(O.reagents.reagent_list.len == 0)
|
||||
remove_object(O)
|
||||
|
||||
//Sheets
|
||||
for (var/obj/item/stack/sheet/O in holdingitems)
|
||||
var/allowed = get_allowed_by_id(O)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
for(var/i = 1; i <= round(O.amount, 1); i++)
|
||||
for (var/r_id in allowed)
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
beaker.reagents.add_reagent(r_id,min(amount, space))
|
||||
if (space < amount)
|
||||
break
|
||||
if (i == round(O.amount, 1))
|
||||
remove_object(O)
|
||||
break
|
||||
//Plants
|
||||
for (var/obj/item/weapon/grown/O in holdingitems)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
var/allowed = get_allowed_by_id(O)
|
||||
for (var/r_id in allowed)
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
if (amount == 0)
|
||||
if (O.reagents != null && O.reagents.has_reagent(r_id))
|
||||
beaker.reagents.add_reagent(r_id,min(O.reagents.get_reagent_amount(r_id), space))
|
||||
else
|
||||
beaker.reagents.add_reagent(r_id,min(amount, space))
|
||||
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
remove_object(O)
|
||||
break
|
||||
//Plants
|
||||
for(var/obj/item/weapon/grown/O in holdingitems)
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
var/allowed = get_allowed_by_id(O)
|
||||
for(var/r_id in allowed)
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
if(amount == 0)
|
||||
if(O.reagents != null && O.reagents.has_reagent(r_id))
|
||||
beaker.reagents.add_reagent(r_id,min(O.reagents.get_reagent_amount(r_id), space))
|
||||
else
|
||||
beaker.reagents.add_reagent(r_id,min(amount, space))
|
||||
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
remove_object(O)
|
||||
//Slime Extractis
|
||||
for (var/obj/item/slime_extract/O in holdingitems)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
if (O.reagents != null)
|
||||
var/amount = O.reagents.total_volume
|
||||
O.reagents.trans_to(beaker, min(amount, space))
|
||||
if (O.Uses > 0)
|
||||
beaker.reagents.add_reagent("slimejelly",min(20, space))
|
||||
remove_object(O)
|
||||
|
||||
//xenoarch
|
||||
/*for(var/obj/item/weapon/rocksliver/O in holdingitems)
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
var/allowed = get_allowed_by_id(O)
|
||||
for(var/r_id in allowed)
|
||||
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
|
||||
var/amount = allowed[r_id]
|
||||
beaker.reagents.add_reagent(r_id,min(amount, space), O.geological_data)
|
||||
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
remove_object(O)*/
|
||||
|
||||
//Everything else - Transfers reagents from it into beaker
|
||||
for(var/obj/item/weapon/reagent_containers/O in holdingitems)
|
||||
if(beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
var/amount = O.reagents.total_volume
|
||||
O.reagents.trans_to(beaker, amount)
|
||||
if(!O.reagents.total_volume)
|
||||
remove_object(O)
|
||||
//Everything else - Transfers reagents from it into beaker
|
||||
for (var/obj/item/weapon/reagent_containers/O in holdingitems)
|
||||
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
|
||||
break
|
||||
var/amount = O.reagents.total_volume
|
||||
O.reagents.trans_to(beaker, amount)
|
||||
if(!O.reagents.total_volume)
|
||||
remove_object(O)
|
||||
@@ -925,8 +925,8 @@
|
||||
alien_weeds.healthcheck()
|
||||
else if(istype(O, /obj/effect/glowshroom)) //even a small amount is enough to kill it
|
||||
qdel(O)
|
||||
else if(istype(O,/obj/structure/spacevine))
|
||||
var/obj/structure/spacevine/SV = O
|
||||
else if(istype(O,/obj/effect/spacevine))
|
||||
var/obj/effect/spacevine/SV = O
|
||||
SV.on_chem_effect(src)
|
||||
|
||||
/datum/reagent/atrazine/reaction_mob(mob/living/M, method=TOUCH, volume)
|
||||
|
||||
@@ -195,24 +195,6 @@
|
||||
shuttle_master.points += shuttle_master.points_per_design
|
||||
shuttle_master.researchDesigns += design.id
|
||||
msg += "<span class='good'>+[shuttle_master.points_per_design]</span>: Reliable [design.name] design.<br>"
|
||||
|
||||
// Sell exotic plants
|
||||
if(istype(thing, /obj/item/seeds))
|
||||
var/obj/item/seeds/S = thing
|
||||
if(S.seed.get_trait(TRAIT_RARITY) == 0) // Mundane species
|
||||
msg += "<span class='bad'>+0</span>: We don't need samples of mundane species \"[capitalize(S.seed.seed_name)]\".<br>"
|
||||
else if(shuttle_master.discoveredPlants[S.type]) // This species has already been sent to CentComm
|
||||
var/potDiff = S.seed.get_trait(TRAIT_POTENCY) - shuttle_master.discoveredPlants[S.type] // Compare it to the previous best
|
||||
if(potDiff > 0) // This sample is better
|
||||
shuttle_master.discoveredPlants[S.type] = S.seed.get_trait(TRAIT_POTENCY)
|
||||
msg += "<span class='good'>+[potDiff]</span>: New sample of \"[capitalize(S.seed.seed_name)]\" is superior. Good work.<br>"
|
||||
shuttle_master.points += potDiff
|
||||
else // This sample is worthless
|
||||
msg += "<span class='bad'>+0</span>: New sample of \"[capitalize(S.seed.seed_name)]\" is not more potent than existing sample ([shuttle_master.discoveredPlants[S.type]] potency).<br>"
|
||||
else // This is a new discovery!
|
||||
shuttle_master.discoveredPlants[S.type] = S.seed.get_trait(TRAIT_POTENCY)
|
||||
msg += "<span class='good'>+[S.seed.get_trait(TRAIT_RARITY)]</span>: New species discovered: \"[capitalize(S.seed.seed_name)]\". Excellent work.<br>"
|
||||
shuttle_master.points += S.seed.get_trait(TRAIT_RARITY) // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later
|
||||
qdel(MA)
|
||||
shuttle_master.sold_atoms += "."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user