Coder Social home page Coder Social logo

magic's People

Contributors

aherrmann avatar chiller avatar cirquit avatar gseitz avatar leonardpunt avatar m0rph3v5 avatar medeamelana avatar seckii avatar wismill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magic's Issues

Linked abilities

Cards like Oblivion Ring and Stuffy doll ask the player to choose another object or player and remember that choice for later. Maybe objects need to keep track of one or more mutable variables to facilitate this.

Replacement effects

Replacement effects modify OneShotEffects before they are executed. There is currently some early, commented-out code in module Magic.Engine.Events that deals with replacement effects but it hasn't been adapted yet to changes in the API.

Furthermore, the type of a replacement effect should be changed to [OneShotEffect] -> Contextual (Maybe (Magic [OneShotEffect])) because some effects are interested in an entire event rather than just the individual parts. It is however much more common for cards to be interested in individual events; for these cases a helper function can be created that converts a OneShotEffect -> version to a [OneShotEffect] -> version.

Replacement effects are needed for cards that modify how a card enters the battlefield (e.g. the rare lands) and for planeswalkers that enter the battlefield with counters on them.

Manipulating target lists

Some cards allow you to choose new targets for a spell or ability on the stack (Reverberate, Redirect).

Clone effects

Certains cards become copies of other objects on the battlefield (e.g. Clone). To facilitate this, a new constructor needs to be added to ModifyObject that acts in Layer1.

Multiple-choice questions

Some cards require players to make choices. Examples:

  • Duress asks a player to choose between objects in the game
  • Gilded Lotus asks a player to choose a color
  • Primal Clay asks a player to choose one of three forms

To facilitate these cards, datatype Question needs to be expanded with a question that asks the player to choose between values.

Manipulating libraries

Certain cards allow you to look at parts of your library and move cards around (Augur of Bolas, Index).

Mind control

One card, Odric, Master Tactician, allows the active player to choose how the defending player blocks. More generally, some cards allow a player to completely take over someone else's turn.

Delayed triggered abilities

Some effects create delayed triggered abilities. For example, Chandra, the Firebrand says in part: "-When you cast your next instant or sorcery spell this turn, copy that spell".

This effect stays applicable even if Chandra were to die before the end of the turn. Therefore such effects need to be stored somewhere globally rather than in a specific object.

Piles

Some cards ask players to separate a set of objects in piles (Sphinx of Uthuun). A special kind of Question needs to be created for this.

Hand size modifiers

Certain cards increase or decrease a player's hand size, or remove a player's maximum hand size completely (Reliquary Tower).

Cost increasers/decreasers

Certain cards allow other cards to be cast without paying their mana costs (Mindclaw Shaman, Spelltwince, Omniscience). Paying mana costs for casting spells should therefore probably be done by the engine rather than actively by the cards themselves so that sometimes the engine can decide not to ask the player to actually pay these mana costs. Additional costs still need to be paid, however, including additional mana costs.

Furthermore, certain cards increase or decrease the total cost of a spell (its mana cost + additional costs).

Add last known information to move events

Right now move events don't have the last known information of an object associated with them so you can't see, for example, if an object was a creature when it was on the battlefield. Some triggers, such as that of Blood Artist, need to see this in order to know whether to trigger.

Searching libraries

Certain cards allow you to search libraries for certain cards: Evolving Wilds, Farseek, Gem of Becoming, Mwonvuli Beast Tracker, Liliana of the Dark Realms, Liliana's Shade, Ranger's Path, Shimian Specter, Diabolic Revelation, Boundless Realms.

Combat requirements

Certain cards say that a creature must attack, must block, or must be blocked (Courtly Provocateur, Reckless Brute, Predatory Rampage). Furthermore, if combat requirements would conflict with combat restrictions (things that say "can't"), all restrictions must be obeyed, and as many requirements must be obeyed as possible.

At the moment I don't know how to implement this efficiently, i.e. faster than 2^n, where n is the number of creatures involved.

Revealing cards

Sometimes cards in hidden zones are revealed. There needs to be an event for this.

State-based triggers

Some cards trigger not on events but when a certain state is reached in the game (Phylactery Lich). To fully implement the rules for state-based triggers like this one, they need to have IDs so we can make sure they don't trigger more ofen than necessary.

Blocking

In the DeclareBlockersStep, the game should ask players that are being attacked by creatures how they want to block. The game should then verify that the set of blocks is legal according to _allowBlocks in each object in the game.

Global replacement effects

Some non-permanent objects (instants, sorceries, triggered abilities, activated abilities) create replacement effects that are not tied to a specific object and can therefore not be stored in a single object, but rather need to be stored somewhere in the world. In M13 these are:

  • Safe Passage: Prevent all damage that would be dealt to you and creatures you control this turn.
  • Fog: Prevent all combat damage that would be dealt this turn.

Invalid targets

When some but not all targets of a spell or ability become invalid, as many effects as possible are applied. Currently what actually happens is unspecified; this needs to be fixed.

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.