Commit graph

418 commits

Author SHA1 Message Date
Al Riddoch
75e9d3a546 2005-11-10 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-11-11 00:06:48 +00:00
Al Riddoch
cab0671c68 2005-11-02 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-11-02 02:46:57 +00:00
Al Riddoch
8c0a05b40b 2005-11-02 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-11-02 02:06:38 +00:00
Al Riddoch
ec7f371b75 2005-10-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Immobilise character if they have no stamina.

	* configure.ac, NEWS: Increment version and update news.

	* TODO: Remove done TODO items.
2005-10-24 16:11:59 +00:00
Al Riddoch
2735f09740 2005-10-23 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Report an error if m_task becomes null
	  while processing a task tick op.

	* rulesets/Combat.cpp: Remove debug output.

	* rulesets/Statistics.cpp: Remove debug output.
2005-10-23 21:10:48 +00:00
Al Riddoch
409060aec3 2005-10-20 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-20 21:47:51 +00:00
Al Riddoch
e3806759eb 2005-10-20 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-20 14:34:01 +00:00
Al Riddoch
be74e78b55 2005-10-20 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-20 13:43:04 +00:00
Al Riddoch
4a344efba4 2005-10-19 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-19 16:41:27 +00:00
Al Riddoch
1ab13bf6c3 2005-10-18 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-18 21:46:42 +00:00
Al Riddoch
2e0f9a4c83 2005-10-16 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-16 20:47:33 +00:00
Al Riddoch
26fbbe9d4b 2005-10-01 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-10-01 17:34:21 +00:00
Al Riddoch
a0836a6818 2005-09-28 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-28 23:02:50 +00:00
Al Riddoch
9f84ec07ef 2005-09-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Report an error if a movement tick op has
	  no serialno. Remove some obsolete comments.
2005-09-27 00:00:17 +00:00
Al Riddoch
7edb9b919e 2005-09-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: When processing Move op from mind,
	  suppress Tick op used to update if character is not moving.
2005-09-26 12:43:40 +00:00
Al Riddoch
0504e6cf79 2005-09-26 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-26 01:56:21 +00:00
Al Riddoch
f3a20714ec 2005-09-26 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-26 00:06:19 +00:00
Al Riddoch
ab71b9c6b8 2005-09-22 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-22 17:24:03 +00:00
Al Riddoch
168480f85c 2005-09-20 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-20 23:09:22 +00:00
Al Riddoch
ab7244ccb0 2005-09-20 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-20 00:26:42 +00:00
Al Riddoch
85f6672fbe 2005-09-19 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-19 22:36:14 +00:00
Al Riddoch
77cfe37fb4 2005-09-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Task.h, rulesets/Task.cpp: Add reference counting to the
	  task interface.

	* rulesets/Character.cpp, rulesets/Combat.cpp, rulesets/Combat.h:
	  Add experimental code to handle initiating combat.
2005-09-19 00:42:03 +00:00
Al Riddoch
68fdae5266 2005-09-18 Al Riddoch <alriddoch@zepler.org>
* common/Attack.h, common/operations.cpp, common/types.h:
	  Add a new Attack operation type.

	* common/op_switch.h, common/BaseEntity.h, common/BaseEntity.cpp,
	  rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/Character.cpp, rulesets/Character.h: Add handlers to base
	  classes for Attack op.
2005-09-18 02:03:37 +00:00
Al Riddoch
d52414f72a 2005-09-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/PythonMindScript.cpp, rulesets/PythonMindScript.h,
	  rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h
	  rulesets/PythonScript.h, rulesets/Script.cpp, rulesets/Script.h:
	  Clean up script API.

	* rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Food.cpp, rulesets/Plant.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp: Modify script calls to new API.

	* rulesets/BaseMind.cpp, rulesets/BaseMind.h: All sub_op calls now
	  take const ref for sub_op argument.
2005-09-18 00:55:58 +00:00
Al Riddoch
f2a739734a 2005-09-14 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-13 23:29:42 +00:00
Al Riddoch
6c5aedd3e8 2005-09-12 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-12 01:11:35 +00:00
Al Riddoch
2ef3642327 2005-09-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/Thing.cpp, rulesets/Character.cpp: Use getVelocity()
	  on RootEntity, rather than accessing it as a soft attribute.
2005-09-10 01:26:23 +00:00
Al Riddoch
aef624468b 2005-09-07 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-09-07 17:18:27 +00:00
Al Riddoch
39918324e0 2005-08-31 Al Riddoch <alriddoch@zepler.org>
* 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++.
2005-08-30 23:53:34 +00:00
Al Riddoch
42e1c99565 2005-08-30 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-08-30 20:43:19 +00:00
Al Riddoch
776ee701f0 2005-08-29 Al Riddoch <alriddoch@zepler.org>
* 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.
2005-08-29 03:34:24 +00:00
Al Riddoch
fdd316b628 2005-08-27 Al Riddoch <alriddoch@zepler.org>
* Port whole code base to Atlas-C++ 0.6 series. Main server binary
	  now links.
2005-08-27 14:52:12 +00:00
Al Riddoch
7a4c1a67ed 2005-06-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/Movement.cpp, rulesets/Movement.h,
	  rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
	  rulesets/Character.cpp: Remove the obsoleted movement code.
	  Eliminate friend relationship with Character, adding necessary
	  accessors. Remove unused member variables.
2005-06-08 17:37:55 +00:00
Al Riddoch
71e477ae4f 2005-06-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Movement.cpp,
	  rulesets/Pedestrian.cpp: Get rid of m_collAxis as it was unused.
	  Add velocity to the interface of getTickAddition to avoid using
	  the redundant m_velocity member of Movement. Fix calculation
	  of velocity magnitude in new movement code. Correctly set
	  velocity to zero when movement reaches its target.

	* rulesets/Character.cpp: Add alternative movement processing
	  code based on the new mathods in Pedestrian.
2005-06-08 01:05:01 +00:00
Al Riddoch
33c9bff356 2005-06-07 Al Riddoch <alriddoch@zepler.org>
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Pedestrian.cpp:
	  Add a return value to getUpdatedLocation to indicate whether an
	  update was necessary or not.

	* rulesets/Character.cpp: Add some notes on how this code could be
	  adapted to Use the new Movement code.
2005-06-07 23:16:42 +00:00
Al Riddoch
83b8e4e0df 2005-06-07 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add some comments on how the movement
	  code should work.
2005-06-07 19:07:18 +00:00
Al Riddoch
b875b3e4eb 2005-06-06 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Clean up check for movements that currently
	  can't be handled.
2005-06-06 22:55:03 +00:00
Al Riddoch
4ccd2b8bd1 2005-06-06 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
	  rulesets/Pedestrian.cpp: Rename some variables to make the code
	  more comprehensible.
2005-06-06 21:53:57 +00:00
Al Riddoch
bc6b32672e 2005-06-01 Al Riddoch <alriddoch@zepler.org>
* data/mason.xml: Set default mode to swimming on fish.

	* rulesets/Character.cpp: Don't set intial mode of characters to
	  "birth".
2005-06-01 15:15:24 +00:00
Al Riddoch
e63d1c5504 2005-05-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Send a Sight(Action) op from character when
	  using a tool so the client know when to run an animation.
2005-05-26 23:21:30 +00:00
Al Riddoch
06ceca655b 2005-05-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Character.h, rulesets/attributes.h,
	  server/Persistor.cpp, server/Persistor_impl.h, server/Restorer.cpp;
	  Make right_hand_wield a real Atlas property, and add it to the
	  database code.

	* rulesets/Character.cpp: When wielding a tool, set right_hand_wield
	  correctly to notify clients.
2005-05-26 00:03:14 +00:00
Al Riddoch
627484f79b 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* data/mason.xml: Add a new rule for fish.

	* rulesets/mason/define_world.py: Add a shoal of fish to the lake.

	* common/custom.cpp, rulesets/Character.cpp,
	  rulesets/basic/mind/NPCMind.py: Use Unseen operation to notify
	  minds when they attempt to interactive with something that
	  they can't iteract with, either because its outside their
	  area of perception, or because its been deleted.
2005-05-14 15:17:31 +00:00
Al Riddoch
699fd848ef 2005-05-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/World.cpp, rulesets/Character.cpp: Remove the debug output.
2005-05-10 16:48:00 +00:00
Al Riddoch
c1d4d91b21 2005-05-07 Al Riddoch <alriddoch@zepler.org>
* common/Add.h, common/custom.cpp, common/operations.cpp,
	  common/types.h: Add new Add operation class.

	* common/BaseEntity.h, common/BaseEntity.cpp, common/op_switch.h,
	  rulesets/Character.cpp, rulesets/Character.h:
	  Add handling for the Add operation into the core operation set.

	* common/Delve.h, common/Dig.h, common/Mow.h: Fix comments.
2005-05-06 23:23:34 +00:00
Al Riddoch
341f82d14e 2005-05-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add some debug stuff.

	* rulesets/World.cpp, rulesets/World.h: Add handler for delve
	  operations. Just for testing for now, no functionality.
2005-05-04 21:36:28 +00:00
Al Riddoch
7f1ee732b7 2005-05-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Include POS from a Use op argument when
	  building the arg for the resulting op.

	* rulesets/Py_Point3D.cpp: Add a print handler.

	* rulesets/Python_API.cpp: When constructing Point3D or Vector3D
	  accept an Atlas list as well as a standard python list.
2005-05-01 18:05:52 +00:00
Al Riddoch
7ba24a29d9 2005-04-21 Al Riddoch <alriddoch@zepler.org>
* common/custom.cpp, common/Delve.h,
	  common/operations.cpp, common/operations.h:
	  Add new delve operation for digging with a pickaxe.

	* data/basic.xml, rulesets/basic/world/objects/tools/Pickaxe.py:
	  Add new pickaxe entity which emits a Delve operation when
	  used.

	* rulesets/Character.cpp: Fix a bug where a segfault occured
	  if an operation was requested by a tool that was unknown to
	  to the core server code. Instead an error message is emitted.

	* rulesets/World.cpp: Subscribe world terrain to delve ops.
2005-04-22 00:29:10 +00:00
Al Riddoch
3c1de4ff35 2005-03-03 Al Riddoch <alriddoch@zepler.org>
* common/Property.cpp, rulesets/EntityProperties.cpp,
	  server/Persistor.cpp, server/Restorer.cpp, tools/cycmd.cpp:
	  Tweak template code to work with stricter standard compliance
	  of gcc 4.

	* rulesets/Character.h, rulesets/Character.cpp: static const
	  members need to be defined in the .cpp to satisfy all compilers.
2005-03-03 23:45:32 +00:00
Al Riddoch
e2c86c0b8b 2005-02-17 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/op_switch.h,
	  common/operations.cpp, common/operations.h, common/types.h,
	  rulesets/Character.cpp, rulesets/Character.h, rulesets/Thing.cpp,
	  rulesets/Thing.h: Add core op handling for update operation, used
	  to handle move ops better.
2005-02-17 01:47:32 +00:00
Al Riddoch
a66be27ec2 2005-02-15 Al Riddoch <alriddoch@zepler.org>
* tools/Makefile.am: Add copy_python.sh to the distribution.
2005-02-15 19:27:53 +00:00