Whebon / dale-of-merchants

Board Game Arena adaptation of Dale Of Merchants
Other
2 stars 0 forks source link

[DISCARDED PROPOSAL] Card modifications #70

Closed Whebon closed 2 weeks ago

Whebon commented 3 weeks ago

Card Modifications

Any state modifications of a card instance beyond its printed properties will be reflected in the card_modification table. If the state of a card is updated for the first time, a new row in the table will be created for that card instance and the values are set accordingly. Subsequent card modifications of that instance will be applied on top of the already existing row for that card_id.

New db table

CREATE TABLE IF NOT EXISTS `card_modification` (
  `card_id` int(10) unsigned NOT NULL,     #uniquely defines the card instance
  `effective_type_id` int(11),             #if not null, override all printed properties with those of another card
  `chameleon_target_id` int(11),           #if not null, this must be the card_id of the chameleon's target
  `value` int(11),                         #if not null, override the printed value with this value
  `passive_used` BOOLEAN NOT NULL,         #if true, the ability cannot be used again (e.g. market discovery)
  `GOT_passive_used` BOOLEAN NOT NULL      #if true, the 'Good Old Times' ability cannot be used again
  `expires_on_resolve`: BOOLEAN NOT NULL,  #if true, delete all modifications when this technique resolves
  `effect_pointer`: int(11) NOT NULL,      #keeps track of the number of global effects that have already been applied
  PRIMARY KEY (`card_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

Notes

  1. When a chameleon is "used", that chameleon copies ALL card modifications from its target (except for the card_id). If effective_type_id is null, set it to the printed type id of the target.
  2. All card modifications expire at the end of the turn. If a card is still in a schedule, expires_on_resolve is set to true, and it will expire when fully resolving the technique instead.
  3. Two global effect types, CT_FLASHYSHOW and CT_PRACTICALVALUES, are stored in the effects table. Only when a card is "used", those effects are applied. Then the effect_pointer is updated for that instance to assure those effects are not applied again.
  4. Effects that directly modify the cards value (e.g. bold haggler, stove, etc) can directly modify the value field.
  5. Accordions do not apply card modifications. Instead, for each accordion, 1 point of margin is added to the stack's target value. (e.g. if you are building stack n with 2 accordions, the stack value must be in range [n-2, n+2] instead of exactly n)
Whebon commented 3 weeks ago

Update:

~It is asserted that a chameleon does not have a card_modification row before copying, otherwise it should have already been "used".~

Good old times is allowed to set its active_used to true before copying. On copying a card, active_used will also be overwritten by the active_used of the target.

Whebon commented 3 weeks ago

This proposal will be discarded in favor of #74