* rulesets/basic/mind/goals/common/common.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/mind/goals/humanoid/build_home.py,
rulesets/basic/mind/goals/humanoid/fire.py,
rulesets/basic/mind/goals/humanoid/mason.py,
rulesets/basic/mind/goals/humanoid/transaction.py:
Clean up the way goals are imported so it makes more sense,
and doxygen has an easier time with it.
* rulesets/Script.h, rulesets/Script.cpp,
rulesets/PythonThingScript.h, rulesets/PythonThingScript.cpp,
rulesets/PythonMindScript.h, rulesets/PythonMindScript.cpp:
Modify the script interface so it now only handles one operation.
* rulesets/BaseMind.cpp: Pass in the sub operation only for
sight and sound of other operations.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/humanoid/transaction.py: Adapt the mind
and goal code so it only requires one operation.
* rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/mind/goals/humanoid/construction.py,
rulesets/mason/define_world.py: Fix most goals so they no longer
require a reference to the owning mind object on initialisation,
meaning they are now more stateless.
* rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/mind/goals/humanoid/construction.py:
Re-write goals relating to gathering things off the ground
to be clearer, more efficient, and to deal with lists of types.
* rulesets/mason/define_world.py: Use warrior test to test gathering
lists of types.
* rulesets/basic/mind/goals/common/misc_goal.py: Fix a problem where
an NPC seller would not count all the coins handed over immediatly.
* rulesets/basic/mind/goals/humanoid/transaction.py: Add a FIXME about
a mis-coding using for loops.
* rulesets/basic/mind/goals/humanoid/transaction.py: Tell the seller
how much the pig they have just sold was worth. Only value each
pig rather than continuously re-pricing the same pig.
* rulesets/mason/define_world.py: Fix formatting.
* rulesets/basic/mind/NPCMind.py: Add structure to store things
an NPC has been given.
* rulesets/basic/mind/goals/humanoid/transaction.py: Add new goal
for buying things from a given entity.
* modules/Location.cpp: Fix a bug where POS was being corrupted
whenever velocity was supposed to be set.
* rulesets/basic/mind/goals/humanoid/mason.py: Convert ID to entity
before checking location.
* rulesets/mason/mind/PigMind.py: Convert ID to entity before
passing location to another function.
* rulesets/Py_Operation.h, rulesets/Py_Operation.cpp: Remove reference
ownership flag, and from and to pointers from the python operation
structure.
* rulesets/Py_Map.cpp, rulesets/Py_Oplist.cpp,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp: Remove all usage of own, from and to.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/humanoid/mason.py,
rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/mason/world/objects/clothing/Garment.py,
rulesets/mason/world/objects/plants/seeds/Acorn.py,
rulesets/mason/world/objects/plants/seeds/Apple.py,
rulesets/mason/world/objects/plants/seeds/Fircone.py,
rulesets/mason/world/objects/tools/Bucksaw.py,
rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/tools/Trowel.py: Modify all scripts
so they expect from and to of ops to be an ID string rather than
an entity.
* rulesets/basic/mind/goals/common/common.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/mind/goals/humanoid/build_home.py,
rulesets/basic/world/probability.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/mason/define_world.py, rulesets/mason/mind/SkelMind.py,
rulesets/mason/world/objects/Weather.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/mason/world/objects/animals/Pig.py,
rulesets/mason/world/objects/outdoor/Gravestone.py,
rulesets/mason/world/objects/plants/seeds/Seed.py,
rulesets/mason/world/objects/undead/Skeleton.py,
rulesets/werewolf/define_world.py:
Switch to importing random and fall back to deprecated whrandom
on older python versions.
* rulesets/basic/mind/goals/humanoid/construction.py: Re-work
goals to use new movement goals, and fix some bugs. Use
right_hand_wield properlly when using tools. Adjust to use
new spot_something goal.
* rulesets/mason/define_world.py: Fix up world initialisation
to setup forage now the constructor args have changed.
* rulesets/basic/mind/goals/humanoid/construction.py: Add a new
goal for planting seeds.
* rulesets/mason/define_world.py: Add a forester NPC that uses
the plant_seeds goal to plant acorns.
* rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/humanoid/construction.py:
Make sure Use arguments explicitly have an objtype in the
argument.
* rulesets/mason/define_world.py: Use know() for prices rather
than the special case code.
* rulesets/basic/editor.py, rulesets/basic/mind/NPCMind.py:
Remove obsolete special case code for handling knowledge of
prices. Improve code to express distance to a location so
it neglects the vertical distance, and better handles the
very close case.
* rulesets/basic/mind/goals/humanoid/mason.py: Track the character
being helped in the help goal, and turn to face them when speaking.
* rulesets/basic/mind/panlingua/interlinguish.py: Add more support
for pronouns, conjugations and whitespace in regex used to match
certain sentence structures.
* rulesets/mason/define_world.py,
rulesets/basic/mind/goals/humanoid/mason.py: Add suggested responses
to talk messages from NPCs. Helps the client make it easy
for the user to respond.
* rulesets/Python_API.cpp: Clear up the logging wrappers.
Add python wrapper for squareDistance which is more efficient
in the goal code that distanceTo. Remove some old python functions
which serve no purpose. Move distanceTo and squareDistance into
their own module.
* rulesets/basic/mind/NPCMind.py: Remove obsolete import.
* rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/common/move.py,
rulesets/basic/mind/goals/humanoid/construction.py: Use the new
physics.square_distance where linear distance is required
in goals.
* rulesets/Character.cpp, rulesets/Plant.cpp: Encapsulate the
debugging output relating to tool use into the debug macro, so it
is no longer printed.
* rulesets/basic/mind/goals/common/move.py: Re-write a couple
of movement goals so they work more reliably.
* rulesets/basic/mind/goals/humanoid/construction.py: Comment out
debugging output.
* rulesets/mason/define_world.py: More additions to NPC settler test.
* rulesets/basic/mind/goals/common/move.py:
Try and make some of the move goals a bit more legible.
* rulesets/basic/mind/goals/humanoid/construction.py:
Fix a bunch of bugs in the resource gathering goals.
These now basically work.
* rulesets/mason/define_world.py: Add knowledge of a test location
to the settler NPC testing code.
* rulesets/basic/mind/goals/humanoid/construction.py: New currently
non-functional goals for construction related tasks.
* rulesets/mason/define_world.py: Add new test for construction
goals.
* rulesets/Character.cpp: Add notes, and a check to ensure that
ops from the mind don't have TO set.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/basic/mind/goals/humanoid/mason.py: Don't set TO or FROM
on goals from the mind.
* rulesets/Plant.h, rulesets/Plant.cpp: Add handler for chop so
we can chop down vegetation.
* rulesets/basic/world/objects/tools/Axe.py: Modify Axe to comply
with new tool use mechanism.
* rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/basic/mind/goals/common/misc_goal.py,
rulesets/mason/define_world.py: Update butcher goals to use tool
use mechanism.
* rulesets/Python_API.cpp: Ensure entities created from Python
have an objtype.
* rulesets/werewolf/world/objects/tools/Gallows.py: Make sure
Point3D module is imported.
* rulesets/basic/mind/goals/humanoid/transaction.py: Fix a couple
of bugs with pig seller code.
* rulesets/werewolf/world/objects/tools/Gallows.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/mind/goals/humanoid/transaction.py,
rulesets/basic/mind/goals/common/misc_goal.py:
Fix bugs initialising Location ensuring the second
arg is a Point3D, not a Vector3D for position.
Fixes pig purchasing.
* rulesets/basic/mind/goals/humanoid/mason.py:
Fix the velocity check for escaping pigs.
* rulesets/Py_Point3D.cpp: Fix Point3D subtraction operator to
allow subtraction of both Point and Vector. Fixes pig merchant
goal for keeping pigs.
* server/WorldRouter.cpp: Add a note to check the code.
* rulesets/basic/mind/goals/humanoid/transaction.py: Remove debug
output.
* rulesets/basic/mind/goals/common/move.py: New goal to accompany
another person.
* rulesets/basic/mind/goals/common/misc_goal.py: Use new accompany
goal for hirelings.
* rulesets/Python_API.cpp: Fix distance_to arg checking error
message.
* rulesets/Py_Vector3D.cpp: Add square magnitude and distance checking
methods.
* modules/Location.cpp, modules/Location.h: Add new function for
usefully calculating the distance vector of another entity.
* tests/distancetest.cpp: Update test to check new distance
function.
* rulesets/Python_API.cpp: Make the new distance vector function
available to python rather than the relative postion function.
* rulesets/basic/mind/Knowledge.py, rulesets/basic/mind/NPCMind.py:
Ensure that Knowledge really does handle arbitrary triples.
* rulesets/basic/mind/goals/common/misc_goal.py: Add new version
of transaction goal for transactions for hirelings.
* rulesets/basic/mind/goals/humanoid/transaction.py: Complete
the implementation of the trigger goal for hirelings.
* rulesets/mason/define_world.py: Move the mercenaries closer to
origin for debugging.