Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions code/__defines/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
#define MAT_SOLVENT_MODERATE 2
#define MAT_SOLVENT_STRONG 3

#define DIRTINESS_STERILE -2
#define DIRTINESS_CLEAN -1
#define DIRTINESS_NEUTRAL 0
#define DIRTINESS_DECONTAMINATE -3
#define DIRTINESS_STERILE -2
#define DIRTINESS_CLEAN -1
#define DIRTINESS_NEUTRAL 0

#define DEFAULT_GAS_ACCELERANT /decl/material/gas/hydrogen
#define DEFAULT_GAS_OXIDIZER /decl/material/gas/oxygen
Expand Down
5 changes: 0 additions & 5 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@
#define WRINKLES_WRINKLY 1
#define WRINKLES_NONE 2

//detergent states for clothes
#define SMELL_DEFAULT 0
#define SMELL_CLEAN 1
#define SMELL_STINKY 2

//Shuttle mission stages
#define SHUTTLE_MISSION_PLANNED 1
#define SHUTTLE_MISSION_STARTED 2
Expand Down
20 changes: 13 additions & 7 deletions code/datums/extensions/scent/_scent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Scent intensity
*****/
/decl/scent_intensity
var/cooldown = 5 MINUTES
var/cooldown = 5 MINUTES
var/intensity = 1

/decl/scent_intensity/proc/PrintMessage(var/mob/user, var/descriptor, var/scent)
Expand Down Expand Up @@ -121,18 +121,24 @@ To add a scent extension to an atom using a reagent's info, where R. is the reag
*****/

/proc/set_scent_by_reagents(var/atom/smelly_atom)
var/decl/material/smelliest = get_smelliest_reagent(smelly_atom.reagents)
if(smelliest)
set_extension(smelly_atom, /datum/extension/scent/custom, smelliest.scent, smelliest.scent_intensity, smelliest.scent_descriptor, smelliest.scent_range)

// Returns the smelliest reagent of a reagent holder.
/proc/get_smelliest_reagent(var/datum/reagents/holder)
var/decl/material/smelliest
var/decl/material/scent_intensity
if(!smelly_atom.reagents || !smelly_atom.reagents.total_volume)
if(!holder || !holder.total_volume)
return
for(var/reagent_type in smelly_atom.reagents.reagent_volumes)
for(var/reagent_type in holder.reagent_volumes)
var/decl/material/R = GET_DECL(reagent_type)
if(!R.scent)
continue
var/decl/scent_intensity/SI = GET_DECL(R.scent_intensity)
var/r_scent_intensity = REAGENT_VOLUME(smelly_atom.reagents, reagent_type) * SI.intensity
var/r_scent_intensity = REAGENT_VOLUME(holder, reagent_type) * SI.intensity
if(r_scent_intensity > scent_intensity)
smelliest = R
scent_intensity = r_scent_intensity
if(smelliest)
set_extension(smelly_atom, /datum/extension/scent/custom, smelliest.scent, smelliest.scent_intensity, smelliest.scent_descriptor, smelliest.scent_range)
scent_intensity = r_scent_intensity

return smelliest
Loading