obj
House_Cards
var
House = ""
Strength = 0
Swords = 0
Shields = 0
mob/Player/Owner
obj/SNSIcon
swordsNShields(var/obj/House_Cards/card)
var/count = 0
var/obj/Sword = new()
var/obj/Shield = new()
Sword.icon = icon('HUD.dmi',"Sword")
Shield.icon = icon('HUD.dmi',"Shield")
for(var/i = 1; i<=card.Swords; i++)
world<<"[card] has [i] swords."
Sword.step_x = 8 * count
card.SNSIcon.overlays+= Sword
count++
for(var/i = 1; i<=card.Shields; i++)
world<<"[card] has [i] Shields."
Shield.pixel_x += 8 * count
card.SNSIcon.overlays+=Shield
count++
Problem description:
AIM: If a House_Card has Swords = 3, I'd like three swords next to each other in one icon. If they have Swords = 1 and Shields = 1 I'd like a sword next to a shield.
Current state: Will add one sword and one shield, though they are placed directly on top of each other.
Question: How do I add the same object to overlays repeatedly? How do I shift an overlay to the right 8 pixels?
I'm a little sleep deprived (got a two week old daughter keeping me up :) ) so please pardon the idiocy of this query.
Instead of using objects you can use /image objects as well, to save a bit of overhead, they act about the same when used as overlays without all of the non-visual stuff attached to objects.