示例#1
0
 def __init__(self, what, place, seat=None):
     if seat == None:
         Goal.__init__(
             self, "have a meal", self.am_i_full,
             [MoveMeArea(place, 10),
              AcquireThing(what), self.eat])
     else:
         Goal.__init__(self, "have a meal", self.am_i_full, [
             MoveMeArea(place, 10),
             AcquireThing(what),
             SitDown(seat), self.eat
         ])
     self.what = what
     self.place = place
     self.full = 0.01
     self.vars = ["what", "place"]
示例#2
0
 def __init__(self, what, where):
     Goal.__init__(self, "fetch a thing",
                   self.is_it_in_my_inventory,
                   [MoveMeArea(where, 20),
                    SpotSomething(what),
                    PickUpFocus(what)])
     self.what = what
     self.vars = ["what"]
示例#3
0
 def __init__(self, desc, place, what, tool):
     Goal.__init__(self, desc, false, [
         AcquireThing(tool),
         MoveMeArea(place),
         SpotSomething(what),
         MoveMeToFocus(what), self.do
     ])
     self.tool = tool
     self.what = what
     self.vars = ["tool", "what"]
示例#4
0
 def __init__(self, what, source, place, tool, range=30):
     Goal.__init__(self, "Gather a resource using a tool",
                   false,
                   [AcquireThing(tool),
                    MoveMeArea(place, range=range),
                    Gather(what),
                    SpotSomethingInArea(source, location=place, range=range,
                                        condition=self.source_entity_condition, ),
                    MoveMeToFocus(source),
                    self.do])
     self.what = what
     self.source = source
     self.place = place
     self.tool = tool
     self.range = range
     self.vars = ["what", "source", "place", "tool", "range"]
示例#5
0
 def __init__(self, seed, source, place, tool, range=30, spacing=4):
     Goal.__init__(self, "Plant seed to grow plants",
                   false,
                   [AcquireThing(tool),
                    MoveMeArea(place, range=range),
                    SpotSomethingInArea(seed, place, range=range, seconds_until_forgotten=360),
                    MoveMeToFocus(seed),
                    self.do,
                    SpotSomethingInArea(source, place, range=range),
                    MoveMeNearFocus(source, allowed_movement_radius=5),
                    ClearFocus(source)])
     self.seed = seed
     self.source = source
     self.source_filter = entity_filter.Filter(source)
     self.place = place
     self.tool = tool
     self.range = range
     self.spacing = spacing
     self.vars = ["seed", "source", "place", "tool", "range", "spacing"]