-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Changes from 6 commits
91947a7
c01ef4d
cf94267
87a2b78
a78bdd1
6f57bfb
0c065c0
9a945ce
e5cab66
3025d1e
8aafa2d
03e5660
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,21 +251,28 @@ | |
// 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(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) | ||
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.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 | ||
Comment on lines
+475
to
+484
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||
|
||
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, "<span class='danger'>You are pricked by [G]!</span>") | ||
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 | ||
|
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