Git Product home page Git Product logo

stsfriendlyminions's Introduction

STSFriendlyMinions

Library for adding Custom Characters that can spawn Friendly Minions

Currently in Beta and open for testing. Appreciate any bug reports.

Requirements

Example GetLoadout

public static CharSelectInfo getLoadout() {

    CharSelectInfo info = new CustomCharSelectInfo(
            "Character Name",
            "Character Flavor",
            80, //currentHP
            80, //maxHP
            0,  //maxOrbs
            2,  //maxMinions
            99, //gold
            5,  //cardDraw
            this,
            getStartingRelics(),
            getStartingDeck(),
            false);

    return info;
}

Example FriendlyMinion

public class TestMinion extends AbstractFriendlyMonster {
    
    private static String NAME = "Testing Minion";
    private static String ID = "TestingMinion";
    private AbstractMonster target;

    public TestMinion(int offsetX, int offsetY) {
        super(NAME, ID, 20, -8.0F, 10.0F, 230.0F, 240.0F, "images/monsters/monster_testing.png", offsetX, offsetY);
        addMoves();
    }

    private void addMoves(){
        this.moves.addMove(new MinionMove("Attack", this, new Texture("images/monsters/atk_bubble.png"), "Deal 5 damage", () -> {
            target = AbstractDungeon.getRandomMonster();
            DamageInfo info = new DamageInfo(this,5,DamageInfo.DamageType.NORMAL);
            info.applyPowers(this, target); // <--- This lets powers effect minions attacks
            AbstractDungeon.actionManager.addToBottom(new DamageAction(target, info));
        }));
        this.moves.addMove(new MinionMove("Defend", this, new Texture("images/monsters/atk_bubble.png"),"Gain 5 block", () -> {
            AbstractDungeon.actionManager.addToBottom(new GainBlockAction(this,this, 5));
        }));
    }
}

Example use method for a Card to summon a minion with CustomCharacter

public void use(AbstractPlayer abstractPlayer, AbstractMonster abstractMonster) {
    if(abstractPlayer instanceof AbstractPlayerWithMinions) {
        AbstractPlayerWithMinions player = (AbstractPlayerWithMinions) abstractPlayer;
        player.addMinion(companion);
    }
}

Example use method for a Card to summon a minion with BaseCharacter

public void use(AbstractPlayer abstractPlayer, AbstractMonster abstractMonster) {
    BasePlayerMinionHelper.addMinion(abstractPlayer, companion);
}

stsfriendlyminions's People

Contributors

mikepaccnt avatar kobting avatar

Stargazers

 avatar  avatar Wangyi avatar Dan Bjorge avatar  avatar rfht avatar 极光萝卜 avatar Naf avatar Yangjie Su avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hlysine

stsfriendlyminions's Issues

Minions that die() because of their powers throw an exception

If a minion dies because of their own actions or powers the game throws an exception.
This is because the minion triggers a ArrayList.remove() action while in the middle of that a ArrayList.forEach loop, making the loop break because of a missing minion.

Can be reproduced by adding the following to a child of AbstractFriendlyMonster:

@Override
    public void applyEndOfTurnTriggers(){
        this.die();
        super.applyEndOfTurnTriggers();
}

This can be prevented by:

  1. Using iterators instead of a forEach loop
  2. Removing the removeMinion() function in the die() function
  3. If a creature is marked isDead , remove it at the end of the iterator loop

I have already made a branch for this, if you allow me to push it you can review and add it to the code.

Remove protection/private on some variables, please

In AbstractFriendlyMonster, MinionMoveGroup moves is protected. However, in cards you may desire to modify or adjust the display of moves, which makes this awkward to access.

Likewise, in MinionMoveGroup, ArrayList moves is private.

My specific use case is, I have a card for which I wish to reset the moves of a minion. Instead of simply calling moves.move.clear(), I must now use reflection or subclass AbstractFriendlyMonster to Instantiate a completely new MinionMoveGroup, both of which are clunky solutions.

While making a 'clearAllMoves' function is probably your first thought, I submit that there may be other reasons besides clearing for which people may wish to access these fields. Such as reordering moves, modifying existing moves on the fly, etc. Thus, making them public hurts no one and would be of great help.

Update version in pom.xml

Your version field still reads '0.1', instead of '0.0.4'. It's a bit confusing. In your next release, would you update it to match the Github release number?

The Transient nightmare

I am not sure if it is intended or not, but when I summoned the minion during the Transient fight, it started partially tanking his atk debuffs. Insult to injury, the "will receive the lost attack at the end of the turn" effect was retained by the Transient regardless of who received the debuff, resulting in 100+ damage on not even the final attack.
Also, if it is not the fault of this mod, but rather the one that implemented the particular minion, I am sorry, I just saw the part about minions being able to be chosen for debuffs in the description.
The mod in question is The Mystic, the card Summon Fox.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.