* rulesets/basic/mind/goals/common/misc_goal.py: Clean up defend
goal so it works with new spot_something.
* rulesets/mason/define_world.py: Add goblins.
* client/Py_CreatorClient.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp:
Convert functions that take a single argument to use METH_O
and avoid calling PyArg_ParseTuple.
* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
rulesets/basic/mind/goals/common/move.py: Rename
unit_vector_to_another_vector to unit_vector_to.
* rulesets/Python_API.cpp: Remove C++ implementation of server.dictlist
as its installation was messy, and it serves no purpose being
implemented in C++.
* rulesets/basic/mind/NPCMind.py, rulesets/basic/mind/dictlist.py:
Use python dictlist implementation from original Python version
of cyphesis.
* rulesets/Py_WorldTime.cpp: Extend the type object for python
WorldTime to the format used by more recent python versions,
adding new and init methods as well as flags, and doc string.
* rulesets/Python_API.cpp: Refactor the way the server python
module and its type server.WorldTime are created to be the
preferred way for more recent python versions.
* rulesets/basic/mind/NPCMind.py: Remove explicit WorldTime
member, as there is already one in the C++ base class.
* rulesets/Python_API.cpp: Re-work the keywords handling in Operation()
to avoid bugs in the mapping protocol by using Dict functions, and
eliminate wasteful double lookup. No longer accept setting FROM
in constructor as its never required.
* rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/basic/editor.py: No longer set FROM on operations at
construction. It was never necessary.
* 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.
* common/const.h: Add a second const for the non-squared default
box size for visibility calculations.
* modules/Location.cpp: Initialise cached box size members with
defaults from consts.
* rulesets/basic/mind/goals/common/move.py: Don't remove focus
knowledge about item just because it has been picked up. This
fixes eating acorns.
* rulesets/basic/mind/goals/common/misc_goal.py: Remove focus knowledge
when something is eaten.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/world/objects/Thing.py: Move some functionality
from the Thing base class into NPCMind, leaving minimal
functionality in the base class making it suitable as an interface
for all scripts.
* rulesets/Py_BBox.cpp, rulesets/Py_Optime.cpp,
rulesets/Py_Statistics.cpp, rulesets/Py_Thing.cpp: Ensure that
setattr returns an exception if the attribute is not a valid one.
* rulesets/Py_Map.cpp, rulesets/Py_Point3D.cpp,
rulesets/Py_Quaternion.cpp, rulesets/Py_World.cpp,
rulesets/Py_WorldTime.cpp: Remove setattr, as no attributes can
be set on this type.
* rulesets/Py_Mind.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Vector3D.cpp: Clean up type structure.
* rulesets/basic/mind/goals/common/move.py: Remove attempt
to set "rotation" attribute on location, as its obsolete
and pointless.
* rulesets/basic/world/objects/Thing.py: Get rid of redundant kw
arg to constructor, move op_dict initialisation to cinit()
and remove base_init completely as its only required to handle
the C++ constructor behavoir which we no longer need.
* rulesets/basic/mind/NPCMind.py: Get rid of redundant args to
to mind, and call cinit to handle connection to C++ core directly
now that base_init is gone.
* rulesets/basic/world/objects/Thing.py: Remove self.attributes
from the base class for all python scripts.
* rulesets/mason/world/objects/Weather.py,
rulesets/basic/world/objects/plants/Tree.py,
rulesets/basic/world/objects/animals/Animal.py,
data/basic.xml, data/mason.xml: Don't use set_kw to handle default
attributes, and add the to the .xml rules files.
* rulesets/basic/world/objects/buildings/House.py,
rulesets/basic/world/objects/buildings/StoneHouse.py,
rulesets/basic/world/objects/tools/Bow.py,
rulesets/basic/world/objects/tools/Sword.py,
rulesets/mason/world/objects/animals/Deer.py,
rulesets/mason/world/objects/animals/Pig.py,
rulesets/mason/world/objects/outdoor/Campfire.py,
rulesets/mason/world/objects/outdoor/Gravestone.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/plants/seeds/Seed.py,
rulesets/mason/world/objects/tools/Cleaver.py,
rulesets/mason/world/objects/undead/Skeleton.py,
rulesets/werewolf/world/objects/characters/Villager.py,
rulesets/werewolf/world/objects/tools/Gallows.py:
Don't import set_kw from misc, as its now obsolete and unused.
* rulesets/basic/mind/NPCMind.py: Add handling for 'about' knowledge
and return it in a way that makes sense to the listener.
* rulesets/mason/define_world.py: Provide NPCs which lots of
information 'about' the world, so they can help players.
* rulesets/basic/mind/NPCMind.py: Don't respond to knowledge
queries if the character has no knowledge.
* server/Connection.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
Use flag check to see if operations have FROM set, rather than
checking for an empty string.
* rulesets/Thing.cpp: When handling move ops, avoid lookup of LOC
in world unless it has changed.
* rulesets/Character.cpp: Report a warning when action ops are sent
from client or mind code.
* rulesets/Py_Location.cpp: Allow invalid vectors to be used
to set attributes on Location.
* rulesets/acorn/world/objects/undead/Skeleton.py,
rulesets/mason/world/objects/undead/Skeleton.py: Remove action
ops replacing them with setting MODE of skeleton to
collapsed.
* rulesets/basic/mind/NPCMind.py,
rulesets/basic/mind/goals/common/misc_goal.py: Use Imaginary ops
rather than Action for emotes.
* rulesets/basic/mind/NPCMind.py: Fix face() so that NPC doesn't crash
if it turns to face something that is zero distance away.
* server/EntityFactory.cpp: Improve error reporting when an entity
has velocity set at creation, and ensure that the velocity is
unset before the entity goes into the world.
* 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/misc_goal.py: Don't return
non-existant ops.
* rulesets/Thing.cpp: Fix some places where root_operations
were being returned.
* common/inheritance.cpp: Add "affect" operation base class,
and fix parents on use and wield.
* common/custom.cpp: Install atlas factories for custom op
types.
* 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/common/misc_goal.py: More changes
to make goals work with new spot_something.
* rulesets/basic/mind/goals/common/move.py: Modify hunt pursuit goal
to fit with spot_something.
* 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/common/misc_goal.py: Re-work
spot_something goal to store the entity spotted in Knowledge
rather than it being hacked in as a possession. Re-work many
other goals to work with spot_something, eliminating reference
to mind from constructors where possible.
* rulesets/basic/mind/goals/common/move.py: Break down goals for
picking up things into separate goals for picking up
posessions, and focussed items, and similarly for moving toward
items.
* 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.
* data/basic.xml: Added operations "disperse" and "extinguish".
Set up "disperse" as the default operation for the pile.
* rulesets/basic/world/objects/Pile.py: The operation "disperse"
will call the "extinguish" operation on the target. Maybe it is
advisable to add an assertion if the target is indeed a fire.
* rulesets/mason/define_world.py: Add peck as a goal for the chicken,
and a test_chicken function.
* rulesets/basic/mind/panlingua/interlinguish.py: Add peck verb.
* rulesets/basic/mind/goals/common/misc_goal.py: Add peck goal.
Chicken will now run around. The actual peck will be added later.
* rulesets/mason/define_world.py: Fix graveyard bbox.
Tweak lych's patrol path so he doesn't run into gravestones.
* rulesets/basic/mind/NPCMind.py: WTF!
* 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.
* server/WorldRouter.cpp: Fix a problem where entities contained by
other entities had their height adjusted incorrectly.
* rulesets/basic/world/objects/elements/Fire.py: Allow fires to be
moved.
* rulesets/Python_API.cpp: Add constructor for BBox.
* data/mason.xml: Add a torch. Add burn_speed attributes to a
bunch more entity classes.
* rulesets/mason/world/objects/tools/Torch.py: Script for torch.
* rulesets/mason/world/objects/tools/Tinderbox.py: Change strength
of initial fire spark to 0.05.
* common/operations.cpp: Fix nourish op, which got broken when mow
was added.
* data/basic.xml: Add a default bbox for lumber, giving it a more
apropriate size.
* rulesets/Py_World.cpp: Add a compare implementation so that
` scripts can check entities to see if they are the world.
* rulesets/basic/world/objects/elements/Fire.py: Tune the
changes which occur in fire as it burns.
* rulesets/mason/world/objects/tools/Rope.py: Correct the syntax
of stub functions.
* rulesets/basic/world/objects/buildings/StoneHouse.py: Fix the import
statements.
* rulesets/basic/world/objects/buildings/House.py: Fix import for
physics module.
* rulesets/basic/mind/goals/common/misc_goal.py: Fix typo in
cut_something.
* server/ScriptFactory.cpp, server/ScriptFactory.h: New factory
class for handling python scripts for entities much more
efficiently, and provide a means where they can be re-imorted
at an apropriate time.
* server/PersistantThingFactory.h,
server/PersistantThingFactory.cpp: Make PersistantThingFactory
copy constructor protected, to ensure its not used accidentally.
Replace strings for storing python script data with a pointer
to a factory for creating scripts.
* server/EntityFactory.cpp: Use the new ScriptFactory mechnism
for creating scripts attached to entities. Improve variable
names a little.