From 72a716b66cd300de752e4db920726a977a510fb2 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 9 Jun 2015 21:39:45 -0400 Subject: [PATCH 01/11] Attempts to make transferring reagents a bit more logical Attempts to give trans_to, touch, and trans_to_* procs more distinct purposes. Applying reagents to things now calls touch() before attempting to transfer reagents. Reagents that affect fire stacks now do so from touch. Fixes #9750 when combined with the above. Also fixes acid affect_touch dealing brute instead of burn. --- code/modules/reagents/Chemistry-Holder.dm | 97 ++++++++++++------- code/modules/reagents/Chemistry-Readme.dm | 13 ++- code/modules/reagents/Chemistry-Reagents.dm | 7 +- .../Chemistry-Reagents-Core.dm | 26 ++--- .../Chemistry-Reagents-Dispenser.dm | 8 +- .../Chemistry-Reagents-Other.dm | 11 +-- .../Chemistry-Reagents-Toxins.dm | 9 +- 7 files changed, 104 insertions(+), 67 deletions(-) diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 6b5b9d7a0d..fcfd4b96c6 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -288,43 +288,13 @@ /* Holder-to-atom and similar procs */ -/datum/reagents/proc/touch(var/atom/target) // This picks the appropriate reaction. Reagents are not guaranteed to transfer to the target. - if(ismob(target)) - touch_mob(target) - if(isturf(target)) - touch_turf(target) - if(isobj(target)) - touch_obj(target) - return - -/datum/reagents/proc/touch_mob(var/mob/target) - if(!target || !istype(target)) - return - - for(var/datum/reagent/current in reagent_list) - current.touch_mob(target) - - update_total() - -/datum/reagents/proc/touch_turf(var/turf/target) - if(!target || !istype(target)) - return - - for(var/datum/reagent/current in reagent_list) - current.touch_turf(target) - - update_total() - -/datum/reagents/proc/touch_obj(var/obj/target) - if(!target || !istype(target)) - return - - for(var/datum/reagent/current in reagent_list) - current.touch_obj(target) - - update_total() - +//The general proc for applying reagents to things. This proc assumes the reagents are being applied externally, +//not directly injected into the contents. It first calls touch, then the appropriate trans_to_*() or splash_mob(). +//If for some reason touch effects are bypassed (e.g. injecting stuff directly into a reagent container or person), +//call the appropriate trans_to_*() proc. /datum/reagents/proc/trans_to(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0) + touch(target) //First, handle mere touch effects + if(ismob(target)) //warning("[my_atom] is trying to transfer reagents to [target], which is a mob, using trans_to()") //return trans_to_mob(target, amount, multiplier, copy) @@ -351,9 +321,62 @@ return F.trans_to(target, amount) // Let this proc check the atom's type +// When applying reagents to an atom externally, touch() is called to trigger any on-touch effects of the reagent. +// This does not handle transferring reagents to things. +// For example, splashing someone with water will get them wet and extinguish them if they are on fire, +// even if they are wearing an impermeable suit that prevents the reagents from contacting the skin. +/datum/reagents/proc/touch(var/atom/target) + if(ismob(target)) + touch_mob(target) + if(isturf(target)) + touch_turf(target) + if(isobj(target)) + touch_obj(target) + return + +/datum/reagents/proc/touch_mob(var/mob/target) + if(!target || !istype(target)) + return + + for(var/datum/reagent/current in reagent_list) + current.touch_mob(target, current.volume) + + update_total() + +/datum/reagents/proc/touch_turf(var/turf/target) + if(!target || !istype(target)) + return + + for(var/datum/reagent/current in reagent_list) + current.touch_turf(target, current.volume) + + update_total() + +/datum/reagents/proc/touch_obj(var/obj/target) + if(!target || !istype(target)) + return + + for(var/datum/reagent/current in reagent_list) + current.touch_obj(target, current.volume) + + update_total() + +// Attempts to place a reagent on the mob's skin. +// Reagents are not guaranteed to transfer to the target. /datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) var/perm = 0 - var/list/L = list("head" = THERMAL_PROTECTION_HEAD, "upper_torso" = THERMAL_PROTECTION_UPPER_TORSO, "lower_torso" = THERMAL_PROTECTION_LOWER_TORSO, "legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT, "feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT, "arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT, "hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT) + + //this all seems very human-specific + var/list/L = list( + "head" = THERMAL_PROTECTION_HEAD, + "upper_torso" = THERMAL_PROTECTION_UPPER_TORSO, + "lower_torso" = THERMAL_PROTECTION_LOWER_TORSO, + "legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT, + "feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT, + "arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT, + "hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT + ) + if(clothes) for(var/obj/item/clothing/C in target.get_equipped_items()) if(C.permeability_coefficient == 1 || C.body_parts_covered == 0) diff --git a/code/modules/reagents/Chemistry-Readme.dm b/code/modules/reagents/Chemistry-Readme.dm index 399e856bf3..cb3c6a8458 100644 --- a/code/modules/reagents/Chemistry-Readme.dm +++ b/code/modules/reagents/Chemistry-Readme.dm @@ -88,7 +88,12 @@ About the Holder: Transfers [amount] reagents from [src] to [target], multiplying them by [multiplier]. Returns actual amount removed from [src] (not amount transferred to [target]). If [copy] is 1, copies reagents instead. touch(var/atom/target) - Not recommended to use. Calls touch_mob(target), touch_turf(target), or touch_obj(target), depending on target's type. + When applying reagents to an atom externally, touch() is called to trigger any on-touch effects of the reagent. + This does not handle transferring reagents to things. + For example, splashing someone with water will get them wet and extinguish them if they are on fire, + even if they are wearing an impermeable suit that prevents the reagents from contacting the skin. + Basically just defers to touch_mob(target), touch_turf(target), or touch_obj(target), depending on target's type. + Not recommended to use this directly, since trans_to() calls it before attempting to transfer. touch_mob(var/mob/target) Calls each reagent's touch_mob(target). @@ -100,7 +105,11 @@ About the Holder: Calls each reagent's touch_obj(target). trans_to(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0) - Checks the type of [target], calling splash_mob(target, amount), trans_to_turf(target, amount, multiplier, copy), or trans_to_obj(target, amount, multiplier, copy). + The general proc for applying reagents to things externally (as opposed to directly injected into the contents). + It first calls touch, then the appropriate trans_to_*() or splash_mob(). + If for some reason you want touch effects to be bypassed (e.g. injecting stuff directly into a reagent container or person), call the appropriate trans_to_*() proc. + + Calls touch() before checking the type of [target], calling splash_mob(target, amount), trans_to_turf(target, amount, multiplier, copy), or trans_to_obj(target, amount, multiplier, copy). trans_id_to(var/atom/target, var/id, var/amount = 1) Transfers [amount] of [id] to [target]. Returns amount transferred. diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 0e0da75e2a..13c7aaf7bc 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -24,13 +24,14 @@ /datum/reagent/proc/remove_self(var/amount) // Shortcut holder.remove_reagent(id, amount) -/datum/reagent/proc/touch_mob(var/mob/M) // This doesn't apply to being splashed - this is for, e.g. extinguishers and sprays. The difference is that reagent is not on the mob - it's in another object. +// This doesn't apply to skin contact - this is for, e.g. extinguishers and sprays. The difference is that reagent is not directly on the mob's skin - it might just be on their clothing. +/datum/reagent/proc/touch_mob(var/mob/M, var/amount) return -/datum/reagent/proc/touch_obj(var/obj/O) // Acid melting, cleaner cleaning, etc +/datum/reagent/proc/touch_obj(var/obj/O, var/amount) // Acid melting, cleaner cleaning, etc return -/datum/reagent/proc/touch_turf(var/turf/T) // Cleaner cleaning, lube lubbing, etc, all go here +/datum/reagent/proc/touch_turf(var/turf/T, var/amount) // Cleaner cleaning, lube lubbing, etc, all go here return /datum/reagent/proc/on_mob_life(var/mob/living/carbon/M, var/alien, var/location) // Currently, on_mob_life is called on carbons. Any interaction with non-carbon mobs (lube) will need to be done in touch_mob. diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm index d957e88a4c..7d73b1ce20 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm @@ -155,6 +155,17 @@ if(!cube.wrapped) cube.Expand() +/datum/reagent/water/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + var/needed = L.fire_stacks * 10 + if(amount > needed) + L.fire_stacks = 0 + L.ExtinguishMob() + remove_self(needed) + else + L.adjust_fire_stacks(-(amount / 10)) + remove_self(amount) + /datum/reagent/water/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) if(istype(M, /mob/living/carbon/slime)) var/mob/living/carbon/slime/S = M @@ -165,15 +176,6 @@ ++S.Discipline if(dose == removed) S.visible_message("[S]'s flesh sizzles where the water touches it!", "Your flesh burns in the water!") - var/needed = M.fire_stacks * 10 - if(volume > needed) - M.fire_stacks = 0 - M.ExtinguishMob() - remove_self(needed) - else - M.adjust_fire_stacks(-(volume / 10)) - remove_self(volume) - return /datum/reagent/fuel name = "Welding fuel" @@ -194,5 +196,7 @@ /datum/reagent/fuel/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.adjustToxLoss(2 * removed) -/datum/reagent/fuel/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) // Splashing people with welding fuel to make them easy to ignite! - M.adjust_fire_stacks(0.1 * removed) +/datum/reagent/fuel/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 10) // Splashing people with welding fuel to make them easy to ignite! + diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index b9caf096d6..5822b6edf8 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -70,9 +70,9 @@ glass_name = "glass of ethanol" glass_desc = "A well-known alcohol with a variety of applications." -/datum/reagent/ethanol/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - M.adjust_fire_stacks(removed / 15) - return +/datum/reagent/ethanol/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 15) /datum/reagent/ethanol/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.adjustToxLoss(removed * 2 * toxicity) @@ -318,7 +318,7 @@ return if(volume < meltdose) // Not enough to melt anything - M.take_organ_damage(removed * power * 0.2) + M.take_organ_damage(0, removed * power * 0.2) //burn damage, since it causes chemical burns. Acid doesn't make bones shatter, like brute trauma would. return if(!M.unacidable && removed > 0) if(istype(M, /mob/living/carbon/human) && volume >= meltdose) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm index 0b57ef9372..63cfb46235 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm @@ -67,10 +67,7 @@ /datum/reagent/paint/touch_mob(var/mob/M) if(istype(M) && !istype(M, /mob/dead)) //painting ghosts: not allowed - M.color = color - -/datum/reagent/paint/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - M.color = color + M.color = color //maybe someday change this to paint only clothes and exposed body parts for human mobs. /datum/reagent/paint/get_data() return color @@ -265,9 +262,9 @@ remove_self(5) return -/datum/reagent/thermite/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - M.adjust_fire_stacks(removed * 0.2) - return +/datum/reagent/thermite/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 5) /datum/reagent/thermite/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.adjustFireLoss(3 * removed) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 92b6b67796..fcf2f658a0 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -45,9 +45,12 @@ color = "#9D14DB" strength = 30 +/datum/reagent/toxin/phoron/touch_mob(var/mob/living/L, var/amount) + if(istype(L)) + L.adjust_fire_stacks(amount / 5) + /datum/reagent/toxin/phoron/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) - ..() - M.adjust_fire_stacks(removed / 5) + M.take_organ_damage(0, removed * 0.1) //being splashed directly with phoron causes minor chemical burns /datum/reagent/toxin/phoron/touch_turf(var/turf/simulated/T) if(!istype(T)) @@ -494,7 +497,7 @@ /datum/reagent/nanites/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) if(prob(10)) - M.contract_disease(new /datum/disease/robotic_transformation(0), 1) + M.contract_disease(new /datum/disease/robotic_transformation(0), 1) //What /datum/reagent/nanites/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.contract_disease(new /datum/disease/robotic_transformation(0), 1) From 8007d4278319d63af090bdb7cd94d1b58c1d93c3 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 10 Jun 2015 00:03:08 -0400 Subject: [PATCH 02/11] Adjusts usages of reagent transfer procs Adds splash() proc for futureproofing. Replaces instances of splash_mob() with splash() Replaces instances of trans_to() with splash() where appropriate. --- code/game/objects/effects/chem/water.dm | 2 +- code/game/objects/items/toys.dm | 2 +- code/modules/reagents/Chemistry-Holder.dm | 6 ++++++ code/modules/reagents/Chemistry-Readme.dm | 1 + code/modules/reagents/reagent_containers.dm | 2 +- code/modules/reagents/reagent_containers/dropper.dm | 2 +- .../reagents/reagent_containers/food/drinks/bottle.dm | 2 +- code/modules/reagents/reagent_containers/food/snacks.dm | 2 +- code/modules/reagents/reagent_containers/glass.dm | 2 +- code/modules/reagents/reagent_containers/spray.dm | 4 ++-- 10 files changed, 16 insertions(+), 9 deletions(-) diff --git a/code/game/objects/effects/chem/water.dm b/code/game/objects/effects/chem/water.dm index eac107923e..30f436db9a 100644 --- a/code/game/objects/effects/chem/water.dm +++ b/code/game/objects/effects/chem/water.dm @@ -30,7 +30,7 @@ else if(ismob(A) && !M) M = A if(M) - reagents.splash_mob(M, reagents.total_volume) + reagents.trans_to(M, reagents.total_volume) break if(T == get_turf(target)) break diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 8290296fe0..dcb12f2a5d 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -61,7 +61,7 @@ else if(O.reagents.total_volume >= 1) if(O.reagents.has_reagent("pacid", 1)) user << "The acid chews through the balloon!" - O.reagents.splash_mob(user, reagents.total_volume) + O.reagents.splash(user, reagents.total_volume) qdel(src) else src.desc = "A translucent balloon with some form of liquid sloshing around in it." diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index fcfd4b96c6..f346f17491 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -305,6 +305,11 @@ return trans_to_obj(target, amount, multiplier, copy) return 0 +//Using this in case we want to differentiate splashing an atom from transferring reagents to it later down the road. +//For now it just calls trans_to. +/datum/reagents/proc/splash(var/atom/target, var/amount = 1, var/multiplier = 1, var/copy = 0) + trans_to(target, amount, multiplier, copy) + /datum/reagents/proc/trans_id_to(var/atom/target, var/id, var/amount = 1) if (!target || !target.reagents) return @@ -363,6 +368,7 @@ // Attempts to place a reagent on the mob's skin. // Reagents are not guaranteed to transfer to the target. +// Do not call this directly, call trans_to() instead. /datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) var/perm = 0 diff --git a/code/modules/reagents/Chemistry-Readme.dm b/code/modules/reagents/Chemistry-Readme.dm index cb3c6a8458..9a49d409e0 100644 --- a/code/modules/reagents/Chemistry-Readme.dm +++ b/code/modules/reagents/Chemistry-Readme.dm @@ -116,6 +116,7 @@ About the Holder: splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) Checks mob's clothing if [clothes] is 1 and transfers [amount] reagents to mob's skin. + Don't call this directly. Call apply_to() instead. trans_to_mob(var/mob/target, var/amount = 1, var/type = CHEM_BLOOD, var/multiplier = 1, var/copy = 0) Transfers [amount] reagents to the mob's appropriate holder, depending on [type]. Ignores protection. diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 2d0a1469b5..39c6075ae2 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -72,7 +72,7 @@ msg_admin_attack("[user.name] ([user.ckey]) splashed [target.name] ([target.key]) with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (JMP)") user.visible_message("[target] has been splashed with something by [user]!", "You splash the solution onto [target].") - reagents.splash_mob(target, reagents.total_volume) + reagents.splash(target, reagents.total_volume) return 1 /obj/item/weapon/reagent_containers/proc/self_feed_message(var/mob/user) diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index c67c6ab7de..44fd6b1a49 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -64,7 +64,7 @@ return else - trans = reagents.trans_to(target, amount_per_transfer_from_this) + trans = reagents.splash(target, amount_per_transfer_from_this) //sprinkling reagents on generic non-mobs user << "You transfer [trans] units of the solution." else // Taking from something diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm index e6b1308603..7e289a45f3 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm @@ -78,7 +78,7 @@ //The reagents in the bottle splash all over the target, thanks for the idea Nodrak if(reagents) user.visible_message("The contents of the [src] splash all over [target]!") - reagents.splash_mob(target, reagents.total_volume) + reagents.splash(target, reagents.total_volume) //Finally, smash the bottle. This kills (qdel) the bottle. src.smash(target, user) diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 65257f7d03..4f828d23a3 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -483,7 +483,7 @@ /obj/item/weapon/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom) ..() new/obj/effect/decal/cleanable/egg_smudge(src.loc) - src.reagents.trans_to(hit_atom, reagents.total_volume) + src.reagents.splash(hit_atom, reagents.total_volume) src.visible_message("\red [src.name] has been squashed.","\red You hear a smack.") qdel(src) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 836b500df3..26f58fb471 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -88,7 +88,7 @@ if(reagents.total_volume) user << "You splash the solution onto [target]." - reagents.trans_to(target, reagents.total_volume) + reagents.splash(target, reagents.total_volume) return attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index c041f529ee..0da6f7e0c4 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -53,7 +53,7 @@ /obj/item/weapon/reagent_containers/spray/proc/Spray_at(atom/A as mob|obj, mob/user as mob, proximity) if (A.density && proximity) A.visible_message("[usr] sprays [A] with [src].") - reagents.trans_to(A, amount_per_transfer_from_this) + reagents.splash(A, amount_per_transfer_from_this) else spawn(0) var/obj/effect/effect/water/chempuff/D = new/obj/effect/effect/water/chempuff(get_turf(src)) @@ -88,7 +88,7 @@ return if(isturf(usr.loc)) usr << "You empty \the [src] onto the floor." - reagents.trans_to(usr.loc, reagents.total_volume) + reagents.splash(usr.loc, reagents.total_volume) //space cleaner /obj/item/weapon/reagent_containers/spray/cleaner From ad24805eb8d99c72e34d7192f6b7db80a61a6ef8 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 10 Jun 2015 23:16:40 -0400 Subject: [PATCH 03/11] Mob fire temperature fix, tweaks Mob fires are now guaranteed to burn at least as hot as a cold flame - no more merely warming mobs up slightly with low fire stacks. Also made mob fires burn hotter overall and resisting slower. --- code/modules/mob/living/carbon/resist.dm | 8 ++++---- code/modules/mob/living/living_defense.dm | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/resist.dm b/code/modules/mob/living/carbon/resist.dm index 9a511504f3..c99a8bd599 100644 --- a/code/modules/mob/living/carbon/resist.dm +++ b/code/modules/mob/living/carbon/resist.dm @@ -3,14 +3,14 @@ //drop && roll if(on_fire) - fire_stacks -= 2 //reduced - Weaken(3) - spin(32,2) + fire_stacks -= 2 + Weaken(5) + spin(52,2) visible_message( "[src] rolls on the floor, trying to put themselves out!", "You stop, drop, and roll!" ) - sleep(30) + sleep(50) if(fire_stacks <= 0) visible_message( "[src] has successfully extinguished themselves!", diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 9dd399a804..ab39b502c5 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -236,7 +236,7 @@ location.hotspot_expose(fire_burn_temperature(), 50, 1) /mob/living/fire_act() - adjust_fire_stacks(0.5) + adjust_fire_stacks(2) IgniteMob() //Finds the effective temperature that the mob is burning at. @@ -245,4 +245,5 @@ return 0 //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. - return round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2) + //lower limit of 700 K, same as matches and roughly the temperature of a cool flame. + return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2), 700) From f0c096627cd347ec5ca54c55af57cfe6cf8fbfbc Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 10 Jun 2015 23:34:41 -0400 Subject: [PATCH 04/11] Matches can be used to light things in adjacent turfs when thrown --- code/game/objects/items/weapons/cigs_lighters.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index d59a1cdea5..074181395a 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -55,8 +55,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM return /obj/item/weapon/flame/match/dropped(mob/user as mob) + //If dropped, put ourselves out + //not before lighting up the turf we land on, though. if(lit) - burn_out() + spawn(0) + var/turf/location = src.loc + if(istype(location)) + location.hotspot_expose(700, 5) + burn_out() return ..() /obj/item/weapon/flame/match/proc/burn_out() From a4c2b639751d58a0bd08bf84f0623f31896bda4c Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 10 Jun 2015 23:35:05 -0400 Subject: [PATCH 05/11] Updates changelog --- html/changelogs/HarpyEagle-dev-freeze.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 html/changelogs/HarpyEagle-dev-freeze.yml diff --git a/html/changelogs/HarpyEagle-dev-freeze.yml b/html/changelogs/HarpyEagle-dev-freeze.yml new file mode 100644 index 0000000000..7302d8c9ce --- /dev/null +++ b/html/changelogs/HarpyEagle-dev-freeze.yml @@ -0,0 +1,12 @@ +author: HarpyEagle + +delete-after: False + +changes: + - bugfix: "Prevents being on fire from merely warming mobs up slightly in some cases. Mob fires also burn hotter." + - rscadd: "Matches can now be used to light things adjacent to you when thrown." + - tweak: "Made the effects of having a damaged robotic leg more prominent." + - bugfix: "Robot limbs no longer cause pain messages. A reminder that you can still check their status with 'Help Intent' -> 'Click Self'." + - tweak: "Knifing damage scales with weapon force and throat protection. Helmets only provide throat protection if they are air tight. Trying to cut someone's throat with wirecutters and/or while wearing an armoured sealed helmet will require several attempts before the victim passes out." + - tweak: "Knifing switches on harm intent, in case you just wanted to beat on the victim for some reason." + - bugfix: "Prevents knifing bots or silicons." From 4cb70b2b94a54ae708bbcdfe980be5501b390bb2 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 13 Jun 2015 15:42:02 -0400 Subject: [PATCH 06/11] Ingesting diseased blood contracts the disease Only if the disease is a contact type disease. The same restriction is also applied to touching diseased blood. --- .../Chemistry-Reagents-Core.dm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm index 7d73b1ce20..16dd0bd323 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm @@ -55,19 +55,34 @@ M.adjustToxLoss(removed) if(dose > 15) M.adjustToxLoss(removed) + if(data && data["viruses"]) + for(var/datum/disease/D in data["viruses"]) + if(D.spread_type == SPECIAL || D.spread_type == NON_CONTAGIOUS) + continue + if(D.spread_type in list(CONTACT_FEET, CONTACT_HANDS, CONTACT_GENERAL)) + M.contract_disease(D) + if(data && data["virus2"]) + var/list/vlist = data["virus2"] + if(vlist.len) + for(var/ID in vlist) + var/datum/disease2/disease/V = vlist[ID] + if(V.spreadtype == "Contact") + infect_virus2(M, V.getcopy()) /datum/reagent/blood/affect_touch(var/mob/living/carbon/M, var/alien, var/removed) if(data && data["viruses"]) for(var/datum/disease/D in data["viruses"]) if(D.spread_type == SPECIAL || D.spread_type == NON_CONTAGIOUS) continue - M.contract_disease(D) + if(D.spread_type in list(CONTACT_FEET, CONTACT_HANDS, CONTACT_GENERAL)) + M.contract_disease(D) if(data && data["virus2"]) var/list/vlist = data["virus2"] if(vlist.len) for(var/ID in vlist) var/datum/disease2/disease/V = vlist[ID] - infect_virus2(M, V.getcopy()) + if(V.spreadtype == "Contact") + infect_virus2(M, V.getcopy()) if(data && data["antibodies"]) M.antibodies |= data["antibodies"] From 70433b4367fa438bb170b3ca2a46499c900ee7dd Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 13 Jun 2015 16:06:54 -0400 Subject: [PATCH 07/11] Makes showers wash away touching reagents Also moves reagent permeability to it's own proc, and makes splash_mob respect copy --- code/game/objects/structures/watercloset.dm | 6 +++ .../mob/living/carbon/human/human_defense.dm | 39 +++++++++++++++- code/modules/mob/living/living_defense.dm | 3 ++ code/modules/reagents/Chemistry-Holder.dm | 45 +++---------------- code/modules/reagents/Chemistry-Metabolism.dm | 17 +++++++ 5 files changed, 71 insertions(+), 39 deletions(-) create mode 100644 code/modules/reagents/Chemistry-Metabolism.dm diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 81a3a16cdd..08bfbb6ed2 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -225,6 +225,12 @@ if(M.back) if(M.back.clean_blood()) M.update_inv_back(0) + + //flush away reagents on the skin + if(M.touching) + var/remove_amount = M.touching.maximum_volume * M.reagent_permeability() //take off your suit first + M.touching.remove_any(remove_amount) + if(ishuman(M)) var/mob/living/carbon/human/H = M var/washgloves = 1 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 994cab11f6..b2f3e17745 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -444,4 +444,41 @@ emp_act if(!istype(wear_suit,/obj/item/clothing/suit/space)) return var/obj/item/clothing/suit/space/SS = wear_suit var/penetrated_dam = max(0,(damage - SS.breach_threshold)) - if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam) \ No newline at end of file + if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam) + +/mob/living/human/reagent_permeability() + var/perm = 0 + + var/list/perm_by_part = list( + "head" = THERMAL_PROTECTION_HEAD, + "upper_torso" = THERMAL_PROTECTION_UPPER_TORSO, + "lower_torso" = THERMAL_PROTECTION_LOWER_TORSO, + "legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT, + "feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT, + "arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT, + "hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT + ) + + for(var/obj/item/clothing/C in src.get_equipped_items()) + if(C.permeability_coefficient == 1 || !C.body_parts_covered) + continue + if(C.body_parts_covered & HEAD) + perm_by_part["head"] *= C.permeability_coefficient + if(C.body_parts_covered & UPPER_TORSO) + perm_by_part["upper_torso"] *= C.permeability_coefficient + if(C.body_parts_covered & LOWER_TORSO) + perm_by_part["lower_torso"] *= C.permeability_coefficient + if(C.body_parts_covered & LEGS) + perm_by_part["legs"] *= C.permeability_coefficient + if(C.body_parts_covered & FEET) + perm_by_part["feet"] *= C.permeability_coefficient + if(C.body_parts_covered & ARMS) + perm_by_part["arms"] *= C.permeability_coefficient + if(C.body_parts_covered & HANDS) + perm_by_part["hands"] *= C.permeability_coefficient + + for(var/part in perm_by_part) + perm += perm_by_part[part] + + return perm + diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index ab39b502c5..32b0235009 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -247,3 +247,6 @@ //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. //lower limit of 700 K, same as matches and roughly the temperature of a cool flame. return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2), 700) + +/mob/living/proc/reagent_permeability() + return 1 diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index f346f17491..d5364e40c2 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -296,9 +296,7 @@ touch(target) //First, handle mere touch effects if(ismob(target)) - //warning("[my_atom] is trying to transfer reagents to [target], which is a mob, using trans_to()") - //return trans_to_mob(target, amount, multiplier, copy) - return splash_mob(target, amount) + return splash_mob(target, amount, copy) if(isturf(target)) return trans_to_turf(target, amount, multiplier, copy) if(isobj(target)) @@ -369,41 +367,12 @@ // Attempts to place a reagent on the mob's skin. // Reagents are not guaranteed to transfer to the target. // Do not call this directly, call trans_to() instead. -/datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/clothes = 1) - var/perm = 0 - - //this all seems very human-specific - var/list/L = list( - "head" = THERMAL_PROTECTION_HEAD, - "upper_torso" = THERMAL_PROTECTION_UPPER_TORSO, - "lower_torso" = THERMAL_PROTECTION_LOWER_TORSO, - "legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT, - "feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT, - "arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT, - "hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT - ) - - if(clothes) - for(var/obj/item/clothing/C in target.get_equipped_items()) - if(C.permeability_coefficient == 1 || C.body_parts_covered == 0) - continue - if(C.body_parts_covered & HEAD) - L["head"] *= C.permeability_coefficient - if(C.body_parts_covered & UPPER_TORSO) - L["upper_torso"] *= C.permeability_coefficient - if(C.body_parts_covered & LOWER_TORSO) - L["lower_torso"] *= C.permeability_coefficient - if(C.body_parts_covered & LEGS) - L["legs"] *= C.permeability_coefficient - if(C.body_parts_covered & FEET) - L["feet"] *= C.permeability_coefficient - if(C.body_parts_covered & ARMS) - L["arms"] *= C.permeability_coefficient - if(C.body_parts_covered & HANDS) - L["hands"] *= C.permeability_coefficient - for(var/t in L) - perm += L[t] - return trans_to_mob(target, amount, CHEM_TOUCH, perm) +/datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/copy = 0) + var/perm = 1 + if(isliving(target)) //will we ever even need to tranfer reagents to non-living mobs? + var/mob/living/L = target + perm = L.reagent_permeability() + return trans_to_mob(target, amount, CHEM_TOUCH, perm, copy) /datum/reagents/proc/trans_to_mob(var/mob/target, var/amount = 1, var/type = CHEM_BLOOD, var/multiplier = 1, var/copy = 0) // Transfer after checking into which holder... if(!target || !istype(target)) diff --git a/code/modules/reagents/Chemistry-Metabolism.dm b/code/modules/reagents/Chemistry-Metabolism.dm new file mode 100644 index 0000000000..63f055d035 --- /dev/null +++ b/code/modules/reagents/Chemistry-Metabolism.dm @@ -0,0 +1,17 @@ +/datum/reagents/metabolism + var/metabolism_type + +/datum/reagents/metabolism/New(var/max = 100, var/met_type, mob/living/carbon/parent_mob) + ..() + metabolism_type = met_type + my_atom = parent_mob + +/datum/reagents/proc/metabolize(var/alien) + if(!iscarbon(my_atom)) + return + var/mob/living/carbon/C = my_atom + if(!C || !istype(C)) + return + for(var/datum/reagent/current in reagent_list) + current.on_mob_life(C, alien, metabolism_type) + update_total() \ No newline at end of file From 73333ac9c8410f4238a24e85d77b0f0bcdbb8543 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 13 Jun 2015 18:37:51 -0400 Subject: [PATCH 08/11] Moves metabolism to a holder subtype --- baystation12.dme | 1 + code/modules/mob/living/carbon/brain/life.dm | 9 ++---- code/modules/mob/living/carbon/carbon.dm | 13 ++++----- .../mob/living/carbon/carbon_defines.dm | 5 ++-- code/modules/mob/living/carbon/human/life.dm | 13 ++++----- .../modules/mob/living/carbon/metroid/life.dm | 9 ++---- code/modules/reagents/Chemistry-Holder.dm | 19 ++++--------- code/modules/reagents/Chemistry-Metabolism.dm | 28 +++++++++++-------- 8 files changed, 43 insertions(+), 54 deletions(-) diff --git a/baystation12.dme b/baystation12.dme index 3dc5369865..dc78e022a1 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1472,6 +1472,7 @@ #include "code\modules\reagents\Chemistry-Colours.dm" #include "code\modules\reagents\Chemistry-Holder.dm" #include "code\modules\reagents\Chemistry-Machinery.dm" +#include "code\modules\reagents\Chemistry-Metabolism.dm" #include "code\modules\reagents\Chemistry-Readme.dm" #include "code\modules\reagents\Chemistry-Reagents.dm" #include "code\modules\reagents\Chemistry-Recipes.dm" diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 189dfd81e7..2a6aba0bf6 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -108,12 +108,9 @@ chem_effects.Cut() analgesic = 0 - if(touching) - touching.metabolize(0, CHEM_TOUCH) - if(ingested) - ingested.metabolize(0, CHEM_INGEST) - if(reagents) - reagents.metabolize(0, CHEM_BLOOD) + if(touching) touching.metabolize() + if(ingested) ingested.metabolize() + if(bloodstr) bloodstr.metabolize() if(CE_PAINKILLER in chem_effects) analgesic = chem_effects[CE_PAINKILLER] diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ad191db257..904a970637 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1,11 +1,10 @@ /mob/living/carbon/New() - create_reagents(1000) - var/datum/reagents/R1 = new/datum/reagents(1000) - var/datum/reagents/R2 = new/datum/reagents(1000) - ingested = R1 - touching = R2 - R1.my_atom = src - R2.my_atom = src + //setup reagent holders + bloodstr = new/datum/reagents/metabolism(1000, src, CHEM_BLOOD) + ingested = new/datum/reagents/metabolism(1000, src, CHEM_INGEST) + touching = new/datum/reagents/metabolism(1000, src, CHEM_TOUCH) + reagents = bloodstr + ..() /mob/living/carbon/Life() diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index e617506c23..1478108b2a 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -18,7 +18,8 @@ //Active emote/pose var/pose = null var/list/chem_effects = list() - var/datum/reagents/ingested = null - var/datum/reagents/touching = null + var/datum/reagents/metabolism/bloodstr = null + var/datum/reagents/metabolism/ingested = null + var/datum/reagents/metabolism/touching = null var/pulse = PULSE_NORM //current pulse level diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index f07351c705..a624b3d18c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -858,15 +858,14 @@ proc/handle_chemicals_in_body() - if(reagents && !(species.flags & IS_SYNTHETIC)) //Synths don't process reagents. + if(!(species.flags & IS_SYNTHETIC)) //Synths don't process reagents. chem_effects.Cut() analgesic = 0 - var/alien = 0 - if(species && species.reagent_tag) - alien = species.reagent_tag - touching.metabolize(alien, CHEM_TOUCH) - ingested.metabolize(alien, CHEM_INGEST) - reagents.metabolize(alien, CHEM_BLOOD) + + if(touching) touching.metabolize() + if(ingested) ingested.metabolize() + if(bloodstr) bloodstr.metabolize() + if(CE_PAINKILLER in chem_effects) analgesic = chem_effects[CE_PAINKILLER] diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index b41fdb758a..b1918f1aa2 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -85,12 +85,9 @@ chem_effects.Cut() analgesic = 0 - if(touching) - touching.metabolize(0, CHEM_TOUCH) - if(ingested) - ingested.metabolize(0, CHEM_INGEST) - if(reagents) - reagents.metabolize(0, CHEM_BLOOD) + if(touching) touching.metabolize() + if(ingested) ingested.metabolize() + if(bloodstr) bloodstr.metabolize() if(CE_PAINKILLER in chem_effects) analgesic = chem_effects[CE_PAINKILLER] diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index d5364e40c2..495046362a 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -4,8 +4,10 @@ var/maximum_volume = 100 var/atom/my_atom = null -/datum/reagents/New(var/max = 100) - maximum_volume = max +/datum/reagents/New(var/max = 100, atom/A = null) + maximum_volume = max + my_atom = A + //I dislike having these here but map-objects are initialised before world/New() is called. >_> if(!chemical_reagents_list) //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id @@ -414,18 +416,7 @@ return trans_to_holder(target.reagents, amount, multiplier, copy) -/datum/reagents/proc/metabolize(var/alien, var/location) - if(!iscarbon(my_atom)) - return - var/mob/living/carbon/C = my_atom - if(!C || !istype(C)) - return - for(var/datum/reagent/current in reagent_list) - current.on_mob_life(C, alien, location) - update_total() - /* Atom reagent creation - use it all the time */ /atom/proc/create_reagents(var/max_vol) - reagents = new/datum/reagents(max_vol) - reagents.my_atom = src + reagents = new/datum/reagents(max_vol, src) diff --git a/code/modules/reagents/Chemistry-Metabolism.dm b/code/modules/reagents/Chemistry-Metabolism.dm index 63f055d035..74ef2d4730 100644 --- a/code/modules/reagents/Chemistry-Metabolism.dm +++ b/code/modules/reagents/Chemistry-Metabolism.dm @@ -1,17 +1,21 @@ /datum/reagents/metabolism - var/metabolism_type + var/metabolism_class //CHEM_TOUCH, CHEM_INGEST, or CHEM_BLOOD + var/mob/living/carbon/parent -/datum/reagents/metabolism/New(var/max = 100, var/met_type, mob/living/carbon/parent_mob) - ..() - metabolism_type = met_type - my_atom = parent_mob +/datum/reagents/metabolism/New(var/max = 100, mob/living/carbon/parent_mob, var/met_class) + ..(max, parent_mob) + + metabolism_class = met_class + if(istype(parent_mob)) + parent = parent_mob -/datum/reagents/proc/metabolize(var/alien) - if(!iscarbon(my_atom)) - return - var/mob/living/carbon/C = my_atom - if(!C || !istype(C)) - return +/datum/reagents/metabolism/proc/metabolize() + + var/metabolism_type = 0 //non-human mobs + if(ishuman(parent)) + var/mob/living/carbon/human/H = parent + metabolism_type = H.species.reagent_tag + for(var/datum/reagent/current in reagent_list) - current.on_mob_life(C, alien, metabolism_type) + current.on_mob_life(parent, metabolism_type, metabolism_class) update_total() \ No newline at end of file From a60b91fd1bfb2a9ea2e8067f69e260f4509191f4 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Wed, 17 Jun 2015 10:00:35 +0100 Subject: [PATCH 09/11] Adds a new configuration value, SERVERURL, for the IRC bot to use if set --- code/controllers/configuration.dm | 4 ++++ code/modules/ext_scripts/irc.dm | 2 +- config/example/config.txt | 24 ++++++++++++++---------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index caed2c734c..166582a227 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -86,6 +86,7 @@ var/guests_allowed = 1 var/debugparanoid = 0 + var/serverurl var/server var/banappeals var/wikiurl @@ -365,6 +366,9 @@ if ("hostedby") config.hostedby = value + if ("serverurl") + config.serverurl = value + if ("server") config.server = value diff --git a/code/modules/ext_scripts/irc.dm b/code/modules/ext_scripts/irc.dm index 8006652139..aa8f9f3a7f 100644 --- a/code/modules/ext_scripts/irc.dm +++ b/code/modules/ext_scripts/irc.dm @@ -26,6 +26,6 @@ /hook/startup/proc/ircNotify() - send2mainirc("Server starting up on [config.server? "byond://[config.server]" : "byond://[world.address]:[world.port]"]") + send2mainirc("Server starting up on byond://[config.serverurl ? config.serverurl : (config.server ? config.server : "[world.address]:[world.port]")]") return 1 diff --git a/config/example/config.txt b/config/example/config.txt index 6119ab7cfd..f38e66f46f 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -73,12 +73,12 @@ LOG_PDA ## disconnect players who did nothing during 10 minutes # KICK_INACTIVE -## Use Mentors instead of Moderators. Mentors are designed with the idea that -###they help in pushing new people to be better at roleplay. If you uncomment -###this it will reduce the rights that your mods have. -#MENTORS - - +## Use Mentors instead of Moderators. Mentors are designed with the idea that +###they help in pushing new people to be better at roleplay. If you uncomment +###this it will reduce the rights that your mods have. +#MENTORS + + ## probablities for game modes chosen in "secret" and "random" modes ## ## default probablity is 1, increase to make that mode more likely to be picked @@ -100,9 +100,9 @@ TRAITOR_SCALING ## if objectives are disabled #OBJECTIVES_DISABLED -## make ERT's be only called by admins -#ERT_ADMIN_ONLY - +## make ERT's be only called by admins +#ERT_ADMIN_ONLY + ## If security is prohibited from being most antagonists #PROTECT_ROLES_FROM_ANTAGONIST @@ -171,6 +171,10 @@ GUEST_BAN ## set a server location for world reboot. Don't include the byond://, just give the address and port. #SERVER server.net:port +## set a server URL for the IRC bot to use; like SERVER, don't include the byond:// +## Unlike SERVER, this one shouldn't break auto-reconnect +#SERVERURL server.net:port + ## forum address # FORUMURL http://example.com @@ -265,7 +269,7 @@ REQ_CULT_GHOSTWRITER 6 CHARACTER_SLOTS 10 ## Uncomment to use overmap system for zlevel travel -#USE_OVERMAP +#USE_OVERMAP ## Defines which Z-levels the station exists on. STATION_LEVELS 1 From 8d232e930405760d09cb6ada1f53f67be46f680e Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Thu, 18 Jun 2015 18:34:55 +0100 Subject: [PATCH 10/11] Adds support for bots which use world.Export() for server-to-bot communication --- code/controllers/configuration.dm | 4 ++++ code/modules/ext_scripts/irc.dm | 25 ++++++++++++++----------- config/example/config.txt | 23 +++++++++++++---------- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index caed2c734c..442008d806 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -153,6 +153,7 @@ var/use_irc_bot = 0 var/irc_bot_host = "" + var/irc_bot_export = 0 // whether the IRC bot in use is a Bot32 (or similar) instance; Bot32 uses world.Export() instead of nudge.py/libnudge var/main_irc = "" var/admin_irc = "" var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix @@ -479,6 +480,9 @@ if("use_irc_bot") use_irc_bot = 1 + if("irc_bot_export") + irc_bot_export = 1 + if("ticklag") Ticklag = text2num(value) diff --git a/code/modules/ext_scripts/irc.dm b/code/modules/ext_scripts/irc.dm index 8006652139..05a3430b7f 100644 --- a/code/modules/ext_scripts/irc.dm +++ b/code/modules/ext_scripts/irc.dm @@ -1,17 +1,20 @@ /proc/send2irc(var/channel, var/msg) if(config.use_irc_bot && config.irc_bot_host) - if(config.use_lib_nudge) - var/nudge_lib - if(world.system_type == MS_WINDOWS) - nudge_lib = "lib\\nudge.dll" - else - nudge_lib = "lib/nudge.so" - - spawn(0) - call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]") + if(config.irc_bot_export) + world.Export("http://[config.irc_bot_host]:45678?[list2params(list(pwd=config.comms_password, chan=channel, mesg=msg))]") else - spawn(0) - ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]") + if(config.use_lib_nudge) + var/nudge_lib + if(world.system_type == MS_WINDOWS) + nudge_lib = "lib\\nudge.dll" + else + nudge_lib = "lib/nudge.so" + + spawn(0) + call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]") + else + spawn(0) + ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]") return /proc/send2mainirc(var/msg) diff --git a/config/example/config.txt b/config/example/config.txt index 6119ab7cfd..d6dc496578 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -73,12 +73,12 @@ LOG_PDA ## disconnect players who did nothing during 10 minutes # KICK_INACTIVE -## Use Mentors instead of Moderators. Mentors are designed with the idea that -###they help in pushing new people to be better at roleplay. If you uncomment -###this it will reduce the rights that your mods have. -#MENTORS - - +## Use Mentors instead of Moderators. Mentors are designed with the idea that +###they help in pushing new people to be better at roleplay. If you uncomment +###this it will reduce the rights that your mods have. +#MENTORS + + ## probablities for game modes chosen in "secret" and "random" modes ## ## default probablity is 1, increase to make that mode more likely to be picked @@ -100,9 +100,9 @@ TRAITOR_SCALING ## if objectives are disabled #OBJECTIVES_DISABLED -## make ERT's be only called by admins -#ERT_ADMIN_ONLY - +## make ERT's be only called by admins +#ERT_ADMIN_ONLY + ## If security is prohibited from being most antagonists #PROTECT_ROLES_FROM_ANTAGONIST @@ -238,6 +238,9 @@ USEALIENWHITELIST ## Uncomment to enable sending data to the IRC bot. #USE_IRC_BOT +## Uncomment if the IRC bot requires using world.Export() instead of nudge.py/libnudge +#IRC_BOT_EXPORT + ## Host where the IRC bot is hosted. Port 45678 needs to be open. #IRC_BOT_HOST localhost @@ -265,7 +268,7 @@ REQ_CULT_GHOSTWRITER 6 CHARACTER_SLOTS 10 ## Uncomment to use overmap system for zlevel travel -#USE_OVERMAP +#USE_OVERMAP ## Defines which Z-levels the station exists on. STATION_LEVELS 1 From 839b26f9272e504c7f85b765e2e823e9b2dce79b Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Fri, 19 Jun 2015 09:56:16 +0200 Subject: [PATCH 11/11] Changelog entry. --- html/changelog.html | 12 ++++++++++++ html/changelogs/.all_changelog.yml | 15 +++++++++++++++ html/changelogs/HarpyEagle-dev-freeze.yml | 13 ++----------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/html/changelog.html b/html/changelog.html index 3acfe08828..ca9cb73ae7 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,18 @@ -->
+

19 June 2015

+

HarpyEagle updated:

+
    +
  • Prevents being on fire from merely warming mobs up slightly in some cases. Mob fires also burn hotter.
  • +
  • Matches can now be used to light things adjacent to you when thrown.
  • +
  • Made the effects of having a damaged robotic leg more prominent.
  • +
  • Robot limbs no longer cause pain messages. A reminder that you can still check their status with 'Help Intent' -> 'Click Self'.
  • +
  • Knifing damage scales with weapon force and throat protection. Helmets only provide throat protection if they are air tight. Trying to cut someone's throat with wirecutters and/or while wearing an armoured sealed helmet will require several attempts before the victim passes out.
  • +
  • Knifing switches on harm intent, in case you just wanted to beat on the victim for some reason.
  • +
  • Prevents knifing bots or silicons.
  • +
+

05 June 2015

PsiOmegaDelta updated:

    diff --git a/html/changelogs/.all_changelog.yml b/html/changelogs/.all_changelog.yml index a2b465ccab..aef75f37bd 100644 --- a/html/changelogs/.all_changelog.yml +++ b/html/changelogs/.all_changelog.yml @@ -1883,3 +1883,18 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py. PsiOmegaDelta: - bugfix: Split stacks no longer lose their coloring. - tweak: Can no longer merge cables of different colors. +2015-06-19: + HarpyEagle: + - bugfix: Prevents being on fire from merely warming mobs up slightly in some cases. + Mob fires also burn hotter. + - rscadd: Matches can now be used to light things adjacent to you when thrown. + - tweak: Made the effects of having a damaged robotic leg more prominent. + - bugfix: Robot limbs no longer cause pain messages. A reminder that you can still + check their status with 'Help Intent' -> 'Click Self'. + - tweak: Knifing damage scales with weapon force and throat protection. Helmets + only provide throat protection if they are air tight. Trying to cut someone's + throat with wirecutters and/or while wearing an armoured sealed helmet will + require several attempts before the victim passes out. + - tweak: Knifing switches on harm intent, in case you just wanted to beat on the + victim for some reason. + - bugfix: Prevents knifing bots or silicons. diff --git a/html/changelogs/HarpyEagle-dev-freeze.yml b/html/changelogs/HarpyEagle-dev-freeze.yml index 7302d8c9ce..a999f1236d 100644 --- a/html/changelogs/HarpyEagle-dev-freeze.yml +++ b/html/changelogs/HarpyEagle-dev-freeze.yml @@ -1,12 +1,3 @@ author: HarpyEagle - -delete-after: False - -changes: - - bugfix: "Prevents being on fire from merely warming mobs up slightly in some cases. Mob fires also burn hotter." - - rscadd: "Matches can now be used to light things adjacent to you when thrown." - - tweak: "Made the effects of having a damaged robotic leg more prominent." - - bugfix: "Robot limbs no longer cause pain messages. A reminder that you can still check their status with 'Help Intent' -> 'Click Self'." - - tweak: "Knifing damage scales with weapon force and throat protection. Helmets only provide throat protection if they are air tight. Trying to cut someone's throat with wirecutters and/or while wearing an armoured sealed helmet will require several attempts before the victim passes out." - - tweak: "Knifing switches on harm intent, in case you just wanted to beat on the victim for some reason." - - bugfix: "Prevents knifing bots or silicons." +changes: [] +delete-after: false