Help me figure out how to stop duplicate cards in GW?

Discussion in 'Mod Support' started by burntcustard, February 1, 2015.

  1. burntcustard

    burntcustard Post Master General

    Messages:
    699
    Likes Received:
    1,312
    I want to make a galactic war mod that stops a player from ever getting duplicate tech (among other things).

    I believe the easiest way to do this would be for a check to be performed when a system is won (or when it's "explored"?), to see if the player already has that card in their inventory. If the player does have it, the systems card is quickly switched to a different one, without any sort of visual message or popup.

    Doing the currently-in-inventory check (game.inventory().hasCard(card)) and assigning the card (id) to the star (stars[self.currentStar()]?) seems simple enough, but I'm really struggling to figure out how to generate that new random card.

    I'm looking in:

    \ui\main\game\galactic_war\gw_start\gw_start.js - line ~160
    Potential place to put the duplicate check and swap cards.

    \ui\main\game\galactic_war\gw_play\gw_play.js - line ~1109
    Potential place to put the duplicate check and swap cards.

    \ui\main\game\galactic_war\gw_start\gw_dealer.js - line 189+
    Functions deal and dealCard look... important.

    Obviously I haven't made any progress yet, but I really want to get this working because I think it would make Galactic War a lot more fun.

    Any help from community members and/or Uber employees would be great. @pinbender ?
    stuart98 likes this.
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    A brute force solution would be modify most cards to set their chance to zero when dealt. You might be able to handle it globally by editing dealer around line 220, just take care with multi-slots and maybe minions.

Share This Page