diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index ce86f97476c..72280f0bc74 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -1456,9 +1456,9 @@ /// Called on the organ when it is removed from someone (mob/living/carbon/old_owner) #define COMSIG_ORGAN_REMOVED "comsig_organ_removed" - ///Called when the ticker enters the pre-game phase #define COMSIG_TICKER_ENTER_PREGAME "comsig_ticker_enter_pregame" ///Called when the ticker sets up the game for start #define COMSIG_TICKER_ENTER_SETTING_UP "comsig_ticker_enter_setting_up" + diff --git a/code/datums/components/caltrop.dm b/code/datums/components/caltrop.dm index c9b31185ed9..712bd7d0dc5 100644 --- a/code/datums/components/caltrop.dm +++ b/code/datums/components/caltrop.dm @@ -24,6 +24,8 @@ COMSIG_ATOM_ENTERED = .proc/on_entered, ) + ///So we can update ant damage + dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS /datum/component/caltrop/Initialize(min_damage = 0, max_damage = 0, probability = 100, flags = NONE, soundfile = null) . = ..() @@ -41,6 +43,21 @@ else RegisterSignal(get_turf(parent), COMSIG_ATOM_ENTERED, .proc/on_entered) +// Inherit the new values passed to the component +/datum/component/caltrop/InheritComponent(datum/component/caltrop/new_comp, original, min_damage, max_damage, probability, flags, soundfile) + if(!original) + return + if(min_damage) + src.min_damage = min_damage + if(max_damage) + src.max_damage = max_damage + if(probability) + src.probability = probability + if(flags) + src.flags = flags + if(soundfile) + src.soundfile = soundfile + /datum/component/caltrop/proc/on_entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs) SIGNAL_HANDLER diff --git a/code/datums/components/food/decomposition.dm b/code/datums/components/food/decomposition.dm index db11c9b7179..55a86d5354b 100644 --- a/code/datums/components/food/decomposition.dm +++ b/code/datums/components/food/decomposition.dm @@ -23,12 +23,12 @@ /// Used for examining var/examine_type = DECOMP_EXAM_NORMAL -/datum/component/decomposition/Initialize(mapload, decomp_flags = NONE) +/datum/component/decomposition/Initialize(mapload, decomp_req_handle, decomp_flags = NONE) if(!isobj(parent)) return COMPONENT_INCOMPATIBLE src.decomp_flags = decomp_flags - if(mapload) + if(mapload || decomp_req_handle) handled = FALSE RegisterSignal(parent, COMSIG_MOVABLE_MOVED, .proc/handle_movement) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 50bf5fa16be..58233fee56a 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -1018,20 +1018,20 @@ victim.say(pick("GET THEM OFF ME!!", "OH GOD THE ANTS!!", "MAKE IT END!!", "THEY'RE EVERYWHERE!!", "GET THEM OFF!!", "SOMEBODY HELP ME!!"), forced = /datum/status_effect/ants) if(2) victim.emote("scream") - if(prob(50)) + if(prob(50)) // Most of the damage is done through random chance. When tested yielded an average 100 brute with 200u ants. switch(rand(1,50)) if (1 to 8) //16% Chance var/obj/item/bodypart/head/hed = victim.get_bodypart(BODY_ZONE_HEAD) to_chat(victim, "You scratch at the ants on your scalp!.") - hed.receive_damage(0.1,0) + hed.receive_damage(1,0) if (9 to 29) //40% chance var/obj/item/bodypart/arm = victim.get_bodypart(pick(BODY_ZONE_L_ARM,BODY_ZONE_R_ARM)) to_chat(victim, "You scratch at the ants on your arms!") - arm.receive_damage(0.1,0) + arm.receive_damage(3,0) if (30 to 49) //38% chance var/obj/item/bodypart/leg = victim.get_bodypart(pick(BODY_ZONE_L_LEG,BODY_ZONE_R_LEG)) to_chat(victim, "You scratch at the ants on your leg!") - leg.receive_damage(0.1,0) + leg.receive_damage(3,0) if(50) // 2% chance to_chat(victim, "You rub some ants away from your eyes!") victim.blur_eyes(3) diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index e37c9b9f7f3..1d93e9397c1 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -262,15 +262,28 @@ name = "space ants" desc = "A small colony of space ants. They're normally used to the vacuum of space, so they can't climb too well." icon = 'icons/obj/objects.dmi' - icon_state = "spaceants" + icon_state = "ants" beauty = -150 + layer = LOW_OBJ_LAYER + var/ant_bite_damage = 0.1 + var/ant_volume /obj/effect/decal/cleanable/ants/Initialize(mapload) . = ..() - var/scale = (rand(6, 8) / 10) + (rand(2, 5) / 50) - transform = matrix(transform, scale, scale, MATRIX_SCALE) - setDir(pick(GLOB.cardinals)) - reagents.add_reagent(/datum/reagent/ants, rand(2, 5)) - pixel_x = rand(-5, 5) - pixel_y = rand(-5, 5) - AddComponent(/datum/component/caltrop, min_damage = 0.2, max_damage = 1, flags = (CALTROP_NOCRAWL | CALTROP_NOSTUN | CALTROP_BYPASS_SHOES), soundfile = 'sound/weapons/bite.ogg') + ant_volume = rand(3, 5) + reagents.add_reagent(/datum/reagent/ants, ant_volume) + update_ant_damage() + +/obj/effect/decal/cleanable/ants/proc/update_ant_damage(spilled_ants) + ant_volume += spilled_ants + ant_bite_damage = min(10, round((ant_volume * 0.1),0.1)) // 100u ants = 10 max_damage + AddComponent(/datum/component/caltrop, min_damage = 0.1, max_damage = ant_bite_damage, flags = (CALTROP_NOCRAWL | CALTROP_NOSTUN | CALTROP_BYPASS_SHOES), soundfile = 'sound/weapons/bite.ogg') + switch(ant_bite_damage) + if(0 to 1) + icon_state = initial(icon_state) + if(1.1 to 4) + icon_state = "[initial(icon_state)]_2" + if(4.1 to 7) + icon_state = "[initial(icon_state)]_3" + if(7.1 to 10) + icon_state = "[initial(icon_state)]_4" diff --git a/code/game/objects/items/food/_food.dm b/code/game/objects/items/food/_food.dm index a5ba8f9ff97..6e684628f6b 100644 --- a/code/game/objects/items/food/_food.dm +++ b/code/game/objects/items/food/_food.dm @@ -40,6 +40,8 @@ var/venue_value ///Food that's immune to decomposition. var/preserved_food = FALSE + ///Food that needs to be picked up in order to decompose. + var/decomp_req_handle = FALSE /obj/item/food/Initialize(mapload) . = ..() @@ -97,6 +99,7 @@ return ///This proc makes things decompose. Set preserved_food to TRUE to make it never decompose. +///Set decomp_req_handle to TRUE to only make it decompose when someone picks it up. /obj/item/food/proc/MakeDecompose(mapload) if(!preserved_food) - AddComponent(/datum/component/decomposition, mapload, decomp_flags = foodtypes) + AddComponent(/datum/component/decomposition, mapload, decomp_req_handle, decomp_flags = foodtypes) diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index e79e12a6c34..0e003637dd9 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -202,6 +202,7 @@ food_reagents = list(/datum/reagent/consumable/nutriment = 3, /datum/reagent/consumable/nutriment/vitamin = 2) foodtypes = GROSS | MEAT | RAW grind_results = list(/datum/reagent/blood = 20, /datum/reagent/liquidgibs = 5) + decomp_req_handle = TRUE /obj/item/food/deadmouse/Initialize() . = ..() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 657ff2e8f47..24ba0eb46d2 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2736,7 +2736,7 @@ var/amount_left = 0 /datum/reagent/ants/on_mob_life(mob/living/carbon/victim, delta_time) - victim.adjustBruteLoss(max(0.1, round((ant_damage * 0.005),0.1))) //Scales with time. Around 12.5 brute for 50 seconds. + victim.adjustBruteLoss(max(0.1, round((ant_damage * 0.025),0.1))) //Scales with time. Roughly 32 brute with 100u. if(DT_PROB(5, delta_time)) if(DT_PROB(5, delta_time)) //Super rare statement victim.say("AUGH NO NOT THE ANTS! NOT THE ANTS! AAAAUUGH THEY'RE IN MY EYES! MY EYES! AUUGH!!", forced = /datum/reagent/ants) @@ -2744,9 +2744,9 @@ victim.say(pick("THEY'RE UNDER MY SKIN!!", "GET THEM OUT OF ME!!", "HOLY HELL THEY BURN!!", "MY GOD THEY'RE INSIDE ME!!", "GET THEM OUT!!"), forced = /datum/reagent/ants) if(DT_PROB(15, delta_time)) victim.emote("scream") - if(DT_PROB(2, delta_time)) - victim.vomit(rand(1, 2), stun = FALSE) - ant_damage += 1 + if(DT_PROB(2, delta_time)) // Stuns, but purges ants. + victim.vomit(rand(5,10), FALSE, TRUE, 1, TRUE, FALSE, purge_ratio = 1) + ant_damage++ return ..() /datum/reagent/ants/on_mob_end_metabolize(mob/living/living_anthill) @@ -2762,6 +2762,18 @@ amount_left = round(reac_volume,0.1) exposed_mob.apply_status_effect(STATUS_EFFECT_ANTS, amount_left) +/datum/reagent/ants/expose_turf(turf/exposed_turf, reac_volume) + . = ..() + if((reac_volume < 10) || isspaceturf(exposed_turf)) + return + + var/obj/effect/decal/cleanable/ants/pests = locate() in exposed_turf.contents + if(!pests) + pests = new(exposed_turf) + var/spilled_ants = (round(reac_volume,1) - 5) // To account for ant decals giving 3-5 ants on initialize. + pests.reagents.add_reagent(/datum/reagent/ants, spilled_ants) + pests.update_ant_damage(spilled_ants) + //This is intended to a be a scarce reagent to gate certain drugs and toxins with. Do not put in a synthesizer. Renewable sources of this reagent should be inefficient. /datum/reagent/lead name = "lead" diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index 98be0b37a43..d5ff17c71db 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -909,9 +909,9 @@ clear_products(holder, step_volume_added) holder.my_atom.audible_message(span_notice("[icon2html(holder.my_atom, viewers(DEFAULT_MESSAGE_RANGE, src))] The reaction gives out a fizz, teleporting items everywhere!")) -/datum/chemical_reaction/ants +/datum/chemical_reaction/ants // Breeding ants together, high sugar cost makes this take a while to farm. results = list(/datum/reagent/ants = 3) - required_reagents = list(/datum/reagent/ants = 2, /datum/reagent/consumable/sugar = 6) + required_reagents = list(/datum/reagent/ants = 2, /datum/reagent/consumable/sugar = 8) //FermiChem vars: optimal_ph_min = 3 optimal_ph_max = 12 diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi index 2d7121a9b8f..d16285d2176 100644 Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ