i think we need to replace the "some" stuff,
because at the moment i dont see how this goes with every cardslot
it should be like this:
deck -> cardslot-> cardtype
and i think we did this:
deck-> cardtype
...
but could you first try out to add a "console.log" in order to figure out the exact data of "result"?
JavaScript:
Game_Party.prototype.isCardOk = function(index) {
// 41 = type 0 ; 42 = type 1 ; 43 = type 2 ; 44 = type 3 ; 45 = type 4
var deck = this.deck(index);
//"some" should ask if there is a cardtype in the deck)
deck.some(function(cardType) {
var result = true;
// we use the "result var" to have better control over the "return" -usage
if ((cardType == 0) && $gameSwitches.value(41)) result = false;
if ((cardType == 1) && $gameSwitches.value(42)) result = false;
if ((cardType == 2) && $gameSwitches.value(43)) result = false;
if ((cardType == 3) && $gameSwitches.value(44)) result = false;
if ((cardType == 4) && $gameSwitches.value(45)) result = false;
});
console.log(result); // ADDED this can be seen in console f8
return result;
};
i think instead of asking some, we should use "foreach" -> cards.meta.cardtype ..
this might be a bit more code, and i need to re-think ..
(i cant test most things myself properly that makes it a bit more difficult sry)