12/21 modernizations from TG live (#103)

* sync (#3)

* shuttle auto call

* Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why

* Subsystem 12/21

Most Recent TG subsystem folder

* globalvars 12/21

Tossed out the flavor_misc and parallax files

* Onclick 12/21

as well as .dme updates

* _defines 12/21

ommited old _MC.dm

* _HELPERS 12/21

Preserved snowflake placement of furry sprites

* _defeines/genetics

reapplied narkism holdover for snowflake races.

* Oops forgot mutant colors

* modules porting 12/21 + Sounds/icons

Admin, Client and most of mob life files ommitted

* enviroment file

* Admin optimizations

ahelp log system kept

* Mob ports 12/21

Flavor text preserved

* datums ported 12/21

* Game ported 12/21

* batch of duplicate fixes/dogborg work

Dogborgs need to be modernized to refractored borg standards.

* moar fixes

* Maps and futher compile fixes
This commit is contained in:
Poojawa
2016-12-22 03:57:55 -06:00
committed by GitHub
parent f5e143a452
commit cf59ac1c3d
2215 changed files with 707445 additions and 87041 deletions
+83 -66
View File
@@ -4,6 +4,8 @@
icon_state = "hydrotray"
density = 1
anchored = 1
pixel_y = 8
unique_rename = 1
var/waterlevel = 100 //The amount of water in the tray (max 100)
var/maxwater = 100 //The maximum amount of water in the tray
var/nutrilevel = 10 //The amount of nutrient in the tray (max 10)
@@ -15,7 +17,7 @@
var/toxic = 0 //Toxicity in the tray?
var/age = 0 //Current age
var/dead = 0 //Is it dead?
var/health = 0 //Its health.
var/plant_health //Its health
var/lastproduce = 0 //Last time it was harvested
var/lastcycle = 0 //Used for timing of cycles.
var/cycledelay = 200 //About 10 seconds / cycle
@@ -23,11 +25,10 @@
var/obj/item/seeds/myseed = null //The currently planted seed
var/rating = 1
var/unwrenchable = 1
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpolinate one plant
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpollinate one plant
var/using_irrigation = FALSE //If the tray is connected to other trays via irrigation hoses
var/self_sustaining = FALSE //If the tray generates nutrients and water on its own
pixel_y=8
/obj/machinery/hydroponics/constructable
name = "hydroponics tray"
@@ -121,11 +122,11 @@
myseed.loc = src
if(self_sustaining)
adjustNutri(2 / rating)
adjustWater(rand(8, 10) / rating)
adjustWeeds(-5 / rating)
adjustPests(-5 / rating)
adjustToxic(-5 / rating)
adjustNutri(1)
adjustWater(rand(3,5))
adjustWeeds(-2)
adjustPests(-2)
adjustToxic(-2)
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
@@ -143,15 +144,15 @@
adjustNutri(-1 / rating)
// Lack of nutrients hurts non-weeds
if(nutrilevel <= 0 && myseed.plant_type != PLANT_WEED)
if(nutrilevel <= 0 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-rand(1,3))
//Photosynthesis/////////////////////////////////////////////////////////
// Lack of light hurts non-mushrooms
if(isturf(loc))
var/turf/currentTurf = loc
var/lightAmt = currentTurf.get_lumcount()
if(myseed.plant_type == PLANT_MUSHROOM)
var/lightAmt = currentTurf.lighting_lumcount
if(myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
if(lightAmt < 2)
adjustHealth(-1 / rating)
else // Non-mushroom
@@ -163,7 +164,7 @@
adjustWater(-rand(1,6) / rating)
// If the plant is dry, it loses health pretty fast, unless mushroom
if(waterlevel <= 10 && myseed.plant_type != PLANT_MUSHROOM)
if(waterlevel <= 10 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
adjustHealth(-rand(0,1) / rating)
if(waterlevel <= 0)
adjustHealth(-rand(0,2) / rating)
@@ -192,13 +193,13 @@
adjustHealth(-1 / rating)
// If it's a weed, it doesn't stunt the growth
if(weedlevel >= 5 && myseed.plant_type != PLANT_WEED)
if(weedlevel >= 5 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy))
adjustHealth(-1 / rating)
//Health & Age///////////////////////////////////////////////////////////
// Plant dies if health <= 0
if(health <= 0)
// Plant dies if plant_health <= 0
if(plant_health <= 0)
plantdies()
adjustWeeds(1 / rating) // Weeds flourish
@@ -222,7 +223,7 @@
// Weeeeeeeeeeeeeeedddssss
if(weedlevel >= 10 && prob(50)) // At this point the plant is kind of fucked. Weeds can overtake the plant spot.
if(myseed)
if(myseed.plant_type == PLANT_NORMAL) // If a normal plant
if(!myseed.get_gene(/datum/plant_gene/trait/plant_type/weed_hardy) && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism)) // If a normal plant
weedinvasion()
else
weedinvasion() // Weed invasion into empty tray
@@ -256,10 +257,10 @@
if(self_sustaining)
if(istype(src, /obj/machinery/hydroponics/soil))
color = rgb(255, 175, 0)
add_atom_colour(rgb(255, 175, 0), FIXED_COLOUR_PRIORITY)
else
overlays += image('icons/obj/hydroponics/equipment.dmi', icon_state = "gaia_blessing")
set_light(3)
SetLuminosity(3)
update_icon_hoses()
@@ -270,9 +271,9 @@
if(!self_sustaining)
if(myseed && myseed.get_gene(/datum/plant_gene/trait/glow))
var/datum/plant_gene/trait/glow/G = myseed.get_gene(/datum/plant_gene/trait/glow)
set_light(G.get_lum(myseed))
SetLuminosity(G.get_lum(myseed))
else
set_light(0)
SetLuminosity(0)
return
@@ -305,7 +306,7 @@
add_overlay(image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowwater3"))
if(nutrilevel <= 2)
add_overlay(image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lownutri3"))
if(health <= (myseed.endurance / 2))
if(plant_health <= (myseed.endurance / 2))
add_overlay(image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_lowhealth3"))
if(weedlevel >= 5 || pestlevel >= 5 || toxic >= 40)
add_overlay(image('icons/obj/hydroponics/equipment.dmi', icon_state = "over_alert3"))
@@ -321,7 +322,7 @@
user << "<span class='warning'>It's dead!</span>"
else if (harvest)
user << "<span class='info'>It's ready to harvest.</span>"
else if (health <= (myseed.endurance / 2))
else if (plant_health <= (myseed.endurance / 2))
user << "<span class='warning'>It looks unhealthy.</span>"
else
user << "<span class='info'>[src] is empty.</span>"
@@ -366,7 +367,7 @@
else
myseed = new /obj/item/seeds/weeds(src)
age = 0
health = myseed.endurance
plant_health = myseed.endurance
lastcycle = world.time
harvest = 0
weedlevel = 0 // Reset
@@ -375,13 +376,13 @@
visible_message("<span class='warning'>The [oldPlantName] is overtaken by some [myseed.plantname]!</span>")
/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25) // Mutates the current seed
/obj/machinery/hydroponics/proc/mutate(lifemut = 2, endmut = 5, productmut = 1, yieldmut = 2, potmut = 25, wrmut = 2, wcmut = 5, traitmut = 0) // Mutates the current seed
if(!myseed)
return
myseed.mutate(lifemut, endmut, productmut, yieldmut, potmut)
myseed.mutate(lifemut, endmut, productmut, yieldmut, potmut, wrmut, wcmut, traitmut)
/obj/machinery/hydroponics/proc/hardmutate()
mutate(4, 10, 2, 4, 50)
mutate(4, 10, 2, 4, 50, 4, 10, 3)
/obj/machinery/hydroponics/proc/mutatespecie() // Mutagent produced a new plant!
@@ -399,7 +400,7 @@
hardmutate()
age = 0
health = myseed.endurance
plant_health = myseed.endurance
lastcycle = world.time
harvest = 0
weedlevel = 0 // Reset
@@ -419,7 +420,7 @@
dead = 0
hardmutate()
age = 0
health = myseed.endurance
plant_health = myseed.endurance
lastcycle = world.time
harvest = 0
weedlevel = 0 // Reset
@@ -432,7 +433,7 @@
/obj/machinery/hydroponics/proc/plantdies() // OH NOES!!!!! I put this all in one function to make things easier
health = 0
plant_health = 0
harvest = 0
pestlevel = 0 // Pests die
if(!dead)
@@ -440,16 +441,17 @@
dead = 1
/obj/machinery/hydroponics/proc/mutatepest()
if(pestlevel > 5)
visible_message("<span class='warning'>The pests seem to behave oddly...</span>")
for(var/i=0, i<3, i++)
var/obj/effect/spider/spiderling/S = new(src.loc)
S.grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/hunter
else
usr << "<span class='warning'>The pests seem to behave oddly, but quickly settle down...</span>"
/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S)
/obj/machinery/hydroponics/proc/mutatepest(mob/user)
if(pestlevel > 5)
message_admins("[ADMIN_LOOKUPFLW(user)] caused spiderling pests to spawn in a hydro tray")
log_game("[key_name(user)] caused spiderling pests to spawn in a hydro tray")
visible_message("<span class='warning'>The pests seem to behave oddly...</span>")
spawn_atom_to_turf(/obj/structure/spider/spiderling/hunter, src, 3, FALSE)
else
user << "<span class='warning'>The pests seem to behave oddly, but quickly settle down...</span>"
/obj/machinery/hydroponics/proc/applyChemicals(datum/reagents/S, mob/user)
if(myseed)
myseed.on_chem_reaction(S) //In case seeds have some special interactions with special chems, currently only used by vines
@@ -457,7 +459,8 @@
if(S.has_reagent("mutagen", 5) || S.has_reagent("radium", 10) || S.has_reagent("uranium", 10))
switch(rand(100))
if(91 to 100)
plantdies()
adjustHealth(-10)
user << "<span class='warning'>The plant shrivels and burns.</span>"
if(81 to 90)
mutatespecie()
if(66 to 80)
@@ -465,13 +468,13 @@
if(41 to 65)
mutate()
if(21 to 41)
usr << "<span class='warning'>The plants don't seem to react...</span>"
user << "<span class='notice'>The plants don't seem to react...</span>"
if(11 to 20)
mutateweed()
if(1 to 10)
mutatepest()
mutatepest(user)
else
usr << "<span class='warning'>Nothing happens...</span>"
user << "<span class='notice'>Nothing happens...</span>"
// 2 or 1 units is enough to change the yield and other stats.// Can change the yield and other stats, but requires more than mutagen
else if(S.has_reagent("mutagen", 2) || S.has_reagent("radium", 5) || S.has_reagent("uranium", 5))
@@ -489,18 +492,18 @@
// Nutriments
if(S.has_reagent("eznutriment", 1))
yieldmod = 1 * rating
mutmod = 1 * rating
yieldmod = 1
mutmod = 1
adjustNutri(round(S.get_reagent_amount("eznutriment") * 1))
if(S.has_reagent("left4zednutriment", 1))
yieldmod = 0 * rating
mutmod = 2 * rating
yieldmod = 0
mutmod = 2
adjustNutri(round(S.get_reagent_amount("left4zednutriment") * 1))
if(S.has_reagent("robustharvestnutriment", 1))
yieldmod = 2 * rating
mutmod = 0 * rating
yieldmod = 1.3
mutmod = 0
adjustNutri(round(S.get_reagent_amount("robustharvestnutriment") *1 ))
// Antitoxin binds shit pretty well. So the tox goes significantly down
@@ -615,11 +618,11 @@
// Saltpetre is used for gardening IRL, to simplify highly, it speeds up growth and strengthens plants
if(S.has_reagent("saltpetre", 1))
adjustHealth(round(S.get_reagent_amount("saltpetre") * 0.25))
if(myseed)
myseed.adjust_production(-round(S.get_reagent_amount("saltpetre") * 0.02))
myseed.adjust_potency(round(S.get_reagent_amount("saltpetre") * 0.01))
var/salt = S.get_reagent_amount("saltpetre")
adjustHealth(round(salt * 0.25))
if (myseed)
myseed.adjust_production(-round(salt/100)-prob(salt%100))
myseed.adjust_potency(round(salt*0.50))
// Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer
if(S.has_reagent("ash", 1))
adjustHealth(round(S.get_reagent_amount("ash") * 0.25))
@@ -667,9 +670,9 @@
if(33 to 65)
mutateweed()
if(1 to 32)
mutatepest()
mutatepest(user)
else
usr << "<span class='warning'>Nothing happens...</span>"
user << "<span class='warning'>Nothing happens...</span>"
/obj/machinery/hydroponics/attackby(obj/item/O, mob/user, params)
//Called when mob user "attacks" it with object O
@@ -682,6 +685,16 @@
return
if(alert(user, "This will make [src] self-sustaining but consume [O] forever. Are you sure?", "[name]", "I'm Sure", "Abort") == "Abort" || !user)
return
if(!O || qdeleted(O))
return
if(!Adjacent(user))
return
if(self_sustaining)
user << "<span class='warning'>This [name] is already self-sustaining!</span>"
return
if(myseed || weedlevel)
user << "<span class='warning'>[src] needs to be clear of plants and weeds!</span>"
return
user.visible_message("<span class='notice'>[user] gently pulls open the soil for [O] and places it inside.</span>", "<span class='notice'>You tenderly root [O] into [src].</span>")
user.drop_item()
qdel(O)
@@ -746,7 +759,7 @@
if(istype(reagent_source, /obj/item/weapon/reagent_containers/food/snacks) || istype(reagent_source, /obj/item/weapon/reagent_containers/pill))
qdel(reagent_source)
H.applyChemicals(S)
H.applyChemicals(S, user)
S.clear_reagents()
qdel(S)
@@ -764,9 +777,9 @@
dead = 0
myseed = O
age = 1
health = myseed.endurance
plant_health = myseed.endurance
lastcycle = world.time
O.loc = src
O.forceMove(src)
update_icon()
else
user << "<span class='warning'>[src] already has seeds in it!</span>"
@@ -811,8 +824,8 @@
if(!anchored && !isinspace())
user.visible_message("[user] begins to wrench [src] into place.", \
"<span class='notice'>You begin to wrench [src] in place...</span>")
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if (do_after(user, 20/O.toolspeed, target = src))
playsound(loc, O.usesound, 50, 1)
if (do_after(user, 20*O.toolspeed, target = src))
if(anchored)
return
anchored = 1
@@ -821,8 +834,8 @@
else if(anchored)
user.visible_message("[user] begins to unwrench [src].", \
"<span class='notice'>You begin to unwrench [src]...</span>")
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if (do_after(user, 20/O.toolspeed, target = src))
playsound(loc, O.usesound, 50, 1)
if (do_after(user, 20*O.toolspeed, target = src))
if(!anchored)
return
anchored = 0
@@ -831,7 +844,7 @@
else if(istype(O, /obj/item/weapon/wirecutters) && unwrenchable)
using_irrigation = !using_irrigation
playsound(src, 'sound/items/Wirecutter.ogg', 50, 1)
playsound(src, O.usesound, 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))
@@ -848,6 +861,10 @@
user.visible_message("<span class='notice'>[user] digs out the plants in [src]!</span>", "<span class='notice'>You dig out all of [src]'s plants!</span>")
playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1)
if(myseed) //Could be that they're just using it as a de-weeder
age = 0
plant_health = 0
if(harvest)
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
qdel(myseed)
myseed = null
weedlevel = 0 //Has a side effect of cleaning up those nasty weeds
@@ -857,7 +874,7 @@
return ..()
/obj/machinery/hydroponics/attack_hand(mob/user)
if(istype(user, /mob/living/silicon)) //How does AI know what plant is?
if(issilicon(user)) //How does AI know what plant is?
return
if(harvest)
myseed.harvest(user)
@@ -879,7 +896,7 @@
user << "<span class='warning'>You fail to harvest anything useful!</span>"
else
user << "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>"
if(myseed.oneharvest)
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
qdel(myseed)
myseed = null
dead = 0
@@ -897,7 +914,7 @@
/obj/machinery/hydroponics/proc/adjustHealth(adjustamt)
if(myseed && !dead)
health = Clamp(health + adjustamt, 0, myseed.endurance)
plant_health = Clamp(plant_health + adjustamt, 0, myseed.endurance)
/obj/machinery/hydroponics/proc/adjustToxic(adjustamt)
toxic = Clamp(toxic + adjustamt, 0, 100)