Skip to content

Commit 4afde47

Browse files
authored
Removes Memories, returns Notes in their place. (#1101)
* removes memories, adds notes * fixes and tweaks
1 parent 0c607a1 commit 4afde47

File tree

39 files changed

+162
-926
lines changed

39 files changed

+162
-926
lines changed

code/__DEFINES/memory_defines.dm

+6-159
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,12 @@
1-
///name of the file that has all the memory strings
2-
#define MEMORY_FILE "memories.json"
1+
#define NOTES_CUSTOM "Custom"
2+
#define NOTES_BANK_ACCOUNT "Bank"
3+
#define NOTES_ANTAG "Antag"
4+
#define NOTES_TRAITS "Traits"
5+
36
///name of the file that has all the saved engravings
47
#define ENGRAVING_SAVE_FILE "data/engravings/[SSmapping.config.map_name]_engravings.json"
5-
///name of the file that has all the prisoner tattoos
6-
#define PRISONER_TATTOO_SAVE_FILE "data/engravings/prisoner_tattoos.json"
78
///Current version of the engraving persistence json
8-
#define ENGRAVING_PERSISTENCE_VERSION 0
9-
///Current version of the tattoo persistence json
10-
#define TATTOO_PERSISTENCE_VERSION 0
11-
9+
#define ENGRAVING_PERSISTENCE_VERSION 1
1210
///how many engravings will be loaded max with persistence
1311
#define MIN_PERSISTENT_ENGRAVINGS 15
1412
#define MAX_PERSISTENT_ENGRAVINGS 25
15-
16-
///threshold for the memory being a happy one 8)
17-
#define MEMORY_HAPPY_THRESHOLD 7
18-
///threshold for the memory being a sad one :^(
19-
#define MEMORY_SAD_THRESHOLD 7
20-
///moodlet set if the creature with the memory doesn't use mood (doesn't include mood line)
21-
#define MOODLESS_MEMORY "nope"
22-
23-
///Factor of how beauty is divided to make the engraving art value
24-
#define ENGRAVING_BEAUTY_TO_ART_FACTOR 10
25-
//Factor on how much beauty is removed from before adding the element on old engravings
26-
#define ENGRAVING_PERSISTENCE_BEAUTY_LOSS_FACTOR 5
27-
28-
///How cool a story is!
29-
#define STORY_VALUE_SHIT 0 // poo icon
30-
#define STORY_VALUE_NONE 1 // |: face
31-
#define STORY_VALUE_MEH 2 // bronze star
32-
#define STORY_VALUE_OKAY 3 // silver star
33-
#define STORY_VALUE_AMAZING 4 //gold star
34-
#define STORY_VALUE_LEGENDARY 5 //platinum star
35-
36-
//Flags for memories
37-
///this memory doesn't have a location, emit that
38-
#define MEMORY_FLAG_NOLOCATION (1<<0)
39-
///this memory shouldn't include the station name (example: revolution memory)
40-
#define MEMORY_FLAG_NOSTATIONNAME (1<<1)
41-
///this memory is REALLY shit and should never be saved in persistence, basically apply this to all quirks.
42-
#define MEMORY_FLAG_NOPERSISTENCE (1<<2)
43-
///this memory has already been engraved, and cannot be selected for engraving again.
44-
#define MEMORY_FLAG_ALREADY_USED (1<<3)
45-
///this memory requires the target not to be blind.
46-
#define MEMORY_CHECK_BLINDNESS (1<<4)
47-
///this memory requires the target not to be deaf.
48-
#define MEMORY_CHECK_DEAFNESS (1<<5)
49-
///this memory requires the target not to be both deaf and blind.
50-
#define MEMORY_CHECK_BLIND_AND_DEAF (MEMORY_CHECK_BLINDNESS|MEMORY_CHECK_DEAFNESS)
51-
///this memory can be memorized by unconscious people.
52-
#define MEMORY_SKIP_UNCONSCIOUS (1<<6)
53-
54-
// These defines are for what notable event happened. they correspond to the json lists related to the memory
55-
/// A memory of completing a surgery.
56-
#define MEMORY_SUCCESSFUL_SURGERY "surgery"
57-
/// A memory of priming a bomb
58-
#define MEMORY_BOMB_PRIMED "bomb"
59-
/// A memory of pulling off either a high five or a high ten
60-
#define MEMORY_HIGH_FIVE "highfive"
61-
/// A memory of getting borged
62-
#define MEMORY_BORGED "borged"
63-
/// A memory of dying! includes time of death
64-
#define MEMORY_DEATH "death"
65-
/// A memory of being creampied! Mentions where
66-
#define MEMORY_CREAMPIED "creampied"
67-
/// A memory of being slipped! Mentions on what
68-
#define MEMORY_SLIPPED "slipped"
69-
/// A memory of letting my spaghetti spill, how embarrasing!
70-
#define MEMORY_SPAGHETTI_SPILL "spaghetti_spilled"
71-
/// A memory of getting a kiss blown. Provides the kisser and kissee.
72-
#define MEMORY_KISS "kiss"
73-
/// A memory of a really good meal
74-
#define MEMORY_MEAL "meal"
75-
/// A memory of a really good drink
76-
#define MEMORY_DRINK "drink"
77-
/// A memory of being lit
78-
#define MEMORY_FIRE "fire"
79-
/// A memory of limb loss
80-
#define MEMORY_DISMEMBERED "dismembered"
81-
/// A memory of seeing a pet die
82-
#define MEMORY_PET_DEAD "pet_dead"
83-
/// A memory of leading a winning revolution
84-
#define MEMORY_WON_REVOLUTION "won_revolution"
85-
/// An award ceremony of a medal
86-
#define MEMORY_RECEIVED_MEDAL "received_medal"
87-
/// A megafauna kill!
88-
#define MEMORY_MEGAFAUNA_KILL "megafauna_kill"
89-
/// Being held at gunpoint
90-
#define MEMORY_GUNPOINT "held_at_gunpoint"
91-
/// Exploding into gibs
92-
#define MEMORY_GIBBED "gibbed"
93-
/// Crushed by vending machine
94-
#define MEMORY_VENDING_CRUSHED "vending_crushed"
95-
/// Dusted by SM
96-
#define MEMORY_SUPERMATTER_DUSTED "supermatter_dusted"
97-
/// Nuke ops nuke code memory
98-
#define MEMORY_NUKECODE "nuke_code"
99-
/// A memory of having to play 52 card pickup
100-
#define MEMORY_PLAYING_52_PICKUP "playing_52_pickup"
101-
/// A memory of playing cards with others
102-
#define MEMORY_PLAYING_CARDS "playing_cards"
103-
104-
105-
/**
106-
* These are also memories, but they're examples of what I kinda don't want to be memories. They're stuff that I had to port
107-
* over to this system from the old old and they don't make for good examples
108-
*
109-
* ideally these eventually get moved off this system... though engraving your bank account is so HILARIOUSLY dumb so maybe leave that one
110-
*/
111-
///your memorized bank account
112-
#define MEMORY_ACCOUNT "account"
113-
///your memorized drug
114-
#define MEMORY_QUIRK_DRUG "quirk_drug"
115-
///your allergy
116-
#define MEMORY_ALLERGY "allergy"
117-
118-
//These defines are for what the story is for, they should be defined as what part of the json file they interact with
119-
///wall engraving stories
120-
#define STORY_ENGRAVING "engraving"
121-
///changeling memory reading
122-
#define STORY_CHANGELING_ABSORB "changeling_absorb"
123-
///tattoos
124-
#define STORY_TATTOO "tattoo"
125-
126-
//These defines are story flags for including special bits on the generated story.
127-
///include a date this event happened
128-
#define STORY_FLAG_DATED (1<<0)
129-
130-
///Generic memory info keys. Use these whenever one of these is the case in a story, because we add extra story piece if these exist.
131-
///The location of the memory, add these to have a chance of it being added to the story
132-
#define DETAIL_WHERE "WHERE"
133-
///The main subject of the memory. Should be whoever has the biggest impact on the story. (As it grabs the memory from this person)
134-
#define DETAIL_PROTAGONIST "PROTAGONIST"
135-
///Usually used bespokely by specific memory types and not added generically, but its generaly the object used to cause the memory. E.g. a peel to slip, the food that was eaten.
136-
#define DETAIL_WHAT_BY "WHAT_BY"
137-
///Used whenever a memory has a secondary character. Used bespokely by actions.
138-
#define DETAIL_DEUTERAGONIST "DEUTERAGONIST"
139-
///Automatically obtained details
140-
#define DETAIL_PROTAGONIST_MOOD "VICTIM_MOOD"
141-
142-
//Specific memory info keys. they are used to replace json strings with memory specific data!
143-
#define DETAIL_SURGERY_TYPE "SURGERY_TYPE"
144-
#define DETAIL_TIME_OF_DEATH "TIME_OF_DEATH"
145-
#define DETAIL_ALLERGY_TYPE "ALLERGY_TYPE"
146-
#define DETAIL_FAV_BRAND "FAV_BRAND"
147-
#define DETAIL_HIGHFIVE_TYPE "HIGHFIVE_TYPE"
148-
#define DETAIL_BOMB_TYPE "BOMB_TYPE"
149-
#define DETAIL_ACCOUNT_ID "ACCOUNT_ID"
150-
#define DETAIL_ACCOUNT_PIN "ACCOUNT_PIN"
151-
#define DETAIL_KISSER "KISSER"
152-
#define DETAIL_FOOD "FOOD"
153-
#define DETAIL_DRINK "DRINK"
154-
#define DETAIL_LOST_LIMB "LOST_LIMB"
155-
#define DETAIL_STATION_NAME "STATION_NAME"
156-
#define DETAIL_MEDAL_TYPE "MEDAL_TYPE"
157-
#define DETAIL_MEDAL_REASON "MEDAL_REASON"
158-
#define DETAIL_NUKE_CODE "NUKE_CODE"
159-
// for cardgames
160-
#define DETAIL_PLAYERS "PLAYERS"
161-
#define DETAIL_CARDGAME "CARDGAME"
162-
#define DETAIL_DEALER "DEALER"
163-
#define DETAIL_HELD_CARD_ITEM "HELD_CARD_ITEM" // could either be a singlecard, cardhand, or a deck
164-
165-

code/__HELPERS/memory_helpers.dm

-99
This file was deleted.

code/_compile_options.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
/////////////////////// MISC PERFORMANCE
166166

167167
//uncomment this to load centcom and runtime station and thats it.
168-
#define LOWMEMORYMODE
168+
// #define LOWMEMORYMODE
169169

170170
//uncomment to enable the spatial grid debug proc.
171171
// #define SPATIAL_GRID_ZLEVEL_STATS

code/_globalvars/lists/maintenance_loot.dm

-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ GLOBAL_LIST_INIT(rarity_loot, list(//rare: really good items
313313
/obj/item/book/granter/crafting_recipe/trash_cannon = 1,
314314
/obj/item/disk/nuclear/fake = 1,
315315
/obj/item/skillchip/brainwashing = 1,
316-
/obj/item/tattoo_kit = 1,
317316
) = 1,
318317

319318
))

code/controllers/subsystem/job.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ SUBSYSTEM_DEF(job)
622622
var/mob/living/carbon/human/wageslave = equipping
623623
var/datum/bank_account/bank = SSeconomy.bank_accounts_by_id["[wageslave.account_id]"]
624624

625-
wageslave.mind.add_memory(MEMORY_ACCOUNT, list(DETAIL_ACCOUNT_ID = wageslave.account_id, DETAIL_ACCOUNT_PIN = bank.account_pin), story_value = STORY_VALUE_SHIT, memory_flags = MEMORY_FLAG_NOLOCATION)
625+
wageslave.mind.set_note(NOTES_BANK_ACCOUNT, list("Account ID: [wageslave.account_id]<br>Account PIN: [bank.account_pin]"))
626626
to_chat(player_client, span_obviousnotice("Your bank account pin is: <b>[bank.account_pin]</b>"))
627627

628628
setup_alt_job_items(wageslave, job, player_client) //PARIAH EDIT ADDITION

code/controllers/subsystem/persistence.dm

-61
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ SUBSYSTEM_DEF(persistence)
99

1010
///instantiated wall engraving components
1111
var/list/wall_engravings = list()
12-
///tattoo stories that we're saving.
13-
var/list/prison_tattoos_to_save = list()
14-
///tattoo stories that have been selected for this round.
15-
var/list/prison_tattoos_to_use = list()
1612
var/list/saved_messages = list()
1713
var/list/saved_modes = list(1,2,3)
1814
var/list/saved_maps = list()
@@ -25,7 +21,6 @@ SUBSYSTEM_DEF(persistence)
2521
/datum/controller/subsystem/persistence/Initialize()
2622
LoadPoly()
2723
load_wall_engravings()
28-
load_prisoner_tattoos()
2924
LoadTrophies()
3025
LoadRecentMaps()
3126
LoadPhotoPersistence()
@@ -37,7 +32,6 @@ SUBSYSTEM_DEF(persistence)
3732

3833
/datum/controller/subsystem/persistence/proc/collect_data()
3934
save_wall_engravings()
40-
save_prisoner_tattoos()
4135
CollectTrophies()
4236
CollectMaps()
4337
SavePhotoPersistence() //THIS IS PERSISTENCE, NOT THE LOGGING PORTION.
@@ -129,61 +123,6 @@ SUBSYSTEM_DEF(persistence)
129123

130124
return json
131125

132-
/datum/controller/subsystem/persistence/proc/load_prisoner_tattoos()
133-
var/json_file = file(PRISONER_TATTOO_SAVE_FILE)
134-
if(!fexists(json_file))
135-
return
136-
var/list/json = json_decode(file2text(json_file))
137-
if(!json)
138-
return
139-
140-
if(json["version"] < TATTOO_PERSISTENCE_VERSION)
141-
update_prisoner_tattoos(json)
142-
143-
var/datum/job/prisoner_datum = SSjob.name_occupations[JOB_PRISONER]
144-
if(!prisoner_datum)
145-
return
146-
var/iterations_allowed = prisoner_datum.spawn_positions
147-
148-
var/list/entries = json["entries"]
149-
if(entries.len)
150-
for(var/index in 1 to iterations_allowed)
151-
prison_tattoos_to_use += list(entries[rand(1, entries.len)])
152-
153-
log_world("Loaded [prison_tattoos_to_use.len] prison tattoos")
154-
155-
/datum/controller/subsystem/persistence/proc/save_prisoner_tattoos()
156-
var/json_file = file(PRISONER_TATTOO_SAVE_FILE)
157-
var/list/saved_data = list()
158-
var/list/entries = list()
159-
160-
if(fexists(json_file))
161-
var/list/old_json = json_decode(file2text(json_file))
162-
if(old_json)
163-
entries += old_json["entries"] //Save the old if its there
164-
165-
entries += prison_tattoos_to_save
166-
167-
saved_data["version"] = ENGRAVING_PERSISTENCE_VERSION
168-
saved_data["entries"] = entries
169-
170-
fdel(json_file)
171-
WRITE_FILE(json_file, json_encode(saved_data))
172-
173-
///This proc can update entries if the format has changed at some point.
174-
/datum/controller/subsystem/persistence/proc/update_prisoner_tattoos(json)
175-
176-
for(var/tattoo_entry in json["entries"])
177-
continue //no versioning yet
178-
179-
//Save it to the file
180-
var/json_file = file(PRISONER_TATTOO_SAVE_FILE)
181-
fdel(json_file)
182-
WRITE_FILE(json_file, json_encode(json))
183-
184-
return json
185-
186-
187126
/datum/controller/subsystem/persistence/proc/LoadTrophies()
188127
if(fexists("data/npc_saves/TrophyItems.sav")) //legacy compatability to convert old format to new
189128
var/savefile/S = new /savefile("data/npc_saves/TrophyItems.sav")

code/datums/components/creamed.dm

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ GLOBAL_LIST_INIT(creamable, typecacheof(list(
1919

2020
SEND_SIGNAL(parent, COMSIG_MOB_CREAMED)
2121

22-
add_memory_in_range(parent, 7, MEMORY_CREAMPIED, list(DETAIL_PROTAGONIST = parent), story_value = STORY_VALUE_OKAY, memory_flags = MEMORY_CHECK_BLINDNESS, protagonist_memory_flags = NONE)
23-
2422
creamface = mutable_appearance('icons/effects/creampie.dmi')
2523

2624
if(ishuman(parent))

0 commit comments

Comments
 (0)