Skip to content

Commit

Permalink
[MIRROR] basic cleanbots refactor and new janitor skillchip [MDB IGNO…
Browse files Browse the repository at this point in the history
…RE] (#25511)

* basic cleanbots refactor and new janitor skillchip

* Update medbot.dm

* UpdatePaths

---------

Co-authored-by: Ben10Omintrix <[email protected]>
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
3 people authored and FFMirrorBot committed Dec 9, 2023
1 parent 0430061 commit 150ef6b
Show file tree
Hide file tree
Showing 38 changed files with 776 additions and 542 deletions.
4 changes: 2 additions & 2 deletions _maps/RandomRuins/SpaceRuins/oldstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,12 @@
pixel_y = 2;
pixel_x = 6
},
/mob/living/simple_animal/bot/cleanbot/autopatrol{
/mob/living/basic/bot/cleanbot/autopatrol{
bot_mode_flags = 12;
name = "Ramboo";
pixel_x = -2;
pixel_y = 5;
bot_cover_flags = 0
bot_access_flags = 0
},
/turf/open/floor/plating{
initial_gas_mix = "co2=6;o2=16;n2=82;TEMP=293.15"
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/spacehotel_skyrat.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@
dir = 9
},
/obj/effect/decal/cleanable/cobweb,
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron,
/area/ruin/space/has_grav/hotel/custodial)
"hL" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -12405,7 +12405,7 @@
pixel_x = 9;
pixel_y = 2
},
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/obj/machinery/ai_slipper{
uses = 10
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/IceBoxStation/IceBoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -52996,7 +52996,7 @@
/obj/effect/turf_decal/tile/blue{
dir = 8
},
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/turret_protected/aisat/service)
"qhp" = (
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3473,7 +3473,7 @@
/obj/machinery/light/small/directional/east,
/obj/machinery/firealarm/directional/east,
/obj/effect/turf_decal/tile/blue,
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/turret_protected/aisat_interior)
"bkF" = (
Expand Down Expand Up @@ -11435,7 +11435,7 @@
/turf/open/floor/iron,
/area/station/hallway/primary/fore)
"eih" = (
/mob/living/simple_animal/bot/cleanbot/medbay,
/mob/living/basic/bot/cleanbot/medbay,
/turf/open/floor/iron/white,
/area/station/medical/storage)
"eiO" = (
Expand Down Expand Up @@ -64698,7 +64698,7 @@
dir = 4
},
/obj/effect/turf_decal/tile/neutral,
/mob/living/simple_animal/bot/cleanbot/autopatrol,
/mob/living/basic/bot/cleanbot/autopatrol,
/turf/open/floor/iron,
/area/station/hallway/primary/central)
"wUt" = (
Expand Down
10 changes: 5 additions & 5 deletions _maps/map_files/NSVBlueshift/Blueshift.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -11877,7 +11877,7 @@
/turf/open/floor/iron/dark/side,
/area/station/security/prison/shower)
"cnL" = (
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/obj/structure/railing,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/turret_protected/aisat_interior)
Expand Down Expand Up @@ -24539,7 +24539,7 @@
"eGG" = (
/obj/structure/cable,
/obj/effect/landmark/event_spawn,
/mob/living/simple_animal/bot/cleanbot{
/mob/living/basic/bot/cleanbot{
name = "Soapficcer Cleansky"
},
/obj/structure/disposalpipe/segment{
Expand Down Expand Up @@ -36813,7 +36813,7 @@
/obj/effect/landmark/start/medical_doctor,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/mob/living/simple_animal/bot/cleanbot/medbay,
/mob/living/basic/bot/cleanbot/medbay,
/obj/item/beacon,
/turf/open/floor/iron/white,
/area/station/medical/medbay/central)
Expand Down Expand Up @@ -59165,7 +59165,7 @@
/obj/effect/landmark/event_spawn,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/mob/living/simple_animal/bot/cleanbot{
/mob/living/basic/bot/cleanbot{
name = "Sweeps-The-Tiles"
},
/turf/open/floor/iron,
Expand Down Expand Up @@ -114073,7 +114073,7 @@
/turf/open/floor/catwalk_floor/iron_smooth,
/area/station/cargo/miningdock)
"vIy" = (
/mob/living/simple_animal/bot/cleanbot/autopatrol,
/mob/living/basic/bot/cleanbot/autopatrol,
/obj/structure/cable,
/turf/open/floor/iron/goonplaque,
/area/station/hallway/primary/central/aft)
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/NorthStar/north_star.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2976,7 +2976,7 @@
/area/station/commons/fitness)
"aOw" = (
/obj/machinery/light/small/directional/north,
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/turret_protected/aisat_interior)
"aOx" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/VoidRaptor/VoidRaptor.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -46614,7 +46614,7 @@
/turf/open/floor/iron/dark/smooth_large,
/area/station/medical/morgue)
"nfC" = (
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/obj/structure/railing,
/turf/open/floor/circuit,
/area/station/ai_monitored/turret_protected/aisat_interior)
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/generic/CentCom_skyrat_z2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@
/turf/open/floor/iron/showroomfloor,
/area/centcom/holding/cafe)
"atf" = (
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/indestructible/hotelwood,
/area/centcom/holding/cafe)
"ati" = (
Expand Down
4 changes: 2 additions & 2 deletions _maps/map_files/tramstation/tramstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -15550,7 +15550,7 @@
/obj/machinery/atmospherics/components/unary/vent_scrubber/on/layer2{
dir = 1
},
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/turret_protected/aisat_interior)
"esA" = (
Expand Down Expand Up @@ -70301,7 +70301,7 @@
},
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/turret_protected/aisat/maint)
"xZi" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_casino.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@
"MS" = (
/obj/structure/mop_bucket,
/obj/item/mop,
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/mineral/titanium/yellow,
/area/shuttle/escape)
"MT" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_shadow.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@
/turf/open/floor/eighties,
/area/shuttle/escape)
"RV" = (
/mob/living/simple_animal/bot/cleanbot{
/mob/living/basic/bot/cleanbot{
name = "Mopsy"
},
/obj/machinery/holopad,
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_tranquility.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@
/obj/effect/turf_decal/siding/wood{
dir = 9
},
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/obj/machinery/vending/wallmed/directional/south,
/turf/open/floor/wood,
/area/shuttle/escape)
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/ruin_cyborg_mothership.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/turf/open/floor/plating/airless,
/area/shuttle/ruin/cyborg_mothership)
"bE" = (
/mob/living/simple_animal/bot/cleanbot,
/mob/living/basic/bot/cleanbot,
/turf/open/floor/iron/showroomfloor,
/area/shuttle/ruin/cyborg_mothership)
"cU" = (
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/ai/ai_blackboard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@
#define BB_BASIC_MOB_REINFORCEMENT_TARGET "BB_basic_mob_reinforcement_target"
/// The next time at which this mob can call for reinforcements
#define BB_BASIC_MOB_REINFORCEMENTS_COOLDOWN "BB_basic_mob_reinforcements_cooldown"

///Text we display when we befriend someone
#define BB_FRIENDLY_MESSAGE "friendly_message"
22 changes: 22 additions & 0 deletions code/__DEFINES/ai/bot_keys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,25 @@
#define BB_NEAR_DEATH_SPEECH "near_death_speech"
///in crit patient we must alert medbay about
#define BB_PATIENT_IN_CRIT "patient_in_crit"

// cleanbots
///key that holds the foaming ability
#define BB_CLEANBOT_FOAM "cleanbot_foam"
///key that holds decals we hunt
#define BB_CLEANABLE_DECALS "cleanable_decals"
///key that holds blood we hunt
#define BB_CLEANABLE_BLOOD "cleanable_blood"
///key that holds pests we hunt
#define BB_HUNTABLE_PESTS "huntable_pests"
///key that holds emagged speech
#define BB_CLEANBOT_EMAGGED_PHRASES "emagged_phrases"
///key that holds drawings we hunt
#define BB_CLEANABLE_DRAWINGS "cleanable_drawings"
///Key that holds our clean target
#define BB_CLEAN_TARGET "clean_target"
///key that holds the janitor we will befriend
#define BB_FRIENDLY_JANITOR "friendly_janitor"
///key that holds the victim we will spray
#define BB_ACID_SPRAY_TARGET "acid_spray_target"
///key that holds trash we will burn
#define BB_HUNTABLE_TRASH "huntable_trash"
3 changes: 3 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// Trait given to foam darts that have an insert in them
#define TRAIT_DART_HAS_INSERT "dart_has_insert"

///Trait granted by janitor skillchip, allows communication with cleanbots
#define TRAIT_CLEANBOT_WHISPERER "cleanbot_whisperer"

/// Trait given when a mob is currently in invisimin mode
#define TRAIT_INVISIMIN "invisimin"

Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_CHEF_KISS" = TRAIT_CHEF_KISS,
"TRAIT_CHUNKYFINGERS_IGNORE_BATON" = TRAIT_CHUNKYFINGERS_IGNORE_BATON,
"TRAIT_CHUNKYFINGERS" = TRAIT_CHUNKYFINGERS,
"TRAIT_CLEANBOT_WHISPERER" = TRAIT_CLEANBOT_WHISPERER,
"TRAIT_CLIFF_WALKER" = TRAIT_CLIFF_WALKER,
"TRAIT_CLOWN_ENJOYER" = TRAIT_CLOWN_ENJOYER,
"TRAIT_CLUMSY" = TRAIT_CLUMSY,
Expand Down
21 changes: 21 additions & 0 deletions code/datums/ai/basic_mobs/basic_ai_behaviors/befriend_target.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
///behavior to befriend any targets
/datum/ai_behavior/befriend_target

/datum/ai_behavior/befriend_target/perform(seconds_per_tick, datum/ai_controller/controller, target_key, befriend_message)
. = ..()
var/mob/living/living_pawn = controller.pawn
var/mob/living/living_target = controller.blackboard[target_key]
if(QDELETED(living_target))
finish_action(controller, FALSE, target_key)
return

living_pawn.befriend(living_target)
var/befriend_text = controller.blackboard[befriend_message]
if(befriend_text)
to_chat(living_target, span_nicegreen("[living_pawn] [befriend_text]"))

finish_action(controller, TRUE, target_key)

/datum/ai_behavior/befriend_target/finish_action(datum/ai_controller/controller, succeeded, target_key)
. = ..()
controller.clear_blackboard_key(target_key)
4 changes: 3 additions & 1 deletion code/datums/components/cleaner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,16 @@
cleaning_duration = (cleaning_duration * min(user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER)+skill_duration_modifier_offset, 1))

//do the cleaning
var/clean_succeeded = FALSE
if(do_after(user, cleaning_duration, target = target))
clean_succeeded = TRUE
if(clean_target)
for(var/obj/effect/decal/cleanable/cleanable_decal in target) //it's important to do this before you wash all of the cleanables off
user.mind?.adjust_experience(/datum/skill/cleaning, round(cleanable_decal.beauty / CLEAN_SKILL_BEAUTY_ADJUSTMENT))
if(target.wash(cleaning_strength))
user.mind?.adjust_experience(/datum/skill/cleaning, round(CLEAN_SKILL_GENERIC_WASH_XP))
on_cleaned_callback?.Invoke(source, target, user)

on_cleaned_callback?.Invoke(source, target, user, clean_succeeded)
//remove the cleaning overlay
target.cut_overlay(low_bubble)
target.cut_overlay(high_bubble)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/crafting/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/datum/crafting_recipe/cleanbot
name = "Cleanbot"
result = /mob/living/simple_animal/bot/cleanbot
result = /mob/living/basic/bot/cleanbot
reqs = list(
/obj/item/reagent_containers/cup/bucket = 1,
/obj/item/assembly/prox_sensor = 1,
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/clown_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@
* * target - The atom that is being cleaned
* * user - The mob that is using the soap to clean.
*/
/obj/item/soap/proc/decreaseUses(datum/source, atom/target, mob/living/user)
/obj/item/soap/proc/decreaseUses(datum/source, atom/target, mob/living/user, clean_succeeded)
if(!clean_succeeded)
return
var/skillcheck = 1
if(user?.mind)
skillcheck = user.mind.get_skill_modifier(/datum/skill/cleaning, SKILL_SPEED_MODIFIER)
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/mop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
* * cleaned_turf the turf that is being cleaned
* * cleaner the mob that is doing the cleaning
*/
/obj/item/mop/proc/apply_reagents(datum/cleaning_source, turf/cleaned_turf, mob/living/cleaner)
/obj/item/mop/proc/apply_reagents(datum/cleaning_source, turf/cleaned_turf, mob/living/cleaner, clean_succeeded)
if(!clean_succeeded)
return
reagents.expose(cleaned_turf, TOUCH, 10) //Needed for proper floor wetting.
var/val2remove = 1
if(cleaner?.mind)
Expand Down
1 change: 1 addition & 0 deletions code/modules/jobs/job_types/janitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
uniform = /obj/item/clothing/under/rank/civilian/janitor
belt = /obj/item/modular_computer/pda/janitor
ears = /obj/item/radio/headset/headset_srv
skillchips = list(/obj/item/skillchip/job/janitor)

/datum/outfit/job/janitor/pre_equip(mob/living/carbon/human/human_equipper, visuals_only)
. = ..()
Expand Down
9 changes: 9 additions & 0 deletions code/modules/library/skill_learning/job_skillchips/janitor.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/obj/item/skillchip/job/janitor
name = "CL34NM4ST.R skillchip"
desc = "Become a cleanbot whisperer."
auto_traits = list(TRAIT_CLEANBOT_WHISPERER)
skill_name = "Voice Of The Voiceless"
skill_description = "Gain the affection of all thankless, hardworking cleanbots on the station."
skill_icon = "broom"
activate_message = span_notice("You start feeling empathetic towards all the cleanbots on the station.")
deactivate_message = span_notice("You forget why you felt any sympathy towards the cleanbots, they are just robots after all.")
Loading

0 comments on commit 150ef6b

Please sign in to comment.