question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Battlecry targeting minions do not work as expected

See original GitHub issue

The code reports that it told it to target the correct target. This has been discussed in #9 but imo needs its own issue.

What usually happens is it will:

  1. Say ‘Shattered Sun Cleric > Friendly Minion’
  2. Click the battlecry minion
  3. Play the battlecry minion
  4. Not click who it was told to target with it
  5. Attempt to continue playing, usually results in the battlecry being used on the next friendly minion to attack, for example. Sometimes it just spasms out at this stage, constantly playing and canceling until it targets a random minion.

I saw you say in another thread that this could be caused by me? I am using the most up to date client, have based my bot off of the Python base example, and the command is properly “popped up” in game.

@lanhin Said that this is caused by: “playing the battlecry” is a targeted action [cleric, minion], but once it is placed (and not yet battlecried), it becomes a different PlayOption halfway through, similar to that of an attack. So now it is [cleric], [cleric, minion] if you want to play a battlecry minion.

This can probably be solved on the bot end by recognizing when a battlecry minion is asking for a target and thus choosing one.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
yangyuancommented, Mar 14, 2018

@AiSatan thanks for the suggestion, I’ve already included it in the current code. Next time you can directly create a pull request no matter how small the change is.

The fix doesn’t seem to be perfect but it could be a temp solution as long as it works.

@All sorry for my absence during the discussion. I have a few interviews on-going so I pretty much give priorities to preparing the interviews. I will be back as soon as I get them done.

2reactions
AiSatancommented, Mar 12, 2018

We notice that it works fine, if we add this.pegasus.DropObject(); in this method:

`

    public void Apply()
    {
        RockGameHooks.PlayZoneSlotMousedOverValue = this.slot;
        RockGameHooks.EnablePlayZoneSlotMousedOver = true;

        // Pick source card
        if (this.step == 0)
        {
            this.pegasus.ClickObject(this.actions[0]);
        }
        else if (this.step == 1 && this.actions.Count == 1)
        {
            this.pegasus.DropObject();
        }
        else if (this.actions.Count > this.step)
        {
            // I add this line
            this.pegasus.DropObject();
            this.pegasus.ClickObject(this.actions[this.step]);
        }
        else
        {
            this.pegasus.DropObject();
        }

        this.step++;

        RockGameHooks.EnablePlayZoneSlotMousedOver = false;
        RockGameHooks.PlayZoneSlotMousedOverValue = -1;

        return;
    }

`

we tested battlecrys, target spells and attack

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can minions with “can't be targeted by spells or Hero ...
"Can't be targeted" means the player can't choose them as the target of a spell or HP. Random effects don't target, so they...
Read more >
How do I play a "silence" battlecry minion without ...
The only way to silence nothing is if there are no minions. Similarly, if you control the only dragon on the board and...
Read more >
Working as intended? - Bug Report - Hearthstone Forums
1 - Lady Vashj + primordial wave. When used she doesnt create a copy of the minion she should turn into, she just...
Read more >
Broken Mechanics - Multiplayer Discussion - Hearthstone ...
Cause the battlecries were “triggered twice” “from that card” it doesn't make sense ... Evolve doesn't summon a minion before it is evolved....
Read more >
Target - Hearthstone Wiki - Fandom
If a minion has a player-targeted Battlecry but there are no valid targets, it is played as if it had no Battlecry at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found