Skip to content

Commit

Permalink
Merge pull request #1091 from ariaworld/throwkiss-emote
Browse files Browse the repository at this point in the history
[NON-MODULAR PORT] Adds blowable kisses + improved code for updating lip color and applying special lipstick traits
  • Loading branch information
MosleyTheMalO authored Mar 11, 2024
2 parents 101d8e1 + c62528c commit 33bed95
Show file tree
Hide file tree
Showing 17 changed files with 518 additions and 298 deletions.
31 changes: 31 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define SIGNAL_TRAIT(trait_ref) "trait [trait_ref]"
#define SIGNAL_REMOVETRAIT(trait_ref) "removetrait [trait_ref]"

// trait accessor defines
#define ADD_TRAIT(target, trait, source) \
Expand Down Expand Up @@ -59,6 +60,30 @@
};\
}\
} while (0)

#define REMOVE_TRAITS_IN(target, sources) \
do { \
var/list/_L = target.status_traits; \
var/list/_S = sources; \
if (sources && !islist(sources)) { \
_S = list(sources); \
} else { \
_S = sources\
}; \
if (_L) { \
for (var/_T in _L) { \
_L[_T] -= _S;\
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T)); \
}; \
};\
if (!length(_L)) { \
target.status_traits = null\
};\
}\
} while (0)

#define HAS_TRAIT(target, trait) (target.status_traits ? (target.status_traits[trait] ? TRUE : FALSE) : FALSE)
#define HAS_TRAIT_FROM(target, trait, source) (target.status_traits ? (target.status_traits[trait] ? (source in target.status_traits[trait]) : FALSE) : FALSE)
#define HAS_TRAIT_FROM_ONLY(target, trait, source) (\
Expand Down Expand Up @@ -236,6 +261,12 @@
#define TRAIT_NO_STAMINA_REGENERATION "block_stamina_regen" /// Prevents stamina regeneration
#define TRAIT_ARMOR_BROKEN "armor_broken" //acts as if you are wearing no clothing when taking damage, does not affect non-clothing sources of protection
#define TRAIT_IWASBATONED "iwasbatoned" //some dastardly fellow has struck you with a baton and thought to use another to strike you again, the rogue
//Given by social anxiety quirk
#define TRAIT_ANXIOUS "anxious"
/// Trait granted by lipstick
#define LIPSTICK_TRAIT "lipstick_trait"
/// Blowing kisses that actually do damage to the victim
#define TRAIT_KISS_OF_DEATH "kiss_of_death"
/// forces update_density to make us not dense
#define TRAIT_LIVING_NO_DENSITY "living_no_density"
/// forces us to not render our overlays
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_SNOWSTORM_IMMUNE" = TRAIT_SNOWSTORM_IMMUNE,
"TRAIT_VOIDSTORM_IMMUNE" = TRAIT_VOIDSTORM_IMMUNE,
"TRAIT_WEATHER_IMMUNE" = TRAIT_WEATHER_IMMUNE,
"TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH,
"TRAIT_ANXIOUS" = TRAIT_ANXIOUS,
"TRAIT_SPACEWALK" = TRAIT_SPACEWALK,
"TRAIT_PRIMITIVE" = TRAIT_PRIMITIVE, //unable to use mechs. Given to Ash Walkers
),
Expand Down
5 changes: 5 additions & 0 deletions code/datums/mood_events/generic_positive_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,8 @@
description = "<span class='nicegreen'>The gods are pleased with this offering!</span>\n"
mood_change = 5
timeout = 3 MINUTES

/datum/mood_event/kiss
description = span_nicegreen("Someone blew a kiss at me, I must be a real catch!\n")
mood_change = 1.5
timeout = 2 MINUTES
11 changes: 6 additions & 5 deletions code/datums/traits/negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@

GLOBAL_LIST_EMPTY(family_heirlooms)

/datum/quirk/family_heirloom/on_spawn()
/datum/quirk/family_heirloom/on_spawn()
// Define holder and type
var/mob/living/carbon/human/human_holder = quirk_holder
var/obj/item/heirloom_type

// The quirk holder's species - we have a 50% chance, if we have a species with a set heirloom, to choose a species heirloom.
var/datum/species/holder_species = human_holder.dna?.species
if(holder_species && LAZYLEN(holder_species.family_heirlooms) && prob(50))
Expand All @@ -61,13 +61,13 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
// If we didn't find an heirloom somehow, throw them a generic one
if(!heirloom_type)
heirloom_type = pick(/obj/item/toy/cards/deck, /obj/item/lighter, /obj/item/dice/d20)

// Create the heirloom item
heirloom = new heirloom_type(get_turf(quirk_holder))

// Add to global list
GLOB.family_heirlooms += heirloom

// Determine and assign item location
var/list/slots = list(
"in your left pocket" = ITEM_SLOT_LPOCKET,
Expand Down Expand Up @@ -330,6 +330,7 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
gain_text = "<span class='danger'>You start worrying about what you're saying.</span>"
lose_text = "<span class='notice'>You feel easier about talking again.</span>" //if only it were that easy!
medical_record_text = "Patient is usually anxious in social encounters and prefers to avoid them."
mob_trait = TRAIT_ANXIOUS
var/dumb_thing = TRUE
processing_quirk = TRUE

Expand Down
93 changes: 46 additions & 47 deletions code/game/objects/items/cosmetics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
w_class = WEIGHT_CLASS_TINY
var/colour = "red"
var/open = FALSE
/// A trait that's applied while someone has this lipstick applied, and is removed when the lipstick is removed
var/lipstick_trait

/obj/item/lipstick/purple
name = "purple lipstick"
Expand All @@ -21,6 +23,10 @@
name = "black lipstick"
colour = "black"

/obj/item/lipstick/black/death
name = "Kiss of Death"
lipstick_trait = TRAIT_KISS_OF_DEATH

/obj/item/lipstick/random
name = "lipstick"
icon_state = "random_lipstick"
Expand All @@ -33,7 +39,7 @@

/obj/item/lipstick/attack_self(mob/user)
cut_overlays()
to_chat(user, "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>")
to_chat(user, span_notice("You twist \the [src] [open ? "closed" : "open"]."))
open = !open
if(open)
var/mutable_appearance/colored_overlay = mutable_appearance(icon, "lipstick_uncap_color")
Expand All @@ -44,60 +50,53 @@
icon_state = "lipstick"

/obj/item/lipstick/attack(mob/M, mob/user)
if(!open)
if(!open || !ismob(M))
return

if(!ismob(M))
if(!ishuman(M))
to_chat(user, span_warning("Where are the lips on that?"))
return

if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.is_mouth_covered())
to_chat(user, "<span class='warning'>Remove [ H == user ? "your" : "[H.p_their()]" ] mask!</span>")
return
if(H.lip_style) //if they already have lipstick on
to_chat(user, "<span class='warning'>You need to wipe off the old lipstick first!</span>")
return
if(H == user)
user.visible_message("<span class='notice'>[user] does [user.p_their()] lips with \the [src].</span>", \
"<span class='notice'>You take a moment to apply \the [src]. Perfect!</span>")
H.lip_style = "lipstick"
H.lip_color = colour
H.update_body()
else
user.visible_message("<span class='warning'>[user] begins to do [H]'s lips with \the [src].</span>", \
"<span class='notice'>You begin to apply \the [src] on [H]'s lips...</span>")
if(do_after(user, 20, target = H))
user.visible_message("[user] does [H]'s lips with \the [src].", \
"<span class='notice'>You apply \the [src] on [H]'s lips.</span>")
H.lip_style = "lipstick"
H.lip_color = colour
H.update_body()
else
to_chat(user, "<span class='warning'>Where are the lips on that?</span>")
var/mob/living/carbon/human/target = M
if(target.is_mouth_covered())
to_chat(user, span_warning("Remove [ target == user ? "your" : "[target.p_their()]" ] mask!"))
return
if(target.lip_style) //if they already have lipstick on
to_chat(user, span_warning("You need to wipe off the old lipstick first!"))
return

if(target == user)
user.visible_message(span_notice("[user] does [user.p_their()] lips with \the [src]."), \
span_notice("You take a moment to apply \the [src]. Perfect!"))
target.update_lips("lipstick", colour, lipstick_trait)
return

user.visible_message(span_warning("[user] begins to do [target]'s lips with \the [src]."), \
span_notice("You begin to apply \the [src] on [target]'s lips..."))
if(!do_after(user, 2 SECONDS, target = target))
return
user.visible_message(span_notice("[user] does [target]'s lips with \the [src]."), \
span_notice("You apply \the [src] on [target]'s lips."))
target.update_lips("lipstick", colour, lipstick_trait)

//you can wipe off lipstick with paper!
/obj/item/paper/attack(mob/M, mob/user)
if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
if(!ismob(M))
return
if(user.zone_selected != BODY_ZONE_PRECISE_MOUTH || !ishuman(M))
return ..()

if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H == user)
to_chat(user, "<span class='notice'>You wipe off the lipstick with [src].</span>")
H.lip_style = null
H.update_body()
else
user.visible_message("<span class='warning'>[user] begins to wipe [H]'s lipstick off with \the [src].</span>", \
"<span class='notice'>You begin to wipe off [H]'s lipstick...</span>")
if(do_after(user, 10, target = H))
user.visible_message("[user] wipes [H]'s lipstick off with \the [src].", \
"<span class='notice'>You wipe off [H]'s lipstick.</span>")
H.lip_style = null
H.update_body()
else
..()
var/mob/living/carbon/human/target = M
if(target == user)
to_chat(user, span_notice("You wipe off the lipstick with [src]."))
target.clean_lips()
return

user.visible_message(span_warning("[user] begins to wipe [target]'s lipstick off with \the [src]."), \
span_notice("You begin to wipe off [target]'s lipstick..."))
if(!do_after(user, 10, target = target))
return
user.visible_message(span_notice("[user] wipes [target]'s lipstick off with \the [src]."), \
span_notice("You wipe off [target]'s lipstick."))
target.clean_lips()

/obj/item/razor
name = "electric razor"
Expand Down
Loading

0 comments on commit 33bed95

Please sign in to comment.