* rulesets/Character.cpp: Improve error logging in task setup.
* rulesets/Task.h, rulesets/Py_Task.cpp: Add an accessor for the
refcount of a task, and expose it to the script interface.
* rulesets/mason/world/tasks/Combat.py: Add a check that there are
still at least two participants in combat, or end the task.
* common/BaseWorld.h, server/WorldRouter.h, server/WorldRouter.cpp:
Add interface to allow world entities to activate tasks based on
tool use operations.
* server/EntityFactory.h, server/EntityFactory.cpp: Add method which
createa a new task in response to an activation request.
* rulesets/Character.cpp: When a character uses a tool, use the
tool type and operation to activate a task if one is available.
* rulesets/Character.h, rulesets/Character.cpp: Add stub of Use op
handler on character. Re-write the mind Use op handler to be
cleaner, faster and easier to understand.
* rulesets/Entity.h, rulesets/Thing.cpp: Add a signal to be emitted
when an entities container changes, and emit it during
MoveOperation processing.
* rulesets/Character.h, rulesets/Character.cpp: Hook up to the
containered signal of a wielded entity, and unwield it when its
container changes.
* rulesets/PythonArithmeticScript.cpp: Implement getting attribute
values from statistics script.
* rulesets/Statistics.cpp, rulesets/Statistics.h,
rulesets/Py_Statistics.cpp, rulesets/Character.cpp,
rulesets/Combat.cpp: Remove hard coded stats for combat
and strength.
* rulesets/mason/world/statistics/Statistics.py: Add test support
for combat and strength stats.
* server/PersistantThingFactory.cpp: Remove debug output.
* rulesets/Character.cpp, rulesets/StatisticsProperty.h,
rulesets/StatisticsProperty.cpp: Add a property handler for
statistics.
* rulesets/Character.cpp: When setting task, check if an existing
task needs to be cleared first. When clearing a task, check
whether a task exists or not.
* rulesets/Character.cpp: When initiating combat task from task
factory, check to see if the task is successfully created before
using it.
* rulesets/Py_Property.cpp, rulesets/Py_Property.h: New python wrapper
class for entity properties.
* rulesets/Py_Mind.cpp: Re-work getattr logic to make it clearer.
* rulesets/Py_Object.cpp: Return Py_None when an Atlas Element cannot
be converted to python. This ensures that this function never returns
null.
* rulesets/Py_Statistics.cpp: Add temporary handlers for hardcoded
statistics for "attack", "defence", and "strength".
* rulesets/Py_Task.cpp: Add wrappers for methods Task.irrelevant and
Task.obsolete, as these are now required in combat scripts.
* rulesets/Py_Task.h: Fix the PyTask_Check macro, which was miscoded.
* rulesets/Py_Thing.cpp: Add wrapper for Entity.send_world so that
scripts can channel ops through entities.
* rulesets/Py_Thing.h, rulesets/Py_Thing.cpp: Add an addition structure
for directlty wrapping Character in a type safe way. Add method
structure pointer to Entity and Character wrappers so that
the same getattr method is used for both. Add new method table for
Character including wrappers for set_task and clear_task, allowing
task scripts to add themselves and remove themselves from
characters. Modify wrapEntity() to ensure that Character entities
get the right wrapper.
* rulesets/Py_Thing.cpp: Re-work getattr code so that properties and
soft attributes are checked individually, rather than in a single
call to Entity.get. Use new python property wrappers to wrap
properties explicitly if required rather than converting to Atlas
then to generic Python data.
* rulesets/TerrainProperty.h: Fix incorrect class description in
documentation.
* rulesets/mason/world/tasks/Combat.py: Complete implementation of
simple example combat.
* server/TaskFactory.cpp: Remove debug output.
* common/BaseWorld.h: Add factory method for new tasks to the world
interface.
* rulesets/Character.cpp: Use world interface to create combat
task, rather than using EntityFactory directly.
* server/WorldRouter.h, server/WorldRouter.cpp: Implement the
new task method in the core world object.
* rulesets/Character.cpp: Switch to using the test combat script.
* rulesets/Py_EntityWrapper.h, rulesets/Py_Statistics.h: Move the
generic entity wrapper structure into its own header.
* client/Py_CreatorClient.cpp, rulesets/Py_Location.cpp,
rulesets/Py_Location.h, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp,
rulesets/Python_API.cpp: Modify PyLocation so that rather than
having a flag to indicate whether the script owns the object,
it instead stores a pointer to the entity that owns it in that
eventuality.
* rulesets/Py_Thing.cpp: Allow map and list attributes to be set from
scripts as long as the contents are Atlas compatible.
* rulesets/Python_API.cpp: Fix script output handling so only complete
lines are output.
* rulesets/mason/world/tasks/Combat.py: Add code for identifying
attacker and defender in a combat.
* rulesets/mason/world/tasks/Combat.py: Expand the sample combat
to include tick ops.
* rulesets/Python_API.cpp, rulesets/Py_Operation.cpp: Add necessary
handlers for sub_to attribute on operations.
* rulesets/Character.cpp: Adapt test code for combat scripts to
the latest task API.
* rulesets/Script.cpp: Document the script interface.
* rulesets/Task.h: Modify task interface so tasks now expect
the operation that initiated the task to be passed in
to an init function.
* rulesets/Combat.h, rulesets/Combat.cpp: Modify the combat task
methods to match the interface changes.
* rulesets/Character.cpp: Modify Combat use to take account
of interface changes. Prototype using script based
combat.
* rulesets/TaskScript.h, rulesets/TaskScript.cpp: Implement
passing the initialising op through to the script using the
standard scripp operation handling functions.
* rulesets/mason/world/tasks/Combat.py: Add handler for Attack
operation, which should now be passed in at init time.
* common/id.cpp, common/id.h: Break integer ID conversion into
two versions, one which abort()s and one which returns a known
invalid ID.
* rulesets/Character.cpp: Fix the grammar in an error message.
* server/Player.cpp: Make error message on failed character creation
clearer.
* rulesets/Entity.cpp: Switch to using SignalProperty for BBOX.
* rulesets/Area.cpp, rulesets/Character.cpp, rulesets/Line.cpp,
rulesets/Plant.cpp, rulesets/Py_Location.cpp:
Update bbox on location using setBBox(), so cached values are
updated.
* common/types.h, server/Persistance.h, common/BaseWorld.h,
common/BaseWorld.cpp, server/WorldRouter.cpp:
Switch core world map to reference by integer ID rather than string.
Add version of getEntity() which converts from string to integer
automatically.
* rulesets/Character.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/EntityFactory.cpp,
Use getEntity() when looking up an entity, so that conversion of
ID from string to integer is automatic.
* rulesets/BaseMind.cpp, rulesets/MemMap.cpp, rulesets/MemMap.h:
Switch to using integer IDs in MemMap's core mapping.
* server/Account.cpp, server/Account.h: Switch a few function
parameters to use integer ID values, making the code cleaner.
* server/Account.cpp, server/Admin.cpp, server/Persistance.cpp:
Handle string ID to integer conversions as required.
* common/BaseEntity.h, common/BaseEntity.cpp: Add an integer ID
member variable, and accessor, and require it to be initialised
along with string ID in constructor.
* common/const.cpp, common/const.h: Add a const for the integer value
of the world ID.
* rulesets/Area.cpp, rulesets/Area.h, rulesets/BaseMind.cpp,
rulesets/BaseMind.h, rulesets/Character.cpp, rulesets/Character.h,
rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Food.cpp, rulesets/Food.h,
rulesets/Line.cpp, rulesets/Line.h, rulesets/MemEntity.cpp,
rulesets/MemEntity.h, rulesets/Plant.cpp, rulesets/Plant.h,
rulesets/Stackable.cpp, rulesets/Stackable.h, rulesets/Structure.cpp,
rulesets/Structure.h, rulesets/Thing.cpp, rulesets/Thing.h,
rulesets/World.cpp, rulesets/World.h: Add integer ID handling to
constructors of all in-game entity classes.
* rulesets/MemMap.cpp: Initialise integer ID of entities in the mind
map.
* rulesets/MindFactory.cpp, rulesets/MindFactory.h: Handle integer
ID when constructing mind objects.
* server/EntityFactory.cpp, server/EntityFactory.h,
server/PersistantThingFactory_impl.h: Handle integer
ID when contructing entity objects.
* server/Restoration.cpp, server/Restoration.h, server/Restorer.h,
server/Restorer_impl.h: Handle integer ID when restoring from
database.
* server/WorldRouter.cpp: Assign integer ID when constructing the
world.
* rulesets/Character.cpp: Prevent clients and minds for using
FUTURE_SECONDS on ops other than tick. Remove all handling
of FUTURE_SECONDS when processing move ops from clients and minds.
* 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: Immobilise character if they have no stamina.
* configure.ac, NEWS: Increment version and update news.
* TODO: Remove done TODO items.
* rulesets/Character.cpp, rulesets/Creator.cpp: Modify operations
in place rather than copying first in the mind operation interface
as this should be much more efficient.
* 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/Character.cpp: Audit all mindFooOperation() methods, to
ensure operations from the mind or client code are handled in
a correct and consistant manner. Improve comments documenting
the mind operation interface.
* rulesets/Entity.cpp: Add comments documenting how externalOperation
should be used.
* rulesets/Task.h: Make irrelevant() virtual so that each task
class is responsible for doing most of its cleanup.
* rulesets/Movement.h: Make updateNeeded() public so other code
can determine if a character is moving.
* rulesets/Character.h, rulesets/Character.cpp: Add a stamina property.
Add clearTask() used to clear the current running task. Check
if tasks are irrelevant immediatly after setup, or after each
tick, and remove if they are.
* rulesets/Combat.h: Add irrelevant() implementation, and a static
variable defining stamina level below which combat cannot occur.
* rulesets/Combat.cpp: Switch to stamina as the base stat for
combat. Implement checking stamina at setup to ensure
both combatants are fit to fight, and each tick to determine if
someone has lost.
* rulesets/Character.cpp: Fix handling of Touch op so it now
returns a Sight(Touch) rather than an Action op to indicate
what has occured.
* common/custom.cpp: Fix inheritance of Attack op to Action.
* TODO: Add a note about optimising the mind operation interface.
* rulesets/Character.cpp, rulesets/Character.h: Add a Statistics
objects as a member variable of Character, and use it to
determine if a character is strong enough to move other
entities.
* rulesets/Character.cpp: Re-order code so that its not necessary
to lookup an entity that is to be moved unless we already know
its not the current entity.
* rulesets/Character.cpp: Implement destination based movement when
the target position is specified with a different LOC to the
current LOC of the character.
* modules/Location.cpp: Document the functions used to determine
relative distance vectors.
* modules/Location.cpp, modules/Location.h:
Add const accessors for location data, in preparation for
adding cached collision data which must be updated every
time data is modified.
* physics/Collision.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/EntityFactory.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer_impl.h,
server/WorldRouter.cpp, tests/Locationtest.cpp:
Use the const accessors whenver reading data from Location.
* common/BaseEntity.cpp, common/BaseEntity.h, common/inheritance.cpp,
common/inheritance.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Food.cpp, rulesets/Plant.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, server/server.cpp:
Remove the subscription mechanism as it is no longer necessary
now that operations have class numbers.
* common/BaseEntity.cpp, common/custom.cpp, common/op_switch.h,
common/types.h, rulesets/BaseMind.cpp, rulesets/Character.cpp,
rulesets/Creator.cpp, rulesets/Food.cpp, rulesets/Plant.cpp,
rulesets/Thing.cpp, rulesets/World.cpp, server/Admin.cpp,
server/Admin.cpp: Replace OpNo enumeration with defines for the
integer class numbers. Expand the switch statements used for op
dispatch because runtime extended op definitions don't have a const
number.
* server/EntityFactory.cpp: Re-order installation of ops to ensure
the number registered in enumeration maps is the one returned by
the Atlas factories.
* rulesets/Character.cpp: Improve debug output for op handling when
debug is enabled for this file.
* rulesets/Character.cpp: If reading quaternion from Atlas results
in an invalid quaternion, report an ERROR. Abort processing
the move op if any exception is thrown when reading values
from Atlas.
* rulesets/Character.cpp, rulesets/Character.h:
Add handler for chop ops, which is a quick implementation of
Axe murder to test the health bar in clients.
* rulesets/Character.cpp, rulesets/Character.h: Add Attack operation
handler to set up combat when sent by attacker.
* rulesets/Combat.cpp: Fix bootstrap tick op, and return a future tick
op from the tick op handler.
* rulesets/Entity.h, rulesets/Entity.cpp: Add default script
only handler for Attack ops.
* rulesets/Character.cpp: When Attack op comes from mind,
move it on to the target entity.
* client/ClientConnection.cpp: Improve error reporting when
unexpected object arrives from server.
* rulesets/Character.cpp: Invert test so that tool use op arguments
are now set correctly.
* rulesets/Entity.cpp: Use proper entities to handle responses to
Create and Look ops.
* server/Connection.cpp, server/EntityFactory.cpp: Improve error
reporting using String::compose.
* server/EntityFactory.cpp: Invert test so that all custom ops
now don't fail to get installed. Ensure that custom ops that
need to wait for their parent a properly inserted into the
waiting queue.
* common/custom.cpp, rulesets/Character.cpp: Ensure all custom op
types are registered with the Atlas factories, and switch
to using it for tool operations.
* common/compose.hpp: Add Ole Laursen's fine string composition
library for improved messages.
* rulesets/Character.cpp: Fix inverted check for string pos,
and add a clearer error message when it fails, using
compose.
* common/inheritance.h: Set the correct objtype on the Root meta class.
* rulesets/Character.cpp, rulesets/Food.cpp, rulesets/Plant.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp, server/Account.cpp,
server/Admin.cpp, server/Connection.cpp, tools/AdminClient.cpp,
tools/cycmd.cpp: Switch to renamed copyAttr() method from
Atlas-C++.
* common/AtlasFileLoader.cpp, common/Database.cpp,
common/FormattedXMLWriter.cpp, common/Property.cpp,
common/accountbase.cpp, rulesets/Character.cpp,
rulesets/Entity_getLocation.h, rulesets/MemMap.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Object.cpp, rulesets/Thing.cpp,
server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
server/WorldRouter.cpp, tools/AdminClient.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp: After an Element has been checked
with isFoo(), it is more efficient to get its value using Foo()
rather than asFoo() which repeats the check.
* server/Account.cpp, rulesets/Thing.cpp, rulesets/Character.cpp:
Replace asserts with proper checks that arguments are of the
expected type.
* common/custom.cpp: Put ignite op installation back in.