Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2017-05-08

# Conflicts:
#	code/modules/mob/dead/observer/observer.dm
#	code/modules/mob/living/carbon/human/life.dm
#	code/modules/mob/mob_defines.dm
#	html/changelogs/.all_changelog.yml
#	vorestation.dme
This commit is contained in:
Leshana
2017-05-08 21:07:45 -04:00
211 changed files with 1840 additions and 1237 deletions
+15 -3
View File
@@ -13,11 +13,11 @@
if(!holder) return
if(!plant_controller || !plant_controller.gene_tag_masks)
usr << "Gene masks not set."
to_chat(usr, "Gene masks not set.")
return
for(var/mask in plant_controller.gene_tag_masks)
usr << "[mask]: [plant_controller.gene_tag_masks[mask]]"
to_chat(usr, "[mask]: [plant_controller.gene_tag_masks[mask]]")
var/global/datum/controller/plants/plant_controller // Set in New().
@@ -33,6 +33,8 @@ var/global/datum/controller/plants/plant_controller // Set in New().
var/list/plant_sprites = list() // List of all harvested product sprites.
var/list/plant_product_sprites = list() // List of all growth sprites plus number of growth stages.
var/processing = 0 // Off/on.
var/list/gene_masked_list = list() // Stored gene masked list, rather than recreating it when needed.
var/list/plant_gene_datums = list() // Stored datum versions of the gene masked list.
/datum/controller/plants/New()
if(plant_controller && plant_controller != src)
@@ -83,6 +85,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
S.update_seed()
//Might as well mask the gene types while we're at it.
var/list/gene_datums = decls_repository.decls_of_subtype(/decl/plantgene)
var/list/used_masks = list()
var/list/plant_traits = ALL_GENES
while(plant_traits && plant_traits.len)
@@ -92,9 +95,18 @@ var/global/datum/controller/plants/plant_controller // Set in New().
while(gene_mask in used_masks)
gene_mask = "[uppertext(num2hex(rand(0,255)))]"
var/decl/plantgene/G
for(var/D in gene_datums)
var/decl/plantgene/P = gene_datums[D]
if(gene_tag == P.gene_tag)
G = P
gene_datums -= D
used_masks += gene_mask
plant_traits -= gene_tag
gene_tag_masks[gene_tag] = gene_mask
plant_gene_datums[gene_mask] = G
gene_masked_list.Add(list(list("tag" = gene_tag, "mask" = gene_mask)))
// Proc for creating a random seed type.
/datum/controller/plants/proc/create_random_seed(var/survive_on_station)
@@ -147,4 +159,4 @@ var/global/datum/controller/plants/plant_controller // Set in New().
plant_queue |= plant
/datum/controller/plants/proc/remove_plant(var/obj/effect/plant/plant)
plant_queue -= plant
plant_queue -= plant
+135
View File
@@ -0,0 +1,135 @@
/datum/seed/proc/diverge_mutate_gene(var/decl/plantgene/G, var/turf/T)
if(!istype(G))
log_debug("Attempted to mutate [src] with a non-plantgene var.")
return src
var/datum/seed/S = diverge() //Let's not modify all of the seeds.
T.visible_message("<span class='notice'>\The [S.display_name] quivers!</span>") //Mimicks the normal mutation.
G.mutate(S, T)
return S
/decl/plantgene
var/gene_tag
/decl/plantgene/biochem
gene_tag = GENE_BIOCHEMISTRY
/decl/plantgene/hardiness
gene_tag = GENE_HARDINESS
/decl/plantgene/environment
gene_tag = GENE_ENVIRONMENT
/decl/plantgene/metabolism
gene_tag = GENE_METABOLISM
/decl/plantgene/structure
gene_tag = GENE_STRUCTURE
/decl/plantgene/diet
gene_tag = GENE_DIET
/decl/plantgene/pigment
gene_tag = GENE_PIGMENT
/decl/plantgene/output
gene_tag = GENE_OUTPUT
/decl/plantgene/atmosphere
gene_tag = GENE_ATMOSPHERE
/decl/plantgene/vigour
gene_tag = GENE_VIGOUR
/decl/plantgene/fruit
gene_tag = GENE_FRUIT
/decl/plantgene/special
gene_tag = GENE_SPECIAL
/decl/plantgene/proc/mutate(var/datum/seed/S)
return
/decl/plantgene/biochem/mutate(var/datum/seed/S)
S.set_trait(TRAIT_POTENCY, S.get_trait(TRAIT_POTENCY)+rand(-20,20),200, 0)
/decl/plantgene/hardiness/mutate(var/datum/seed/S)
if(prob(60))
S.set_trait(TRAIT_TOXINS_TOLERANCE, S.get_trait(TRAIT_TOXINS_TOLERANCE)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_PEST_TOLERANCE, S.get_trait(TRAIT_PEST_TOLERANCE)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_WEED_TOLERANCE, S.get_trait(TRAIT_WEED_TOLERANCE)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_ENDURANCE, S.get_trait(TRAIT_ENDURANCE)+rand(-5,5),100,0)
/decl/plantgene/environment/mutate(var/datum/seed/S)
if(prob(60))
S.set_trait(TRAIT_IDEAL_HEAT, S.get_trait(TRAIT_IDEAL_HEAT)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_IDEAL_LIGHT, S.get_trait(TRAIT_IDEAL_LIGHT)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_LIGHT_TOLERANCE, S.get_trait(TRAIT_LIGHT_TOLERANCE)+rand(-5,5),100,0)
/decl/plantgene/metabolism/mutate(var/datum/seed/S)
if(prob(65))
S.set_trait(TRAIT_REQUIRES_NUTRIENTS, S.get_trait(TRAIT_REQUIRES_NUTRIENTS)+rand(-2,2),10,0)
if(prob(65))
S.set_trait(TRAIT_REQUIRES_WATER, S.get_trait(TRAIT_REQUIRES_WATER)+rand(-2,2),10,0)
if(prob(40))
S.set_trait(TRAIT_ALTER_TEMP, S.get_trait(TRAIT_ALTER_TEMP)+rand(-5,5),100,0)
/decl/plantgene/diet/mutate(var/datum/seed/S)
if(prob(60))
S.set_trait(TRAIT_CARNIVOROUS, S.get_trait(TRAIT_CARNIVOROUS)+rand(-1,1),2,0)
if(prob(60))
S.set_trait(TRAIT_PARASITE, !S.get_trait(TRAIT_PARASITE))
if(prob(65))
S.set_trait(TRAIT_NUTRIENT_CONSUMPTION, S.get_trait(TRAIT_NUTRIENT_CONSUMPTION)+rand(-0.1,0.1),5,0)
if(prob(65))
S.set_trait(TRAIT_WATER_CONSUMPTION, S.get_trait(TRAIT_WATER_CONSUMPTION)+rand(-1,1),50,0)
/decl/plantgene/output/mutate(var/datum/seed/S, var/turf/T)
if(prob(50))
S.set_trait(TRAIT_BIOLUM, !S.get_trait(TRAIT_BIOLUM))
if(S.get_trait(TRAIT_BIOLUM))
T.visible_message("<span class='notice'>\The [S.display_name] begins to glow!</span>")
if(prob(50))
S.set_trait(TRAIT_BIOLUM_COLOUR,get_random_colour(0,75,190))
T.visible_message("<span class='notice'>\The [S.display_name]'s glow </span><font color='[S.get_trait(TRAIT_BIOLUM_COLOUR)]'>changes colour</font>!")
else
T.visible_message("<span class='notice'>\The [S.display_name]'s glow dims...</span>")
if(prob(60))
S.set_trait(TRAIT_PRODUCES_POWER, !S.get_trait(TRAIT_PRODUCES_POWER))
/decl/plantgene/atmosphere/mutate(var/datum/seed/S)
if(prob(60))
S.set_trait(TRAIT_TOXINS_TOLERANCE, S.get_trait(TRAIT_TOXINS_TOLERANCE)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_PEST_TOLERANCE, S.get_trait(TRAIT_PEST_TOLERANCE)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_WEED_TOLERANCE, S.get_trait(TRAIT_WEED_TOLERANCE)+rand(-2,2),10,0)
if(prob(60))
S.set_trait(TRAIT_ENDURANCE, S.get_trait(TRAIT_ENDURANCE)+rand(-5,5),100,0)
/decl/plantgene/vigour/mutate(var/datum/seed/S, var/turf/T)
if(prob(65))
S.set_trait(TRAIT_PRODUCTION, S.get_trait(TRAIT_PRODUCTION)+rand(-1,1),10,0)
if(prob(65))
S.set_trait(TRAIT_MATURATION, S.get_trait(TRAIT_MATURATION)+rand(-1,1),30,0)
if(prob(55))
S.set_trait(TRAIT_SPREAD, S.get_trait(TRAIT_SPREAD)+rand(-1,1),2,0)
T.visible_message("<span class='notice'>\The [S.display_name] spasms visibly, shifting in the tray.</span>")
/decl/plantgene/fruit/mutate(var/datum/seed/S)
if(prob(65))
S.set_trait(TRAIT_STINGS, !S.get_trait(TRAIT_STINGS))
if(prob(65))
S.set_trait(TRAIT_EXPLOSIVE, !S.get_trait(TRAIT_EXPLOSIVE))
if(prob(65))
S.set_trait(TRAIT_JUICY, !S.get_trait(TRAIT_JUICY))
/decl/plantgene/special/mutate(var/datum/seed/S)
if(prob(65))
S.set_trait(TRAIT_TELEPORTING, !S.get_trait(TRAIT_TELEPORTING))
+1 -3
View File
@@ -137,9 +137,7 @@
var/list/data = list()
var/list/geneMasks[0]
for(var/gene_tag in plant_controller.gene_tag_masks)
geneMasks.Add(list(list("tag" = gene_tag, "mask" = plant_controller.gene_tag_masks[gene_tag])))
var/list/geneMasks = plant_controller.gene_masked_list
data["geneMasks"] = geneMasks
data["activity"] = active
+8 -3
View File
@@ -181,9 +181,14 @@
return
//Override for somatoray projectiles.
if(istype(Proj ,/obj/item/projectile/energy/floramut) && prob(20))
mutate(1)
return
if(istype(Proj ,/obj/item/projectile/energy/floramut)&& prob(20))
if(istype(Proj, /obj/item/projectile/energy/floramut/gene))
var/obj/item/projectile/energy/floramut/gene/G = Proj
if(seed)
seed = seed.diverge_mutate_gene(G.gene, get_turf(loc)) //get_turf just in case it's not in a turf.
else
mutate(1)
return
else if(istype(Proj ,/obj/item/projectile/energy/florayield) && prob(20))
yield_mod = min(10,yield_mod+rand(1,2))
return