diff --git a/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm b/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm index 23a029d04e9..685c62f28f9 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm @@ -225,7 +225,7 @@ /turf/open/floor/wood, /area/ruin/powered/beach) "fS" = ( -/mob/living/simple_animal/crab{ +/mob/living/basic/crab{ name = "Jonny" }, /turf/open/misc/beach/sand, @@ -581,7 +581,7 @@ /turf/closed/wall/mineral/wood/nonmetal, /area/ruin/powered/beach) "sA" = ( -/mob/living/simple_animal/crab{ +/mob/living/basic/crab{ name = "Jon" }, /turf/open/misc/beach/sand, @@ -739,7 +739,7 @@ /area/ruin/powered/beach) "AB" = ( /obj/effect/turf_decal/sand, -/mob/living/simple_animal/crab{ +/mob/living/basic/crab{ name = "James" }, /turf/open/misc/beach/sand, @@ -1244,7 +1244,7 @@ /area/ruin/powered/beach) "SC" = ( /obj/machinery/light/directional/north, -/mob/living/simple_animal/crab{ +/mob/living/basic/crab{ name = "Eddie" }, /turf/open/misc/beach/sand, diff --git a/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm b/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm index eb34871246d..ef7740fcc1e 100644 --- a/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm +++ b/_maps/RandomRuins/SpaceRuins/abandonedzoo.dmm @@ -203,7 +203,7 @@ /turf/open/floor/plating, /area/ruin/space/has_grav/abandonedzoo) "bJ" = ( -/mob/living/simple_animal/crab{ +/mob/living/basic/crab{ faction = list("carp") }, /turf/open/floor/plating, diff --git a/_maps/RandomRuins/SpaceRuins/anomaly_research.dmm b/_maps/RandomRuins/SpaceRuins/anomaly_research.dmm index ad925a3baf1..86c0549778b 100644 --- a/_maps/RandomRuins/SpaceRuins/anomaly_research.dmm +++ b/_maps/RandomRuins/SpaceRuins/anomaly_research.dmm @@ -981,11 +981,6 @@ "AV" = ( /turf/closed/wall, /area/misc/anomaly_research) -"Bc" = ( -/obj/effect/decal/cleanable/dirt, -/obj/effect/turf_decal/tile/purple/opposingcorners, -/turf/open/floor/iron/white, -/area/misc/anomaly_research) "Bq" = ( /obj/effect/turf_decal/tile/purple/fourcorners, /obj/effect/decal/cleanable/dirt, @@ -2980,7 +2975,7 @@ rX xo xo aX -Bc +ek Cl xE xE @@ -3018,7 +3013,7 @@ Ew AV lL QP -Bc +ek Cl xE xE @@ -3056,7 +3051,7 @@ QI AV SQ Iw -Bc +ek Cl Cl AV @@ -3095,8 +3090,8 @@ AV wz Iw Ov -Bc -Bc +ek +ek AV Ya xE @@ -3134,7 +3129,7 @@ GI Iw iK wg -Bc +ek AV Ya xE @@ -3172,7 +3167,7 @@ ok Iw uB oq -Bc +ek AV Ya xE @@ -3210,7 +3205,7 @@ sg Iw hU Ia -Bc +ek AV Ya Ya @@ -3361,7 +3356,7 @@ kY oK ip ii -Bc +ek Iw fe YA @@ -3399,7 +3394,7 @@ Gr mC nh cA -Bc +ek ZL Ng Ox @@ -3515,7 +3510,7 @@ ut cA Cf sE -Bc +ek xQ AV jN diff --git a/_maps/RandomZLevels/TheBeach.dmm b/_maps/RandomZLevels/TheBeach.dmm index d2f43e6dcbc..18d0a7fdc86 100644 --- a/_maps/RandomZLevels/TheBeach.dmm +++ b/_maps/RandomZLevels/TheBeach.dmm @@ -137,7 +137,7 @@ /turf/open/misc/beach/sand, /area/awaymission/beach) "aB" = ( -/mob/living/simple_animal/crab/kreb, +/mob/living/basic/crab/kreb, /turf/open/misc/beach/sand, /area/awaymission/beach) "aC" = ( @@ -177,7 +177,7 @@ /turf/open/water/beach, /area/awaymission/beach) "aK" = ( -/mob/living/simple_animal/crab, +/mob/living/basic/crab, /turf/open/misc/beach/sand, /area/awaymission/beach) "aO" = ( diff --git a/_maps/map_files/Basketball/beach_bums.dmm b/_maps/map_files/Basketball/beach_bums.dmm index 06ea7084054..aa5948a34e6 100644 --- a/_maps/map_files/Basketball/beach_bums.dmm +++ b/_maps/map_files/Basketball/beach_bums.dmm @@ -214,7 +214,7 @@ }, /area/centcom/basketball) "yY" = ( -/mob/living/simple_animal/crab, +/mob/living/basic/crab, /turf/open/misc/beach/sand, /area/centcom/basketball) "zk" = ( @@ -313,7 +313,7 @@ /turf/open/water/beach, /area/centcom/basketball) "Fy" = ( -/mob/living/simple_animal/crab/kreb, +/mob/living/basic/crab/kreb, /turf/open/misc/beach/sand, /area/centcom/basketball) "FS" = ( diff --git a/_maps/map_files/NorthStar/north_star.dmm b/_maps/map_files/NorthStar/north_star.dmm index 74c08955b0d..271eae94818 100644 --- a/_maps/map_files/NorthStar/north_star.dmm +++ b/_maps/map_files/NorthStar/north_star.dmm @@ -91595,7 +91595,7 @@ /turf/open/floor/iron, /area/station/engineering/atmos) "xVl" = ( -/mob/living/simple_animal/crab, +/mob/living/basic/crab, /obj/structure/railing{ dir = 1 }, diff --git a/_maps/map_files/tramstation/maintenance_modules/medsciupper_attachment_a_2.dmm b/_maps/map_files/tramstation/maintenance_modules/medsciupper_attachment_a_2.dmm index 6683f8a23e3..1b839b3bc32 100644 --- a/_maps/map_files/tramstation/maintenance_modules/medsciupper_attachment_a_2.dmm +++ b/_maps/map_files/tramstation/maintenance_modules/medsciupper_attachment_a_2.dmm @@ -23,7 +23,7 @@ /turf/open/floor/iron/white, /area/station/maintenance/department/science) "m" = ( -/mob/living/simple_animal/crab{ +/mob/living/basic/crab{ name = "la creatura"; desc = "ay dios mios..." }, diff --git a/_maps/shuttles/emergency_cere.dmm b/_maps/shuttles/emergency_cere.dmm index 6e50e7e4c77..c964d37011f 100644 --- a/_maps/shuttles/emergency_cere.dmm +++ b/_maps/shuttles/emergency_cere.dmm @@ -1026,10 +1026,6 @@ /obj/machinery/light/small/directional/east, /turf/open/floor/iron, /area/shuttle/escape) -"OU" = ( -/obj/item/kirbyplants/organic/plant21, -/turf/open/floor/iron, -/area/shuttle/escape) "PD" = ( /obj/structure/chair/comfy/beige{ dir = 1 @@ -1203,7 +1199,7 @@ bc bc bc bc -OU +ej gy Zw aZ @@ -1520,7 +1516,7 @@ aZ aZ aZ bc -OU +ej ab dd bc diff --git a/_maps/shuttles/emergency_delta.dmm b/_maps/shuttles/emergency_delta.dmm index 2be5a663004..14a6c123b85 100644 --- a/_maps/shuttles/emergency_delta.dmm +++ b/_maps/shuttles/emergency_delta.dmm @@ -955,16 +955,6 @@ }, /turf/open/floor/iron, /area/shuttle/escape) -"AX" = ( -/obj/item/kirbyplants/organic/plant21{ - pixel_x = -3; - pixel_y = 3 - }, -/obj/effect/turf_decal/tile/neutral/half/contrasted{ - dir = 8 - }, -/turf/open/floor/iron, -/area/shuttle/escape) "En" = ( /obj/item/kirbyplants/organic/plant21{ pixel_x = -3; @@ -1142,7 +1132,7 @@ ab ad af ah -AX +nU av av aH @@ -1154,7 +1144,7 @@ nU av av av -AX +nU aE af pd diff --git a/_maps/shuttles/emergency_luxury.dmm b/_maps/shuttles/emergency_luxury.dmm index 6341f8d7dc7..1d6dfce2664 100644 --- a/_maps/shuttles/emergency_luxury.dmm +++ b/_maps/shuttles/emergency_luxury.dmm @@ -927,11 +927,6 @@ /obj/item/storage/box/fireworks/dangerous, /turf/open/floor/carpet/green, /area/shuttle/escape/luxury) -"KC" = ( -/obj/effect/decal/cleanable/dirt, -/obj/effect/decal/cleanable/glass, -/turf/open/floor/plating, -/area/shuttle/escape) "KE" = ( /obj/structure/chair/comfy/shuttle{ dir = 1 @@ -1461,7 +1456,7 @@ zR JO KE kJ -KC +rh ty kJ Yb diff --git a/_maps/shuttles/whiteship_birdshot.dmm b/_maps/shuttles/whiteship_birdshot.dmm index a240978c38b..cdc9011daa7 100644 --- a/_maps/shuttles/whiteship_birdshot.dmm +++ b/_maps/shuttles/whiteship_birdshot.dmm @@ -1008,13 +1008,6 @@ }, /turf/open/floor/iron/small, /area/shuttle/abandoned/bar) -"Gh" = ( -/obj/effect/decal/cleanable/dirt, -/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden{ - dir = 4 - }, -/turf/open/floor/iron/smooth_large, -/area/shuttle/abandoned/cargo) "Gi" = ( /turf/closed/wall/mineral/titanium, /area/shuttle/abandoned/engine) @@ -1365,11 +1358,6 @@ /obj/effect/decal/cleanable/dirt, /turf/open/floor/iron/smooth_large, /area/shuttle/abandoned/cargo) -"Sx" = ( -/obj/effect/decal/cleanable/dirt, -/obj/structure/cable, -/turf/open/floor/iron/smooth_large, -/area/shuttle/abandoned/cargo) "SZ" = ( /obj/effect/turf_decal/box/white/corners{ dir = 8 @@ -1698,7 +1686,7 @@ kQ DK er er -Gh +er kQ Vp AV @@ -1709,8 +1697,8 @@ AV Vp kQ uF -Sx -Sx +uF +uF BR kQ ma diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm index d5c6a188852..d7063b0df5f 100644 --- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm @@ -38,7 +38,7 @@ #define COMSIG_BLOCK_RELAYMOVE (1<<0) /// From base of atom/setDir(): (old_dir, new_dir). Called before the direction changes -#define COMSIG_ATOM_PRE_DIR_CHANGE "mob_pre_face_atom" +#define COMSIG_ATOM_PRE_DIR_CHANGE "atom_pre_face_atom" #define COMPONENT_ATOM_BLOCK_DIR_CHANGE (1<<0) ///from base of atom/setDir(): (old_dir, new_dir). Called before the direction changes. #define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" @@ -53,3 +53,5 @@ #define COMSIG_ATOM_PRE_PRESSURE_PUSH "atom_pre_pressure_push" ///prevents pressure movement #define COMSIG_ATOM_BLOCKS_PRESSURE (1<<0) +///From base of /datum/move_loop/process() after attempting to move a movable: (datum/move_loop/loop, old_dir) +#define COMSIG_MOVABLE_MOVED_FROM_LOOP "movable_moved_from_loop" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm index 957171e34bf..2c80f3f1985 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm @@ -42,7 +42,7 @@ #define MOVE_ARG_NEW_LOC 1 /// The arugment of move_args which dictates our movement direction #define MOVE_ARG_DIRECTION 2 -/// From base of /client/Move() +/// From base of /client/Move(): (direction, old_dir) #define COMSIG_MOB_CLIENT_MOVED "mob_client_moved" /// From base of /client/proc/change_view() (mob/source, new_size) #define COMSIG_MOB_CLIENT_CHANGE_VIEW "mob_client_change_view" diff --git a/code/__DEFINES/movement.dm b/code/__DEFINES/movement.dm index 1c2f1b4fba1..f71871f964a 100644 --- a/code/__DEFINES/movement.dm +++ b/code/__DEFINES/movement.dm @@ -43,7 +43,7 @@ GLOBAL_VAR_INIT(glide_size_multiplier, 1.0) * Returns a bitfield containing flags both present in `flags` arg and the `processing_move_loop_flags` move_packet variable. * Has no use outside of procs called within the movement proc chain. */ -#define CHECK_MOVE_LOOP_FLAGS(movable, flags) (movable.move_packet ? (movable.move_packet.processing_move_loop_flags & flags) : NONE) +#define CHECK_MOVE_LOOP_FLAGS(movable, flags) (movable.move_packet ? (movable.move_packet.processing_move_loop_flags & (flags)) : NONE) //Index defines for movement bucket data packets #define MOVEMENT_BUCKET_TIME 1 diff --git a/code/controllers/subsystem/movement/movement_types.dm b/code/controllers/subsystem/movement/movement_types.dm index 81a6b38c228..2c8c411e236 100644 --- a/code/controllers/subsystem/movement/movement_types.dm +++ b/code/controllers/subsystem/movement/movement_types.dm @@ -113,9 +113,14 @@ return var/visual_delay = controller.visual_delay + var/old_dir = moving.dir + var/old_loc = moving.loc owner?.processing_move_loop_flags = flags var/result = move() //Result is an enum value. Enums defined in __DEFINES/movement.dm + if(moving) + var/direction = get_dir(old_loc, moving.loc) + SEND_SIGNAL(moving, COMSIG_MOVABLE_MOVED_FROM_LOOP, src, old_dir, direction) owner?.processing_move_loop_flags = NONE SEND_SIGNAL(src, COMSIG_MOVELOOP_POSTPROCESS, result, delay * visual_delay) diff --git a/code/datums/ai/basic_mobs/basic_subtrees/simple_find_nearest_target_to_flee.dm b/code/datums/ai/basic_mobs/basic_subtrees/simple_find_nearest_target_to_flee.dm index 6ed9486e139..42a361c25cd 100644 --- a/code/datums/ai/basic_mobs/basic_subtrees/simple_find_nearest_target_to_flee.dm +++ b/code/datums/ai/basic_mobs/basic_subtrees/simple_find_nearest_target_to_flee.dm @@ -9,9 +9,13 @@ /// Find the nearest thing on our list of 'things which have done damage to me' and set it as the flee target /datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee + var/targeting_key = BB_TARGETTING_DATUM /datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick) . = ..() if (!controller.blackboard[BB_BASIC_MOB_FLEEING]) return - controller.queue_behavior(/datum/ai_behavior/target_from_retaliate_list/nearest, BB_BASIC_MOB_RETALIATE_LIST, BB_BASIC_MOB_CURRENT_TARGET, BB_TARGETTING_DATUM, BB_BASIC_MOB_CURRENT_TARGET_HIDING_LOCATION) + controller.queue_behavior(/datum/ai_behavior/target_from_retaliate_list/nearest, BB_BASIC_MOB_RETALIATE_LIST, BB_BASIC_MOB_CURRENT_TARGET, targeting_key, BB_BASIC_MOB_CURRENT_TARGET_HIDING_LOCATION) + +/datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee/from_flee_key + targeting_key = BB_FLEE_TARGETTING_DATUM diff --git a/code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm b/code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm index fa6f10f3905..06ad6b37033 100644 --- a/code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm +++ b/code/datums/ai/basic_mobs/basic_subtrees/speech_subtree.dm @@ -185,6 +185,11 @@ emote_see = list("shakes their head.", "shivers.") speak = list("Ack-Ack", "Ack-Ack-Ack-Ackawoooo", "Geckers", "Awoo", "Tchoff") +/datum/ai_planning_subtree/random_speech/crab + speech_chance = 1 + emote_hear = list("clicks.") + emote_see = list("clacks.") + /datum/ai_planning_subtree/random_speech/penguin speech_chance = 5 speak = list("Gah Gah!", "NOOT NOOT!", "NOOT!", "Noot", "noot", "Prah!", "Grah!") diff --git a/code/datums/elements/sideway_movement.dm b/code/datums/elements/sideway_movement.dm new file mode 100644 index 00000000000..dfe23187807 --- /dev/null +++ b/code/datums/elements/sideway_movement.dm @@ -0,0 +1,27 @@ +///A simple element that forces the mob to face a perpendicular direction when moving, like crabs. +/datum/element/sideway_movement + +/datum/element/sideway_movement/Attach(atom/movable/target) + . = ..() + if(!ismovable(target)) + return ELEMENT_INCOMPATIBLE + RegisterSignal(target, COMSIG_MOB_CLIENT_MOVED, PROC_REF(on_client_move)) + RegisterSignal(target, COMSIG_MOVABLE_MOVED_FROM_LOOP, PROC_REF(on_moved_from_loop)) + +/datum/element/sideway_movement/proc/on_client_move(atom/movable/source, direction, old_dir) + SIGNAL_HANDLER + on_move(source, direction, old_dir) + +/datum/element/sideway_movement/proc/on_moved_from_loop(atom/movable/source, datum/move_loop/loop, old_dir, direction) + SIGNAL_HANDLER + if(!CHECK_MOVE_LOOP_FLAGS(source, MOVEMENT_LOOP_OUTSIDE_CONTROL|MOVEMENT_LOOP_NO_DIR_UPDATE)) + on_move(source, direction, old_dir) + +///retain the old dir unless walking straight ahead or backward, in which case rotate the dir left or right by a 90° +/datum/element/sideway_movement/proc/on_move(atom/movable/source, direction, old_dir) + if(!source.set_dir_on_move) + return + var/new_dir = old_dir + if(direction == old_dir || direction == REVERSE_DIR(old_dir)) + new_dir = angle2dir(dir2angle(direction) + pick(90, -90)) + source.setDir(new_dir) diff --git a/code/datums/memory/_memory.dm b/code/datums/memory/_memory.dm index 19b6a499964..9c4ae2d905b 100644 --- a/code/datums/memory/_memory.dm +++ b/code/datums/memory/_memory.dm @@ -253,6 +253,7 @@ /mob/living/basic/chicken, /mob/living/basic/cow, /mob/living/basic/cow/wisdom, + /mob/living/basic/crab, /mob/living/basic/giant_spider, /mob/living/basic/giant_spider/hunter, /mob/living/basic/mining/goliath, @@ -268,7 +269,6 @@ /mob/living/basic/statue, /mob/living/basic/stickman, /mob/living/basic/stickman/dog, - /mob/living/simple_animal/crab, /mob/living/simple_animal/hostile/asteroid/basilisk/watcher, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/blob/blobbernaut/independent, diff --git a/code/modules/cargo/packs/livestock.dm b/code/modules/cargo/packs/livestock.dm index bf7ca95e216..8c0c0f0c907 100644 --- a/code/modules/cargo/packs/livestock.dm +++ b/code/modules/cargo/packs/livestock.dm @@ -117,14 +117,14 @@ ROCKEEEEEEEEEGGGGHHHHTT CRAB CRAB CRAABROCKET CRAB ROCKEEEET."//fun fact: i actually spent like 10 minutes and transcribed the entire video. cost = CARGO_CRATE_VALUE * 8 access_view = ACCESS_HOS - contains = list(/mob/living/simple_animal/crab) + contains = list(/mob/living/basic/crab) crate_name = "look sir free crabs" drop_pod_only = TRUE /datum/supply_pack/critter/crab/generate() . = ..() for(var/i in 1 to 49) - new /mob/living/simple_animal/crab(.) + new /mob/living/basic/crab(.) /datum/supply_pack/critter/corgis/exotic name = "Exotic Corgi Crate" diff --git a/code/modules/holodeck/holo_effect.dm b/code/modules/holodeck/holo_effect.dm index 6e3e1267922..02502c1e6fb 100644 --- a/code/modules/holodeck/holo_effect.dm +++ b/code/modules/holodeck/holo_effect.dm @@ -115,4 +115,4 @@ mobtype = /mob/living/basic/pet/penguin/baby/permanent /obj/effect/holodeck_effect/mobspawner/crab/jon - mobtype = /mob/living/simple_animal/crab/jon + mobtype = /mob/living/basic/crab/jon diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/basic/vermin/crab.dm similarity index 54% rename from code/modules/mob/living/simple_animal/friendly/crab.dm rename to code/modules/mob/living/basic/vermin/crab.dm index 7018ba4426a..abe5c25117b 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/basic/vermin/crab.dm @@ -1,15 +1,14 @@ //Look Sir, free crabs! -/mob/living/simple_animal/crab +/mob/living/basic/crab name = "crab" desc = "Free crabs!" icon_state = "crab" icon_living = "crab" icon_dead = "crab_dead" + speak_emote = list("clicks") - emote_hear = list("clicks.") - emote_see = list("clacks.") - speak_chance = 1 - turns_per_move = 5 + melee_damage_lower = 2 + melee_damage_upper = 2 butcher_results = list(/obj/item/food/meat/slab/rawcrab = 2) response_help_continuous = "pets" response_help_simple = "pet" @@ -17,49 +16,39 @@ response_disarm_simple = "gently push aside" response_harm_continuous = "stomps" response_harm_simple = "stomp" - stop_automated_movement = 1 friendly_verb_continuous = "pinches" friendly_verb_simple = "pinch" - var/obj/item/inventory_head - var/obj/item/inventory_mask gold_core_spawnable = FRIENDLY_SPAWN + mob_size = MOB_SIZE_SMALL ///In the case 'melee_damage_upper' is somehow raised above 0 attack_verb_continuous = "snips" attack_verb_simple = "snip" attack_sound = 'sound/weapons/bite.ogg' attack_vis_effect = ATTACK_EFFECT_BITE + ai_controller = /datum/ai_controller/basic_controller/crab -/mob/living/simple_animal/crab/Initialize(mapload) +/mob/living/basic/crab/Initialize(mapload) . = ..() ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) - -/mob/living/simple_animal/crab/Life(seconds_per_tick = SSMOBS_DT, times_fired) - ..() - //CRAB movement - if(!ckey && !stat) - if(isturf(loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc. - turns_since_move++ - if(turns_since_move >= turns_per_move) - var/east_vs_west = pick(4, 8) - if(Process_Spacemove(east_vs_west)) - Move(get_step(src,east_vs_west), east_vs_west) - turns_since_move = 0 - regenerate_icons() + AddElement(/datum/element/sideway_movement) + AddElement(/datum/element/tiny_mob_hunter, MOB_SIZE_TINY) + AddElement(/datum/element/ai_retaliate) + AddElement(/datum/element/ai_flee_while_injured) //COFFEE! SQUEEEEEEEEE! -/mob/living/simple_animal/crab/coffee +/mob/living/basic/crab/coffee name = "Coffee" real_name = "Coffee" desc = "It's Coffee, the other pet!" gender = FEMALE gold_core_spawnable = NO_SPAWN -/mob/living/simple_animal/crab/jon //holodeck crab +/mob/living/basic/crab/jon //holodeck crab name = "Jon" real_name = "Jon" gold_core_spawnable = NO_SPAWN -/mob/living/simple_animal/crab/evil +/mob/living/basic/crab/evil name = "Evil Crab" real_name = "Evil Crab" desc = "Unnerving, isn't it? It has to be planning something nefarious..." @@ -68,7 +57,7 @@ icon_dead = "evilcrab_dead" gold_core_spawnable = FRIENDLY_SPAWN -/mob/living/simple_animal/crab/kreb +/mob/living/basic/crab/kreb name = "Kreb" desc = "This is a real crab. The other crabs are simply gubbucks in disguise!" real_name = "Kreb" @@ -77,10 +66,30 @@ icon_dead = "kreb_dead" gold_core_spawnable = NO_SPAWN -/mob/living/simple_animal/crab/evil/kreb +/mob/living/basic/crab/evil/kreb name = "Evil Kreb" real_name = "Evil Kreb" icon_state = "evilkreb" icon_living = "evilkreb" icon_dead = "evilkreb_dead" gold_core_spawnable = NO_SPAWN + +///The basic ai controller for crabs +/datum/ai_controller/basic_controller/crab + blackboard = list( + BB_BASIC_MOB_FLEEING = FALSE, + BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/of_size/ours_or_smaller, + BB_FLEE_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction, + ) + + ai_traits = STOP_MOVING_WHEN_PULLED + ai_movement = /datum/ai_movement/basic_avoidance + idle_behavior = /datum/idle_behavior/idle_random_walk + planning_subtrees = list( + /datum/ai_planning_subtree/find_nearest_thing_which_attacked_me_to_flee/from_flee_key, + /datum/ai_planning_subtree/flee_target/from_flee_key, + /datum/ai_planning_subtree/target_retaliate/to_flee, + /datum/ai_planning_subtree/simple_find_target, + /datum/ai_planning_subtree/basic_melee_attack_subtree, + /datum/ai_planning_subtree/random_speech/crab, + ) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a3e25df7ca5..7b4480649b2 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1415,6 +1415,7 @@ /mob/living/basic/chick, /mob/living/basic/chicken, /mob/living/basic/cow, + /mob/living/basic/crab, /mob/living/basic/giant_spider, /mob/living/basic/giant_spider/hunter, /mob/living/basic/mining/goliath, @@ -1430,7 +1431,6 @@ /mob/living/basic/statue, /mob/living/basic/stickman, /mob/living/basic/stickman/dog, - /mob/living/simple_animal/crab, /mob/living/simple_animal/hostile/asteroid/basilisk/watcher, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/blob/blobbernaut/independent, diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 05440fbb4bd..ef7fc253d22 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -132,6 +132,7 @@ //Basically an optional override for our glide size //Sometimes you want to look like you're moving with a delay you don't actually have yet visual_delay = 0 + var/old_dir = dir . = ..() @@ -153,7 +154,7 @@ // At this point we've moved the client's attached mob. This is one of the only ways to guess that a move was done // as a result of player input and not because they were pulled or any other magic. - SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_MOVED) + SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_MOVED, direct, old_dir) var/atom/movable/P = mob.pulling if(P && !ismob(P) && P.density) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 9502042ce20..6ced60af0d3 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -378,7 +378,7 @@ return TRUE if(ispath(MP, /mob/living/basic/pet/dog/corgi)) return TRUE - if(ispath(MP, /mob/living/simple_animal/crab)) + if(ispath(MP, /mob/living/basic/crab)) return TRUE if(ispath(MP, /mob/living/basic/carp)) return TRUE diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index f005b0c6f76..bdd8c1713dd 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -642,12 +642,12 @@ /mob/living/basic/bee, /mob/living/basic/butterfly, /mob/living/basic/carp, + /mob/living/basic/crab, /mob/living/basic/lizard, /mob/living/basic/mouse, /mob/living/basic/pet/dog/corgi, /mob/living/basic/pet/dog/pug, /mob/living/basic/pet/fox, - /mob/living/simple_animal/crab, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/parrot/natural, /mob/living/simple_animal/pet/cat, diff --git a/code/modules/unit_tests/simple_animal_freeze.dm b/code/modules/unit_tests/simple_animal_freeze.dm index d31568176ec..b14f37fcade 100644 --- a/code/modules/unit_tests/simple_animal_freeze.dm +++ b/code/modules/unit_tests/simple_animal_freeze.dm @@ -32,12 +32,6 @@ /mob/living/simple_animal/bot/secbot/honkbot, /mob/living/simple_animal/bot/secbot/pingsky, /mob/living/simple_animal/bot/vibebot, - /mob/living/simple_animal/crab, - /mob/living/simple_animal/crab/coffee, - /mob/living/simple_animal/crab/evil, - /mob/living/simple_animal/crab/evil/kreb, - /mob/living/simple_animal/crab/jon, - /mob/living/simple_animal/crab/kreb, /mob/living/simple_animal/drone, /mob/living/simple_animal/drone/classic, /mob/living/simple_animal/drone/derelict, diff --git a/tgstation.dme b/tgstation.dme index cab9a3708e3..dd3f0a7babb 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1278,6 +1278,7 @@ #include "code\datums\elements\selfknockback.dm" #include "code\datums\elements\series.dm" #include "code\datums\elements\shatters_when_thrown.dm" +#include "code\datums\elements\sideway_movement.dm" #include "code\datums\elements\simple_flying.dm" #include "code\datums\elements\skittish.dm" #include "code\datums\elements\snail_crawl.dm" @@ -4119,6 +4120,7 @@ #include "code\modules\mob\living\basic\vermin\axolotl.dm" #include "code\modules\mob\living\basic\vermin\butterfly.dm" #include "code\modules\mob\living\basic\vermin\cockroach.dm" +#include "code\modules\mob\living\basic\vermin\crab.dm" #include "code\modules\mob\living\basic\vermin\frog.dm" #include "code\modules\mob\living\basic\vermin\lizard.dm" #include "code\modules\mob\living\basic\vermin\mothroach.dm" @@ -4287,7 +4289,6 @@ #include "code\modules\mob\living\simple_animal\bot\SuperBeepsky.dm" #include "code\modules\mob\living\simple_animal\bot\vibebot.dm" #include "code\modules\mob\living\simple_animal\friendly\cat.dm" -#include "code\modules\mob\living\simple_animal\friendly\crab.dm" #include "code\modules\mob\living\simple_animal\friendly\farm_animals.dm" #include "code\modules\mob\living\simple_animal\friendly\gondola.dm" #include "code\modules\mob\living\simple_animal\friendly\pet.dm" diff --git a/tools/UpdatePaths/Scripts/77109_simple_to_basic_crabs.txt b/tools/UpdatePaths/Scripts/77109_simple_to_basic_crabs.txt new file mode 100644 index 00000000000..ad25a5e1848 --- /dev/null +++ b/tools/UpdatePaths/Scripts/77109_simple_to_basic_crabs.txt @@ -0,0 +1 @@ +/mob/living/simple_animal/crab/@SUBTYPES : /mob/living/basic/crab/@SUBTYPES{@OLD} \ No newline at end of file