From daa9b0e0bc9ba1639c188053adbffac2af61c986 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 4 Nov 2015 17:49:42 +0100 Subject: [PATCH 1/5] When a diona splits, the main nymph inherits all known languages. Fixes #11401. --- code/modules/mob/language/language.dm | 4 ++++ code/modules/mob/living/carbon/human/human_powers.dm | 3 +-- code/modules/mob/mob_helpers.dm | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/language/language.dm b/code/modules/mob/language/language.dm index 8c6b92c555..c6d9756c9b 100644 --- a/code/modules/mob/language/language.dm +++ b/code/modules/mob/language/language.dm @@ -188,4 +188,8 @@ else return ..() +/proc/transfer_languages(var/mob/source, var/mob/target) + for(var/datum/language/L in source.languages) + target.add_language(L.name) + #undef SCRAMBLE_CACHE_LEN diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 50f46b4bb4..8ddd6bb1a6 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -229,6 +229,7 @@ var/mob/living/carbon/alien/diona/S = new(T) S.set_dir(dir) + transfer_languages(src, S) if(mind) mind.transfer_to(S) @@ -254,5 +255,3 @@ visible_message("\The [src] quivers slightly, then splits apart with a wet slithering noise.") qdel(src) - - diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 862f92fd5b..4f55f3d55b 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -640,7 +640,7 @@ proc/is_blind(A) // A proper CentCom id is hard currency. else if(id && istype(id, /obj/item/weapon/card/id/centcom)) return SAFE_PERP - + if(check_access && !access_obj.allowed(src)) threatcount += 4 From 1e6c0017d4a3bf382c7891abaaae467f8251bf92 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 5 Nov 2015 08:07:12 +0100 Subject: [PATCH 2/5] Changes alien intent_hurt icon state to intent_harm. Fixes #11415. --- icons/mob/screen1_alien.dmi | Bin 141060 -> 141059 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/icons/mob/screen1_alien.dmi b/icons/mob/screen1_alien.dmi index b21cd203dd59dd4e0bc8c244c29fbe7f091156a4..4ee41ca91c655ff0c0002c465fb7b73713b999f6 100644 GIT binary patch delta 806 zcmV+>1KIq9&Ip6f2#_Ry0eVzebVOxyV{&P5bZKvH004NLrI$^Q+At7?&*WFQyT^u> z1hVDArP@`shwWd8oOpt*ICg3~eDv4%02SfG%%Bw~q$jV(_B-R5XZG{$*ZXhw`thD@ zzeT4m?}2>;zQ2 zZigPllnLMr*RvCu-6u0LnWJQ*9N;TA$^pKr-R*HHyW8VR!R~OSV0XBZ1g?X`#SR=* z4?oufHz#rnB3Inz@?;`F^F3R!A}uaIdO^keK@;rP4_ePks|8992L24HCn@4bUTI#p zG>RM5@c_5s#p#rP@?w@|X_k)N1YJ+?9CSUwzR>l!MFMm^Zjb<7AF;>i+UM!~{F5my z$|)_(DJ{C{B9h0374wyjaHxuXKXi-_x|EaE5OU*k;C)g2!5sHl`@TWH6G*_I(o4C_f~2B z2pf4l$Bj{%r+KUjkCY<&o?j?^rkd~YoZUN7~O53`BC8U-wFFJup)6wu+nKdf6<+`PC zZZL+z38<}BhS0SE*FpXu4s5tL19ZKP&MeoH?36Nq9jDm`*!%%@9%o0L{vusojkymj zQjpj~Ng|<#XS3vll6gc)-NKP2HXuiu)MEUPf};D^8Yn&BTa(-no;S&jAhh;%DDMvX k&+P3G_bYq-cu)QTG`eml25!UPgD(SzF9QL$F9QPABMga`g#Z8m delta 807 zcmV+?1K9k7&Ip9g2#_Ry0(w+fbVOxyV{&P5bZKvH004NLrI*ca+b|5r&+$`e?QzZ) zJ8_pwE<=l&*`g!CvgAo}KKArGBtx7Jg$xRx4E#h<;-3`x%znQ8djHK{Ki-oK zIIpZ>E4KJHOD0<-f@CW;&y$G+wU*)V;{y-CR_y61nF!@PTd`$-GHD#|z_S(0PC&)$ zcIZ(|nE=jkJv))veKI4HIZ8Il0lssi9N@d!-5xh(cYEAYushsRusht61g?X`jU70u zJ^Wq|+?>cQh+J`-%ae%!&G&4@inO>~^nx1i2ThP)KWIHGtrjRb82B@&o@5cf@=Ei% zrBU3djt966FHX0Alozu!OS5#WCg^&C=Ai2d@`bL)B@&?Pae)Nr`iMM6VV|e-^CeT7 zms6UXQ<|UC2OX`nB}A6jp$yX5ZE2h45!#So;ViDy3q40lx#UKa%J4d<%}9icJ2a84 z!31!m^GI&+3_XV;o9<9EJ6t~8IlH}06(?C_hjdKyWa40dtBklxZi5S@(cH@jH9M2w zKn#Zc}$Wr9o^9xI#spdPp=MdbrS-vE3FL;kFxNGP5izeK#UPmOpynfQM z%TCi+;ZyfeqJYfUeikndN$tol*v{<23sKn?JzLcG53K@ z3KDxLNhI{}Y?ho*GLI;!TR5`B2INSST8#f*3=Yr2zt%wM0Y94LhVZ;eZUmvVuS0ov l(0^tTZ@*vJ>&JWY4@p>VLLb!-$b&8ehb{vFw=M$$)gvg5la~Mh From 5f4af85af985227e1dbfca34438760fd53a4fd5c Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 5 Nov 2015 08:14:22 +0100 Subject: [PATCH 3/5] Refactors diona split code for maximum reuse. --- .../mob/living/carbon/human/human_powers.dm | 9 ++++++--- .../living/carbon/human/species/station/station.dm | 14 +------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 8ddd6bb1a6..bcb4dd2c33 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -224,7 +224,9 @@ set name = "Split" set desc = "Split your humanoid form into its constituent nymphs." set category = "Abilities" + diona_split_into_nymphs(5, 1) // Separate proc to void argments being supplied when used as a verb +/mob/living/carbon/human/proc/diona_split_into_nymphs(var/number_of_resulting_nymphs, var/delete_self = 1) var/turf/T = get_turf(src) var/mob/living/carbon/alien/diona/S = new(T) @@ -243,8 +245,8 @@ D.loc = T D.set_dir(pick(NORTH, SOUTH, EAST, WEST)) - if(nymphs < 5) - for(var/i in nymphs to 4) + if(nymphs < number_of_resulting_nymphs) + for(var/i in nymphs to (number_of_resulting_nymphs - 1)) var/mob/M = new /mob/living/carbon/alien/diona(T) M.set_dir(pick(NORTH, SOUTH, EAST, WEST)) @@ -254,4 +256,5 @@ visible_message("\The [src] quivers slightly, then splits apart with a wet slithering noise.") - qdel(src) + if(delete_self) + qdel(src) diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index 010cfae341..54b7c32205 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -221,19 +221,7 @@ return ..() /datum/species/diona/handle_death(var/mob/living/carbon/human/H) - - var/mob/living/carbon/alien/diona/S = new(get_turf(H)) - - if(H.mind) - H.mind.transfer_to(S) - - for(var/mob/living/carbon/alien/diona/D in H.contents) - if(D.client) - D.loc = H.loc - else - qdel(D) - - H.visible_message("\red[H] splits apart with a wet slithering noise!") + diona_split_into_nymphs(0, 0) /datum/species/machine name = "Machine" From 20eb505c694fdf5342ac4bc5915aaf0230a98d3f Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 5 Nov 2015 08:46:26 +0100 Subject: [PATCH 4/5] Adds antag datum flag that is used to exlude the type from random selection. Death Commando, Mercenary Commando (inherits from death commando), and the ERT antag types added to the exclude list. Fixes #11416. --- code/game/antagonist/_antagonist_setup.dm | 1 + code/game/antagonist/antagonist_helpers.dm | 10 +++++++++- code/game/antagonist/outsider/deathsquad.dm | 2 +- code/game/antagonist/outsider/ert.dm | 2 +- code/game/gamemodes/calamity/calamity.dm | 8 +++----- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/code/game/antagonist/_antagonist_setup.dm b/code/game/antagonist/_antagonist_setup.dm index fa99f001f3..a521225602 100644 --- a/code/game/antagonist/_antagonist_setup.dm +++ b/code/game/antagonist/_antagonist_setup.dm @@ -26,6 +26,7 @@ #define ANTAG_RANDSPAWN 256 // Potentially randomly spawns due to events. #define ANTAG_VOTABLE 512 // Can be voted as an additional antagonist before roundstart. #define ANTAG_SET_APPEARANCE 1024 // Causes antagonists to use an appearance modifier on spawn. +#define ANTAG_RANDOM_EXCEPTED 2048 // If a game mode randomly selects antag types, antag types with this flag should be excluded. // Globals. var/global/list/all_antag_types = list() diff --git a/code/game/antagonist/antagonist_helpers.dm b/code/game/antagonist/antagonist_helpers.dm index adc706734f..1a3f9aa67d 100644 --- a/code/game/antagonist/antagonist_helpers.dm +++ b/code/game/antagonist/antagonist_helpers.dm @@ -47,4 +47,12 @@ return 1 /datum/antagonist/proc/is_latejoin_template() - return (flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB)) \ No newline at end of file + return (flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB)) + +/proc/all_random_antag_types() + // No caching as the ANTAG_RANDOM_EXCEPTED flag can be added/removed mid-round. + var/list/antag_candidates = all_antag_types.Copy() + for(var/datum/antagonist/antag in antag_candidates) + if(antag.flags & ANTAG_RANDOM_EXCEPTED) + antag_candidates -= antag + return antag_candidates diff --git a/code/game/antagonist/outsider/deathsquad.dm b/code/game/antagonist/outsider/deathsquad.dm index cbb57abe1a..e716cc72e9 100644 --- a/code/game/antagonist/outsider/deathsquad.dm +++ b/code/game/antagonist/outsider/deathsquad.dm @@ -7,7 +7,7 @@ var/datum/antagonist/deathsquad/deathsquad role_text_plural = "Death Commandos" welcome_text = "You work in the service of Central Command Asset Protection, answering directly to the Board of Directors." landmark_id = "Commando" - flags = ANTAG_OVERRIDE_JOB | ANTAG_OVERRIDE_MOB | ANTAG_HAS_NUKE | ANTAG_HAS_LEADER + flags = ANTAG_OVERRIDE_JOB | ANTAG_OVERRIDE_MOB | ANTAG_HAS_NUKE | ANTAG_HAS_LEADER | ANTAG_RANDOM_EXCEPTED default_access = list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage) antaghud_indicator = "huddeathsquad" diff --git a/code/game/antagonist/outsider/ert.dm b/code/game/antagonist/outsider/ert.dm index 67d98f8ae5..23e94dc24f 100644 --- a/code/game/antagonist/outsider/ert.dm +++ b/code/game/antagonist/outsider/ert.dm @@ -9,7 +9,7 @@ var/datum/antagonist/ert/ert welcome_text = "As member of the Emergency Response Team, you answer only to your leader and CentComm officials." leader_welcome_text = "As leader of the Emergency Response Team, you answer only to CentComm, and have authority to override the Captain where it is necessary to achieve your mission goals. It is recommended that you attempt to cooperate with the captain where possible, however." landmark_id = "Response Team" - flags = ANTAG_OVERRIDE_JOB | ANTAG_SET_APPEARANCE | ANTAG_HAS_LEADER | ANTAG_CHOOSE_NAME + flags = ANTAG_OVERRIDE_JOB | ANTAG_SET_APPEARANCE | ANTAG_HAS_LEADER | ANTAG_CHOOSE_NAME | ANTAG_RANDOM_EXCEPTED antaghud_indicator = "hudloyalist" hard_cap = 5 diff --git a/code/game/gamemodes/calamity/calamity.dm b/code/game/gamemodes/calamity/calamity.dm index 3104e624e3..b17277aaae 100644 --- a/code/game/gamemodes/calamity/calamity.dm +++ b/code/game/gamemodes/calamity/calamity.dm @@ -11,19 +11,17 @@ event_delay_mod_major = 0.75 /datum/game_mode/calamity/create_antagonists() + var/list/antag_candidates = all_random_antag_types() - //Let's not modify global lists for trivial reasons, even if it seems harmless right now. - var/list/antag_candidates = all_antag_types.Copy() - var/grab_antags = round(num_players()/ANTAG_TYPE_RATIO)+1 while(antag_candidates.len && antag_tags.len < grab_antags) var/antag_id = pick(antag_candidates) antag_candidates -= antag_id antag_tags |= antag_id - + ..() /datum/game_mode/calamity/check_victory() world << "This terrible, terrible day has finally ended!" -#undef ANTAG_TYPE_RATIO \ No newline at end of file +#undef ANTAG_TYPE_RATIO From 73f99a4c018440323560b46497ba40e852f23d50 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 5 Nov 2015 08:20:34 +0100 Subject: [PATCH 5/5] Secondary diona nymphs now get non-restricted/whitelisted languages on split. --- code/modules/mob/language/language.dm | 4 +++- .../modules/mob/living/carbon/human/human_powers.dm | 13 ++++++------- .../living/carbon/human/species/station/station.dm | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/language/language.dm b/code/modules/mob/language/language.dm index c6d9756c9b..2d058e3b78 100644 --- a/code/modules/mob/language/language.dm +++ b/code/modules/mob/language/language.dm @@ -188,8 +188,10 @@ else return ..() -/proc/transfer_languages(var/mob/source, var/mob/target) +/proc/transfer_languages(var/mob/source, var/mob/target, var/except_flags) for(var/datum/language/L in source.languages) + if(L.flags & except_flags) + continue target.add_language(L.name) #undef SCRAMBLE_CACHE_LEN diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index bcb4dd2c33..1728b61008 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -224,9 +224,9 @@ set name = "Split" set desc = "Split your humanoid form into its constituent nymphs." set category = "Abilities" - diona_split_into_nymphs(5, 1) // Separate proc to void argments being supplied when used as a verb + diona_split_into_nymphs(5) // Separate proc to void argments being supplied when used as a verb -/mob/living/carbon/human/proc/diona_split_into_nymphs(var/number_of_resulting_nymphs, var/delete_self = 1) +/mob/living/carbon/human/proc/diona_split_into_nymphs(var/number_of_resulting_nymphs) var/turf/T = get_turf(src) var/mob/living/carbon/alien/diona/S = new(T) @@ -242,19 +242,18 @@ for(var/mob/living/carbon/alien/diona/D in src) nymphs++ - D.loc = T + D.forceMove(T) + transfer_languages(src, D, WHITELISTED|RESTRICTED) D.set_dir(pick(NORTH, SOUTH, EAST, WEST)) if(nymphs < number_of_resulting_nymphs) for(var/i in nymphs to (number_of_resulting_nymphs - 1)) var/mob/M = new /mob/living/carbon/alien/diona(T) + transfer_languages(src, M, WHITELISTED|RESTRICTED) M.set_dir(pick(NORTH, SOUTH, EAST, WEST)) - for(var/obj/item/W in src) drop_from_inventory(W) visible_message("\The [src] quivers slightly, then splits apart with a wet slithering noise.") - - if(delete_self) - qdel(src) + qdel(src) diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index 54b7c32205..9ba341ff4a 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -221,7 +221,7 @@ return ..() /datum/species/diona/handle_death(var/mob/living/carbon/human/H) - diona_split_into_nymphs(0, 0) + H.diona_split_into_nymphs(0) /datum/species/machine name = "Machine"