obj
Scoreboard
icon = 'Scoreboard.dmi'
Track
layer = 4
IronThrone
icon_state="IronThrone"
screen_loc="scoreboard:1,3"
Click()
beenClicked(usr)
beenClicked(var/mob/Player/clicker)
if(PHASE == "AKBTW-Win")
if(clicker == Highest)
movePlayer(Highest, IronThrone, 1)
world<<"[Highest] has moved to the top of the Iron Throne track."
c_endCardPhase()
s_updateScoreboard()
Fiefdoms
icon_state="Fiefdoms"
screen_loc="scoreboard:1,2"
Click()
beenClicked(usr)
beenClicked(var/mob/Player/clicker)
if(PHASE == "AKBTW-Win")
if(clicker == Highest)
movePlayer(Highest, Fiefdoms, 1)
world<<"[Highest] has moved to the top of the Fiefdoms track."
c_endCardPhase()
else
world<<"got to fiefdoms click: [clicker], PT [PlayerTurn]"
if(PHASE == "AKBTW-Loss")
if(PlayerTurn == clicker)
movePlayer(PlayerTurn, Fiefdoms, Fiefdoms.len)
world<<"[PlayerTurn] has moved to the bottom of the Fiefdoms track."
var/list/others = IronThrone.Copy()
if(!others.Remove(Lowest))
world<<"ERROR - could not remove Lowest bidder: [Lowest] from IronThrone during [PHASE]."
return 0
if(others[others.len]==clicker) // If the last person's turn, then run the penalty for Lowest bidder
PHASE="AKBTW-Lowest"
WACARD.lowestEffect()
s_updateScoreboard()
Raven
icon_state="Raven"
screen_loc="scoreboard:1,1"
Click()
beenClicked(usr)
beenClicked(var/mob/Player/clicker)
world<<"got to Raven click: [clicker], PT [PlayerTurn]"
if(PHASE == "AKBTW-Win")
if(clicker == Highest)
movePlayer(Highest, Raven, 1)
world<<"[Highest] has moved to the top of the Raven track."
c_endCardPhase()
else
if(PHASE == "AKBTW-Loss")
if(PlayerTurn == clicker)
movePlayer(PlayerTurn, Raven, Raven.len)
world<<"[PlayerTurn] has moved to the bottom of the Raven track."
var/list/others = IronThrone.Copy()
if(!others.Remove(Lowest))
world<<"ERROR - could not remove Lowest bidder: [Lowest] from IronThrone during [PHASE]."
return 0
if(others[others.len]==clicker) // If the last person's turn, then run the penalty for Lowest bidder
PHASE="AKBTW-Lowest"
WACARD.lowestEffect()
s_updateScoreboard()
Problem description:
These all work as intended, however the if(PHASE == "AKBTW-Loss") of each one is essentially the same, albeit affecting a different global list.
Is there any way I could pass beenClicked() a different variable depending on which obj/Scoreboard/Track was clicked?
Your question is a consequence of trying to just use global lists for everything rather than defining a datum and abstracting the behavior.