MV Help on Boolean True or False

I'm looking into this function in TMCard
JavaScript:
    // is deck valid
    Game_Party.prototype.isDeckValid = function(index) {
        var deck = this.deck(index);
        if (TMPlugin.Card.FixCardNum) {
            return !deck.contains(0);
        } else {
            return deck.some(function(cardId) {
                return cardId > 0;
            });
        }
    };

i think this interprets as when the deck has no cards equip return false, so the duel will not proceed..

I managed to make this in the card list , so when the switch is on for the card type, it wont be listed useable.
JavaScript:
        // if type is true and switch is on
        if (item.meta.cardType == 0 && $gameSwitches.value(41)) { return +item.meta.cardType < 4;}
        if (item.meta.cardType == 1 && $gameSwitches.value(42)) { return +item.meta.cardType < 4;}
        if (item.meta.cardType == 2 && $gameSwitches.value(43)) { return +item.meta.cardType < 4;}
        if (item.meta.cardType == 3 && $gameSwitches.value(44)) { return +item.meta.cardType < 4;}

I need to put this conditions in the deck valid.. when the switch is ON the deck containing the card type will not be valid and the duel will not proceed.

Thank you
first of all in the second code example i would put the ";" at the end..
like this : (not really important)
JavaScript:
if (item.meta.cardType == 0 && $gameSwitches.value(41)) { return +item.meta.cardType < 4};

second thing:
if i understand correctly you want to put the if conditions in the first function..

the only problem is, that the first function has one "else" option..
i would try to replace the else option with the opposite of the first "if condition" ..
and add your if conditions on top,..
..something like this perhaps?:

JavaScript:
    Game_Party.prototype.isDeckValid = function(index) {
        var deck = this.deck(index);
        // your extra if conditions:
        if (item.meta.cardType == 0 && $gameSwitches.value(41)) { return +item.meta.cardType < 4};
        if (item.meta.cardType == 1 && $gameSwitches.value(42)) { return +item.meta.cardType < 4};
        if (item.meta.cardType == 2 && $gameSwitches.value(43)) { return +item.meta.cardType < 4};
        if (item.meta.cardType == 3 && $gameSwitches.value(44)) { return +item.meta.cardType < 4};     
        // default code:
        if (TMPlugin.Card.FixCardNum) {
            return !deck.contains(0);
        }
        // replace the else condition:
        if !(TMPlugin.Card.FixCardNum) {
            return deck.some(function(cardId) {
                return cardId > 0;
            });
        }
    };

this is just an idea, i cant test anything and i am not even sure if i understood your question correctly..

just as sidenote, the whole function will end as soon any "return" command was triggered, without reading/using the rest functions code..
first of all in the second code example i would put the ";" at the end..
like this : (not really important)
JavaScript:
if (item.meta.cardType == 0 && $gameSwitches.value(41)) { return +item.meta.cardType < 4};

second thing:
if i understand correctly you want to put the if conditions in the first function..

the only problem is, that the first function has one "else" option..
i would try to replace the else option with the opposite of the first "if condition" ..
and add your if conditions on top,..
..something like this perhaps?:

JavaScript:
    Game_Party.prototype.isDeckValid = function(index) {
        var deck = this.deck(index);
        // your extra if conditions:
        if (item.meta.cardType == 0 && $gameSwitches.value(41)) { return +item.meta.cardType < 4};
        if (item.meta.cardType == 1 && $gameSwitches.value(42)) { return +item.meta.cardType < 4};
        if (item.meta.cardType == 2 && $gameSwitches.value(43)) { return +item.meta.cardType < 4};
        if (item.meta.cardType == 3 && $gameSwitches.value(44)) { return +item.meta.cardType < 4};    
        // default code:
        if (TMPlugin.Card.FixCardNum) {
            return !deck.contains(0);
        }
        // replace the else condition:
        if !(TMPlugin.Card.FixCardNum) {
            return deck.some(function(cardId) {
                return cardId > 0;
            });
        }
    };

this is just an idea, i cant test anything and i am not even sure if i understood your question correctly..

just as sidenote, the whole function will end as soon any "return" command was triggered, without reading/using the rest functions code..
This won't work, as "item" doesn't exist in the isDeckValid function. We definitely need more information from OP on what this plugin does and what they're trying to do.

@xabileug When you're asking for help, assume that the people you're asking have never heard of the plugins you're referencing. Someone who's reading this topic should know everything about your request from the text of your post without having to do homework to understand it.
@Trihan

you are right i didnt saw that point.. so my example would atleast need the " var item = addstuffhere ;"..
on top right after the "var deck = this.deck(index);"
i cant post the whole code here cause it's very very long, the code is available in the forums for download. i am asking help where to insert the switch and card type, because i cant read properly the first function, and I've run out of trial and errors where to paste the if conditions i made that worked.
Do you know what type item.meta.cardType is? String or number? In your code on the left, you check it against numbers, while on the right you do a conversion into numbers by using the plus sign.

Your if statement and return value tells me that you are not that experienced in JS (which is okay of course!). The right side will only return if and only if item.cardType is e.g. 0 but then why do you check if this variable is less than 4? You already know, that when this code is executed, it MUST be 0. So you maybe want to return "true" instead of this < 4 check.

Sorry I'm on my smartphone I cannot write code right now.
i cant post the whole code here cause it's very very long, the code is available in the forums for download. i am asking help where to insert the switch and card type, because i cant read properly the first function, and I've run out of trial and errors where to paste the if conditions i made that worked.
ok after some research here is the link to the PLUGIN
..
next thing i tried was to search for every function that has a data-definition of "item":
Spoiler
JavaScript:
    // change card : sets card in deck
    Game_Party.prototype.changeCard = function(deckId, slotId, item) {
        if (item && !this.hasItem(item)) return;
        $gameParty.loseItem(item, 1);
        if (slotId === this.maxCard()) {
            $gameParty.gainItem(this.itemCard(deckId), 1);
            this._itemCards[deckId] = item ? item.id : 0;
        } else {
            $gameParty.gainItem(this.cards(deckId)[slotId], 1);
            var deck = this.deck(deckId);
            deck[slotId] = item ? item.id : 0;
        }
    };

JavaScript:
    // wether to include the card in the list
    Window_DeckEditItem.prototype.includes = function(item) {
        if (item === null) return true;
        if (item.meta.cardCost == null) return false;
        if (TMPlugin.Card.UseItemCard && this._slotId === $gameParty.maxCard()) {
            return +item.meta.cardType === 4;
        }
        return +item.meta.cardType < 4;
    };
    // wether to show the card in the list
    Window_DeckEditItem.prototype.isEnabled = function(item) {
        if (item === null) return true;
        if (!TMPlugin.Card.SameCard && this._otherSlotCardIds.contains(item.id)) {
            return false;
        }
        return this._capacity >= +item.meta.cardCost && item.id !== this._currentCardId;
    };

so i assume you had it working allready? if thats the case that should have something todo with the functions in the spoiler above

about the first function:
this function only asks if "TMPlugin.Card.FixCardNum" is true or false..
-> or in other words if its existing or undefined
and returns different stuff related to the result..
..but as far i see it, the returned data should always be "true or false", never a number.


that var is defined in the plugin param ect:
JavaScript:
TMPlugin.Card.FixCardNum = TMPlugin.Card.Parameters['fixCardNum'] === '1';
-------

so if you want to add your if conditions into that first function, we need to find out or transport the "item" -data .. in order to have it in the first function..
sry but at the moment i cant figure out more, ..
Do you know what type item.meta.cardType is? String or number? In your code on the left, you check it against numbers, while on the right you do a conversion into numbers by using the plus sign.

Your if statement and return value tells me that you are not that experienced in JS (which is okay of course!). The right side will only return if and only if item.cardType is e.g. 0 but then why do you check if this variable is less than 4? You already know, that when this code is executed, it MUST be 0. So you maybe want to return "true" instead of this < 4 check.

Sorry I'm on my smartphone I cannot write code right now.

There are 5 card types, it should be less than 4, because the cardType = 5 is for the 5th type and it is for another slot. I did plenty of trials and errors. I really need this part because i want to show that the active deck is not valid or cannot be used because the deck contains a cardType with such value.

this is the window for the cardType
1676201138516.png


this is the deck window where i want it to take effect too. the deck name should be grayed out when the deck contains a certain card type
1676201185919.png


in the Deck Select Mode, the deck names are grayed out because they don't have any cards in them.
This is the effect i want.
1676201271835.png



@dopan the changecard function you found.. any idea how to make it into a plugin command? because that's the next part i need. When a deck contains some card type, I could force unequip that slot. but i had no luck how to use it as a plugin command.
@xabileug
what Aerosys tried to explain is that your scriptcalls are unnessecary complicated and could be simpler like this:
(they will still do the same thing)

JavaScript:
        // your extra if conditions:
        if (item.meta.cardType == 0 && $gameSwitches.value(41)) { return true};
        if (item.meta.cardType == 1 && $gameSwitches.value(42)) { return true};
        if (item.meta.cardType == 2 && $gameSwitches.value(43)) { return true};
        if (item.meta.cardType == 3 && $gameSwitches.value(44)) { return true};
// extra addition from my side-- dopan
     if (item.meta.cardType == 4) { return false};
i added the 5th and let it return false,.. but that still doesnt help aslong i dont know how to adress the "item" data..

about the "change card"-function:
you dont need a plugin command if you can call this function as scriptcall..
(of course you could build a plugin command and add the same code there)
-> i preffer scriptcalls.. "$gameParty" is a global-var scriptcall-class ,.. similar to "$gamePlayer"..
=> that means building a new scriptcall or plugin command is not required, because you can use the original directly,.. without using : "call(this)"
edit.

the original scriptcall should be this (not tested):
JavaScript:
$gameParty.changeCard(deckId, slotId, item);

only issue here is again the item data, but i can probably be solved by using "data.-items" that fit or by getting the data from any plugin-function
-----

i guess i need to look into the demo and the console F8 to get the needed infos about the "item data"..

edit2

2023-02-12 14_26_49-DevTools - chrome-extension___odlameecjipmbmbejkplpemijjgpljce_index.html.png

$gameParty.cards(index);
can give us access to the cardItem meta,..but it will return 3 cards and we need to check all 3

for example like this:
$gameParty.cards(index)[0].meta.cardType
$gameParty.cards(index)[1].meta.cardType
$gameParty.cards(index)[2].meta.cardType



2023-02-12 14_39_35-DevTools - chrome-extension___odlameecjipmbmbejkplpemijjgpljce_index.html.png

the index data is already in the function :
Game_Party.prototype.isDeckValid = function(index)
------
------
so i think i can use these infos to edit the "isDeckValid" function.. in order to check the card types..

but i dont understand why you want the effect to happen on the "deck edit window" if i understand your last posting correctly..
and i am not sure if editing the "isDeckValid" function will have the wanted effect on
this window ..



edit3
well i made it a bit shorter by not checking if any card is the 1st,2nd,3rd,4th -type and return true..
..instead i only checked if any card is the 5th type and return false
- pls try it out:
JavaScript:
    // is deck valid
    Game_Party.prototype.isDeckValid = function(index) {

// edit check if cardtype 4 and return false
// i replaced "$gameParty" with "this" ,because its inside of a $gameParty -function
if (this.cards(index)[0].meta.cardType == 4) { return false};
if (this.cards(index)[1].meta.cardType == 4) { return false};
if (this.cards(index)[2].meta.cardType == 4) { return false};
// if no card type 4.. (which means the 5th type, because it starts with 0..)
    // ...go on with default script:

        var deck = this.deck(index);
        if (TMPlugin.Card.FixCardNum) {
            return !deck.contains(0);
        } else {
            return deck.some(function(cardId) {
                return cardId > 0;
            });
        }
    };
thanks dopan, i will try this out! i see, the console thing clarified the values.

EDIT: it does not work
1676288803072.png


the console mode was really useful.. i got the difference between deck and _deck
the change card thing does not work though. I cant force equip cards.
$gameParty.changeCard(0,0,12) it's undefined

1676289131429.png
ok about the errors,.. we could first ask if the card exist before we ask for its meta.. that might help
.. because the deck-valid fuction probably checks all decks even those that have no cards.

JavaScript:
if ((this.cards(index)[0] > 0) && (this.cards(index)[0].meta.cardType == 4)) {return false};
if ((this.cards(index)[1] > 0) && (this.cards(index)[1].meta.cardType == 4)) {return false};
if ((this.cards(index)[2] > 0) && (this.cards(index)[2].meta.cardType == 4)) {return false};
// now we ask first if the card id in the slot is bigger than 0
// 0 would be no card in slot

-- or "deck is valid"-edit is the wrong approach i dont know..
(maybe we need to edit a "window"-function instead)


about force change card:
$gameParty.changeCard(0,0,12) it's undefined
thats because you only used a number as item data, i think it should be this instead:

$dataItems[cardId];
2023-02-13 17_14_29-TMCard.js - Editor.png

example: ( i use the 12 from your example as id number )

var item = $dataItems[12];
$gameParty.changeCard(0, 0, item);
JavaScript:
var item = $dataItems[12];
// here we put $dataItems[cardId] into a var called "item" and use it as data for the scriptcall
$gameParty.changeCard(0, 0, item);
@dopan your script for changecard worked!
1676444253598.png


This is really a big help! i think you are right that isDeckValid is the wrong approach to what i want

I need to disable the Deck useable when the CardType Switch is ON.

The reason i keep looking at isdeckValid is because the isEnabled calls isdeckValid

Maybe if i could get the condition for:
if CardType Switch is ON and deck slot from slot 0 1 and 2 any contains card type X, return false

JavaScript:
    Window_DeckEdit.prototype.drawItem = function(index) {
        var deckName = TMPlugin.Card.DeckNames[index];
        if (deckName) {
            var maxCost = $gameParty.maxCost();
            var deckCost = $gameParty.deckCost(index);
            var rect = this.itemRectForText(index);
            this.changePaintOpacity(this.isEnabled(index));
            this.drawTextEx(deckName, rect.x, rect.y, rect.width); //edited line
            this.drawText(deckCost + '/' + maxCost, rect.x, rect.y, rect.width, 'right');
            this.changePaintOpacity(1);
        }
    };

    Window_DeckEdit.prototype.isEnabled = function(index) {
        return this._selectMode ? $gameParty.isDeckValid(index) : true;
    };
Maybe if i could get the condition for:
if CardType Switch is ON and deck slot from slot 0 1 and 2 any contains card type X, return false

making this condition is no problem, but i am still not sure where to put it..

i would try first the :
Window_DeckEdit.prototype.isEnabled = function(index)
(putting edited condition before the original code)
...

i am not sure for what you added the "edited" code-line in the :
Window_DeckEdit.prototype.drawItem = function(index)

(this function is building/drawing the content of the deck-edit-window)

.---

ill edit this post soon , in order to add the script for the mentioned condition

JavaScript:
// the "for" checks deck 1,2,3 as index data
for (var index = 0; index <= 2; index++) {
    for (var card = 0; card <= 2; card++) {
         //next we check if the index-deck has cards, check 3 cards with "for"
         if ($gameParty.cards(index)[card] > 0) {
             // check a global gamneSwitch, insert switch id
             if ($gameSwitches.value(insertID)) {
                // here we could also try "return true"
                if ($gameParty.cards(index)[card].meta.cardType == 4) {return false};
             };
         };
    };
};

here i only used 1 global switch and tried to build the if conditions, simple to read, so that the whole code is easy to edit, if needed.. i didnt test anything..

i would suggest to put this here: (above the default code)

JavaScript:
Window_DeckEdit.prototype.isEnabled = function(index) {
        return this._selectMode ? $gameParty.isDeckValid(index) : true;
    };

JavaScript:
    Window_DeckEdit.prototype.isEnabled = function(index) {
// the "for" checks deck 1,2,3 as index data 
for (var index = 0; index <= 2; index++) {
    for (var card = 0; card <= 2; card++) {
         //next we check if the index-deck has cards, check 3 cards with "for"
         if ($gameParty.cards(index)[card] > 0) {
             // check a global gamneSwitch, insert switch id
             if ($gameSwitches.value(insertID)) {
                // here we could also try "return true"
                if ($gameParty.cards(index)[card].meta.cardType == 4) {return false};
             };
         };
    };
};
  
  
        return this._selectMode ? $gameParty.isDeckValid(index) : true;
    };

but it might be not needed to have the line with "for" index ect, because this function allready owns index data:

JavaScript:
    Window_DeckEdit.prototype.isEnabled = function(index) {
// the "for" checks deck 1,2,3 as index data     // REMOVED
//for (var index = 0; index <= 2; index++) {
    for (var card = 0; card <= 2; card++) {
         //next we check if the index-deck has cards, check 3 cards with "for"
         if ($gameParty.cards(index)[card] > 0) {
             // check a global gamneSwitch, insert switch id
             if ($gameSwitches.value(insertID)) {
                // here we could also try "return true"
                if ($gameParty.cards(index)[card].meta.cardType == 4) {return false};
             };
         };
    };
//};  // REMOVED
  
  
        return this._selectMode ? $gameParty.isDeckValid(index) : true;
    };


.. pls try it out, experiment a bit, try to edit as far as you can and need, and if that doesnt solve your problem, let me know...
@dopan the decks are now disabled by default.

EDIT : i put the wrong switch ID ill check again, okay i tried changing true or false, but the end is it's always disabled
1676449897030.png


maybe is it possible to make a new function "hasNoBanCards" or "isCardAllowed"

EDIT:
so i placed your code into this new function
JavaScript:
    Game_Party.prototype.isCardOk = function(index) {
        // the "for" checks deck 1,2,3 as index data
        for (var index = 0; index <= 2; index++) {
            for (var slot = 0; slot <= 2; slot++) {
                 //next we check if the index-deck has cards, check 3 cards with "for"
                 if ($gameParty.cards(index)[slot] > 0) {
                     // check a global gamneSwitch, insert switch id
                     // 41 = type 0 ; 42 = type 1 ; 43 = type 2 ; 44 = type 3 ; 45 = type 4
                     if ($gameSwitches.value(41)) {
                        // here we could also try "return true"
                        if ($gameParty.cards(index)[slot].meta.cardType == 0) {return true};
                     };
                 };
            };
        };
    };

it's always false

this version doesnt work either
JavaScript:
Game_Party.prototype.isCardOk = function(index) {
        var deck = this.deck(index);       
        if ($gameSwitches.value(41)) {
            deck.some(function(cardType) {
                return cardType == 0;
                });
            }     
     };
@dopan the decks are now disabled by default.

EDIT : i put the wrong switch ID ill check again, okay i tried changing true or false, but the end is it's always disabled
View attachment 253261

maybe is it possible to make a new function "hasNoBanCards" or "isCardAllowed"

EDIT:
so i placed your code into this new function
JavaScript:
    Game_Party.prototype.isCardOk = function(index) {
        // the "for" checks deck 1,2,3 as index data
        for (var index = 0; index <= 2; index++) {
            for (var slot = 0; slot <= 2; slot++) {
                 //next we check if the index-deck has cards, check 3 cards with "for"
                 if ($gameParty.cards(index)[slot] > 0) {
                     // check a global gamneSwitch, insert switch id
                     // 41 = type 0 ; 42 = type 1 ; 43 = type 2 ; 44 = type 3 ; 45 = type 4
                     if ($gameSwitches.value(41)) {
                        // here we could also try "return true"
                        if ($gameParty.cards(index)[slot].meta.cardType == 0) {return true};
                     };
                 };
            };
        };
    };

it's always false
first we should figure out , why all decks are disabled now..
or in other words, which codepart exactly is responsible for disabling all decks..

-> from my point of view its a good thing that we could disable them, we just need more infos.. in order to do it correctly


did you also try the code version without the "for index"?
( i mean only using this part )
JavaScript:
    for (var card = 0; card <= 2; card++) {
         //next we check if the index-deck has cards, check 3 cards with "for"
         if ($gameParty.cards(index)[card] > 0) {
             // check a global gamneSwitch, insert switch id
             if ($gameSwitches.value(insertID)) {
                // here we could also try "return true"
                if ($gameParty.cards(index)[card].meta.cardType == 4) {return false};
             };
         };
    };


edit
and of course we can build a new function, but that doesnt change anything aslong we dont use the correct code.. and it seems the current code has still mistakes

edit2
next thing i would try is completly removing the switch option:

JavaScript:
    for (var card = 0; card <= 2; card++) {
         //next we check if the index-deck has cards, check 3 cards with "for"
         if ($gameParty.cards(index)[card] > 0) {
             // here we could also try "return true"
             if ($gameParty.cards(index)[card].meta.cardType == 4) {return false};
         };
    };


edit3.
you sayd it doesnt matter if you use return "true" or "false" ???
if thats the case, thats weird and perhaps their is a typo or something else that breaks the default function...

edit4
if you add a new function, than it must also be triggered somehow, ..
however both your examples have mistakes aswell:
Spoiler
(the function owns index data , we dont need to add it)
Game_Party.prototype.isCardOk = function(index) {
// the "for" checks deck 1,2,3 as index data
for (var index = 0; index <= 2; index++) {

for (var slot = 0; slot <= 2; slot++) {
//next we check if the index-deck has cards, check 3 cards with "for"
if ($gameParty.cards(index)[slot] > 0) {
// check a global gamneSwitch, insert switch id
// 41 = type 0 ; 42 = type 1 ; 43 = type 2 ; 44 = type 3 ; 45 = type 4
if ($gameSwitches.value(41)) {
// here we could also try "return true"
if ($gameParty.cards(index)[slot].meta.cardType == 0) {return true};
};
};
};
};
};

here is the edited version
JavaScript:
    Game_Party.prototype.isCardOk = function(index) {
            for (var slot = 0; slot <= 2; slot++) {
                 //next we check if the index-deck has cards, check 3 cards with "for"
                 if ($gameParty.cards(index)[slot] > 0) {
                     // check a global gamneSwitch, insert switch id
                     // 41 = type 0 ; 42 = type 1 ; 43 = type 2 ; 44 = type 3 ; 45 = type 4
                     if ($gameSwitches.value(41)) {
                        // here we could also try "return true"
                        if ($gameParty.cards(index)[slot].meta.cardType == 0) {return true};
                     };
                 };
            };
    };
sry for double posting, this should be part of edit4.
i copied it into the wrong place

JavaScript:
Game_Party.prototype.isCardOk = function(index) {var deck = this.deck(index);
if ($gameSwitches.value(41)) {
deck.some(function(cardType) {
return cardType == 0;
});
}
};

this only checks if card type 0 is used,.. i would suggest 4 instead
-> ok i missunderstood, i see now that ,you tried to only enable type 0 here^^.. my bad
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);       
        if (!$gameSwitches.value(41)) {
            return deck.some(function(cardType) {
                return cardType == 0;
                });
            }     
        return true;   
     };

this function works! but only for type 0, i don't know what the code does. i placed it with the isdeckready
the only problem i have is when the Switch BanType0 is ON, even if the decks dont have any of them, it's false and i cant start the duel.

switch BanType0 OFF and has no type0 in deck => duel starts
switch BanType0 OFF and has type0 in deck => duel starts
switch BanType0 ON and has no type0 in deck => duel not start !! duel should still start
switch BanType0 ON and has type0 in deck => duel not start

JavaScript:
// is deck ready
    Game_Party.prototype.isDeckReady = function() {
        for (var i = 0; i < this.maxDeck(); i++) {
            if (this.isDeckValid(i) && [B]this.isCardOk(i)[/B]) return true;
        }
        return false;
    };
pls try the next post

edit
i use this post to clarify what i mean with "double return"
(i think this is not working)


2023-02-15 12_43_45-RMMV - Help on Boolean True or False _ RPG Maker Forums – Mozilla Firefox.png
sry for double posting again but i think this should work!

edit3


first your solution on the trigger: (my edit is probably not required in this function, i am not sure)
JavaScript:
    Game_Party.prototype.isDeckReady = function() {
        for (var i = 0; i < this.maxDeck(); i++) {
            if ((this.isDeckValid(i) === true) && (this.isCardOk(i) === true)) return true;
        }
        return false;
    };


In the next function, i removed the "double return"#18 usage!
( i think using "double-return" like in your solution, doesnt work correctly, but i am not sure on this point, thats why i try to avoid it )


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;
            });
        return result;
     };

It should ask if the card-type exist && the bannSwitch is active than return false.
Otherwise ,default result is true.
This includes all 5 types..
-> i am only not sure about the frue/false usage and about usage of the "!" on the $gameSwitches..
=> so if that doesnt work try to edit/switch the true/false & "!" ect..

and look if any other solution works..


if that works, we could change the switch data to add plugin param,.. in order to be able to decide which switches are used ect ( to not force the usage of 41-45 )

edit4
if that doesnt work, we might need to replace the "some"-stuff-function, with another solution to get to the cardtype data..
..because i am not sure about the "some" function, if thats the way it should work..
( i ussually dont use "some" often )
the latest code does not work at all. result is always false

i checked my logic table, i should use or || , not and

i reviewed my notes, the other way i was trying way before was checking note tags for switch required.. but i still think this is better.. i think we're very close to the solution.

Original thread: https://forums.rpgmakerweb.com/threads/help-on-boolean-true-or-false.154881/