예제 #1
0
파일: flipflop.go 프로젝트: onewland/gomud
func ffHandleSay(s mud.Stimulus, n *simple.NPC) {
	scast, ok := s.(mud.TalkerSayStimulus)
	if !ok {
		panic("FF should only receive TalkerSayStimulus")
	} else {
		args := strings.SplitN(scast.Text(), " ", 3)
		mud.Log("FF args:", args)
		if args[0] == "bling" {
			switch args[1] {
			case "set":
				n.Meta["lastText"] = args[2]
				n.SetDescription(n.Meta["lastText"].(string))
			}
		}
	}
}