<commit_before>package standard

import (
	G "github.com/ionous/sashimi/game"
	. "github.com/ionous/sashimi/script"
	"github.com/ionous/sashimi/util/lang"
)

func init() {
	AddScript(func(s *Script) {
		// "Represents a machine or contrivance of some kind which can be switched on or off."
		s.The("props",
			Called("devices"),
			AreEither("operable").Or("inoperable"),
			AreEither("switched off").Or("switched on"))

		s.The("devices",
			When("printing name text").
				Always(func(g G.Play) {
				text := ArticleName(g, "device", func(device G.IObject) (status string) {
					if device.Is("operable") {
						if device.Is("switched on") {
							status = "switched on"
						} else {
							status = "switched off"
						}
					}
					return status
				})
				text = lang.Capitalize(text)
				g.Say(text)
				g.StopHere()
			}))

		s.The("props", Can("report inoperable").And("reporting inoperable").RequiresNothing(),
			To("report inoperable", func(g G.Play) {
				g.Say("It's inoperable.")
			}))

		//
		// Turn on:
		//
		s.The("actors",
			Can("switch it on").And("switching it on").RequiresOne("prop"),
			To("switch it on", func(g G.Play) { ReflectToTarget(g, "report switched on") }))

		s.The("devices",
			Can("report switched on").And("reporting switched on").RequiresOne("actor"),
			To("report switched on", func(g G.Play) {
				device, actor := g.The("device"), g.The("actor")
				if device.Is("inoperable") {
					device.Go("report inoperable")
				} else {
					if device.Is("switched on") {
						device.Go("report already on", actor)
					} else {
						device.IsNow("switched on")
						device.Go("report now on", actor)<commit_msg>move operable/inoperable to objects for converter<commit_after>package standard

import (
	G "github.com/ionous/sashimi/game"
	. "github.com/ionous/sashimi/script"
	"github.com/ionous/sashimi/util/lang"
)

func init() {
	AddScript(func(s *Script) {
		// "Represents a machine or contrivance of some kind which can be switched on or off."

		// FIX: having problems with a lack of parts
		s.The("objects",
			AreEither("operable").Or("inoperable").Usually("inoperable"))

		s.The("props",
			Called("devices"),
			AreEither("switched off").Or("switched on"))

		s.The("devices",
			When("printing name text").
				Always(func(g G.Play) {
				text := ArticleName(g, "device", func(device G.IObject) (status string) {
					if device.Is("operable") {
						if device.Is("switched on") {
							status = "switched on"
						} else {
							status = "switched off"
						}
					}
					return status
				})
				text = lang.Capitalize(text)
				g.Say(text)
				g.StopHere()
			}))

		s.The("props", Can("report inoperable").And("reporting inoperable").RequiresNothing(),
			To("report inoperable", func(g G.Play) {
				g.Say("It's inoperable.")
			}))

		//
		// Turn on, fix: was "prop", now "object" to handle outlet actors :(
		//
		s.The("actors",
			Can("switch it on").And("switching it on").RequiresOne("object"),
			To("switch it on", func(g G.Play) { ReflectToTarget(g, "report switched on") }))

		s.The("objects",
			Can("report switched on").And("reporting switched on").RequiresOne("actor"),
			To("report switched on", func(g G.Play) {
				device, actor := g.The("action.source"), g.The("actor")
				if !device.Is("operable") {
					device.Go("report inoperable")
				} else {
					if device.Is("switched on") {
						device.Go("report already on", actor)
					} else {
						device.IsNow("switched on")
						device.Go("report now on", actor)
{'fraction_non_alphanumeric': 0.17336755061305958, 'fraction_numerical': 0.0, 'mean_word_length': 3.2265060240963854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3906412', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1186, 'n_words': 270}