mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
[MIRROR] Converting art component into element. (#1562)
* Converting art component into element. (#54616) * Only art is now an element. There have been some issues with beauty. * Typo. * Update art.dm * Update art.dm * Maintainer suggestions. Reversing order of switch(impress) for correct moodlets. * Fixing some pre-existing oddities with art element. * stating the right var. * simplifying the component. * Update art.dm * lowercasing pronoun. * Converting art component into element. Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
/datum/component/art
|
||||
var/impressiveness = 0
|
||||
|
||||
/datum/component/art/Initialize(impress)
|
||||
impressiveness = impress
|
||||
if(isobj(parent))
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_obj_examine)
|
||||
else
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_other_examine)
|
||||
if(isstructure(parent))
|
||||
RegisterSignal(parent, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
|
||||
if(isitem(parent))
|
||||
RegisterSignal(parent, COMSIG_ITEM_ATTACK_SELF, .proc/apply_moodlet)
|
||||
|
||||
/datum/component/art/proc/apply_moodlet(mob/M, impress)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
M.visible_message("<span class='notice'>[M] stops and looks intently at [parent].</span>", \
|
||||
"<span class='notice'>You stop to take in [parent].</span>")
|
||||
switch(impress)
|
||||
if (0 to BAD_ART)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artbad", /datum/mood_event/artbad)
|
||||
if (BAD_ART to GOOD_ART)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artok", /datum/mood_event/artok)
|
||||
if (GOOD_ART to GREAT_ART)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artgood", /datum/mood_event/artgood)
|
||||
if(GREAT_ART to INFINITY)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artgreat", /datum/mood_event/artgreat)
|
||||
|
||||
|
||||
/datum/component/art/proc/on_other_examine(datum/source, mob/M)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
apply_moodlet(M, impressiveness)
|
||||
|
||||
/datum/component/art/proc/on_obj_examine(datum/source, mob/M)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
var/obj/O = parent
|
||||
apply_moodlet(M, impressiveness *(O.obj_integrity/O.max_integrity))
|
||||
|
||||
/datum/component/art/proc/on_attack_hand(datum/source, mob/M)
|
||||
SIGNAL_HANDLER_DOES_SLEEP
|
||||
|
||||
to_chat(M, "<span class='notice'>You start examining [parent]...</span>")
|
||||
if(!do_after(M, 20, target = parent))
|
||||
return
|
||||
on_obj_examine(source, M)
|
||||
|
||||
/datum/component/art/rev
|
||||
|
||||
/datum/component/art/rev/apply_moodlet(mob/M, impress)
|
||||
M.visible_message("<span class='notice'>[M] stops to inspect [parent].</span>", \
|
||||
"<span class='notice'>You take in [parent], inspecting the fine craftsmanship of the proletariat.</span>")
|
||||
|
||||
if(M.mind && M.mind.has_antag_datum(/datum/antagonist/rev))
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artgreat", /datum/mood_event/artgreat)
|
||||
else
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "artbad", /datum/mood_event/artbad)
|
||||
@@ -0,0 +1,66 @@
|
||||
/datum/element/art
|
||||
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
|
||||
id_arg_index = 2
|
||||
var/impressiveness = 0
|
||||
|
||||
/datum/element/art/Attach(datum/target, impress)
|
||||
. = ..()
|
||||
if(!isatom(target) || isarea(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
impressiveness = impress
|
||||
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
||||
|
||||
/datum/element/art/Detach(datum/target)
|
||||
UnregisterSignal(target, COMSIG_PARENT_EXAMINE)
|
||||
return ..()
|
||||
|
||||
/datum/element/art/proc/apply_moodlet(atom/source, mob/user, impress)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
var/msg
|
||||
switch(impress)
|
||||
if(GREAT_ART to INFINITY)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgreat", /datum/mood_event/artgreat)
|
||||
msg = "What \a [pick("masterpiece", "chef-d'oeuvre")] [source.p_theyre()]. So [pick("trascended", "awe-inspiring", "bewitching", "impeccable")]!"
|
||||
if (GOOD_ART to GREAT_ART)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgood", /datum/mood_event/artgood)
|
||||
msg = "[source.p_theyre(TRUE)] a [pick("respectable", "commendable", "laudable")] art piece, easy on the keen eye."
|
||||
if (BAD_ART to GOOD_ART)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artok", /datum/mood_event/artok)
|
||||
msg = "[source.p_theyre(TRUE)] fair to middling, enough to be called an \"art object\"."
|
||||
if (0 to BAD_ART)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artbad", /datum/mood_event/artbad)
|
||||
msg = "Wow, [source.p_they()] sucks."
|
||||
|
||||
user.visible_message("<span class='notice'>[user] stops and looks intently at [source].</span>", \
|
||||
"<span class='notice'>You appraise [source]... [msg]</span>")
|
||||
|
||||
/datum/element/art/proc/on_examine(atom/source, mob/user, list/examine_texts)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!INTERACTING_WITH(user, source))
|
||||
INVOKE_ASYNC(src, .proc/appraise, source, user) //Do not sleep the proc.
|
||||
|
||||
/datum/element/art/proc/appraise(atom/source, mob/user)
|
||||
to_chat(user, "<span class='notice'>You start appraising [source]...</span>")
|
||||
if(!do_after(user, 2 SECONDS, target = source))
|
||||
return
|
||||
var/mult = 1
|
||||
if(isobj(source))
|
||||
var/obj/art_piece = source
|
||||
mult = art_piece.obj_integrity/art_piece.max_integrity
|
||||
|
||||
apply_moodlet(source, user, impressiveness * mult)
|
||||
|
||||
/datum/element/art/rev
|
||||
|
||||
/datum/element/art/rev/apply_moodlet(atom/source, mob/user, impress)
|
||||
var/msg
|
||||
if(user.mind?.has_antag_datum(/datum/antagonist/rev))
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgreat", /datum/mood_event/artgreat)
|
||||
msg = "What \a [pick("masterpiece", "chef-d'oeuvre")] [source.p_theyre()]. So [pick("subversive", "revolutionary", "unitizing", "egalitarian")]!"
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artbad", /datum/mood_event/artbad)
|
||||
msg = "Wow, [source.p_they()] sucks."
|
||||
|
||||
user.visible_message("<span class='notice'>[user] stops to inspect [source].</span>", \
|
||||
"<span class='notice'>You appraise [source], inspecting the fine craftsmanship of the proletariat... [msg]</span>")
|
||||
Reference in New Issue
Block a user