mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge remote-tracking branch 'upstream/master' into dev-freeze
Conflicts: code/datums/ai_laws.dm code/modules/hydroponics/spreading/spreading.dm
This commit is contained in:
@@ -49,7 +49,7 @@
|
|||||||
var/n = 1
|
var/n = 1
|
||||||
|
|
||||||
// Figure out power. (power of 2)
|
// Figure out power. (power of 2)
|
||||||
while (n < num)
|
while (n <= num)
|
||||||
power += 4
|
power += 4
|
||||||
n *= 16
|
n *= 16
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
power -= 4
|
power -= 4
|
||||||
|
|
||||||
// Append zeroes to make sure that hex is atleast digits long.
|
// Append zeroes to make sure that hex is atleast digits long.
|
||||||
var/left = length(hex) - digits
|
var/left = digits - length(hex)
|
||||||
while (left-- > 0)
|
while (left-- > 0)
|
||||||
hex = text("0[]", hex)
|
hex = text("0[]", hex)
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
var/list/neighbors = list()
|
var/list/neighbors = list()
|
||||||
var/obj/effect/plant/parent
|
var/obj/effect/plant/parent
|
||||||
var/datum/seed/seed
|
var/datum/seed/seed
|
||||||
|
var/sampled = 0
|
||||||
var/floor = 0
|
var/floor = 0
|
||||||
var/spread_chance = 40
|
var/spread_chance = 40
|
||||||
var/spread_distance = 3
|
var/spread_distance = 3
|
||||||
@@ -237,8 +238,14 @@
|
|||||||
plant_controller.add_plant(src)
|
plant_controller.add_plant(src)
|
||||||
|
|
||||||
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
|
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
|
||||||
|
if(sampled)
|
||||||
|
user << "<span class='warning'>\The [src] has already been sampled recently.</span>"
|
||||||
|
return
|
||||||
|
if(!is_mature())
|
||||||
|
user << "<span class='warning'>\The [src] is not mature enough to yield a sample yet.</span>"
|
||||||
|
return
|
||||||
if(!seed)
|
if(!seed)
|
||||||
user << "<span class='danger'>There is nothing to take a sample from.</span>"
|
user << "<span class='warning'>There is nothing to take a sample from.</span>"
|
||||||
return
|
return
|
||||||
if(sampled)
|
if(sampled)
|
||||||
user << "<span class='danger'>You cannot take another sample from \the [src].</span>"
|
user << "<span class='danger'>You cannot take another sample from \the [src].</span>"
|
||||||
@@ -246,7 +253,8 @@
|
|||||||
if(prob(70))
|
if(prob(70))
|
||||||
sampled = 1
|
sampled = 1
|
||||||
seed.harvest(user,0,1)
|
seed.harvest(user,0,1)
|
||||||
health -= (rand(3,5)*10)
|
health -= (rand(3,5)*5)
|
||||||
|
sampled = 1
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
if(W.force)
|
if(W.force)
|
||||||
|
|||||||
@@ -69,6 +69,12 @@
|
|||||||
last_tick = world.time
|
last_tick = world.time
|
||||||
update_neighbors()
|
update_neighbors()
|
||||||
|
|
||||||
|
if(sampled)
|
||||||
|
//Should be between 2-7 for given the default range of values for TRAIT_PRODUCTION
|
||||||
|
var/chance = max(1, round(30/seed.get_trait(TRAIT_PRODUCTION)))
|
||||||
|
if(prob(chance))
|
||||||
|
sampled = 0
|
||||||
|
|
||||||
if(is_mature() && neighbors.len && prob(spread_chance))
|
if(is_mature() && neighbors.len && prob(spread_chance))
|
||||||
//spread to 1-3 adjacent turfs depending on yield trait.
|
//spread to 1-3 adjacent turfs depending on yield trait.
|
||||||
var/max_spread = between(1, round(seed.get_trait(TRAIT_YIELD)*3/14), 3)
|
var/max_spread = between(1, round(seed.get_trait(TRAIT_YIELD)*3/14), 3)
|
||||||
|
|||||||
@@ -260,7 +260,6 @@
|
|||||||
seed.harvest(user,yield_mod)
|
seed.harvest(user,yield_mod)
|
||||||
else
|
else
|
||||||
seed.harvest(get_turf(src),yield_mod)
|
seed.harvest(get_turf(src),yield_mod)
|
||||||
|
|
||||||
// Reset values.
|
// Reset values.
|
||||||
harvest = 0
|
harvest = 0
|
||||||
lastproduce = age
|
lastproduce = age
|
||||||
@@ -292,6 +291,7 @@
|
|||||||
mutation_mod = 0
|
mutation_mod = 0
|
||||||
|
|
||||||
user << "You remove the dead plant."
|
user << "You remove the dead plant."
|
||||||
|
lastproduce = 0
|
||||||
check_health()
|
check_health()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -461,6 +461,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
user << "You plant the [S.seed.seed_name] [S.seed.seed_noun]."
|
user << "You plant the [S.seed.seed_name] [S.seed.seed_noun]."
|
||||||
|
lastproduce = 0
|
||||||
seed = S.seed //Grab the seed datum.
|
seed = S.seed //Grab the seed datum.
|
||||||
dead = 0
|
dead = 0
|
||||||
age = 1
|
age = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user