Example #1
0
func puritanHandleSay(s mud.Stimulus, n *simple.NPC) {
	scast, ok := s.(mud.TalkerSayStimulus)
	stim := mud.TalkerSay(n, "Wash your mouth out, "+scast.Source().Name())
	if !ok {
		panic("Puritan should only receive TalkerSayStimulus")
	} else {
		text := scast.Text()
		if ContainsAny(text,
			"shit", "piss", "f**k",
			"c**t", "c********r",
			"m**********r", "t**s") {
			n.Room().Broadcast(stim)
		}
	}
}
Example #2
0
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))
			}
		}
	}
}