From 91947a7abb367a29d8c4359de47170253a7ec61a Mon Sep 17 00:00:00 2001 From: Evildragon Date: Fri, 30 Jun 2023 22:47:03 +0900 Subject: [PATCH 01/10] botany change --- code/__DEFINES/cooldowns.dm | 20 ++++++++++++++++++ code/modules/hydroponics/grown/cannabis.dm | 2 +- code/modules/hydroponics/plant_genes.dm | 24 ++++++++++++++++++++-- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/cooldowns.dm b/code/__DEFINES/cooldowns.dm index 13a9ef762387e..5c0a91ac3f9a4 100644 --- a/code/__DEFINES/cooldowns.dm +++ b/code/__DEFINES/cooldowns.dm @@ -72,3 +72,23 @@ #define COOLDOWN_RESET(cd_source, cd_index) cd_source.cd_index = 0 #define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time)) + + + +// when a timer should track targets individually +// this is useful when an item should individually trigger cooldown time per mob +#define COOLDOWN_LIST_DECLARE(cd_index) var/list/##cd_index = list() + +#define COOLDOWN_STATIC_LIST_DECLARE(cd_index) var/static/list/##cd_index = list() + +/// IMPORTANT: "cd_target" should be individual because it's assoc key +#define COOLDOWN_LIST_START(cd_target, cd_source, cd_index, cd_time) (cd_source.cd_index[cd_target] = world.time + (cd_time)) + +#define COOLDOWN_LIST_FINISHED(cd_target, cd_source, cd_index) (cd_source.cd_index[cd_target] < world.time) + +#define COOLDOWN_LIST_RESET(cd_target, cd_source, cd_index) cd_source.cd_index[cd_target] = 0 + +#define COOLDOWN_LIST_TIMELEFT(cd_target, cd_source, cd_index) (max(0, cd_source.cd_index[cd_target] - world.time)) + +/// use to change existing cooldown +#define COOLDOWN_LIST_ADJUST_TIME(cd_target, cd_source, cd_index, cd_time) (cd_source.cd_index[cd_target] = cd_source.cd_index[cd_target] - (cd_time)) diff --git a/code/modules/hydroponics/grown/cannabis.dm b/code/modules/hydroponics/grown/cannabis.dm index 3aa6700245301..157d813c02021 100644 --- a/code/modules/hydroponics/grown/cannabis.dm +++ b/code/modules/hydroponics/grown/cannabis.dm @@ -124,6 +124,6 @@ name = "omega cannabis leaf" desc = "You feel dizzy looking at it. What the fuck?" icon_state = "ocannabis" - volume = 420 + volume = 270 wine_power = 90 discovery_points = 300 diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 1257fd5306beb..5948059223547 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -251,10 +251,14 @@ // Also affects plant batteries see capatative cell production datum name = "Electrical Activity" rate = 0.2 + COOLDOWN_STATIC_LIST_DECLARE(recent_victims) /datum/plant_gene/trait/cell_charge/on_slip(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/C) + if(!COOLDOWN_LIST_FINISHED(C, src, recent_victims)) // if you were a victim recently, you won't get it again + return var/power = round(G.seed.potency*rate) if(prob(power)) + COOLDOWN_LIST_START(C, src, recent_victims, 2 SECONDS) C.electrocute_act(power, G, 1, 1) var/turf/T = get_turf(C) if(C.ckey != G.fingerprintslast) @@ -262,10 +266,13 @@ log_combat(C, G, "slipped on and got electrocuted by", null, "with the power of 10. Last fingerprint: [G.fingerprintslast]") /datum/plant_gene/trait/cell_charge/on_squash(obj/item/reagent_containers/food/snacks/grown/G, atom/target) + if(!COOLDOWN_LIST_FINISHED(target, src, recent_victims)) // if you were a victim recently, you won't get it again + return if(iscarbon(target)) var/mob/living/carbon/C = target var/power = G.seed.potency*rate if(prob(power)) + COOLDOWN_LIST_START(C, src, recent_victims, 2 SECONDS) C.electrocute_act(round(power), G, 1, 1) if(C.ckey != G.fingerprintslast) log_combat(G.thrownby, C, "hit and electrocuted", G, "at [AREACOORD(G)] with power of [power]") @@ -439,6 +446,7 @@ /datum/plant_gene/trait/stinging name = "Hypodermic Prickles" + COOLDOWN_STATIC_LIST_DECLARE(recent_victims) /datum/plant_gene/trait/stinging/on_slip(obj/item/reagent_containers/food/snacks/grown/G, atom/target) if(!isliving(target) || !G.reagents || !G.reagents.total_volume) @@ -464,11 +472,23 @@ if(!L.reagents && !L.can_inject(null, 0)) return FALSE - var/injecting_amount = max(1, G.seed.potency*0.2) // Minimum of 1, max of 20 - var/fraction = min(injecting_amount/G.reagents.total_volume, 1) + // Mechanism: It will always inject the amount as "injecting_amount" variable no matter the total size is + var/prick_efficiency = 0.1 // default (maximum: 10u) + if(locate(/datum/plant_gene/trait/squash) in G.seed.genes) + prick_efficiency = 0.05 // how can a smooth plant be deadly? (maximum: 5u) + else if(istype(G, /obj/item/seeds/nettle/death)) // as long as it has not Liquid Content + prick_efficiency = 0.2 // bonus to "death" nettle (maximum: 20u) + else if(G.force) + prick_efficiency = 0.15 // bonus to blunt plants (miaxmum: 15u) + if(!COOLDOWN_LIST_FINISHED(L, src, recent_victims)) // until 10s cooldown time from a victim is finished, the effective becomes half + prick_efficiency = round(prick_efficiency/2, 0.01) // i.e) 15u to 7.5u + + var/injecting_amount = round(max(1, G.seed.potency * prick_efficiency), 0.1) // mimumum 1u to maximum 5/10/15/20u + var/fraction = min(injecting_amount/G.reagents.total_volume, 1) // Let's say you have 90u + 10u. Injecting 5u will be "4.5u + 0.5u" by the fraction G.reagents.reaction(L, INJECT, fraction) G.reagents.trans_to(L, injecting_amount) to_chat(L, "You are pricked by [G]!") + COOLDOWN_LIST_START(L, src, recent_victims, 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective return TRUE /datum/plant_gene/trait/smoke From c01ef4dc710645fa477c44f8d71b77aa9eafa27d Mon Sep 17 00:00:00 2001 From: Evildragon Date: Fri, 30 Jun 2023 23:09:13 +0900 Subject: [PATCH 02/10] omega --- code/modules/hydroponics/grown.dm | 2 +- code/modules/hydroponics/grown/cannabis.dm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index d27af0811c81c..1f4651031d458 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -56,7 +56,7 @@ /obj/item/reagent_containers/food/snacks/grown/proc/add_juice() if(reagents) if(bitesize_mod) - bitesize = 1 + round(reagents.total_volume / bitesize_mod) + bitesize = max(1, round(reagents.total_volume / bitesize_mod)) return 1 return 0 diff --git a/code/modules/hydroponics/grown/cannabis.dm b/code/modules/hydroponics/grown/cannabis.dm index 157d813c02021..002d02e1e9a23 100644 --- a/code/modules/hydroponics/grown/cannabis.dm +++ b/code/modules/hydroponics/grown/cannabis.dm @@ -124,6 +124,7 @@ name = "omega cannabis leaf" desc = "You feel dizzy looking at it. What the fuck?" icon_state = "ocannabis" - volume = 270 + volume = 420 + bitesize = 1 wine_power = 90 discovery_points = 300 From cf94267b49235b0a726c24d16e7b47107c4c6b01 Mon Sep 17 00:00:00 2001 From: Evildragon Date: Fri, 30 Jun 2023 23:20:23 +0900 Subject: [PATCH 03/10] final --- code/modules/hydroponics/seeds.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 2dfdae599f442..ea2466b62a3ff 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -410,13 +410,13 @@ renamedByPlayer = TRUE if(penchoice == "Plant Description") - var/input = stripped_input(user,"What do you want to change the description of the plant to?", default=plantdesc, max_length=MAX_NAME_LEN) + var/input = stripped_input(user,"What do you want to change the description of the plant to?", default=plantdesc, max_length=MAX_MESSAGE_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return plantdesc = input if(penchoice == "Seed Description") - var/input = stripped_input(user,"What do you want to change the description of the seeds to?", default=desc, max_length=MAX_NAME_LEN) + var/input = stripped_input(user,"What do you want to change the description of the seeds to?", default=desc, max_length=MAX_MESSAGE_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return desc = input From 87a2b78f0f94473e59cab63277d1dfd2455a49b7 Mon Sep 17 00:00:00 2001 From: Evildragon Date: Sat, 1 Jul 2023 00:10:22 +0900 Subject: [PATCH 04/10] review --- code/__DEFINES/cooldowns.dm | 44 ++++++++++++------------- code/modules/hydroponics/plant_genes.dm | 12 +++---- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/code/__DEFINES/cooldowns.dm b/code/__DEFINES/cooldowns.dm index 5c0a91ac3f9a4..a0e483cf73766 100644 --- a/code/__DEFINES/cooldowns.dm +++ b/code/__DEFINES/cooldowns.dm @@ -32,14 +32,14 @@ //TIMER COOLDOWN MACROS -#define COMSIG_CD_STOP(cd_index) "cooldown_[cd_index]" -#define COMSIG_CD_RESET(cd_index) "cd_reset_[cd_index]" +#define COMSIG_CD_STOP(cd_name) "cooldown_[cd_name]" +#define COMSIG_CD_RESET(cd_name) "cd_reset_[cd_name]" -#define TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time)) +#define TIMER_COOLDOWN_START(cd_source, cd_name, cd_time) LAZYSET(cd_source.cooldowns, cd_name, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_name), cd_time)) -#define TIMER_COOLDOWN_CHECK(cd_source, cd_index) LAZYACCESS(cd_source.cooldowns, cd_index) +#define TIMER_COOLDOWN_CHECK(cd_source, cd_name) LAZYACCESS(cd_source.cooldowns, cd_name) -#define TIMER_COOLDOWN_END(cd_source, cd_index) LAZYREMOVE(cd_source.cooldowns, cd_index) +#define TIMER_COOLDOWN_END(cd_source, cd_name) LAZYREMOVE(cd_source.cooldowns, cd_name) /* * Stoppable timer cooldowns. @@ -48,11 +48,11 @@ * A bit more expensive than the regular timers, but can be reset before they end and the time left can be checked. */ -#define S_TIMER_COOLDOWN_START(cd_source, cd_index, cd_time) LAZYSET(cd_source.cooldowns, cd_index, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_index), cd_time, TIMER_STOPPABLE)) +#define S_TIMER_COOLDOWN_START(cd_source, cd_name, cd_time) LAZYSET(cd_source.cooldowns, cd_name, addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(end_cooldown), cd_source, cd_name), cd_time, TIMER_STOPPABLE)) -#define S_TIMER_COOLDOWN_RESET(cd_source, cd_index) reset_cooldown(cd_source, cd_index) +#define S_TIMER_COOLDOWN_RESET(cd_source, cd_name) reset_cooldown(cd_source, cd_name) -#define S_TIMER_COOLDOWN_TIMELEFT(cd_source, cd_index) (timeleft(TIMER_COOLDOWN_CHECK(cd_source, cd_index))) +#define S_TIMER_COOLDOWN_TIMELEFT(cd_source, cd_name) (timeleft(TIMER_COOLDOWN_CHECK(cd_source, cd_name))) /* @@ -60,35 +60,35 @@ * Better performance over timer cooldowns, lower control. Same functionality. */ -#define COOLDOWN_DECLARE(cd_index) var/##cd_index = 0 +#define COOLDOWN_DECLARE(cd_name) var/##cd_name = 0 -#define COOLDOWN_STATIC_DECLARE(cd_index) var/static/##cd_index = 0 +#define COOLDOWN_STATIC_DECLARE(cd_name) var/static/##cd_name = 0 -#define COOLDOWN_START(cd_source, cd_index, cd_time) (cd_source.cd_index = world.time + (cd_time)) +#define COOLDOWN_START(cd_source, cd_name, cd_time) (cd_source.cd_name = world.time + (cd_time)) //Returns true if the cooldown has run its course, false otherwise -#define COOLDOWN_FINISHED(cd_source, cd_index) (cd_source.cd_index < world.time) +#define COOLDOWN_FINISHED(cd_source, cd_name) (cd_source.cd_name < world.time) -#define COOLDOWN_RESET(cd_source, cd_index) cd_source.cd_index = 0 +#define COOLDOWN_RESET(cd_source, cd_name) cd_source.cd_name = 0 -#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time)) +#define COOLDOWN_TIMELEFT(cd_source, cd_name) (max(0, cd_source.cd_name - world.time)) // when a timer should track targets individually // this is useful when an item should individually trigger cooldown time per mob -#define COOLDOWN_LIST_DECLARE(cd_index) var/list/##cd_index = list() +#define COOLDOWN_LIST_DECLARE(cd_name) var/list/##cd_name = list() -#define COOLDOWN_STATIC_LIST_DECLARE(cd_index) var/static/list/##cd_index = list() +#define COOLDOWN_STATIC_LIST_DECLARE(cd_name) var/static/list/##cd_name = list() -/// IMPORTANT: "cd_target" should be individual because it's assoc key -#define COOLDOWN_LIST_START(cd_target, cd_source, cd_index, cd_time) (cd_source.cd_index[cd_target] = world.time + (cd_time)) +/// IMPORTANT: "cd_target_index" should be individual because it's assoc key +#define COOLDOWN_LIST_START(cd_source, cd_name, cd_target_index, cd_time) (cd_source.cd_name[cd_target_index] = world.time + (cd_time)) -#define COOLDOWN_LIST_FINISHED(cd_target, cd_source, cd_index) (cd_source.cd_index[cd_target] < world.time) +#define COOLDOWN_LIST_FINISHED(cd_source, cd_name, cd_target_index) (cd_source.cd_name[cd_target_index] < world.time) -#define COOLDOWN_LIST_RESET(cd_target, cd_source, cd_index) cd_source.cd_index[cd_target] = 0 +#define COOLDOWN_LIST_RESET(cd_source, cd_name, cd_target_index) cd_source.cd_name[cd_target_index] = 0 -#define COOLDOWN_LIST_TIMELEFT(cd_target, cd_source, cd_index) (max(0, cd_source.cd_index[cd_target] - world.time)) +#define COOLDOWN_LIST_TIMELEFT(cd_source, cd_name, cd_target_index) (max(0, cd_source.cd_name[cd_target_index] - world.time)) /// use to change existing cooldown -#define COOLDOWN_LIST_ADJUST_TIME(cd_target, cd_source, cd_index, cd_time) (cd_source.cd_index[cd_target] = cd_source.cd_index[cd_target] - (cd_time)) +#define COOLDOWN_LIST_ADJUST_TIME(cd_source, cd_name, cd_target_index, cd_time) (cd_source.cd_name[cd_target_index] = cd_source.cd_name[cd_target_index] - (cd_time)) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 5948059223547..29963670a901d 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -254,11 +254,11 @@ COOLDOWN_STATIC_LIST_DECLARE(recent_victims) /datum/plant_gene/trait/cell_charge/on_slip(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/C) - if(!COOLDOWN_LIST_FINISHED(C, src, recent_victims)) // if you were a victim recently, you won't get it again + if(!COOLDOWN_LIST_FINISHED(src, recent_victims, C)) // if you were a victim recently, you won't get it again return var/power = round(G.seed.potency*rate) if(prob(power)) - COOLDOWN_LIST_START(C, src, recent_victims, 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, C, 2 SECONDS) C.electrocute_act(power, G, 1, 1) var/turf/T = get_turf(C) if(C.ckey != G.fingerprintslast) @@ -266,13 +266,13 @@ log_combat(C, G, "slipped on and got electrocuted by", null, "with the power of 10. Last fingerprint: [G.fingerprintslast]") /datum/plant_gene/trait/cell_charge/on_squash(obj/item/reagent_containers/food/snacks/grown/G, atom/target) - if(!COOLDOWN_LIST_FINISHED(target, src, recent_victims)) // if you were a victim recently, you won't get it again + if(!COOLDOWN_LIST_FINISHED(src, recent_victims, target)) // if you were a victim recently, you won't get it again return if(iscarbon(target)) var/mob/living/carbon/C = target var/power = G.seed.potency*rate if(prob(power)) - COOLDOWN_LIST_START(C, src, recent_victims, 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, C, 2 SECONDS) C.electrocute_act(round(power), G, 1, 1) if(C.ckey != G.fingerprintslast) log_combat(G.thrownby, C, "hit and electrocuted", G, "at [AREACOORD(G)] with power of [power]") @@ -480,7 +480,7 @@ prick_efficiency = 0.2 // bonus to "death" nettle (maximum: 20u) else if(G.force) prick_efficiency = 0.15 // bonus to blunt plants (miaxmum: 15u) - if(!COOLDOWN_LIST_FINISHED(L, src, recent_victims)) // until 10s cooldown time from a victim is finished, the effective becomes half + if(!COOLDOWN_LIST_FINISHED(src, recent_victims, L)) // until 10s cooldown time from a victim is finished, the effective becomes half prick_efficiency = round(prick_efficiency/2, 0.01) // i.e) 15u to 7.5u var/injecting_amount = round(max(1, G.seed.potency * prick_efficiency), 0.1) // mimumum 1u to maximum 5/10/15/20u @@ -488,7 +488,7 @@ G.reagents.reaction(L, INJECT, fraction) G.reagents.trans_to(L, injecting_amount) to_chat(L, "You are pricked by [G]!") - COOLDOWN_LIST_START(L, src, recent_victims, 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective + COOLDOWN_LIST_START(src, recent_victims, L, 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective return TRUE /datum/plant_gene/trait/smoke From 6f57bfbf66d5182a2ee25a7e2fad2c799b9b1d1e Mon Sep 17 00:00:00 2001 From: Evildragon Date: Mon, 10 Jul 2023 12:57:31 +0900 Subject: [PATCH 05/10] change --- code/modules/hydroponics/plant_genes.dm | 10 +++++----- code/modules/hydroponics/seeds.dm | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 29963670a901d..f617aa274afd1 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -473,15 +473,15 @@ return FALSE // Mechanism: It will always inject the amount as "injecting_amount" variable no matter the total size is - var/prick_efficiency = 0.1 // default (maximum: 10u) + var/prick_efficiency = 0.02 // default (maximum: 2u) if(locate(/datum/plant_gene/trait/squash) in G.seed.genes) - prick_efficiency = 0.05 // how can a smooth plant be deadly? (maximum: 5u) + prick_efficiency = 0.01 // how can a smooth plant be deadly? (maximum: 1u) else if(istype(G, /obj/item/seeds/nettle/death)) // as long as it has not Liquid Content - prick_efficiency = 0.2 // bonus to "death" nettle (maximum: 20u) + prick_efficiency = 0.06 // bonus to "death" nettle (maximum: 6u) else if(G.force) - prick_efficiency = 0.15 // bonus to blunt plants (miaxmum: 15u) + prick_efficiency = 0.04 // bonus to blunt plants (miaxmum: 4u) if(!COOLDOWN_LIST_FINISHED(src, recent_victims, L)) // until 10s cooldown time from a victim is finished, the effective becomes half - prick_efficiency = round(prick_efficiency/2, 0.01) // i.e) 15u to 7.5u + prick_efficiency = round(prick_efficiency/2, 0.01) // i.e) 4u to 2u var/injecting_amount = round(max(1, G.seed.potency * prick_efficiency), 0.1) // mimumum 1u to maximum 5/10/15/20u var/fraction = min(injecting_amount/G.reagents.total_volume, 1) // Let's say you have 90u + 10u. Injecting 5u will be "4.5u + 0.5u" by the fraction diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index ea2466b62a3ff..824ecfd480ec8 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -248,6 +248,10 @@ return initial(plant.name) else return "[initial(plant.name)] (renamed as [plantname])" + +/obj/item/seeds/proc/log_rename(mob/user, obj/item, type, input) + src.investigate_log("[key_name(user)] has changed [type](of [src]) into '[input]'", INVESTIGATE_BOTANY) + // log_game() might fit, but I wanted botany logs contained in a specific log file. //--------- /// Setters procs /// @@ -405,6 +409,10 @@ var/input = stripped_input(user,"What do you want to name the plant?", default=plantname, max_length=MAX_NAME_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return + if(OOC_FILTER_CHECK(input)) + to_chat(src, "That message contained a word prohibited in OOC chat! Consider reviewing the server rules.\n\"[input]\"") + return + log_rename(user, src, "plant name", input) name = "pack of [input] seeds" plantname = input renamedByPlayer = TRUE @@ -413,12 +421,20 @@ var/input = stripped_input(user,"What do you want to change the description of the plant to?", default=plantdesc, max_length=MAX_MESSAGE_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return + if(OOC_FILTER_CHECK(input)) + to_chat(src, "That message contained a word prohibited in OOC chat! Consider reviewing the server rules.\n\"[input]\"") + return + log_rename(user, src, "plant desc", input) plantdesc = input if(penchoice == "Seed Description") var/input = stripped_input(user,"What do you want to change the description of the seeds to?", default=desc, max_length=MAX_MESSAGE_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return + if(OOC_FILTER_CHECK(input)) + to_chat(src, "That message contained a word prohibited in OOC chat! Consider reviewing the server rules.\n\"[input]\"") + return + log_rename(user, src, "seed desc", input) desc = input ..() // Fallthrough to item/attackby() so that bags can pick seeds up From 0c065c07eb88fb3be14a185cedbdae40dba83f3f Mon Sep 17 00:00:00 2001 From: EvilDragonfiend <87972842+EvilDragonfiend@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:43:29 +0900 Subject: [PATCH 06/10] Update code/modules/hydroponics/seeds.dm Co-authored-by: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com> --- code/modules/hydroponics/seeds.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 824ecfd480ec8..eeb7121708a70 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -250,7 +250,7 @@ return "[initial(plant.name)] (renamed as [plantname])" /obj/item/seeds/proc/log_rename(mob/user, obj/item, type, input) - src.investigate_log("[key_name(user)] has changed [type](of [src]) into '[input]'", INVESTIGATE_BOTANY) + src.investigate_log("[key_name(user)] has changed [src] ([type]) into '[input]'", INVESTIGATE_BOTANY) // log_game() might fit, but I wanted botany logs contained in a specific log file. //--------- From 9a945cedbf0db2ff0c05117d05c699cf2cd438e6 Mon Sep 17 00:00:00 2001 From: Evildragon Date: Mon, 14 Aug 2023 14:45:18 +0900 Subject: [PATCH 07/10] filter change --- code/modules/hydroponics/seeds.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index eeb7121708a70..ba6ff53df79b2 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -409,7 +409,7 @@ var/input = stripped_input(user,"What do you want to name the plant?", default=plantname, max_length=MAX_NAME_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return - if(OOC_FILTER_CHECK(input)) + if(CHAT_FILTER_CHECK(input)) to_chat(src, "That message contained a word prohibited in OOC chat! Consider reviewing the server rules.\n\"[input]\"") return log_rename(user, src, "plant name", input) @@ -421,7 +421,7 @@ var/input = stripped_input(user,"What do you want to change the description of the plant to?", default=plantdesc, max_length=MAX_MESSAGE_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return - if(OOC_FILTER_CHECK(input)) + if(CHAT_FILTER_CHECK(input)) to_chat(src, "That message contained a word prohibited in OOC chat! Consider reviewing the server rules.\n\"[input]\"") return log_rename(user, src, "plant desc", input) @@ -431,7 +431,7 @@ var/input = stripped_input(user,"What do you want to change the description of the seeds to?", default=desc, max_length=MAX_MESSAGE_LEN) if(QDELETED(src) || !user.canUseTopic(src, BE_CLOSE)) return - if(OOC_FILTER_CHECK(input)) + if(CHAT_FILTER_CHECK(input)) to_chat(src, "That message contained a word prohibited in OOC chat! Consider reviewing the server rules.\n\"[input]\"") return log_rename(user, src, "seed desc", input) From 3025d1e1b7e103c384337a35bf34ca5d01f94078 Mon Sep 17 00:00:00 2001 From: Evildragon Date: Mon, 13 Nov 2023 03:14:18 +0900 Subject: [PATCH 08/10] real ref to text ref --- code/modules/hydroponics/plant_genes.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index f617aa274afd1..fd1cc59b18dc5 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -254,11 +254,11 @@ COOLDOWN_STATIC_LIST_DECLARE(recent_victims) /datum/plant_gene/trait/cell_charge/on_slip(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/C) - if(!COOLDOWN_LIST_FINISHED(src, recent_victims, C)) // if you were a victim recently, you won't get it again + if(!COOLDOWN_LIST_FINISHED(src, recent_victims, "\ref[C]")) // if you were a victim recently, you won't get it again return var/power = round(G.seed.potency*rate) if(prob(power)) - COOLDOWN_LIST_START(src, recent_victims, C, 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, "\ref[C]", 2 SECONDS) C.electrocute_act(power, G, 1, 1) var/turf/T = get_turf(C) if(C.ckey != G.fingerprintslast) @@ -272,7 +272,7 @@ var/mob/living/carbon/C = target var/power = G.seed.potency*rate if(prob(power)) - COOLDOWN_LIST_START(src, recent_victims, C, 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, "\ref[C]", 2 SECONDS) C.electrocute_act(round(power), G, 1, 1) if(C.ckey != G.fingerprintslast) log_combat(G.thrownby, C, "hit and electrocuted", G, "at [AREACOORD(G)] with power of [power]") @@ -488,7 +488,7 @@ G.reagents.reaction(L, INJECT, fraction) G.reagents.trans_to(L, injecting_amount) to_chat(L, "You are pricked by [G]!") - COOLDOWN_LIST_START(src, recent_victims, L, 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective + COOLDOWN_LIST_START(src, recent_victims, "\ref[L]", 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective return TRUE /datum/plant_gene/trait/smoke From 8aafa2d45ffa05d0fe8de18a781da82727abfa05 Mon Sep 17 00:00:00 2001 From: EvilDragonfiend <87972842+EvilDragonfiend@users.noreply.github.com> Date: Thu, 16 Nov 2023 19:31:05 +0900 Subject: [PATCH 09/10] fastref --- code/modules/hydroponics/plant_genes.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index fd1cc59b18dc5..910dd09125e75 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -254,11 +254,11 @@ COOLDOWN_STATIC_LIST_DECLARE(recent_victims) /datum/plant_gene/trait/cell_charge/on_slip(obj/item/reagent_containers/food/snacks/grown/G, mob/living/carbon/C) - if(!COOLDOWN_LIST_FINISHED(src, recent_victims, "\ref[C]")) // if you were a victim recently, you won't get it again + if(!COOLDOWN_LIST_FINISHED(src, recent_victims, FAST_REF(C))) // if you were a victim recently, you won't get it again return var/power = round(G.seed.potency*rate) if(prob(power)) - COOLDOWN_LIST_START(src, recent_victims, "\ref[C]", 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, FAST_REF(C), 2 SECONDS) C.electrocute_act(power, G, 1, 1) var/turf/T = get_turf(C) if(C.ckey != G.fingerprintslast) @@ -272,7 +272,7 @@ var/mob/living/carbon/C = target var/power = G.seed.potency*rate if(prob(power)) - COOLDOWN_LIST_START(src, recent_victims, "\ref[C]", 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, FAST_REF(C)", 2 SECONDS) C.electrocute_act(round(power), G, 1, 1) if(C.ckey != G.fingerprintslast) log_combat(G.thrownby, C, "hit and electrocuted", G, "at [AREACOORD(G)] with power of [power]") @@ -488,7 +488,7 @@ G.reagents.reaction(L, INJECT, fraction) G.reagents.trans_to(L, injecting_amount) to_chat(L, "You are pricked by [G]!") - COOLDOWN_LIST_START(src, recent_victims, "\ref[L]", 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective + COOLDOWN_LIST_START(src, recent_victims, FAST_REF(L), 10 SECONDS) // this refreshes 10s cooldown time. repeated attack will not be effective return TRUE /datum/plant_gene/trait/smoke From 03e56607f451fe23662b9cce056cb816c6b5c0e6 Mon Sep 17 00:00:00 2001 From: EvilDragonfiend <87972842+EvilDragonfiend@users.noreply.github.com> Date: Sun, 26 Nov 2023 12:17:49 +0900 Subject: [PATCH 10/10] fixes typo --- code/modules/hydroponics/plant_genes.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 910dd09125e75..3ad5407fccd44 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -272,7 +272,7 @@ var/mob/living/carbon/C = target var/power = G.seed.potency*rate if(prob(power)) - COOLDOWN_LIST_START(src, recent_victims, FAST_REF(C)", 2 SECONDS) + COOLDOWN_LIST_START(src, recent_victims, FAST_REF(C), 2 SECONDS) C.electrocute_act(round(power), G, 1, 1) if(C.ckey != G.fingerprintslast) log_combat(G.thrownby, C, "hit and electrocuted", G, "at [AREACOORD(G)] with power of [power]")