-
-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing "COOLDOWN_LIST", and some botany changes #9324
Conversation
code/__DEFINES/cooldowns.dm
Outdated
/// 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These macro param names are confusing considering the index is actually the name of the cooldown and the target is the index.
The order of arguments should be:
object, cooldown name, index (cd_target), value (time/length)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed macro param names. would that work?
Provide actual testing evidence. |
Does this affect the pneumatic cannon death neetle cheese? Or this nerf is not enough and even with halved injection you can get insta crit by a good plant mix? |
This primarily prevents deathnettle to have Liquid Content trait. Deathnettle will be still used as cheese, and it's still possible to give fuckton of reagents, but you won't do the multiple things with a single plant throwing.
Maybe the default value might need to be lowered more than the suggested PR |
todo:
|
|
Otherwise seems fine |
Co-authored-by: PowerfulBacon <[email protected]>
btw, should I use mob as weak_ref for that assoc list key? or textified mob ref? |
@EvilDragonfiend In theory, weakrefs would be more optimized? As all of a mob's weakrefs are in fact a single /datum/weakref wrapping a text ref, so if a mobs have multiple cooldowns, you'd just have a bunch of pointers to the same weakref, instead of duplicate strings everywhere? although I don't know how BYOND handles string deduplication, so uh, I might be incorrect here. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be logged to permanent storage if we are logging it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is permanent logging. It's just categorised rather than all-in-one log_game()
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 | ||
return | ||
var/power = round(G.seed.potency*rate) | ||
if(prob(power)) | ||
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) | ||
C.investigate_log("[C] has slipped on an electric plant at [AREACOORD(T)]. Last fingerprint: [G.fingerprintslast].", INVESTIGATE_BOTANY) | ||
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(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(src, recent_victims, C, 2 SECONDS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't make a lot of sense to have cooldowns on, they execute only on slip and squash which are discrete and non-repeatable events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can happen when multiple items are thrown to a person, or when you step on a squashable slip plant. That's why CD check exists here
// Mechanism: It will always inject the amount as "injecting_amount" variable no matter the total size is | ||
var/prick_efficiency = 0.02 // default (maximum: 2u) | ||
if(locate(/datum/plant_gene/trait/squash) in G.seed.genes) | ||
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.06 // bonus to "death" nettle (maximum: 6u) | ||
else if(G.force) | ||
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) 4u to 2u |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A maximum of 2 units is just ridiculously low to the point where it isn't doing anything. The cooldown on this one doesn't make a lot of sense either since on throw/slip isn't highly repeated events like attacking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly it should be so. It's already horrible source of force-injection of toxins. 6u even does powerful enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also a horrible source of hard deletes if atoms are passed into it instead of strings. If the target index is a number it also won't work. The system just isn't very robust as it is.
It's a stringified atom reference, not a direct atom reference. Would it be still horrible? (I will work on this after I get answers) |
Changed the real reference to textified reference. |
Okay, after some researches, I found using text reference works enough instead of using strong reference. It won't be any horrible source of hardelete. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Merge conflicts for over a month. |
About The Pull Request
This is more dominant than below, so do not mix this with deathnettle unless you have a strong purpose.
i.e.) Deathnettle has 100u of Water. If you throw it to a person, they get 6u water.
If you throw it again to the same person within 10 seconds, they get 3u water.
If you throw a tomato with Hypodermic prickles and 100u water within 10 seconds again, they only get 0.5u water
Why It's Good For The Game
I really don't see any issue with Richer Juice, but the actual issue is Hypodermic Prickles. It's better to be nerfed already.
20u is too much. even 10u (half of 20u) is too much still. so I made it quite reduced.
Testing Photographs and Procedure
Changelog
🆑
code: COOLDOWN_LIST macros are newly added.
balance: Electrical Activity will not shock the same victim within 2 seconds.
balance: Hypodermic Prickles will inject half units of the original effectiveness into the same victim within 10 seconds. (i.e. 10u, 5u, 5u in 3 rows)
balance: Hypodermic Prickles maximum injection is 2u. Liquid Content trait makes it 1u. Deathnattle makes it 6u. Damaging plants (pineapple or nettle) makes it 4u. Priority is said here, so you'll want to avoid Liquid Content.
tweak: Omega weed (can hold 420u) bite size is now 1u. I hope your jaw is strong enough.
tweak: Botany plants' bite size no longer adds one extra bite size, so 2u bite size means you'll eat a plant as 2u size.
tweak: Plant desc length is now 1024
/:cl: