diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 834d4ef5e09..f1b60da557b 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -406,7 +406,7 @@ 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 = 1) +/datum/dna/proc/ready_dna(mob/living/carbon/human/character, flatten_SE = TRUE) ResetUIFrom(character) diff --git a/code/game/dna/dna2_domutcheck.dm b/code/game/dna/dna2_domutcheck.dm index 6c955993863..535f05c3d7d 100644 --- a/code/game/dna/dna2_domutcheck.dm +++ b/code/game/dna/dna2_domutcheck.dm @@ -42,6 +42,9 @@ * Returns TRUE if any changes were made, FALSE otherwise */ /mob/living/carbon/human/proc/update_gene_status(datum/dna/gene/gene, flags = NONE) + if(!gene.block) + return FALSE + // If human mob has no DNA its better runtime to tell us, // since its involves some hacky code elsewhere if(!dna) @@ -93,8 +96,10 @@ * Arguments: * * block - block to manipulate with. * * activate - `TRUE` for activate, `FALSE` for deactivate. - * * update_default_status - whether to add/removes this block in/from `gene default_genes` variable. + * * update_default_status - whether to add/remove this block in/from `gene default_genes` variable. * * ignore_species_default - if `TRUE` gene will be always removed, even if it belongs to `species default_genes` variable. + * + * Returns `TRUE` if a gene was changed, `FALSE` otherwise. */ /mob/proc/force_gene_block(block, activate = FALSE, update_default_status = FALSE, ignore_species_default = FALSE) return @@ -104,9 +109,9 @@ var/force_flags = MUTCHK_FORCED if(ignore_species_default) force_flags |= MUTCHK_IGNORE_DEFAULT - dna.SetSEState(block, activate, TRUE) - check_gene_block(block, force_flags) - if(update_default_status) + dna.SetSEState(block, activate) + . = check_gene_block(block, force_flags) + if(. && update_default_status) if(activate) LAZYOR(dna.default_blocks, block) else diff --git a/code/game/dna/genes/gene.dm b/code/game/dna/genes/gene.dm index b70e7cd5351..80ec3b4b136 100644 --- a/code/game/dna/genes/gene.dm +++ b/code/game/dna/genes/gene.dm @@ -49,8 +49,7 @@ SHOULD_CALL_PARENT(TRUE) LAZYOR(mutant.active_genes, type) mutant.gene_stability -= instability - if(OnDrawUnderlays()) - mutant.update_mutations() + mutant.update_mutations() /** @@ -61,8 +60,7 @@ SHOULD_CALL_PARENT(TRUE) LAZYREMOVE(mutant.active_genes, type) mutant.gene_stability += instability - if(OnDrawUnderlays()) - mutant.update_mutations() + mutant.update_mutations() // This section inspired by goone's bioEffects. diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index 0dd812c623d..454f21dd67b 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -7,11 +7,11 @@ /datum/dna/gene/monkey/can_activate(mob/living/mutant, flags) - return ishuman(mutant) && !ismonkeybasic(mutant) + return ishuman(mutant) && !ismonkeybasic(mutant) && !HAS_TRAIT(mutant, TRAIT_NO_TRANSFORM) /datum/dna/gene/monkey/can_deactivate(mob/living/mutant, flags) - return ishuman(mutant) && ismonkeybasic(mutant) + return ishuman(mutant) && ismonkeybasic(mutant) && !HAS_TRAIT(mutant, TRAIT_NO_TRANSFORM) /datum/dna/gene/monkey/activate(mob/living/carbon/human/mutant, flags) diff --git a/code/modules/antagonists/changeling/powers/lesserform.dm b/code/modules/antagonists/changeling/powers/lesserform.dm index 4f29c1edcda..ce337dca7e4 100644 --- a/code/modules/antagonists/changeling/powers/lesserform.dm +++ b/code/modules/antagonists/changeling/powers/lesserform.dm @@ -27,7 +27,7 @@ user.visible_message(span_warning("[user] transforms!"), span_warning("Our genes cry out!")) remove_changeling_mutations(user) - user.monkeyize() + user.force_gene_block(GLOB.monkeyblock, TRUE) cling.give_power(new /datum/action/changeling/humanform) diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index f41c59345aa..70d93a0d23b 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -2886,7 +2886,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts if(character.dna.dirtySE) character.dna.UpdateSE() - character.dna.ready_dna(character, flatten_SE = 0) + character.dna.ready_dna(character, flatten_SE = FALSE) character.sync_organ_dna(assimilate=1) character.UpdateAppearance() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d40eee42925..24db835d701 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1199,7 +1199,7 @@ * Arguments: * * new_species - The new species to assign. */ -/mob/living/carbon/human/proc/setup_dna(datum/species/new_species) +/mob/living/carbon/human/proc/setup_dna(datum/species/new_species, flatten_SE = TRUE) 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) @@ -1207,7 +1207,7 @@ mind?.name = real_name // DNA ready - dna.ready_dna(src) + dna.ready_dna(src, flatten_SE) dna.real_name = real_name dna.tts_seed_dna = tts_seed sync_organ_dna() @@ -1244,7 +1244,7 @@ * * transfer_special_internals - If `TRUE`, all special internal organs (implants, spider eggs, xeno embryos, etc.), will be present on the mob post-change. Does not affect racial internal organs (heart, liver, etc.). * * save_appearance - If `TRUE`, all bodyparts appearances (head hair style, body tattoos, tail type, etc.) will be transfered to new species. */ -/mob/living/carbon/human/proc/set_species(datum/species/new_species, use_default_color, delay_icon_update = FALSE, skip_same_check = FALSE, retain_damage = FALSE, transformation = FALSE, keep_missing_bodyparts = FALSE, transfer_special_internals = TRUE, save_appearance = FALSE) +/mob/living/carbon/human/proc/set_species(datum/species/new_species, use_default_color = FALSE, delay_icon_update = FALSE, skip_same_check = FALSE, retain_damage = FALSE, transformation = FALSE, keep_missing_bodyparts = FALSE, transfer_special_internals = TRUE, save_appearance = FALSE) if(!skip_same_check && dna.species.name == initial(new_species.name)) return diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index d57ca0caa23..98cb53a2f28 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -187,10 +187,14 @@ var/mob/living/holder = thing.loc holder.drop_item_ground(thing) - if(embedded_zone && !get_organ(embedded_zone)) - embedded_zone = BODY_ZONE_CHEST + var/obj/item/organ/external/bodypart + if(embedded_zone) + bodypart = get_organ(embedded_zone) + if(!bodypart) + bodypart = get_organ(BODY_ZONE_CHEST) + else + bodypart = safepick(bodyparts) - var/obj/item/organ/external/bodypart = embedded_zone ? embedded_zone : safepick(bodyparts) if(!bodypart) return FALSE diff --git a/code/modules/mob/living/carbon/human/monkey.dm b/code/modules/mob/living/carbon/human/monkey.dm index acdd0e9c5ca..28ab7ed33d6 100644 --- a/code/modules/mob/living/carbon/human/monkey.dm +++ b/code/modules/mob/living/carbon/human/monkey.dm @@ -1,37 +1,45 @@ /mob/living/carbon/human/lesser - var/master_commander = null //переменная хранящая владельца "животного" + icon = 'icons/mob/monkey.dmi' // for mappers + var/master_commander = null var/sentience_type = SENTIENCE_ORGANIC - //holder_type = /obj/item/holder/monkey //Задыхается сидя на голове или в сумке, временно отключен -/mob/living/carbon/human/lesser/Initialize(mapload, species) - icon = null - . = ..(mapload, species) - -/mob/living/carbon/human/lesser/setup_dna(datum/species/new_species) +/mob/living/carbon/human/lesser/setup_dna(datum/species/new_species, flatten_SE = FALSE) . = ..() - dna.SetSEState(GLOB.monkeyblock, 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 + icon_state = "monkey1" + /mob/living/carbon/human/lesser/monkey/Initialize(mapload) . = ..(mapload, /datum/species/monkey) tts_seed = "Sniper" +/mob/living/carbon/human/lesser/farwa + icon_state = "tajkey1" + /mob/living/carbon/human/lesser/farwa/Initialize(mapload) . = ..(mapload, /datum/species/monkey/tajaran) tts_seed = "Gyro" - //holder_type = /obj/item/holder/farwa + +/mob/living/carbon/human/lesser/wolpin + icon_state = "wolfling" /mob/living/carbon/human/lesser/wolpin/Initialize(mapload) . = ..(mapload, /datum/species/monkey/vulpkanin) tts_seed = "Bloodseeker" - //holder_type = /obj/item/holder/farwa + +/mob/living/carbon/human/lesser/neara + icon_state = "skrellkey1" /mob/living/carbon/human/lesser/neara/Initialize(mapload) . = ..(mapload, /datum/species/monkey/skrell) tts_seed = "Bounty" - //holder_type = /obj/item/holder/neara + +/mob/living/carbon/human/lesser/stok + icon_state = "stokkey1" /mob/living/carbon/human/lesser/stok/Initialize(mapload) . = ..(mapload, /datum/species/monkey/unathi) tts_seed = "Witchdoctor" - //holder_type = /obj/item/holder/stok diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index 5766a3adfb2..698d26ed842 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -81,6 +81,11 @@ H.meatleft = initial(H.meatleft) +/datum/species/monkey/handle_dna(mob/living/carbon/human/H, remove) + . = ..() + H.force_gene_block(GLOB.monkeyblock, !remove) + + /datum/species/monkey/can_understand(mob/other) return istype(other, /mob/living/simple_animal/hostile/gorilla) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index f32d8bc371c..87152440c0d 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -470,7 +470,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) if(gender == FEMALE) g = "f" // DNA2 - Drawing underlays. - for(var/datum/dna/gene/gene in GLOB.dna_genes) + for(var/datum/dna/gene/gene as anything in GLOB.dna_genes) if(!gene.block) continue if(gene.is_active(src)) diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 3ad2da9de89..d80cc2d58a0 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -279,35 +279,38 @@ color = "#7DFF00" taste_description = "slime" + /datum/reagent/stable_mutagen/on_new(data) ..() START_PROCESSING(SSprocessing, src) + /datum/reagent/stable_mutagen/Destroy() STOP_PROCESSING(SSprocessing, src) return ..() -/datum/reagent/stable_mutagen/on_mob_life(mob/living/M) - if(!ishuman(M) || !M.dna) - return - if(isnucleation(M)) - return ..() - M.apply_effect(1, IRRADIATE, negate_armor = 1) - if(current_cycle == 10 && islist(data)) - if(istype(data["dna"], /datum/dna)) - var/mob/living/carbon/human/H = M - var/datum/dna/D = data["dna"] - if(!D.species.is_small) - H.change_dna(D, TRUE, TRUE) - H.special_post_clone_handling() +/datum/reagent/stable_mutagen/on_mob_life(mob/living/carbon/human/target) + if(isnucleation(target)) + return ..() + target.apply_effect(1, IRRADIATE, negate_armor = TRUE) + if(current_cycle != 10 || !ishuman(target) || !target.dna || !islist(data) || !istype(data["dna"], /datum/dna)) + return ..() + var/datum/dna/reagent_dna = data["dna"] + if(!reagent_dna.species.is_small) + target.change_dna(reagent_dna, TRUE, TRUE) + target.special_post_clone_handling() return ..() + /datum/reagent/stable_mutagen/process() - if(..()) - var/datum/reagent/blood/B = locate() in holder.reagent_list - if(B && islist(B.data) && !data) - data = B.data.Copy() + . = ..() + if(data) + return . + var/datum/reagent/blood/blood = locate() in holder.reagent_list + if(blood && islist(blood.data)) + data = blood.data.Copy() + /datum/reagent/uranium name ="Uranium"