diff --git a/components/room.html b/components/room.html index 588e436..22b669d 100644 --- a/components/room.html +++ b/components/room.html @@ -40,13 +40,10 @@
{{template "teamlist" .Room.BlueTeam}} - {{if and (ne .State.Team "blue") (not .Room.IsRunning)}} - {{template "teampew" "blue"}} + {{if not .Room.IsRunning}} + {{template "teampew" .}} {{end}} - {{if and (ne .State.Team "red") (not .Room.IsRunning)}} - {{template "teampew" "red"}} - {{end}} {{template "teamlist" .Room.RedTeam}}

diff --git a/components/teampew.html b/components/teampew.html index ebe3c68..3a6271d 100644 --- a/components/teampew.html +++ b/components/teampew.html @@ -1,18 +1,44 @@ {{define "teampew"}}
-

Join {{.}} Team

+

Join Blue Team

- +
- + {{end}}
+ {{if eq .Room.BlueTeam.Mime ""}}
-
+ {{end}} +
+
+
+

Join Red Team

+
+ +
+ {{if and (eq .State.Role "guesser") (eq .State.Team "red")}} + {{else}} + + {{end}} +
+ {{if eq .Room.RedTeam.Mime ""}} +
+ +
+ {{end}}
{{end}} diff --git a/models/main.go b/models/main.go index 7b60eab..d34d90b 100644 --- a/models/main.go +++ b/models/main.go @@ -151,6 +151,31 @@ func (r *Room) GetPlayerByName(name string) (role UserRole, team UserTeam, found return "", "", false } +func (r *Room) GetPlayerInfoByName(name string) *BotPlayer { + bp := &BotPlayer{} + if r.RedTeam.Mime == name { + bp.Role = UserRoleMime + bp.Team = UserTeamRed + } + if r.BlueTeam.Mime == name { + bp.Role = UserRoleMime + bp.Team = UserTeamBlue + } + for _, guesser := range r.RedTeam.Guessers { + if guesser == name { + bp.Role = UserRoleGuesser + bp.Team = UserTeamRed + } + } + for _, guesser := range r.BlueTeam.Guessers { + if guesser == name { + bp.Role = UserRoleGuesser + bp.Team = UserTeamBlue + } + } + return bp +} + func (r *Room) CanStart() error { if r.IsRunning { return errors.New("cannot start; game is already running") diff --git a/todos.md b/todos.md index d663cc6..8d3f445 100644 --- a/todos.md +++ b/todos.md @@ -5,13 +5,13 @@ - login with invite link; + - there three places for bot to check if its its move: start-game; end-turn, after mime gave clue; + - remove bot button (if game is not running, or bot already added); + -- show in backlog (and with that in prompt to llm) how many cards are left to open, also additional comment: if guess was right; - hide clue input for mime when it's not their turn; + - needs resend to llm btn; + - check if clue word is the same as one of the cards and return err if it is; + - autoscroll down backlog on update; + - instead of guessing all words at ones, ask only for 1 word to be open. + - ways to remove bots from teams; + +- show in backlog (and with that in prompt to llm) how many cards are left to open, also additional comment: if guess was right; - better styles and fluff; - common auth system between sites; - gameover to backlog; @@ -47,3 +47,4 @@ - guesser bot no request after game restart; - remove join as mime button if there is a mime already on that team (rewrite teampew templ); - openrouter 429 errors; +- there is a clue window for a mime before game started;