Skip to content

Commit

Permalink
Reworking the taste system to allow for species-level taste definitions.
Browse files Browse the repository at this point in the history
Reworking how data is initialized and handled by reagents.

Post-rebase update for taste PR.

Further work on the taste system.

Updating taste strings. God help me.
  • Loading branch information
MistakeNot4892 committed Jul 19, 2023
1 parent 9a8d1bd commit 28bb2b5
Show file tree
Hide file tree
Showing 15 changed files with 700 additions and 276 deletions.
3 changes: 3 additions & 0 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@
#define TASTE_DULL 0.5 //anything below 30%
#define TASTE_NUMB 0.1 //anything below 150%

#define TASTE_STRING_DEFAULT "default"
#define TASTE_DATA_FIELD "taste_strings"

//Used by emotes
#define VISIBLE_MESSAGE 1
#define AUDIBLE_MESSAGE 2
Expand Down
21 changes: 12 additions & 9 deletions code/_helpers/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -890,12 +890,15 @@ This actually tests if they have the same entries and values.

var/global/list/json_cache = list()
/proc/cached_json_decode(var/json_to_decode)
if(!json_to_decode || !length(json_to_decode))
return list()
try
if(isnull(global.json_cache[json_to_decode]))
global.json_cache[json_to_decode] = json_decode(json_to_decode)
. = global.json_cache[json_to_decode]
catch(var/exception/e)
log_error("Exception during JSON decoding ([json_to_decode]): [e]")
return list()
if(length(json_to_decode))
try
if(isnull(global.json_cache[json_to_decode]))
global.json_cache[json_to_decode] = json_decode(json_to_decode)
var/list/decoded = global.json_cache[json_to_decode]
if(islist(decoded)) // To prevent cache mutation.
return deepCopyList(decoded)
else if(decoded)
return decoded
catch(var/exception/e)
log_error("Exception during JSON decoding ([json_to_decode]): [e]")
return list()
2 changes: 1 addition & 1 deletion code/game/gamemodes/technomancer/spells/condensation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
add_attack_logs(user,hit_atom,"Wetted the floor with [src] at [T.x],[T.y],[T.z]")
else if(hit_atom.reagents && !ismob(hit_atom)) //TODO: Something for the scepter
hit_atom.reagents.add_reagent(id = "water", amount = 60, data = null, safety = 0)
adjust_instability(5)
adjust_instability(5)
Loading

0 comments on commit 28bb2b5

Please sign in to comment.