lycos

package module
v0.0.0-...-750952d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2015 License: MIT Imports: 18 Imported by: 0

README

Lycos

GAE/Goで動く長期人狼(開発中)

Introduction

Lycos is "Are you a Werewolf?(Jinrou)" game on Google App Engine.
Supported in Japanese.
This game often played in short(2-3 hours) or long(5-7 days) term.
Those version are very different, Lycos is supporting Long-term Game.

This software is alpha version, So some functions are not implemented.
"Lycos" means "Werewolf" in Greek.

Requirements

  • Golang
  • GAE/Go SDK

Library

  • Goon
  • go-yaml

Usage

Setup Google App Engine SDK for Go
https://cloud.google.com/appengine/downloads

Test on Local

cp app_sample.yaml app.yaml
And set own unique name to application property in app.yaml.
(Don't use same name, it will be fail in deploy process.)

$ goapp serve  

Open "localhost:8080" on your web browser.
If you watch admin server page, open "localhost:8000".

Deploy
$ goapp deploy  

Assets(Character Face's Set)

images/face/default/*.png(00.png ~ 07.png)
Painted by fuaim
(c) Copyright 2015 fuaim
These works are licensed under a Creative Commons Attribution-ShareAlike 2.1(or later version) JP license.
これらの作品は Creative Commons 表示 - 継承 2.1(またはそれ以降) 日本 ライセンスの下で提供されます。
https://creativecommons.org/licenses/by-sa/2.1/jp/

Other Assets

A few pictures are Public Domain, Please see "images/assets_license.txt"

If you want to use original Character Face on this app,

  1. Copy to images/face/
  2. Edit the "characters.yaml"

Author

Haruki Tsurumoto (tSU-RooT) tsu.root@gmail.com

License

Lycos is free software.
Programs are licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Judge

func Judge(people []Person) int

Judge Game

func Raid

func Raid(people []Person)

Raid by Werewolf

Types

type Chapter

type Chapter struct {
	Name    string
	Day     int
	Invalid bool
}

type Chara

type Chara struct {
	File string `yaml:"File"`
	Name string `yaml:"Name"`
}

type Job

type Job int

Job:

Villager - 村人
Seer - 占い師
Medium - 霊能者
Guard - 守護者, 狩人
Freemason - フリーメーソン, 共有者
Possess - 狂人
Wolf - 狼
Fox - 妖狐
const (
	Villager Job = iota + 1
	Seer
	Medium
	Guard
	Freemason
	Possess
	Wolf
	Fox
)

func (Job) CanSpeakWhisper

func (j Job) CanSpeakWhisper() bool

func (Job) CanUseAbility

func (j Job) CanUseAbility(day int) bool

func (Job) Description

func (j Job) Description() string

func (Job) GotVictory

func (j Job) GotVictory(wonCamp int) bool

func (Job) HasAbility

func (j Job) HasAbility() bool

func (Job) IsBlack

func (j Job) IsBlack() bool

func (Job) IsEvil

func (j Job) IsEvil() bool

func (Job) IsHuman

func (j Job) IsHuman() bool

func (Job) IsWolf

func (j Job) IsWolf() bool

func (Job) String

func (j Job) String() string

type Management

type Management struct {
	Key       string `datastore:"-" goon:"id"`
	VillageNo int64  `datastore:"VillageNo,noindex"`
}

type Page

type Page struct {
	Number  int
	Invalid bool
}

type Person

type Person struct {
	UserID        string         `datastore:"UserID"`
	ParentKey     *datastore.Key `datastore:"-" goon:"parent"`
	CharacterID   string         `datastore:"CharacterID" goon:"id"`
	Face          string         `datastore:"Face,noindex"`
	Name          string         `datastore:"Name,noindex"`
	Job           Job            `datastore:"Job,noindex"`
	WantJob       string         `datastore:"WantJob,noindex"`
	AbilityTarget string         `datastore:"AbilityTarget,noindex"`
	VoteTarget    string         `datastore:"VoteTarget,noindex"`
	Dead          bool           `datastore:"Dead,noindex"`
	CreatedTime   time.Time      `datastore:"CreatedTime"`
}

func DecideJob

func DecideJob(people []Person, village Village, random *rand.Rand) ([]Person, error)

func (Person) HasWriteAuth

func (p Person) HasWriteAuth(pt PostType) bool

type Post

type Post struct {
	ID        int64          `datastore:"-" goon:"id"`
	NumberTag string         `datastore:"NumberTag,noindex"`
	ParentKey *datastore.Key `datastore:"-" goon:"parent"`
	Day       int            `datastore:"Day"`
	Text      string         `datastore:"Text,noindex"`
	Author    string         `datastore:"Author,noindex"`
	AuthorID  string         `datastore:"AuthorID,noindex"`
	Type      PostType       `datastore:"Type,noindex"`
	Face      string         `datastore:"Face,noindex"`
	Time      time.Time      `datastore:"Time"`
}

func Execute

func Execute(people []Person) []Post

Execute Player

func Fortune

func Fortune(people []Person) Post

func (Post) HasFace

func (p Post) HasFace() bool

func (Post) IsPersonal

func (p Post) IsPersonal() bool

func (Post) JstAboutTime

func (p Post) JstAboutTime() string

type PostType

type PostType int
const (
	SystemMessage PostType = iota + 1
	Public
	Personal
	Whisper
	SystemSecret
	Graveyard
)

func (PostType) String

func (t PostType) String() string

type PreWriteView

type PreWriteView struct {
	Text        string
	HiddenText  string
	VillageNo   int64
	Author      string
	CharacterID string
	Face        string
	IsPublic    bool
	IsPersonal  bool
	IsWhisper   bool
	IsGraveyard bool
}

type ResultCol

type ResultCol struct {
	Name    string
	Handle  string
	Dead    bool
	Victory bool
	Job     Job
	WantJob string
}

type TextSetting

type TextSetting struct {
	PrologueSystemPost  string `yaml:"prologue_system_post"`
	FirstDaySystemPost  string `yaml:"first_day_system_post"`
	SecondDaySystemPost string `yaml:"second_day_system_post"`
	NpcName             string `yaml:"npc_name"`
	NpcFace             string `yaml:"npc_face"`
	NpcFirstPost        string `yaml:"npc_first_post"`
	NpcSecondPost       string `yaml:"npc_second_post"`
	VillagerWin         string `yaml:"villager_win"`
	WerewolfWin         string `yaml:"werewolf_win"`
	FoxWin              string `yaml:"fox_win"`
}

type TopView

type TopView struct {
	Villages  []Village
	Login     bool
	LoginURL  string
	LogoutURL string
	Reader    User
}

type UpdateSchedule

type UpdateSchedule struct {
	VillageNo  int64          `datastore:"VillageNo" goon:"id"`
	ParentKey  *datastore.Key `datastore:"-" goon:"parent"`
	UpdateTime time.Time      `datastore:"UpdateTime"`
	Hour       int            `datastore:"Hour,noindex"`
	Minute     int            `datastore:"Minute,noindex"`
}

func (UpdateSchedule) IsUpdateTime

func (us UpdateSchedule) IsUpdateTime(now time.Time) bool

func (*UpdateSchedule) SetNextUpdateTime

func (us *UpdateSchedule) SetNextUpdateTime(basetime time.Time)

type User

type User struct {
	Handle string `datastore:"Handle,noindex"`
	ID     string `datastore:"ID" goon:"id"`
	Email  string `datastore:"Email,noindex"`
}

type Village

type Village struct {
	No               int64     `datastore:"No" goon:"id"`
	Name             string    `datastore:"Name,noindex"`
	CreatedTime      time.Time `datastore:"CreatedTime"`
	NumberOfPeople   int       `datastore:"NumberOfPeople,noindex"`
	IncludeFreemason bool      `datastore:"IncludeFreemason,noindex"`
	IncludeFox       bool      `datastore:"IncludeFox,noindex"`
	Chip             bool      `datastore:"Chip,noindex"`
	UpdatetimeHour   int       `datastore:"UpdatetimeHour,noindex"`
	UpdatetimeMinute int       `datastore:"UpdatetimeMinute,noindex"`
	Day              int       `datastore:"Day,noindex"` // 0:プロローグ 1〜N:N日目 -N:N日目で終了したエピローグ
	PublicPostNo     int       `datastore:"PublicPostNo,noindex"`
	PersonalPostNo   int       `datastore:"PersonalPostNo,noindex"`
	WhisperNo        int       `datastore:"WhisperNo,noindex"`
	GraveyardPostNo  int       `datastore:"GraveyardPostNo,noindex"`
	Builder          string    `datastore:"Builder, noindex"`
	Close            bool      `datastore:"Close"`
}

type VillageView

type VillageView struct {
	Posts              []Post
	Village            Village
	People             []Person
	CharacterSet       []Chara
	Chapters           []Chapter
	Indexes            []Page
	Result             []ResultCol
	Reader             Person
	No                 int64
	Day                int
	Login              bool
	Enter              bool
	Recent             bool
	ShowStartButton    bool
	ShowAbility        bool
	ShowAbilitySelect  bool
	ShowResult         bool
	UserName           string
	LoginURL           string
	LogoutURL          string
	UserFace           string
	AbilityDescription string
	UpdatetimeNotice   string
	NpcName            string
}

func (VillageView) AbilityTargetLists

func (v VillageView) AbilityTargetLists() []Person

func (VillageView) AbilityTargetsName

func (v VillageView) AbilityTargetsName() string

func (VillageView) Collecting

func (v VillageView) Collecting() bool

func (VillageView) IsEpilogue

func (v VillageView) IsEpilogue() bool

func (VillageView) JobImage

func (v VillageView) JobImage() string

func (VillageView) Opening

func (v VillageView) Opening() bool

func (VillageView) ShowVoteForm

func (v VillageView) ShowVoteForm() bool

func (VillageView) VoteTargetLists

func (v VillageView) VoteTargetLists() []Person

func (VillageView) VoteTargetsName

func (v VillageView) VoteTargetsName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL