LotR TCG Wiki → Card Sets:  All 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 → Forums:  TLHH CC

Author Topic: GCCG /deckstats bug  (Read 587 times)

0 Members and 1 Guest are viewing this topic.

December 09, 2012, 11:36:35 PM
Read 587 times

Helkadal

  • Guest
GCCG /deckstats bug
« on: December 09, 2012, 11:36:35 PM »
I've realized there's a bug with deck statistics. When it's counting for example Possessions (and other "type"s that are shared by Free Peoples and Shadow cards), it shows the total number, for Free Peoples AND Shadow, instead of separating the values. I know there's a bug on the code and I have some idea of where it is, but since I know nothing about it (don't even know what language it is), I'm helpless. I think it's easy to solve, if you know what you're doing. I've selected some fragments:

fragment from "Deckstats.command", getting name of Type, # of and % of deck for Free Peoples Possessions:
Code: [Select]
listbox_set_entry
(
stats.box,l,
(
"Possessions",
format("%2.0f",CountOfType("Possession",curdeck)),
format("%2.0f",(CountOfType("Possession",curdeck)/totalcards)*100) + "%"
)
);

fragment from "Deckstats.include":
Code: [Select]
def CountOfType
{
push(T);
t=0.0;
for(c)(ARG[1])
{
if(Attr("type",c)==ARG[0])
t=t+1.0;
}
return(T);
t=pop();
}
(there's CountOfKind, too, and also CountOfRarity, almost identical to CountOfType, but they work fine)

Maybe there could be two "CountOfType", like CountOfTypeF, for Free Peoples cards, and CountOfTypeS, for Shadow cards. CountOfType should be checking not only for "type", but also for "kind", to get separate values. Right? I'm not sure lol  ](*,)