So how does cooldown work?
Posted: Tue Jul 10, 2018 2:54 pm
I'm new to SS13 programming, and I can't understand this part of code which is taken from deck code:
Specifically I can't understand "if(cooldown < world.time - 50)" and "cooldown = world.time"
I tried to search these 2 lines in every file but I couldn't find any answer.
If someone could explain me these lines, I would appreciate that.
Code: Select all
if(cooldown < world.time - 50)
cards = shuffle(cards)
playsound(src, 'sound/items/cardshuffle.ogg', 50, 1)
user.visible_message("[user] shuffles the deck.", "<span class='notice'>You shuffle the deck.</span>")
cooldown = world.time
I tried to search these 2 lines in every file but I couldn't find any answer.
If someone could explain me these lines, I would appreciate that.