Commit graph

20 commits

Author SHA1 Message Date
Erik Ogenvik
97a09ae6b0 Conversion to Python 3 through 2to3. 2018-05-07 11:15:26 +02:00
Erik Ogenvik
9e87611433 Only print subgoals if there are any. 2017-09-05 23:10:23 +02:00
Erik Ogenvik
7f3f936308 Filter out invalid subgoals. 2017-05-28 21:51:22 +02:00
Erik Ogenvik
d8eeb05c3d Revert include optimize for Python files.
CLion wasn't as good at optimizing Python as it was at optimizing C++.

This reverts commit 7aaa9b9ba7.
2017-05-28 16:32:17 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
0a81e9897f Added a concept of goal "validity".
Calling "is_valid" checks whether the goal actually can be fulfilled.
If it can't be, False is returned.
By default all Goals return True unless a "validity" function is supplied
in the constructor.

For now we only use it for checking whether movement goals can be reached.
2016-06-08 22:03:59 +02:00
Erik Ogenvik
326c2f6667 Handle subgoals being None. 2016-06-08 21:46:37 +02:00
Erik Ogenvik
924ba32982 Added extra goals to some goals.
These are goals that can be injected to run when the parent goal
is fulfilled.
2016-03-30 22:34:44 +02:00
Erik Ogenvik
44402e0f73 Send last processed goals in report.
Also don't send data if there's nothing in the collections or maps.
2013-06-01 23:17:16 +02:00
Erik Ogenvik
a70b7c1ed3 Store last processed goals as debug data. 2013-06-01 23:17:16 +02:00
Erik Ogenvik
09ba0c4edc Make goals behave more stringent.
I.e. make functions behave just like subgoals.
2013-06-01 23:17:16 +02:00
Erik Ogenvik
fff8695022 Make goal checking code more robust and add docs.
Instead of checking whether there's a debug string available we should
check for any operation being returned.
2013-06-01 23:17:16 +02:00
Erik Ogenvik
333ae7832f Be more forgiving with goal errors.
Instead of treating a goal error as something which will make the entity
inactive, we instead allow for some errors (namely three currently) to
occur before the goal is deactivated. Any other goals are however
allowed to carry on even though one goal is faulty.
We also expose this through the goal_info query functionality, allowing
for world authors to better debug faulty goals.
2013-04-07 23:20:23 +02:00
Erik Ogenvik
3697ba8c42 Allow goals to be queried.
This will return a map containing various useful data about the goal.
This is meant to be used for debugging and inspection of goals and
behaviours.
2013-04-01 22:17:58 +02:00
Al Riddoch
ba57f6e668 2007-09-06 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/panlingua/interlinguish.py: Add the list verb.

	* rulesets/basic/mind/Goal.py: Add a __repr__() method to make it
	  more intuitive to get a text representation of a goal.

	* rulesets/basic/mind/NPCMind.py: Add a handler for the list verb
	  that causes all the matching knowledge to be listed.
2007-09-06 22:17:57 +00:00
Al Riddoch
defed47f1f 2006-12-12 Al Riddoch <alriddoch@zepler.org>
* configure.ac: Increment version.

	* common/const.h: Declare a doxygen group for all the consts.

	* common/operations.cpp, common/Add.h, common/Attack.h, common/Burn.h,
	  common/Chop.h, common/Connect.h, common/Cut.h, common/Delve.h,
	  common/Dig.h, common/Drop.h, common/Eat.h, common/Monitor.h,
	  common/Mow.h, common/Nourish.h, common/Pickup.h, common/Setup.h,
	  common/Tick.h, common/Unseen.h, common/Update.h:
	  Declare a doxygen group for all custom operations.

	* rulesets/Area.h, rulesets/Character.h, rulesets/Creator.h,
	  rulesets/Entity.h, rulesets/Food.h, rulesets/Line.h,
	  rulesets/Missile.h, rulesets/Plant.h, rulesets/Stackable.h,
	  rulesets/Structure.h, rulesets/World.h: Declare a doxygen group
	  for in game entity classses.

	* common/Property.h, common/Property_impl.h, server/ScriptFactory.cpp,
	  server/ScriptFactory.h, server/SlaveClientConnection.cpp,
	  server/SlaveClientConnection.h: Add some more inlined documentation.
2006-12-12 15:54:20 +00:00
Al Riddoch
1c2ee9a610 2005-06-30 Al Riddoch <alriddoch@zepler.org>
* rulesets/basic/mind/Goal.py: Remove debugging output.
2005-06-29 23:49:07 +00:00
Al Riddoch
04a1310ed6 2005-06-23 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h, rulesets/Python_API.cpp:
	  Implement a function for determining the horizontal distance
	  between two locations neglecting height difference, as for
	  locations on the terrain it is not relevant.

	* rulesets/basic/mind/goals/common/move.py: Improve the coding of
	  the move_me_to_it goal, so distance determination is more effective.
	  Make distance independant of height.
	  Relax distances at which character is concidered to have arrived at
	  its destination.

	* rulesets/basic/mind/Goal.py: Modify goal so that it understands
	  that a subgoal can be unfulfilled, but still not need to take any
	  action.
2005-06-23 12:46:28 +00:00
Al Riddoch
d74d7117e5 * server/server.cpp, server/CommClient.h, server/Account.h,
server/Account.cpp, rulesets/Entity.h, rulesets/Entity.cpp,
	  rulesets/Character.h, rulesets/Character.cpp, rulesets/BaseMind.h,
	  rulesets/BaseMind.cpp, common/types.h, common/operations.h,
	  common/op_switch.h, common/BaseEntity.h, common/BaseEntity.cpp:
	  Added support for imaginary operations used in a similar way
	  to emoting.

	* server/WorldTime.h: Added update method so underlying DataTime
	  can be updated.

	* server/ServerRouting.h, server/Lobby.h, server/Lobby.cpp
	  server/ServerRouting.cpp, server/Connection.h,
	  server/Connection.cpp, server/Account.h, server/Account.cpp: Added
	  a lobby object which handles lobby chat. Essentially it stores
	  a list of accounts and allows operations to be sent or broadcast
	  to other accounts.

	* rulesets/Py_WorldTime.cpp: Added python is_now() method because
	  using comparison does not appear to work.

	* rulesets/BaseMind.cpp: Added updating of minds WorldTime each
	  time an operation is received.

	* modules/DateTime.h: Added operator << so DateTime can be sent
	  to cout.

	* common/types.h: Added types for storing accounts in Lobby.

Al Riddoch  <alriddoch@zepler.org>
2001-05-29 11:16:09 +00:00
Al Riddoch
e635657e3f * Added in Python interface code to deal with manipulation of operation
time.

	* Made basic_tick a float, because it should be.

	* Imported all the rulesets python code from python cyphesis.

Al
2000-11-27 18:28:20 +00:00