Skip to content

Conversation

@MTW-PT
Copy link
Collaborator

@MTW-PT MTW-PT commented Aug 7, 2018

Removed the critical error from last pull request attempt.

This version counts the players mana by counting untapped basic lands.
One random spell that the player can cast is cast each turn (it taps lands)
Cards played are removed from the player's hand (land drops and spells cast)

Last attempt at Pull Request Failed, fixed the critical error
@MTW-PT MTW-PT requested a review from hitz August 7, 2018 04:31
Copy link
Owner

@hitz hitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll run some tests and fix it up maybe... I dunno when.

self.tapped = False
if self.cipt:
self.tapped = True
if context is None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably we should remove this case, but it breaks a test or script.

import random
import json
import mtginator.cards as cards
import cards
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the tests still work with this change?

if len(lands) > 0:
pick = random.choice(lands)
# Note: should implment some color optimization
pick.play(None) #lands don't need context to play
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh here you have a null context, probably this should assume a board state/context, even if it's irrelvant for land drops

def enumerate_plays(self):
''' For a given hand (or metahand) and available mana, what plays are available to Player
Returns: Set of Card objects
Returns: List of Card objects
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I made this a Set() on purpose, like what if you have Forest, Forest, Forest, Llnaowar Elves? You don't need an array of 4. But possibly i overlooked something.

#!/usr/bin/env python

import sys
sys.path.insert(0,'/src/mtginator/')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok this is horrible and we need to fix imports if that's what you need.

@MTW-PT
Copy link
Collaborator Author

MTW-PT commented Aug 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants