Closed einsteinsfool closed 7 years ago
As for adding the stringify, here's output from game.js
without it:
players:
[ { name: 'knoob',
cash: 2,
influenceCount: 2,
influence: [Object],
isObserver: false,
ai: false,
isReady: true,
connected: true },
And here is with:
"players": [
{
"name": "knoob",
"cash": 2,
"influenceCount": 2,
"influence": [
{
"role": "assassin",
"revealed": false
},
{
"role": "duke",
"revealed": false
}
],
Good remarks.
Added a comment why lastRoleClaim
shouldn't be nulled on INFLUENCE_REVEAL state. It's because we still need this value to update calledBluffs
.
You're right, I removed the unnecessary function since in onHistoryEvent
we also update calledBluffs
of AIs.
And finally, I think you meant:
If you are in BLOCK_RESPONSE state, you need to check whether the blocking player
Fixed that too.
Good stuff!
Another PR that passed all tests. I will add more tests in the future after I write more PRs. For now AIs don't play as I'd expect them to so I prefer to first improve them. I have over 10 more ideas for fixes/improvements. And I finally know what's the difference between
state.playerIdx
andstate.state.playerIdx
. So it will be easier to change stuff now. :D