Skip to content

Commit

Permalink
bugfix: Minor Fixes Collection (ss220-space#5153)
Browse files Browse the repository at this point in the history
* Duplicate Scream Removal

* Signal Out

* Let Genes Live

* Small Runtime

* Few Gene Fixes

* Food Processor Runtime Fix

* Undense Mobs Stay Undense
  • Loading branch information
Gottfrei authored Jun 10, 2024
1 parent 1d4dbbf commit 16a6646
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 19 deletions.
9 changes: 6 additions & 3 deletions code/game/dna/dna2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,14 @@ GLOBAL_LIST_EMPTY(bad_blocks)
///////////////////////////////////////

// "Zeroes out" all of the blocks.
/datum/dna/proc/ResetSE()
/datum/dna/proc/ResetSE(monkeybasic = FALSE)
for(var/i = 1, i <= DNA_SE_LENGTH, i++)
if(i == DNA_SE_LENGTH && monkeybasic)
continue
SetSEValue(i, rand(1, 1024), 1)
UpdateSE()


// Set a DNA SE block's raw value.
/datum/dna/proc/SetSEValue(block, value, defer = FALSE)

Expand Down Expand Up @@ -406,12 +409,12 @@ GLOBAL_LIST_EMPTY(bad_blocks)
// Initial DNA setup. I'm kind of wondering why the hell this doesn't just call the above.
// ready_dna is (hopefully) only used on mob creation, and sets the struc_enzymes_original and SE_original only once - Bone White

/datum/dna/proc/ready_dna(mob/living/carbon/human/character, flatten_SE = TRUE)
/datum/dna/proc/ready_dna(mob/living/carbon/human/character, flatten_SE = TRUE, monkeybasic = FALSE)

ResetUIFrom(character)

if(flatten_SE)
ResetSE()
ResetSE(monkeybasic)

struc_enzymes_original = struc_enzymes // sets the original struc_enzymes when ready_dna is called
SE_original = SE.Copy()
Expand Down
7 changes: 7 additions & 0 deletions code/game/dna/genes/gene.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
var/instability = 0


/datum/dna/gene/Destroy(force)
if(force)
return ..()
// put your hands off the gene GC!
return QDEL_HINT_LETMELIVE


/*
* Is the gene active in this mob's DNA?
*/
Expand Down
18 changes: 10 additions & 8 deletions code/modules/food_and_drinks/kitchen_machinery/processor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,27 @@
return

default_deconstruction_crowbar(user, O)

var/obj/item/what = O

var/obj/item/grab/grab
if(istype(O, /obj/item/grab))
var/obj/item/grab/G = O
what = G.affecting
grab = O
what = grab.affecting

var/datum/food_processor_process/P = select_recipe(what)

if(!P)
to_chat(user, "<span class='warning'>That probably won't blend.</span>")
return 1
return TRUE

if(grab)
qdel(grab)
what.forceMove(src)
else if(!user.drop_transfer_item_to_loc(what, src))
return

user.visible_message("<span class='notice'>\the [user] puts \the [what] into \the [src].</span>", \
"<span class='notice'>You put \the [what] into \the [src].")

user.drop_transfer_item_to_loc(what, src)

return

/obj/machinery/processor/attack_hand(mob/user)
if(stat & (NOPOWER|BROKEN)) //no power or broken
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
if(QDELING(I))
return FALSE

if(!force && !put_in_hand_check(I, hand_id))
if(!put_in_hand_check(I, hand_id) && !force)
return FALSE

if(!ignore_anim)
Expand Down
5 changes: 3 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1198,16 +1198,17 @@
*
* Arguments:
* * new_species - The new species to assign.
* * monkeybasic - If `TRUE` will skip randomization of the last SE block
*/
/mob/living/carbon/human/proc/setup_dna(datum/species/new_species, flatten_SE = TRUE)
/mob/living/carbon/human/proc/setup_dna(datum/species/new_species, monkeybasic = FALSE)
set_species(new_species, use_default_color = TRUE, delay_icon_update = TRUE, skip_same_check = TRUE)
// Name
real_name = dna.species.get_random_name(gender)
name = real_name
mind?.name = real_name

// DNA ready
dna.ready_dna(src, flatten_SE)
dna.ready_dna(src, TRUE, monkeybasic)
dna.real_name = real_name
dna.tts_seed_dna = tts_seed
sync_organ_dna()
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@
if(usable_legs < default_num_legs)
limbless_slowdown += (default_num_legs - usable_legs) * 4 - get_crutches()
if(!usable_legs)
if(has_pain())
INVOKE_ASYNC(src, PROC_REF(emote), "scream")
ADD_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
if(usable_hands < default_num_hands)
limbless_slowdown += (default_num_hands - usable_hands) * 4
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/living/carbon/human/monkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
var/master_commander = null
var/sentience_type = SENTIENCE_ORGANIC

/mob/living/carbon/human/lesser/setup_dna(datum/species/new_species, flatten_SE = FALSE)
/mob/living/carbon/human/lesser/setup_dna(datum/species/new_species, monkeybasic = TRUE)
. = ..()
// since we are created as monkas we need to manually set our GLOB.monkeyblock as activated
// and also we are skipping SE flattening for the same reasons
LAZYOR(active_genes, /datum/dna/gene/monkey)

/mob/living/carbon/human/lesser/monkey
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
inv?.update_icon()

if(belt)
if(hud_used?.hud_shown && belt)
if(client && hud_used?.hud_shown)
client.screen += belt
belt.screen_loc = ui_belt

Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

if(mobility_flags & MOBILITY_REST)
verbs += /mob/living/proc/toggle_resting
if(!density) // we want undense mobs to stay undense when they stop resting
ADD_TRAIT(src, TRAIT_UNDENSE, INNATE_TRAIT)

GLOB.mob_living_list += src

Expand Down

0 comments on commit 16a6646

Please sign in to comment.