It is currently 16 Apr 2024, 18:16
   
Text Size

Shadows over Innistrad

Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins

Re: Shadows over Innistrad

Postby escplan9 » 28 Mar 2016, 08:43

As I was trying to get to sleep, I thought of other ways to accomplish this. Doesn't look as pretty, but works:

Code: Select all
/*
 *  Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without modification, are
 *  permitted provided that the following conditions are met:
 *
 *     1. Redistributions of source code must retain the above copyright notice, this list of
 *        conditions and the following disclaimer.
 *
 *     2. Redistributions in binary form must reproduce the above copyright notice, this list
 *        of conditions and the following disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 *  THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
 *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 *  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *  The views and conclusions contained in the software and documentation are those of the
 *  authors and should not be interpreted as representing official policies, either expressed
 *  or implied, of BetaSteward_at_googlemail.com.
 */
package mage.sets.shadowsoverinnistrad;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.MadnessAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;

/**
 *
 * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
 */
public class AsylumVisitor extends CardImpl {
   
    public AsylumVisitor(UUID ownerId) {
        super(ownerId, 99, "Asylum Visitor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}");
        this.expansionSetCode = "SOI";
        this.subtype.add("Vampire");
        this.subtype.add("Wizard");
        this.power = new MageInt(3);
        this.toughness = new MageInt(1);

        // At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.
        this.addAbility(new AsylumVisitorTriggeredAbility());

        // Madness {1}{B}
        this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{B}")));
    }

    public AsylumVisitor(final AsylumVisitor card) {
        super(card);
    }

    @Override
    public AsylumVisitor copy() {
        return new AsylumVisitor(this);
    }
}

class AsylumVisitorTriggeredAbility extends TriggeredAbilityImpl {
   
    public AsylumVisitorTriggeredAbility() {
        super(Zone.BATTLEFIELD, null);
    }

    public AsylumVisitorTriggeredAbility(final AsylumVisitorTriggeredAbility ability) {       
        super(ability);
    }

    @Override
    public AsylumVisitorTriggeredAbility copy() {
        return new AsylumVisitorTriggeredAbility(this);
    }

    @Override
    public boolean checkEventType(GameEvent event, Game game) {
        return event.getType() == EventType.UPKEEP_STEP_PRE;
    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
       
        Player you = game.getPlayer(this.getControllerId());
        Player upkeepPlayer = game.getPlayer(event.getPlayerId());

        if (you != null && upkeepPlayer != null && upkeepPlayer.getHand().isEmpty()) {
            you.drawCards(1, game);
            you.loseLife(1, game);
            return true;
        }
       
        return false;
    }

    @Override
    public String getRule() {
        return "At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.";
    }
}
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby halljared » 28 Mar 2016, 16:57

I'll do Neglected Heirloom.
halljared
 
Posts: 11
Joined: 27 Mar 2016, 20:05
Has thanked: 1 time
Been thanked: 3 times

Re: Shadows over Innistrad

Postby escplan9 » 28 Mar 2016, 18:56

To the best of my knowledge, these are the remaining cards to be implemented:

From Under the Floorboards
Harvest Hand//Scrounged Scythe - done
Neglected Heirloom//Ashmouth Blade - done
Accursed Witch//Infectious Curse
Creeping Dread
Pick the Brain

I see you are going to be working on Neglected Heirloomn/Ashmouth Blade. Let me know if I'm missing some other cards not implemented yet.
Last edited by escplan9 on 30 Mar 2016, 06:16, edited 1 time in total.
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby halljared » 28 Mar 2016, 22:54

Taking Harvest Hand / Scrounged Scythe

Edit.. Okay there's something wonky with this thing. It can only be added to decks as the equipment, not the creature. Maybe a metadata issue somewhere in the card database?

I'm moving on to the cursed witch for now.
halljared
 
Posts: 11
Joined: 27 Mar 2016, 20:05
Has thanked: 1 time
Been thanked: 3 times

Re: Shadows over Innistrad

Postby escplan9 » 29 Mar 2016, 04:33

Post what code you currently have for them. You have to rebuild the projects after implementing the cards for them to show up as well. Try a full "mvn clean install" as per developers guide and see if that helps. If you're able to test the card in the "Quick Match" then it should be available in the Deck Editor as well.
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby escplan9 » 29 Mar 2016, 14:06

There still are many SOI cards implemented that are bugged (10 as of now). I have separated them all into issues in GitHub for easier reference:
Code: Select all
https://github.com/magefree/mage/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Abug+[SOI]
I've been gradually adding some automated tests for more of these cards as well. Make sure to at least manually test the cards basic functionality (all their abilities) before closing out an issue.
Last edited by escplan9 on 30 Mar 2016, 07:13, edited 2 times in total.
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby halljared » 29 Mar 2016, 18:27

For [[Harvest Hand]] I have made a branch on my fork and put my code there. I've uploaded a patch of that relevant code. There is also an image of the card in the client.
Attachments
harvest.txt
Code Patch. You can rename it harvest.patch if you need. Site won't let me upload that extension.
(4.95 KiB) Downloaded 165 times
scrounged_scythe_bug.png
Client Picture
halljared
 
Posts: 11
Joined: 27 Mar 2016, 20:05
Has thanked: 1 time
Been thanked: 3 times

Re: Shadows over Innistrad

Postby escplan9 » 29 Mar 2016, 19:01

halljared wrote:For [[Harvest Hand]] I have made a branch on my fork and put my code there. I've uploaded a patch of that relevant code. There is also an image of the card in the client.
Did you also adjust the night time card respectively? Scrounged Scythe needs some minor adjustments since it is the night time version of the card. I didn't see any changes to the Scythe in your branch.
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby halljared » 29 Mar 2016, 19:31

Last night I had the [[Scrounged Scythe]] code but scrapped it to make managing the code easier. This morning I made that Harvest code visible online and forgot to fix the Scythe.

Anyways I have pushed an update on my halljared's github in the harvest branch with that fix.

Thanks for looking at this with me!

FWIW I think this is a metadata issue somewhere outside the code. To re-state the problem:
You can view [[Harvest Hand]] in the card database section of the deck-builder. If you click it once it brings up the card text/art. If you add it to your deck, you get a [[Scrounged Scythe]]. I've coded other DFCs and this doesn't happen with any of them, only the [[Harvest Hand]].
halljared
 
Posts: 11
Joined: 27 Mar 2016, 20:05
Has thanked: 1 time
Been thanked: 3 times

Re: Shadows over Innistrad

Postby escplan9 » 30 Mar 2016, 00:29

I tested out your coding for Harvest Hand / Scrounged Scythe and both work perfectly as far as I can tell functionally. The issue with the Deck Editor you mentioned I was able to duplicate as well, but that's a separate issue (and I'm not very familiar with the inner workings of Deck Editor issues). I don't see a reason it is showing the way it is in Deck Editor when in game the images and cards are working fine. I'll create a separate issue for it anyways.

I added your Harvest Hand / Scrounged Scythe code in the latest commit to the repo - 100% your code and kept you as the author. Thanks for your continuing contributions!

edit: The Deck Editor issue here - https://github.com/magefree/mage/issues/1711
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby halljared » 30 Mar 2016, 03:33

Wow that's awesome. I admit I haven't tested those files in gameplay or test cases but if you think they're good then that's awesome. I'm glad to help.
halljared
 
Posts: 11
Joined: 27 Mar 2016, 20:05
Has thanked: 1 time
Been thanked: 3 times

Re: Shadows over Innistrad

Postby fireshoes » 30 Mar 2016, 13:26

Make sure sure to refresh the database. That may be what is causing Scrounged Scythe to appear instead, since they share a collector's number and it was created first. Scythe does have dfc information included already.
User avatar
fireshoes
 
Posts: 536
Joined: 20 Aug 2014, 03:51
Has thanked: 201 times
Been thanked: 49 times

Re: Shadows over Innistrad

Postby escplan9 » 30 Mar 2016, 14:39

I did everything I could think of - the usual stuff I do when I implement a new card (rebuild Mage sets, clean+build Server, clean+build Client, run Server, run Client, connect with "force database update" checked). Additionally I did a full rebuild of the entire project using the
Code: Select all
mvn clean install
command. I'm not familiar with a way to refresh the DB directly.
escplan9
 
Posts: 257
Joined: 10 Aug 2015, 22:38
Has thanked: 26 times
Been thanked: 40 times

Re: Shadows over Innistrad

Postby halljared » 30 Mar 2016, 20:03

Ok I've been working on Accursed Witch for a day or two and I've finally found my problem. Now that I know the problem I can probably make the card work but before I do, I want to ask the correct way to make it work.

The problem:
The code for handling Auras that enter the battlefield from zones other than being cast doesn't work because the card is technically the Accursed Witch when its put onto the field, then transforms immediately afterwards.

I could probably do some manual rigging of the card to get it to attach to the right player similar to how O-ring targets after it enters the field, but that doesn't seem very elegant to me.

Any ideas for what I can do to get this working properly?
halljared
 
Posts: 11
Joined: 27 Mar 2016, 20:05
Has thanked: 1 time
Been thanked: 3 times

Re: Shadows over Innistrad

Postby Doctor Weird » 30 Mar 2016, 21:35

halljared wrote:because the card is technically the Accursed Witch when its put onto the field, then transforms immediately afterwards.
This doesn't sound right, it should already enter the field as an aura. Maybe take a look at how the planeswalkers from Magic Origins do it, since they too leave as creatures to return as a different type of permanent. Just taking a guess here, of course.
Doctor Weird
 
Posts: 180
Joined: 25 May 2015, 01:33
Has thanked: 7 times
Been thanked: 52 times

PreviousNext

Return to Developers Talk

Who is online

Users browsing this forum: No registered users and 9 guests


Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 9 guests

Login Form