Skip to content

Commit 778373e

Browse files
Merge pull request NebulaSS13#5236 from out-of-phaze/tweak/custom-slogan
Add a proc to allow custom vendor slogans
2 parents 8d1a8dd + f0ad1a4 commit 778373e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

code/game/machinery/vending/_vending.dm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,11 @@
404404

405405
SSnano.update_uis(src)
406406

407+
/// Used to get a slogan to say in Process().
408+
/// If you want to do things like non-constant token replacement you can do that in an override.
409+
/obj/machinery/vending/proc/get_slogan()
410+
return pick(slogan_list)
411+
407412
/obj/machinery/vending/Process()
408413
if(stat & (BROKEN|NOPOWER))
409414
return
@@ -415,8 +420,8 @@
415420
seconds_electrified--
416421

417422
//Pitch to the people! Really sell it!
418-
if(((last_slogan + slogan_delay) <= world.time) && (slogan_list.len > 0) && (!shut_up) && prob(5))
419-
var/slogan = pick(slogan_list)
423+
if(((last_slogan + slogan_delay) <= world.time) && length(slogan_list) && (!shut_up) && prob(5))
424+
var/slogan = get_slogan()
420425
speak(slogan)
421426
last_slogan = world.time
422427

0 commit comments

Comments
 (0)