From fd2f2ae1af2b6192cf705a7aa21760401ab9ea4d Mon Sep 17 00:00:00 2001 From: Ghommie Date: Tue, 23 Jul 2019 07:21:03 +0200 Subject: [PATCH] update, bitflags. --- code/__DEFINES/citadel_defines.dm | 4 +- code/__HELPERS/global_lists.dm | 3 +- .../code/modules/arousal/arousal.dm | 4 +- .../code/modules/arousal/organs/_genitals.dm | 42 +++++++++---------- .../code/modules/arousal/organs/eggsack.dm | 1 + .../code/modules/arousal/organs/ovipositor.dm | 1 + .../code/modules/arousal/organs/testicles.dm | 3 +- 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/code/__DEFINES/citadel_defines.dm b/code/__DEFINES/citadel_defines.dm index 8b75784ab2..b366a792e5 100644 --- a/code/__DEFINES/citadel_defines.dm +++ b/code/__DEFINES/citadel_defines.dm @@ -25,7 +25,9 @@ #define GENITAL_LAYER_INDEX_LENGTH 4 //keep it updated with each new index added, thanks. -#define MASTURBATE_LINKED_ORGAN 2 //special value used to pass our mission to the linked organ +//genital flags +#define GENITAL_BLACKLISTED (1 << 0) //for genitals that shouldn't be added to GLOB.genitals_list. +#define MASTURBATE_LINKED_ORGAN (1<<1) //used to pass our mission to the linked organ #define COCK_SIZE_MIN 1 #define COCK_SIZE_MAX 20 diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index b0b0f32345..96f2d404f8 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -64,7 +64,8 @@ for(var/gpath in subtypesof(/obj/item/organ/genital)) var/obj/item/organ/genital/G = gpath - GLOB.genitals_list[initial(G.name)] = gpath + if(!CHECK_BITFIELD(initial(G.genital_flags), GENITAL_BLACKLISTED)) + GLOB.genitals_list[initial(G.name)] = gpath //END OF CIT CHANGES //Species diff --git a/modular_citadel/code/modules/arousal/arousal.dm b/modular_citadel/code/modules/arousal/arousal.dm index 8826cb0774..924c507e7d 100644 --- a/modular_citadel/code/modules/arousal/arousal.dm +++ b/modular_citadel/code/modules/arousal/arousal.dm @@ -209,7 +209,7 @@ var/datum/reagents/fluid_source = G.climaxable(src) if(!fluid_source) return - var/obj/item/organ/genital/PP = G.can_masturbate_with == MASTURBATE_LINKED_ORGAN ? G.linked_organ : G + var/obj/item/organ/genital/PP = CHECK_BITFIELD(G.genital_flags, MASTURBATE_LINKED_ORGAN) ? G.linked_organ : G if(!PP) to_chat(src, "You shudder, unable to cum with your [name].") if(mb_time) @@ -274,7 +274,7 @@ for(var/obj/item/organ/genital/G in internal_organs) if(G.can_masturbate_with && G.is_exposed(worn_stuff)) //filter out what you can't masturbate with - if(G.can_masturbate_with == MASTURBATE_LINKED_ORGAN && !G.linked_organ) + if(CHECK_BITFIELD(G.genital_flags, MASTURBATE_LINKED_ORGAN) && !G.linked_organ) continue genitals_list += G if(genitals_list.len) diff --git a/modular_citadel/code/modules/arousal/organs/_genitals.dm b/modular_citadel/code/modules/arousal/organs/_genitals.dm index 2222624050..c4c3eaa9f1 100644 --- a/modular_citadel/code/modules/arousal/organs/_genitals.dm +++ b/modular_citadel/code/modules/arousal/organs/_genitals.dm @@ -1,28 +1,28 @@ /obj/item/organ/genital color = "#fcccb3" - w_class = WEIGHT_CLASS_NORMAL - var/shape = "human" - var/sensitivity = AROUSAL_START_VALUE - var/list/genital_flags = list() - var/can_masturbate_with = FALSE - var/masturbation_verb = "masturbate" - var/orgasm_verb = "cumming" //present continous - var/can_climax = FALSE - var/fluid_transfer_factor = 0 //How much would a partner get in them if they climax using this? - var/size = 2 //can vary between num or text, just used in icon_state strings - var/fluid_id = null - var/fluid_max_volume = 50 - var/fluid_efficiency = 1 - var/fluid_rate = 1 - var/fluid_mult = 1 - var/producing = FALSE - var/aroused_state = FALSE //Boolean used in icon_state strings - var/aroused_amount = 50 //This is a num from 0 to 100 for arousal percentage for when to use arousal state icons. + w_class = WEIGHT_CLASS_NORMAL + var/shape = "human" + var/sensitivity = AROUSAL_START_VALUE + var/genital_flags + var/can_masturbate_with = FALSE + var/masturbation_verb = "masturbate" + var/orgasm_verb = "cumming" //present continous + var/can_climax = FALSE + var/fluid_transfer_factor = 0 //How much would a partner get in them if they climax using this? + var/size = 2 //can vary between num or text, just used in icon_state strings + var/fluid_id = null + var/fluid_max_volume = 50 + var/fluid_efficiency = 1 + var/fluid_rate = 1 + var/fluid_mult = 1 + var/producing = FALSE + var/aroused_state = FALSE //Boolean used in icon_state strings + var/aroused_amount = 50 //This is a num from 0 to 100 for arousal percentage for when to use arousal state icons. var/obj/item/organ/genital/linked_organ var/linked_organ_slot //only one of the two organs needs this to be set up. update_link() will handle linking the rest. - var/through_clothes = FALSE - var/internal = FALSE - var/hidden = FALSE + var/through_clothes = FALSE + var/internal = FALSE + var/hidden = FALSE var/layer_index = GENITAL_LAYER_INDEX //Order should be very important. FIRST vagina, THEN testicles, THEN penis, as this affects the order they are rendered in. /obj/item/organ/genital/Initialize() diff --git a/modular_citadel/code/modules/arousal/organs/eggsack.dm b/modular_citadel/code/modules/arousal/organs/eggsack.dm index 3282bad5f9..624b2c24cd 100644 --- a/modular_citadel/code/modules/arousal/organs/eggsack.dm +++ b/modular_citadel/code/modules/arousal/organs/eggsack.dm @@ -5,6 +5,7 @@ icon = 'modular_citadel/icons/obj/genitals/ovipositor.dmi' zone = BODY_ZONE_PRECISE_GROIN slot = ORGAN_SLOT_TESTICLES + genital_flags = GENITAL_BLACKLISTED //unimplemented linked_organ_slot = ORGAN_SLOT_PENIS color = null //don't use the /genital color since it already is colored internal = TRUE diff --git a/modular_citadel/code/modules/arousal/organs/ovipositor.dm b/modular_citadel/code/modules/arousal/organs/ovipositor.dm index 92b608f905..c26424d296 100644 --- a/modular_citadel/code/modules/arousal/organs/ovipositor.dm +++ b/modular_citadel/code/modules/arousal/organs/ovipositor.dm @@ -5,6 +5,7 @@ icon = 'modular_citadel/icons/obj/genitals/ovipositor.dmi' zone = BODY_ZONE_PRECISE_GROIN slot = ORGAN_SLOT_PENIS + genital_flags = GENITAL_BLACKLISTED //unimplemented shape = "knotted" size = 3 layer_index = PENIS_LAYER_INDEX diff --git a/modular_citadel/code/modules/arousal/organs/testicles.dm b/modular_citadel/code/modules/arousal/organs/testicles.dm index de7b6d6f70..c67d6a49a4 100644 --- a/modular_citadel/code/modules/arousal/organs/testicles.dm +++ b/modular_citadel/code/modules/arousal/organs/testicles.dm @@ -7,12 +7,13 @@ slot = ORGAN_SLOT_TESTICLES size = BALLS_SIZE_MIN linked_organ_slot = ORGAN_SLOT_PENIS + genital_flags = MASTURBATE_LINKED_ORGAN var/size_name = "average" shape = "single" var/sack_size = BALLS_SACK_SIZE_DEF fluid_id = "semen" producing = TRUE - can_masturbate_with = MASTURBATE_LINKED_ORGAN + can_masturbate_with = TRUE masturbation_verb = "massage" layer_index = TESTICLES_LAYER_INDEX var/size_linked = FALSE