Gremious / StS-DefaultModBase

(DON'T USE THIS AND BASEMOD IF YOU'RE NEW TO MODDING) This is a minimal, over-commented, "default clean slate" for jump-starting Slay the spire mods.
MIT License
112 stars 61 forks source link

Idea: remove name and description parameters from AbstractDefaultCard constructor #35

Closed bug-sniper closed 5 years ago

bug-sniper commented 5 years ago

In AbstractDefaultCard's source code, the constructor starts with: public AbstractDefaultCard(final String id, final String name, final String img, final int cost, final String rawDescription, final CardType type, final CardColor color, final CardRarity rarity, final CardTarget target) { super(id, name, img, cost, rawDescription, type, color, rarity, target); super(id, name, img, cost, rawDescription, type, color, rarity, target);

To make hardcoding the name and description a more difficult and less tempting course of action, I propose we do that following:

    public static final String ID = DefaultMod.makeID("DefaultCommonAttack");
    private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);

    public static final String NAME = cardStrings.NAME;
    public static final String DESCRIPTION = cardStrings.DESCRIPTION;

This idea synergizes with #34 in nudging people to check the jsons for any name or description-related errors.

bug-sniper commented 5 years ago

Changing issue to take into account the existing function of this class.

bug-sniper commented 5 years ago

As a note, the new card classes will be incompatible with the old classes. A small price to pay for the objectives of this enhancement.