Skip to content

Commit

Permalink
Faction link cooldown
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit committed Feb 14, 2024
1 parent 3f8a843 commit 57c8c06
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

// Our associated trade faction
var/faction = FACTION_INDEPENDENT
// Point at world.time when we can set/reset the faction again
var/faction_cooldown
// How often we can change faction on the console
var/faction_cooldown_time = 2 MINUTES

var/prg_screen = PRG_TREE
var/trade_screen = GOODS_SCREEN
Expand Down Expand Up @@ -229,6 +233,10 @@
return TRUE

if(href_list["PRG_faction"])
if(faction_cooldown > world.time)
to_chat(usr, SPAN_WARNING("The option is currently unavailable! Try again later!"))
return

var/obj/item/stock_parts/computer/card_slot/card_slot = computer.get_component(PART_CARD)
if(!istype(card_slot))
to_chat(usr, SPAN_WARNING("Card slot is not installed."))
Expand Down Expand Up @@ -258,9 +266,14 @@
return

faction = faction_chosen
faction_cooldown = world.time + faction_cooldown_time
return TRUE

if(href_list["PRG_faction_unlink"])
if(faction_cooldown > world.time)
to_chat(usr, SPAN_WARNING("The option is currently unavailable! Try again later!"))
return

faction = FACTION_INDEPENDENT
return TRUE

Expand Down

0 comments on commit 57c8c06

Please sign in to comment.