Skip to content

Commit

Permalink
Refactors moodlets so that newline control characters don't have to b…
Browse files Browse the repository at this point in the history
…e explicitly written, converts descriptions to span macros (#3623)

## About The Pull Request

Refactors moodlets to use span macros, changes how they print so
explicit newlines are not required in descriptions. Added span macros to
a couple descriptions that had no coloring

Tested locally and moodlets display properly


![image](https://github.com/user-attachments/assets/5c186a1e-2d11-44a6-9d27-8fd83b4e375e)


## Why It's Good For The Game

Refactor good

## Changelog

:cl:
refactor: Refactored moods so explicit newlines are not required in
descriptions. None of this changes player facing stuff.
/:cl:

---------

Signed-off-by: CoreyLee Hassell <[email protected]>
Co-authored-by: Theos <[email protected]>
  • Loading branch information
Anticept and SomeguyManperson authored Oct 26, 2024
1 parent 0e7ccda commit 5049e6a
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 166 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#define span_narsie(str) ("<span class='narsie'>" + str + "</span>")
#define span_narsiesmall(str) ("<span class='narsiesmall'>" + str + "</span>")
#define span_nicegreen(str) ("<span class='nicegreen'>" + str + "</span>")
#define span_nicegreen_robot(str) ("<span class='nicegreen robot'>" + str + "</span>")
#define span_notice(str) ("<span class='notice'>" + str + "</span>")
#define span_noticealien(str) ("<span class='noticealien'>" + str + "</span>")
#define span_ooc(str) ("<span class='ooc'>" + str + "</span>")
Expand Down Expand Up @@ -113,6 +114,7 @@
#define span_unconscious(str) ("<span class='unconscious'>" + str + "</span>")
#define span_userdanger(str) ("<span class='userdanger'>" + str + "</span>")
#define span_warning(str) ("<span class='warning'>" + str + "</span>")
#define span_warning_robot(str) ("<span class='warning robot'>" + str + "</span>")
#define span_yell(str) ("<span class='yell'>" + str + "</span>")
#define span_yellowteamradio(str) ("<span class='yellowteamradio'>" + str + "</span>")

Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
if(mood_events.len)
for(var/i in mood_events)
var/datum/mood_event/event = mood_events[i]
msg += event.description
msg += "[event.description]\n" // now we dont have to put \n in every moodlet description
else
msg += "<span class='nicegreen'>I don't have much of a reaction to anything right now.</span>\n"
to_chat(user, examine_block(msg))
Expand Down
10 changes: 5 additions & 5 deletions code/datums/mood_events/beauty_events.dm
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/datum/mood_event/horridroom
description = "<span class='boldwarning'>This room looks terrible!</span>\n"
description = span_boldwarning("This room looks terrible!")
mood_change = -5

/datum/mood_event/badroom
description = "<span class='warning'>This room looks really bad.</span>\n"
description = span_warning("This room looks really bad.")
mood_change = -3

/datum/mood_event/decentroom
description = "<span class='nicegreen'>This room looks alright.</span>\n"
description = span_nicegreen("This room looks alright.")
mood_change = 1

/datum/mood_event/goodroom
description = "<span class='nicegreen'>This room looks really pretty!</span>\n"
description = span_nicegreen("This room looks really pretty!")
mood_change = 3

/datum/mood_event/greatroom
description = "<span class='nicegreen'>This room is beautiful!</span>\n"
description = span_nicegreen("This room is beautiful!")
mood_change = 5
12 changes: 6 additions & 6 deletions code/datums/mood_events/drink_events.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/datum/mood_event/drunk
mood_change = 3
description = "<span class='nicegreen'>Everything just feels better after a drink or two.</span>\n"
description = span_nicegreen("Everything just feels better after a drink or two.")

/datum/mood_event/drunk/add_effects(param)
// Display blush visual
Expand All @@ -13,26 +13,26 @@
owner.update_body()

/datum/mood_event/quality_nice
description = "<span class='nicegreen'>That drink wasn't bad at all.</span>\n"
description = span_nicegreen("That drink wasn't bad at all.")
mood_change = 2
timeout = 7 MINUTES

/datum/mood_event/quality_good
description = "<span class='nicegreen'>That drink was pretty good.</span>\n"
description = span_nicegreen("That drink was pretty good.")
mood_change = 4
timeout = 7 MINUTES

/datum/mood_event/quality_verygood
description = "<span class='nicegreen'>That drink was great!</span>\n"
description = span_nicegreen("That drink was great!")
mood_change = 6
timeout = 7 MINUTES

/datum/mood_event/quality_fantastic
description = "<span class='nicegreen'>That drink was amazing!</span>\n"
description = span_nicegreen("That drink was amazing!")
mood_change = 8
timeout = 7 MINUTES

/datum/mood_event/amazingtaste
description = "<span class='nicegreen'>Amazing taste!</span>\n"
description = span_nicegreen("Amazing taste!")
mood_change = 50
timeout = 10 MINUTES
34 changes: 17 additions & 17 deletions code/datums/mood_events/drug_events.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/datum/mood_event/high
mood_change = 6
description = "<span class='nicegreen'>Woooow duudeeeeee...I'm tripping baaalls...</span>\n"
description = span_nicegreen("Woooow duudeeeeee...I'm tripping baaalls...")

/datum/mood_event/smoked
description = "<span class='nicegreen'>I have had a smoke recently.</span>\n"
description = span_nicegreen("I have had a smoke recently.")
mood_change = 1
timeout = 6 MINUTES

/datum/mood_event/wrong_brand
description = "<span class='warning'>That brand of cigarette just doesn't hit right.</span>\n"
description = span_warning("That brand of cigarette just doesn't hit right.")
mood_change = -1
timeout = 6 MINUTES

Expand All @@ -17,72 +17,72 @@
timeout = 5 MINUTES

/datum/mood_event/overdose/add_effects(drug_name)
description = "<span class='warning'>I think I took a bit too much of that [drug_name]</span>\n"
description = span_warning("I think I took a bit too much of that [drug_name]")

/datum/mood_event/withdrawal_light
mood_change = -2

/datum/mood_event/withdrawal_light/add_effects(drug_name)
description = "<span class='warning'>I could use some [drug_name]</span>\n"
description = span_warning("I could use some [drug_name]")

/datum/mood_event/withdrawal_medium
mood_change = -5

/datum/mood_event/withdrawal_medium/add_effects(drug_name)
description = "<span class='warning'>I really need [drug_name]</span>\n"
description = span_warning("I really need [drug_name]")

/datum/mood_event/withdrawal_severe
mood_change = -8

/datum/mood_event/withdrawal_severe/add_effects(drug_name)
description = "<span class='boldwarning'>Oh god I need some of that [drug_name]</span>\n"
description = span_boldwarning("Oh god I need some of that [drug_name]")

/datum/mood_event/withdrawal_critical
mood_change = -10

/datum/mood_event/withdrawal_critical/add_effects(drug_name)
description = "<span class='boldwarning'>[drug_name]! [drug_name]! [drug_name]!</span>\n"
description = span_boldwarning("[drug_name]! [drug_name]! [drug_name]!")

/datum/mood_event/happiness_drug
description = "<span class='nicegreen'>Can't feel a thing...</span>\n"
description = span_nicegreen("Can't feel a thing...")
mood_change = 50

/datum/mood_event/happiness_drug_good_od
description = "<span class='nicegreen'>YES! YES!! YES!!!</span>\n"
description = span_nicegreen("YES! YES!! YES!!!")
mood_change = 100
timeout = 30 SECONDS
special_screen_obj = "mood_happiness_good"

/datum/mood_event/happiness_drug_bad_od
description = "<span class='boldwarning'>NO! NO!! NO!!!</span>\n"
description = span_boldwarning("NO! NO!! NO!!!")
mood_change = -100
timeout = 30 SECONDS
special_screen_obj = "mood_happiness_bad"

/datum/mood_event/narcotic_medium
description = "<span class='nicegreen'>I feel comfortably numb.</span>\n"
description = span_nicegreen("I feel comfortably numb.")
mood_change = 4
timeout = 3 MINUTES

/datum/mood_event/narcotic_heavy
description = "<span class='nicegreen'>I feel like I'm wrapped up in cotton!</span>\n"
description = span_nicegreen("I feel like I'm wrapped up in cotton!")
mood_change = 9
timeout = 3 MINUTES

/datum/mood_event/stimulant_medium
description = "<span class='nicegreen'>I have so much energy! I feel like I could do anything!</span>\n"
description = span_nicegreen("I have so much energy! I feel like I could do anything!")
mood_change = 4
timeout = 3 MINUTES

/datum/mood_event/stimulant_heavy
description = "<span class='nicegreen'>Eh ah AAAAH! HA HA HA HA HAA! Uuuh.</span>\n"
description = span_nicegreen("Eh ah AAAAH! HA HA HA HA HAA! Uuuh.")
mood_change = 6
timeout = 3 MINUTES

/datum/mood_event/legion_good
mood_change = 20
description = "<span class='nicegreen'>I'm feeling great!</span>\n"
description = span_nicegreen("I'm feeling great!")

/datum/mood_event/legion_bad
mood_change = -20
description = "<span class='warning'>That felt awful!</span>\n"
description = span_warning("That felt awful!")
Loading

0 comments on commit 5049e6a

Please sign in to comment.