lycan-city / werewolf-moderator

A complete Werewolf moderator
4 stars 3 forks source link

Error: Wrong script generation #32

Closed wovalle closed 7 years ago

wovalle commented 7 years ago
wovalle commented 7 years ago

Deeply related to https://github.com/werewolfrd/werewolf-brain/issues/33

vetom commented 7 years ago

@mamodom How many levels of calls are we adding?

mamodom commented 7 years ago

I have the impression that moderator.getScriptFromDeck should return* every possible calls, but provide metadata for the clients to be able to filter.

*I imagine this should probably be an opt-in or opt-out feature, that way clients that won't implement script filtering win't have to worry about this

The way I imagine this working is:

Background:
    Given all the existing cards are
        | Name         | Bindings                 |
        | Villager     |                          |
        | Werewolf     | werewolves               |
        | Seer         | seer                     |
        | Cupid        | cupid, lovebirds         |
        | Direwolf     | dire_wolf, werewolves    |
        | Doppelganger | doppelganger             |
        | Big Bad Wolf | big_bad_wolf, werewolves |
        | Cult Leader  | cult_leader              |
    And I start a game from the following roles
        | Name        |
        | Villager    |
        | Werewolf    |
        | Cult Leader |
        | Seer        |
        | Cupid       |
    And then resulting game includes the following roles
        | Name        |
        | Villager    |
        | Werewolf    |
        | Cult Leader |

Scenario: Game script filter
    When I select the game level script filter
    Then the moderator script is expected to have the following calls
        | CallName    | First Night | Decoy |
        | cult_leader | No          | No    |
        | werewolves  | No          | No    |

Scenario: Deck script filter
    When I select the deck level filter
    Then the moderator script is expected to have the following calls
        | CallName    | First Night | Decoy |
        | Cupid       | Yes         | Yes   |
        | lovebirds   | Yes         | Yes   |
        | cult_leader | No          | No    |
        | werewolves  | No          | No    |
        | seer        | No          | Yes   |

Scenario: No script filter
    When I select no filter
    Then the moderator script is expected to have the following calls
        | CallName     | First Night | Decoy |
        | big_bad_wolf | Yes         | Yes   |
        | cupid        | Yes         | Yes   |
        | lovebirds    | Yes         | Yes   |
        | doppelganger | Yes         | Yes   |
        | dire_wolf    | Yes         | Yes   |
        | cult_leader  |             | No    |
        | werewolves   |             | No    |
        | seer         |             | Yes   |

Scenario: Custom Filter
    When I select the following custom filter
        | Role         |
        | Werewolf     |
        | Seer         |
        | Doppelganger |
        | Big Bad Wolf |
        | Cult Leader  |
    Then the moderator script is expected to have the following calls
        | CallName     | First Night | Decoy |
        | big_bad_wolf | Yes         | Yes   |
        | doppelganger | Yes         | Yes   |
        | cult_leader  |             | No    |
        | werewolves   |             | No    |
        | seer         |             | Yes   |
wovalle commented 7 years ago

@mamodom I'm with you, but by default I would return the results with game filter applied unless I receive another filter as param.

mamodom commented 7 years ago

That's what I meant with

I imagine this should probably be an opt-in or opt-out feature, that way clients that won't implement script filtering win't have to worry about this

wovalle commented 7 years ago

@mamodom Yeah, but the `Scenario: No script filter' should return the game filtered at game level.

mamodom commented 7 years ago

I'm not getting what you're saying