Duelyst Forums

[MOD] Expansion names in card descriptions

Behold:

To enable this mod, copy the following javascript at the end of your duelyst.js:

function putExpansionNames() {
    var cards = GameDataManager.getInstance().cardsCollection.models;
    for (i = 0; i < cards.length; i++) {
        var card = cards[i].attributes;
        card.description += " (" + card.cardSetName + ")";
    }
}
setTimeout(putExpansionNames, 8000);

If you have trouble, please read @t2k5’s help on how to install script mods here:
https://duelyststats.info/scripts/scriptlist.html

Then read this post again.

ALSO AVAILABLE AS A TOOLTIP VERSION BELOW

14 Likes

Niiiice…:sunglasses:

1 Like

Shouldn’t it be in the hover-over box, not the card text itself?

1 Like

Could be. I wanted to have the info directly visible during matches though. I don’t think you can hover over card texts in there.

Kind of odd to have it as a text description, but still a big step up from nothing. I’ll take it!

2 Likes

Yes you can! I mean the black boxes that appear to the side. It could be like:
Set - Shim’zar
Provoke - bla bla bla.
etc

Also, do you know how Duelyst is coded? What are the cards, for instance? JSONs?

1 Like

Did you make this? well done!

1 Like

I love your enthusiasm, but this might just turn out outrageously complex to do. I just don’t know at this point.

The game apparently has an array of javascript objects to represent cards. Yes it would map to JSON. You can check this if you are interested (not my code).

I made this for YOU. :gift:

1 Like

Wow, that’s cool! Thanks!

Here you go, a version that put the set name in the tooltip. It turns out it wasn’t so impossible. :slight_smile:

function putExpansionNames() {
    var cards = GameDataManager.getInstance().cardsCollection.models;
    for (i = 0; i < cards.length; i++) {
        var card = cards[i].attributes;
        var tag = card.cardSetName;
        switch (card.cardSetName) {
            case "Core":
                tag = "Core";
                break;
            case "ShimZar":
                tag = "Denizens of Shim'Zar";
                break;
            case "Bloodbound":
                tag = "Bloodbound Ancients";
                break;
            case "Ancients":
                tag = "Bloodbound Ancients";
                break;
            case "Unearthed":
                tag = "Unearthed Prophecy";
                break;
            case "Immortal":
                tag = "Immortal Vanguard";
                break;
            case "Mythron":
                tag = "Trials of Mythron";
                break;
        }

        var tooltip = {"name": tag, "description": ""};
        card.keywordDescriptions.unshift(tooltip);
    }
}
setTimeout(putExpansionNames, 8000);
6 Likes

Huh, this is actually pretty fun, you can embed any sort of HTML in the card description field, and it will render in-game.

…Including iframes of animated gifs.

2018-08-20-153935_1472x810_scrot

4 Likes

You’re crafty. And crazy. I admire both qualities…

2 Likes

I hope you already added it to the wiki :wink: great job!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.