octachrome / treason

A clone of the card game Coup written in Node.js
Other
138 stars 79 forks source link

Fixed scenarios where AI didn't challenge assassin or bluffed contessa when left with last influence #9

Closed einsteinsfool closed 7 years ago

einsteinsfool commented 7 years ago

All 69 tests passed.

einsteinsfool commented 7 years ago

I think I fixed all issues that you mentioned and I found additional bugs in countRevealedRoles. Thanks for reporting them. The PR status is still "changes requested", though. I don't think any more changes are needed but it you disagree, feel free to comment.

Also, I've noted 9 more things to change in AI script and it would be easier if I could choose starting roles for all AIs before match. Can I do that somehow?

octachrome commented 7 years ago

Not sure what you mean by "choose starting roles for all AIs before match" - players do not get dealt their roles until the game begins. Can you explain more what you mean?

einsteinsfool commented 7 years ago

Well, in that case I want to be able to modify AIs' influences after game starts. Is it possible? So, how do you test a speific scenario? E.g. you want to check what AI does when it revealed contessa, has another contessa and the opponent also has contessa and an assassin. For now I restart the match until I get specific roles, which is a bit boring.

octachrome commented 7 years ago

Look at the AI unit tests. They assign specific roles and states and then they verify how the AI reacts. If you are changing AI behaviour I strongly recommend adding unit tests for it.

einsteinsfool commented 7 years ago

I'll give that a go, thanks. :-)