Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Slime Rancher? In my space station???? #1442

Merged
merged 138 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
9c46431
start
dwasint Mar 10, 2024
80c70b5
more stuff
dwasint Mar 10, 2024
d8913d2
more changes
dwasint Mar 11, 2024
5992356
more slime stuff
dwasint Mar 11, 2024
b341cef
Update slime.dm
dwasint Mar 11, 2024
2c5a8fb
Update slime.dm
dwasint Mar 11, 2024
af31a04
adds more slime stuff
dwasint Mar 12, 2024
36c6eea
start of crossbreeds
dwasint Mar 12, 2024
743fd9e
adds the mutation types to all slimes temp for now
dwasint Mar 12, 2024
b0e4224
guh
dwasint Mar 13, 2024
01693b9
more stuff
dwasint Mar 13, 2024
e6acf42
makes slimes respect eachother eating stuff so they will target other…
dwasint Mar 13, 2024
31c1267
Update feed.dm
dwasint Mar 13, 2024
28a03a8
sponge bob me boy why are the slimes stacking
dwasint Mar 15, 2024
17ac504
more slime stuff
dwasint Mar 15, 2024
78e9f47
Update _base_slime.dm
dwasint Mar 15, 2024
e4cac27
another trait
dwasint Mar 16, 2024
250b1f3
start of slime corrals
dwasint Mar 16, 2024
064ea40
slime corrals
dwasint Mar 18, 2024
7478704
more slime pen stuff
dwasint Mar 18, 2024
4dc2983
adds all the crossbreed recipes.
dwasint Mar 19, 2024
ba7eb7e
base slime colors done
dwasint Mar 19, 2024
e0f5e9f
more traits, more fixes, better ui
dwasint Mar 20, 2024
a6394bd
minor fixes
dwasint Mar 20, 2024
9172579
test fixer
dwasint Mar 20, 2024
3507bbf
holy shit is this a edmund macmillan reference?
dwasint Mar 20, 2024
b8832ed
it fucking auto corrected mcmillen to mcmillan >:(
dwasint Mar 20, 2024
270d853
Merge branch 'master' into slimerancher
dwasint Mar 20, 2024
dfb40b9
overlay fix
dwasint Mar 20, 2024
0e6176a
Merge branch 'slimerancher' of https://github.com/dwasint/monkestatio…
dwasint Mar 20, 2024
811bfa6
Merge branch 'slimerancher' of https://github.com/dwasint/monkestatio…
dwasint Mar 20, 2024
f9e437e
Update tgstation.dme
dwasint Mar 20, 2024
1c1a0c5
hard delete fixes
dwasint Mar 20, 2024
79f395f
makes shop work
dwasint Mar 20, 2024
8ef8aef
changes to mapping id
dwasint Mar 21, 2024
72252eb
metastation mapping changes
dwasint Mar 21, 2024
e8d43e6
adds the request console
dwasint Mar 21, 2024
4e0b5ab
delta, ice and some meta changes
dwasint Mar 21, 2024
fc53687
fixes
dwasint Mar 21, 2024
bf55a70
tram IG
dwasint Mar 21, 2024
99a2879
adds buyable corral pen upgrades
dwasint Mar 22, 2024
e155eae
map fix, slime pen corral buying and upgrade viewing
dwasint Mar 22, 2024
ecbd1b0
sanity checks the liquid groups because splits have a period of time …
dwasint Mar 22, 2024
428dc29
adds placeholder apply_water proc until we rework reagents.
dwasint Mar 23, 2024
72e4611
the research
dwasint Mar 23, 2024
951dd69
fuck
dwasint Mar 23, 2024
af77698
whoops
dwasint Mar 23, 2024
572fb30
fixes
dwasint Mar 23, 2024
9751911
Update mob_stacker.dm
dwasint Mar 23, 2024
ec41174
Update xenobiology.dm
dwasint Mar 23, 2024
4723d42
tons of fixes
dwasint Mar 24, 2024
c61a579
range increase, removal on death, mutation chance
dwasint Mar 24, 2024
722f30d
more changes
dwasint Mar 24, 2024
ad305cc
guh
dwasint Mar 24, 2024
f81becf
Update vacuum_pack.dm
dwasint Mar 24, 2024
70a52f0
Update vacuum_pack.dm
dwasint Mar 24, 2024
724b2c0
Update ooze_compressor.dm
dwasint Mar 24, 2024
1e8938e
Update slime_extracts.dm
dwasint Mar 24, 2024
c7e1f54
potential fixes
dwasint Mar 24, 2024
51e6c64
more fixes
dwasint Mar 24, 2024
b613d70
wasn't getting latch bug anymore
dwasint Mar 24, 2024
75d7f77
no split no ooze, traits pass down, random color mutation syringe
dwasint Mar 24, 2024
a94237f
fixes
dwasint Mar 25, 2024
3b3a083
Update tramstation.dmm
dwasint Mar 25, 2024
7686a03
Update feed.dm
dwasint Mar 25, 2024
dca69b5
repaths extracts, phasing fix, crossbreed cost increase, phasing issu…
dwasint Mar 25, 2024
305bbe8
Update ooze_compressor.dm
dwasint Mar 25, 2024
8376c6d
Update slime_extracts.dm
dwasint Mar 25, 2024
b3b7caf
fixes compressor not being in the plumber, fixes crossbreeds being un…
dwasint Mar 26, 2024
fdbb02b
fixes slime mutations not working all the time, makes corrals load sl…
dwasint Mar 26, 2024
58c633f
soda slime
dwasint Mar 26, 2024
db82812
jps pathing
dwasint Mar 26, 2024
b9b5d4b
adds ooze counter to the pen controller
dwasint Mar 27, 2024
016d63e
forgot to tick beer slimes
dwasint Mar 27, 2024
e146adf
Update ooze_compressor.dm
dwasint Mar 27, 2024
ad469b2
Update cargo_driver.dm
dwasint Mar 27, 2024
82a993b
Update rat_organs.dm
dwasint Mar 27, 2024
a715743
Update rat_organs.dm
dwasint Mar 27, 2024
fe65cf8
Update liquid_groups.dm
dwasint Mar 27, 2024
34d08d0
prevents slime_stacks from feeding as it breaks mob buckling, adds th…
dwasint Mar 27, 2024
112c44d
Update _base_mutation.dm
dwasint Mar 27, 2024
54c854a
fixes
dwasint Mar 28, 2024
07523bc
fixes
dwasint Mar 28, 2024
5040243
Update colors.dm
dwasint Mar 28, 2024
3e05b3d
makes them unbuckle in death
dwasint Mar 28, 2024
c857d8e
should fix crossbreeds not properly respecting full reagents
dwasint Mar 28, 2024
ab2a212
Update traitor.dm
dwasint Mar 28, 2024
800a268
Update changeling.dm
dwasint Mar 28, 2024
49f4398
Update corral_corner.dm
dwasint Mar 28, 2024
4c0fa88
Update colors.dm
dwasint Mar 28, 2024
7d94e7e
changes shit
dwasint Mar 28, 2024
da5dc3f
fixes
dwasint Mar 28, 2024
0230e97
Update liquid_controller.dm
dwasint Mar 28, 2024
659c750
Update liquid_turf.dm
dwasint Mar 28, 2024
04c64c5
Update liquid_turf.dm
dwasint Mar 28, 2024
22b98cd
maybe fixes it?
dwasint Mar 29, 2024
66464ab
Update _base_slime.dm
dwasint Mar 29, 2024
78b92dc
guh
dwasint Mar 29, 2024
5c88405
start of emotional speech
dwasint Mar 29, 2024
4293d1d
Update _base_slime.dm
dwasint Mar 29, 2024
cf88e06
friendship tracker
dwasint Mar 30, 2024
a64748e
slime friendship throw, also fix for ooze compressor
dwasint Mar 30, 2024
fca57d3
adds vac_tagging to gain friendship from feedings
dwasint Mar 30, 2024
642de2e
pet commands
dwasint Mar 30, 2024
848024c
fixes runtime
dwasint Mar 30, 2024
3c09859
Update emotion_buffer.dm
dwasint Mar 30, 2024
669e1fa
old slimes have died woah
dwasint Mar 30, 2024
f8b2b0a
Update _base_slime.dm
dwasint Mar 30, 2024
ef81d98
Merge branch 'master' into slimerancher
dwasint Mar 30, 2024
b348169
box xenobiology
dwasint Mar 30, 2024
2c6ad89
Update BoxStation.dmm
dwasint Mar 30, 2024
7f492a8
snaps xeno shit from kilo
dwasint Mar 30, 2024
c5d8ca1
map fixes
dwasint Mar 30, 2024
4176d7b
Update nonhuman_corpses.dm
dwasint Mar 30, 2024
ff09308
more mapping fixes
dwasint Mar 30, 2024
c98c413
Update hilbertresearchfacility.dmm
dwasint Mar 30, 2024
1f2eb74
bam
dwasint Mar 30, 2024
f446ab1
Merge branch 'master' into slimerancher
dwasint Mar 30, 2024
34220ce
Update tgstation.dme
dwasint Mar 30, 2024
560e41d
whoops
dwasint Mar 30, 2024
9e99c7d
fixes
dwasint Mar 30, 2024
4b1e7db
Update mutation_syringe.dm
dwasint Apr 1, 2024
506c179
fixes
dwasint Apr 1, 2024
c903670
fixes
dwasint Apr 2, 2024
de0a367
Merge branch 'master' into slimerancher
dwasint Apr 7, 2024
ac5e684
Update BoxStation.dmm
dwasint Apr 7, 2024
7ae7933
Revert "Update BoxStation.dmm"
dwasint Apr 7, 2024
8a32f48
Revert "Merge branch 'master' into slimerancher"
dwasint Apr 7, 2024
b90375b
Reapply "Merge branch 'master' into slimerancher"
dwasint Apr 7, 2024
594181d
Reapply "Update BoxStation.dmm"
dwasint Apr 7, 2024
5ba83a5
redoes this manually
dwasint Apr 7, 2024
1a77c08
fixes pyros dying and buckling bug
dwasint Apr 7, 2024
f9ce575
potential fix
dwasint Apr 7, 2024
4a1466d
more additions
dwasint Apr 7, 2024
2256387
Update liquid_status_effect.dm
dwasint Apr 7, 2024
e24281e
what the fuck is wrong with the slow downs
dwasint Apr 8, 2024
dfad24c
slime grinder
dwasint Apr 8, 2024
83987ea
prevents slimes from crushing roaches
dwasint Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,110 changes: 336 additions & 774 deletions _maps/map_files/Deltastation/DeltaStation2.dmm

Large diffs are not rendered by default.

1,295 changes: 329 additions & 966 deletions _maps/map_files/IceBoxStation/IceBoxStation.dmm

Large diffs are not rendered by default.

2,579 changes: 1,415 additions & 1,164 deletions _maps/map_files/MetaStation/MetaStation.dmm

Large diffs are not rendered by default.

1,213 changes: 460 additions & 753 deletions _maps/map_files/tramstation/tramstation.dmm

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@

///from base of mob/living/Stun() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_STUN "living_stun"
///from mob/living/carbon/enter_stamina_stun()
#define COMSIG_LIVING_STAMINA_STUN "carbon_stamina_stun"
///from base of mob/living/Knockdown() (amount, ignore_canstun)
#define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown"
///from base of mob/living/Paralyze() (amount, ignore_canstun)
Expand Down
24 changes: 24 additions & 0 deletions code/__DEFINES/~monkestation/dcs/signals/signals_mob.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#define COMSIG_MOB_STOP_HUNGER "stop_hunger_mob"
#define COMSIG_MOB_START_HUNGER "start_hunger_mob"
#define COMSIG_MOB_FEED "feed_hunger_mob"
#define COMSIG_MOB_RETURN_HUNGER "return_hunger_mob"
#define COMSIG_MOB_REFUSED_EAT "refused_hunger_mob"
#define COMSIG_MOB_OVERATE "overate_hunger_mob"
#define COMSIG_MOB_EAT_NORMAL "normal_eat_hunger_mob"
#define COMSIG_MOB_STARVING "starving_hunger_mob"
#define COMSIG_MOB_FULLY_STARVING "full_starve_hunger_mob"
#define COMSIG_SECRETION_UPDATE "secretion_update"
#define COMSIG_FEEDING_CHECK "latch_check"
#define COMSIG_HUNGER_UPDATED "update_hunger_mob"
#define COMSIG_LIVING_ATE "living_ate_object"
#define COMSIG_MOB_ADJUST_HUNGER "adjust_hunger_mob"

#define COMSIG_EMOTION_STORE "store_emotion"
#define EMOTION_BUFFER_SPEAK_FROM_BUFFER "release_emotion"
#define COMSIG_EMOTION_HEARD "heard_emotion"
#define EMOTION_BUFFER_UPDATE_OVERLAY_STATES "update_emotion_overlay"

#define COMSIG_ATOM_JOIN_STACK "join_stack"
#define COMSIG_STACK_MOVE "stack_move"
#define COMSIG_CHECK_CAN_ADD_NEW_STACK "check_stack_add"
#define COMSIG_MOBSTACKER_DESTROY "mobstack_destroy_stack"
78 changes: 78 additions & 0 deletions code/__DEFINES/~monkestation/slimes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#define ADULT_SLIME (1<<0)
#define PASSIVE_SLIME (1<<1)
#define STORED_SLIME (1<<2)
#define MUTATING_SLIME (1<<3)
#define SPLITTING_SLIME (1<<4)
#define CLEANER_SLIME (1<<5)
#define OVERWRITES_COLOR (1<<6)
#define NOEVOLVE_SLIME (1<<7)
#define NOOOZE_SLIME (1<<8)

#define TRAIT_ON_DEATH (1<<0)
#define TRAIT_VISUAL (1<<1)

#define TRAIT_IN_STACK "inside_mob_stack"
#define TRAIT_FEEDING "feeding_trait"
#define LATCH_TRAIT "latch_trait"
#define TRAIT_LATCH_FEEDERED "feeder_targetted"

#define BB_BASIC_MOB_SCARED_ITEM "BB_basic_mob_scared_item"
#define BB_WONT_TARGET_CLIENTS "BB_wont_target_clients"

#define TRAIT_SLIME_STASIS "slime_stasis"
#define TRAIT_SLIME_RABID "slime_rabid"
#define TRAIT_SLIME_DUST_IMMUNE "slime_dust_immune"
#define COMSIG_ATOM_SUCKED "atom_sucked"

#define TRAIT_OVERFED "overfed_trait"
#define VACPACK_THROW "vacpack_throw"

///from obj/item/vacuum_nozzle/afterattack(atom/movable/target, mob/user, proximity, params): (obj/item/vacuum_nozzle/nozzle, mob/user)
#define COMSIG_LIVING_VACUUM_PRESUCK "living_vacuum_presuck"
#define COMPONENT_LIVING_VACUUM_CANCEL_SUCK (1<<0)

#define SLIME_VALUE_TIER_1 200
#define SLIME_VALUE_TIER_2 400
#define SLIME_VALUE_TIER_3 800
#define SLIME_VALUE_TIER_4 1600
#define SLIME_VALUE_TIER_5 3200
#define SLIME_VALUE_TIER_6 6400
#define SLIME_VALUE_TIER_7 12800

#define SLIME_SELL_MODIFIER_MIN -0.08
#define SLIME_SELL_MODIFIER_MAX -0.01
#define SLIME_SELL_OTHER_MODIFIER_MIN 0.005
#define SLIME_SELL_OTHER_MODIFIER_MAX 0.01
#define SLIME_SELL_MAXIMUM_MODIFIER 2
#define SLIME_SELL_MINIMUM_MODIFIER 0.1
#define SLIME_RANDOM_MODIFIER_MIN -0.0003
#define SLIME_RANDOM_MODIFIER_MAX 0.0003


#define EMOTION_HAPPY "happy"
#define EMOTION_SAD "sad"
#define EMOTION_SCARED "scared"
#define EMOTION_FUNNY "funny"
#define EMOTION_ANGER "anger"
#define EMOTION_SUPRISED "suprised"
#define EMOTION_HUNGRY "hungry"

///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 drawings we hunt
#define BB_CLEANABLE_DRAWINGS "cleanable_drawings"
///Key that holds our clean target
#define BB_CLEAN_TARGET "clean_target"
///key that holds trash we will burn
#define BB_HUNTABLE_TRASH "huntable_trash"


#define FOOD_CHANGE "food_change"
#define ENVIRONMENT_CHANGE "enviro_change"
#define BEHAVIOUR_CHANGE "behaviour_change"
#define DANGEROUS_CHANGE "dangerous_change"
#define DOCILE_CHANGE "docile_change"
5 changes: 5 additions & 0 deletions code/__HELPERS/paths/path.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@
var/incapacitated = FALSE
/// Is our mob incorporeal
var/incorporeal_move = FALSE
/// is our mob a xenofauna or slime
var/xenofauna_or_slime = FALSE
/// If our mob has a rider, what does it look like
var/datum/can_pass_info/rider_info = null
/// If our mob is buckled to something, what's it like
Expand Down Expand Up @@ -346,6 +348,9 @@
src.can_ventcrawl = HAS_TRAIT(living_construct, TRAIT_VENTCRAWLER_ALWAYS) || HAS_TRAIT(living_construct, TRAIT_VENTCRAWLER_NUDE)
src.mob_size = living_construct.mob_size
src.incorporeal_move = living_construct.incorporeal_move
if(istype(living_construct, /mob/living/basic/slime) || istype(living_construct, /mob/living/basic/xenofauna))
src.xenofauna_or_slime = TRUE

if(iscameramob(construct_from))
src.camera_type = construct_from.type
src.is_bot = isbot(construct_from)
Expand Down
28 changes: 28 additions & 0 deletions code/controllers/subsystem/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,25 @@ SUBSYSTEM_DEF(research)
/obj/item/assembly/signaler/anomaly/dimensional = MAX_CORES_DIMENSIONAL,
)

///our total xenobiology points
var/xenobio_points
/// Lookup list for ordnance briefers.
var/list/ordnance_experiments = list()
/// Lookup list for scipaper partners.
var/list/scientific_partners = list()

var/list/slime_core_prices = list()

var/static/list/default_core_prices = list(
SLIME_VALUE_TIER_1,
SLIME_VALUE_TIER_2,
SLIME_VALUE_TIER_3,
SLIME_VALUE_TIER_4,
SLIME_VALUE_TIER_5,
SLIME_VALUE_TIER_6,
SLIME_VALUE_TIER_7,
)

/datum/controller/subsystem/research/Initialize()
point_types = TECHWEB_POINT_TYPE_LIST_ASSOCIATIVE_NAMES
initialize_all_techweb_designs()
Expand All @@ -79,6 +93,7 @@ SUBSYSTEM_DEF(research)
autosort_categories()
error_design = new
error_node = new
initialize_slime_prices()
return SS_INIT_SUCCESS

/datum/controller/subsystem/research/fire()
Expand All @@ -100,6 +115,19 @@ SUBSYSTEM_DEF(research)

techweb_list.last_income = world.time

for(var/core_type in slime_core_prices)
var/obj/item/slime_extract/core = core_type
var/price_mod = rand(SLIME_RANDOM_MODIFIER_MIN * 1000000, SLIME_RANDOM_MODIFIER_MAX * 1000000) / 1000000
var/price_limiter = 1 - ((default_core_prices[initial(core.tier)] * SLIME_SELL_MINIMUM_MODIFIER) / slime_core_prices[core_type])
slime_core_prices[core_type] = (1 + price_mod * price_limiter) * slime_core_prices[core_type]

/datum/controller/subsystem/research/proc/initialize_slime_prices()
for(var/core_type in subtypesof(/obj/item/slime_extract))
var/obj/item/slime_extract/core = core_type
if(!initial(core.tier))
continue
slime_core_prices[core_type] = default_core_prices[initial(core.tier)]

/datum/controller/subsystem/research/proc/autosort_categories()
for(var/i in techweb_nodes)
var/datum/techweb_node/I = techweb_nodes[i]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai/_ai_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ multiple modular subtrees with behaviors
///Stored arguments for behaviors given during their initial creation
var/list/behavior_args = list()
///Tracks recent pathing attempts, if we fail too many in a row we fail our current plans.
var/pathing_attempts
var/consecutive_pathing_attempts
///Can the AI remain in control if there is a client?
var/continue_processing_when_client = FALSE
///distance to give up on target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/datum/ai_behavior/run_away_from_target/perform(seconds_per_tick, datum/ai_controller/controller, target_key, hiding_location_key)
. = ..()
if (controller.blackboard[BB_BASIC_MOB_STOP_FLEEING])
finish_action(controller, succeeded = FALSE, target_key = target_key, hiding_location_key = hiding_location_key)
return
var/atom/target = controller.blackboard[hiding_location_key] || controller.blackboard[target_key]
if (QDELETED(target) || !can_see(controller.pawn, target, run_distance))
Expand Down
16 changes: 10 additions & 6 deletions code/datums/ai/movement/_ai_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@
//Override this to setup the moveloop you want to use
/datum/ai_movement/proc/start_moving_towards(datum/ai_controller/controller, atom/current_movement_target, min_distance)
SHOULD_CALL_PARENT(TRUE)
controller.pathing_attempts = 0
controller.consecutive_pathing_attempts = 0
controller.set_blackboard_key(BB_CURRENT_MIN_MOVE_DISTANCE, min_distance)
moving_controllers[controller] = current_movement_target

/datum/ai_movement/proc/stop_moving_towards(datum/ai_controller/controller)
controller.pathing_attempts = 0
controller.consecutive_pathing_attempts = 0
moving_controllers -= controller
// We got deleted as we finished an action
if(!QDELETED(controller.pawn))
SSmove_manager.stop_looping(controller.pawn, SSai_movement)

/datum/ai_movement/proc/increment_pathing_failures(datum/ai_controller/controller)
controller.pathing_attempts++
if(controller.pathing_attempts >= max_pathing_attempts)
controller.consecutive_pathing_attempts++
if(controller.consecutive_pathing_attempts >= max_pathing_attempts)
controller.CancelActions()

/datum/ai_movement/proc/reset_pathing_failures(datum/ai_controller/controller)
controller.consecutive_pathing_attempts = 0

///Should the movement be allowed to happen? As of writing this, MOVELOOP_SKIP_STEP is defined as (1<<0) so be careful on using (return TRUE) or (can_move = TRUE; return can_move)
/datum/ai_movement/proc/allowed_to_move(datum/move_loop/source)
var/atom/movable/pawn = source.moving
Expand Down Expand Up @@ -58,7 +61,8 @@
//Anything to do post movement
/datum/ai_movement/proc/post_move(datum/move_loop/source, succeeded)
SIGNAL_HANDLER
if(succeeded != FALSE)
return
var/datum/ai_controller/controller = source.extra_info
if(succeeded != MOVELOOP_FAILURE)
reset_pathing_failures(controller)
return
increment_pathing_failures(controller)
22 changes: 15 additions & 7 deletions code/datums/components/plumbing/_plumbing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,43 @@
process_request(amount = MACHINE_REAGENT_TRANSFER, reagent = null, dir = dir)

///check who can give us what we want, and how many each of them will give us
/datum/component/plumbing/proc/process_request(amount, reagent, dir)
var/list/valid_suppliers = list()
/datum/component/plumbing/proc/process_request(amount = MACHINE_REAGENT_TRANSFER, reagent, dir)
//find the duct to take from
var/datum/ductnet/net
if(!ducts.Find(num2text(dir)))
return
net = ducts[num2text(dir)]

//find all valid suppliers in the duct
var/list/valid_suppliers = list()
for(var/datum/component/plumbing/supplier as anything in net.suppliers)
if(supplier.can_give(amount, reagent, net))
valid_suppliers += supplier
// Need to ask for each in turn very carefully, making sure we get the total volume. This is to avoid a division that would always round down and become 0
var/targetVolume = reagents.total_volume + amount
var/suppliersLeft = valid_suppliers.len
if(!suppliersLeft)
return

//take an equal amount from each supplier
var/currentRequest
var/target_volume = reagents.total_volume + amount
for(var/datum/component/plumbing/give as anything in valid_suppliers)
var/currentRequest = (targetVolume - reagents.total_volume) / suppliersLeft
currentRequest = (target_volume - reagents.total_volume) / suppliersLeft
give.transfer_to(src, currentRequest, reagent, net)
suppliersLeft--

///returns TRUE when they can give the specified amount and reagent. called by process request
/datum/component/plumbing/proc/can_give(amount, reagent, datum/ductnet/net)
if(amount <= 0)
return

if(reagent) //only asked for one type of reagent
for(var/datum/reagent/contained_reagent as anything in reagents.reagent_list)
if(contained_reagent.type == reagent)
return TRUE
else if(reagents.total_volume > 0) //take whatever
else if(reagents.total_volume) //take whatever
return TRUE

return FALSE

///this is where the reagent is actually transferred and is thus the finish point of our process()
/datum/component/plumbing/proc/transfer_to(datum/component/plumbing/target, amount, reagent, datum/ductnet/net)
if(!reagents || !target || !target.reagents)
Expand Down
2 changes: 2 additions & 0 deletions code/datums/elements/basic_eating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@
playsound(eater.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
else
playsound(eater.loc,'sound/items/eatfood.ogg', rand(10,50), TRUE)
SEND_SIGNAL(eater, COMSIG_LIVING_ATE, target)
SEND_SIGNAL(eater, COMSIG_EMOTION_STORE, null, EMOTION_HAPPY, "I ate [target], I really like [target].")
qdel(target)
16 changes: 11 additions & 5 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -576,14 +576,15 @@
if(!only_pulling && pulledby && moving_diagonally != FIRST_DIAG_STEP && (get_dist(src, pulledby) > 1 || z != pulledby.z)) //separated from our puller and not in the middle of a diagonal move.
pulledby.stop_pulling()

/atom/movable/proc/set_glide_size(target = 8)
/atom/movable/proc/set_glide_size(target = 8, recursed = FALSE)
if (HAS_TRAIT(src, TRAIT_NO_GLIDE))
return
SEND_SIGNAL(src, COMSIG_MOVABLE_UPDATE_GLIDE_SIZE, target)
glide_size = target

for(var/mob/buckled_mob as anything in buckled_mobs)
buckled_mob.set_glide_size(target)
if(!recursed)
for(var/mob/buckled_mob as anything in buckled_mobs)
buckled_mob.set_glide_size(target, TRUE)

/**
* meant for movement with zero side effects. only use for objects that are supposed to move "invisibly" (like camera mobs or ghosts)
Expand Down Expand Up @@ -639,8 +640,13 @@
if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_MOVE, entering_loc) & COMPONENT_MOVABLE_BLOCK_PRE_MOVE)
return
else // Else just try to enter the single destination.
if(!newloc.Enter(src))
return
if(isliving(src))
var/mob/living/living = src
if(!newloc.Enter(src) && !living.buckled)
return
else
if(!newloc.Enter(src))
return
if(SEND_SIGNAL(src, COMSIG_MOVABLE_PRE_MOVE, newloc) & COMPONENT_MOVABLE_BLOCK_PRE_MOVE)
return

Expand Down
2 changes: 2 additions & 0 deletions code/game/machinery/computer/accounting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

for(var/current_account as anything in SSeconomy.bank_accounts_by_id)
var/datum/bank_account/current_bank_account = SSeconomy.bank_accounts_by_id[current_account]
if(!current_bank_account.account_job || !current_bank_account)
continue
player_accounts += list(list(
"name" = current_bank_account.account_holder,
"job" = current_bank_account.account_job.title,
Expand Down
18 changes: 7 additions & 11 deletions code/game/machinery/dna_infuser/organ_sets/rat_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,22 @@

/obj/item/organ/internal/heart/rat/on_insert(mob/living/carbon/receiver)
. = ..()
if(!. || !ishuman(receiver))
if(!ishuman(receiver))
return
var/mob/living/carbon/human/human_receiver = receiver
if(!human_receiver.can_mutate())
return
human_receiver.dna.add_mutation(/datum/mutation/human/dwarfism)
if(human_receiver.can_mutate())
human_receiver.dna.add_mutation(/datum/mutation/human/dwarfism)
//but 1.5 damage
if(human_receiver.physiology)
human_receiver.physiology.damage_resistance -= 50
human_receiver.physiology?.damage_resistance -= 50

/obj/item/organ/internal/heart/rat/on_remove(mob/living/carbon/heartless, special)
. = ..()
if(!ishuman(heartless))
return
var/mob/living/carbon/human/human_heartless = heartless
if(!human_heartless.can_mutate())
return
human_heartless.dna.remove_mutation(/datum/mutation/human/dwarfism)
if(human_heartless.physiology)
human_heartless.physiology.damage_resistance += 50
if(human_heartless.can_mutate())
human_heartless.dna.remove_mutation(/datum/mutation/human/dwarfism)
human_heartless.physiology?.damage_resistance += 50

/// you occasionally squeak, and have some rat related verbal tics
/obj/item/organ/internal/tongue/rat
Expand Down
Loading
Loading