Commit graph

437 commits

Author SHA1 Message Date
Al Riddoch
e656990464 2007-01-11 Al Riddoch <alriddoch@zepler.org>
* server/CorePropertyManager.cpp: Modify DECAYS Delete handler so
	  that the parent entity handles the creation of entities that
	  have resulted from the decay.

	* rulesets/Character.cpp: Call Entity::operation() from operation()
	  to ensure operation handlers are called, and all future
	  modifications get picked up too.

	* data/basic.xml, data/mason.xml: Add a DECAYS property leaving a
	  skull to all humanoid classes.
2007-01-11 00:26:44 +00:00
Al Riddoch
cc98de2816 2007-01-10 Al Riddoch <alriddoch@zepler.org>
* common/types.h: Add an entity pointer to the handler function
	  pointer arguments.

	* rulesets/ActivePropertyFactory_impl.h: Fix the guard comment.

	* rulesets/Character.cpp: Remove debugging output.

	* rulesets/Entity.cpp: Fix new property code so it now sets the
	  value. Improve the debug reporting when dealing with op handlers.

	* rulesets/mason/define_world.py: Test the decays property.

	* server/CorePropertyManager.cpp: Add a DECAYS property and a
	  test handler for it.
2007-01-10 21:58:49 +00:00
Al Riddoch
d58109f9e3 2007-01-07 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.h: Fix broken doc comments on constants for
	  metabolism.

	* rulesets/Character.cpp: Switch metabolism code over to use the
	  update mechanism, to remove race conditions. Re-write the
	  math so that nothing can stay alive for ages by consuming all their
	  mass. Tune constants so a well fed character will take a month.

	* data/mason.xml: Set up goblin and settler class so that by
	  default they will starve to death in a few hours, and need to find
	  food to avoid this.

	* common/const.h: Oops. Database got disabled again by accident.
	  Turn it back on.
2007-01-08 03:19:20 +00:00
Al Riddoch
c55a9f944c 2007-01-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/OutfitProperty.cpp, rulesets/OutfitProperty.h: Make this
	  property sigc++ trackable, and add a method to handle signals
	  indicating that the entity has been removed from the outfit.

	* rulesets/mason/define_world.py: Add a test function for messing
	  with outfit.

	* rulesets/Character.cpp: Make sure the "outfit" property really is
	  an OutfitProperty.
2007-01-05 00:47:21 +00:00
Al Riddoch
11952a3ba1 2007-01-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Character.h: Remove SEX property
	  from Character.

	* rulesets/attributes.h, server/Persistor_impl.h, server/Restorer.cpp:
	  Remove SEX property from the persistence code.

	* tests/Charactertest.cpp, tests/Creatortest.cpp: Remove SEX attribute
	  from the tests, as it is no longer there.
2007-01-03 22:48:02 +00:00
Al Riddoch
2706d34eae 2007-01-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/OutfitProperty.h, rulesets/OutfitProperty.cpp: Ensure that
	  removed garments or equipment get reported as empty IDs, and provide
	  a function to clean them up. Provide a direct function for adding
	  garments, without needing to go through the slower standard interface.

	* rulesets/mason/define_world.py: Add a quick hacked in test garment.

	* rulesets/Character.cpp: Implement adding OUTFIT property on demand,
	  and adding to it anything wielded that has a WORN attribute.
2007-01-03 02:06:50 +00:00
Al Riddoch
23851b3fd0 2007-01-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/Pedestrian.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Stackable.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
	  Remove m_world member variable from all Entity classes, and
	  access the world manager object as a singleton.
2007-01-01 17:57:06 +00:00
Al Riddoch
e147182d47 2006-12-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/EntityProperty.cpp: Modify EntityProperty so it
	  shows its value as an empty ID if it is not set to anything,
	  and clears its reference if it is set to an empty string.

	* rulesets/Character.cpp: Fix the code that handles an empty wield
	  argument, so it clears the wielded entity correctly and efficiently.
2006-12-30 16:45:01 +00:00
Al Riddoch
4471772ce7 2006-12-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/attributes.h, server/Persistor_impl.h,
	  server/Restorer.cpp: Remove right_hand_wield from the
	  persistence layer, pending its complete removal.

	* rulesets/EntityProperty.h, rulesets/EntityProperty.cpp:
	  Make EntityProperty a more normal property by making it hold
	  a reference to its value, not the value itself.

	* rulesets/Character.cpp, rulesets/Character.h: Use EntityProperty
	  for right_hand_wield attribute, so it stores the value long term
	  which I think is more efficient.
2006-12-30 03:55:37 +00:00
Al Riddoch
e9d142d71f 2006-12-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Thing.cpp: Add some debug instrumentation to the new
	  Property update mechanism.

	* rulesets/Character.cpp: Re-write the Wield handling code to use
	  Update ops.
2006-12-29 18:48:04 +00:00
Al Riddoch
e7c7e232ac 2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/CharacterClient.cpp, client/ClientConnection.h,
	  rulesets/Character.cpp, rulesets/Character.h, tools/cyaddrules.cpp,
	  tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp,
	  tools/cydumprules.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
	  Add inline documentation.

	* client/CharacterClient.h, client/CharacterClient.cpp: Remove
	  overriden sight operation handlers, as they are no longer
	  present in the base class, and will never be called.

	* client/ClientConnection.h: Remove obsolete unimplemented template
	  declaration.

	* rulesets/Entity.cpp: Remove documentation for an argument that was
	  never there.

	* tools/cyctrl.cpp: Mark as removed from the build.

	* Add a FIXME about removing hard coded gender property
2006-12-26 18:24:24 +00:00
Al Riddoch
9a56dac06c 2006-10-26 Al Riddoch <alriddoch@zepler.org>
* Add RCS Id keywords to every file, for better version tracking.
2006-10-26 00:48:00 +00:00
Al Riddoch
eb1879ff05 2006-10-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.h, rulesets/Character.cpp: Remove hacky
	  hardcoded drunkness implementation.

	* rulesets/attributes.h, server/Persistor_impl.h, server/Restorer.cpp:
	  Remove persistence hooks for drunkness.
2006-10-09 03:05:00 +00:00
Al Riddoch
44f9a86bd0 2006-10-09 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Block attempts at admin operations from the
	  mind interface, and therefore the client.
2006-10-09 02:07:29 +00:00
Al Riddoch
7adcce4126 2006-08-21 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.h, rulesets/Character.cpp, common/op_switch.h:
	  Ensure that unseen operations are passed to the mind.
2006-08-21 22:41:27 +00:00
Al Riddoch
e002de1c65 2006-08-10 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.h, rulesets/Character.cpp: Re-write
	  findInInventory to recurse into inventory containers.
2006-08-10 21:19:32 +00:00
Al Riddoch
6b0bdf2208 2006-08-01 Al Riddoch <alriddoch@zepler.org>
* common/op_switch.h, rulesets/Character.h, rulesets/Character.cpp:
	  Add Update to the poll op handlers in the world2mind interface,
	  removing the special case.
2006-08-01 18:01:23 +00:00
Al Riddoch
e3ddc8900c 2006-08-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/Entity.cpp, rulesets/Character.h,
	  rulesets/Character.cpp: Remove now empty operation methods.
2006-08-01 14:01:15 +00:00
Al Riddoch
b5f8a038a0 2006-08-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Food.cpp,
	  rulesets/Plant.cpp, rulesets/Stackable.cpp, rulesets/Thing.cpp:
	  Remove script override calls from the individual C++ operation
	  methods, as script overrides are now done centrally.
2006-08-01 13:49:48 +00:00
Al Riddoch
d699a4ef8c 2006-08-01 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/Entity.cpp: Add a override of
	  BaseEntities operation() method which handles calling
	  script operation handlers directly, rather than relying
	  on the C++ handlers to check for them later.

	* rulesets/Character.cpp, rulesets/BaseMind.cpp: Check for script
	  operation handlers centrally in Character and BaseMind too.
2006-08-01 11:17:16 +00:00
Al Riddoch
e1fee4628c 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add script hooks to Wield and Nourish
	  handlers.
2006-07-31 17:47:59 +00:00
Al Riddoch
d729b606c9 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Move the script hook for Character
	  to the beginning of the Tick op handler.
2006-07-31 17:41:48 +00:00
Al Riddoch
a6ecac949b 2006-07-31 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Add script override code to the
	  imaginary and talk operation handlers.
2006-07-31 17:34:27 +00:00
Al Riddoch
56f7a816e3 2006-07-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Remove Appearance from SetupOperation
	  in Character too.
2006-07-20 23:09:35 +00:00
Al Riddoch
a5549afaaf 2006-07-19 Al Riddoch <alriddoch@zepler.org>
* data/basic.xml: Make coin inherit from stackable.

	* rulesets/Character.cpp, rulesets/Stackable.cpp: Add debug output
	  to new combine op handlers.
2006-07-19 02:44:18 +00:00
Al Riddoch
9ff4f941b8 2006-07-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/Stackable.cpp: Report an error if a divide op has
	  args with the wrong ID.

	* rulesets/Character.h, rulesets/Character.cpp: Add function
	  to check if an entity is in the characters inventory.

	* rulesets/Character.cpp: First pass at implementing filters
	  for combine and divide ops from the client.
2006-07-17 02:09:36 +00:00
Al Riddoch
d9962b3bd0 2006-07-11 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h: Remove opEnumerate
	  method as its now a trivila call to another method.

	* rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Creator.cpp:
	  Replace calls to opEnumerate with direct calls to getClassNo().
2006-07-11 14:24:26 +00:00
Al Riddoch
640c3d28d7 2006-07-03 Al Riddoch <alriddoch@zepler.org>
* client/Py_CreatorClient.cpp, rulesets/Character.cpp,
	  rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Food.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Thing.cpp, server/WorldRouter.cpp:
	  Rename Entity members get(), set() and has() to getAttr(), setAttr()
	  and hasAttr().
2006-07-03 01:41:29 +00:00
Al Riddoch
afd260bf59 2006-06-20 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Don't forward ops to the mind blindly if
	  we don't know what they are.
2006-06-20 16:39:51 +00:00
Al Riddoch
f725415b57 2006-06-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Re-write comments about sending ops from
	  mind to world.
2006-06-19 17:21:46 +00:00
Al Riddoch
07da807b3b 2006-06-06 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, rulesets/Character.cpp, rulesets/Creator.cpp,
	  server/Account.cpp, server/Admin.cpp, server/Connection.cpp,
	  server/Lobby.cpp, server/WorldRouter.cpp: Don't bother with serial
	  numbers on ops generated inside the server. They just leak and upset
	  clients.
2006-06-07 00:13:39 +00:00
Al Riddoch
e757778db6 2006-06-05 Al Riddoch <alriddoch@zepler.org>
* rulesets/Movement.h: Add method to check if a target position has
	  been specified.

	* rulesets/Character.cpp: Don't return a tick for movement if no
	  target is specified, as the old movement object has no further
	  role to play.
2006-06-05 13:10:08 +00:00
Al Riddoch
4bfb14f060 2006-06-05 Al Riddoch <alriddoch@zepler.org>
* server/Connection.cpp, server/CommClient.cpp, server/Account.cpp:
	  Only set refnos on ops if the client has set a serial number.

	* rulesets/Character.cpp: Simplify handling the transfer of
	  operations from client to in-game. Don't give new operations
	  serial numbers at this point.
2006-06-05 12:57:29 +00:00
Al Riddoch
abeb2a55bf 2006-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Be more severe about error messages if
	  client sends an action op. Remove obsolete comments.
	  Warn if client sends a Set op. Don't accept look ops with
	  an arg containing no ID - nothing sends this, and nothing should.

	* rulesets/Thing.cpp: Add an error report if an explicit Action op
	  is received by an entity.
2006-05-14 02:26:17 +00:00
Al Riddoch
a884fa4866 2006-05-06 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/newid.cpp, server/server.cpp:
	  Modify new ID checks so that code still runs when database is
	  unavailable, and events requiring new IDs fail cleanly.

	* server/Connection.cpp: Report a failure to create a player
	  account if no ID available.

	* rulesets/BaseMind.cpp: When processing appearance ops, handle
	  stamp more efficiently, report an error if ID is missing
	  from argument.

	* server/IdlePSQLConnector.cpp, server/IdlePSQLConnector.h:
	  Implement re-connecting to the Database if connection is lost.

	* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Thing.cpp:
	  Ensure STAMP is present on appearance op args.

	* server/CommListener.cpp, server/CommListener.h,
	  server/CommPeerListener.cpp, server/CommPeerListener.h,
	  server/CommSlaveListener.cpp, server/CommSlaveListener.h,
	  server/CommUnixListener.cpp, server/CommUnixListener.h:
	  Add a return value to method for creating new client socket
	  objects, and use it to return failure if no ID is available
	  from the database for a new object.

	* rulesets/Py_Point3D.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Python_API.cpp: Add "new" method for class wrappers, and
	  call the in place constructor from new rather than init. Re-write
	  internal function for creating new instances so it uses the "new"
	  method.

	* rulesets/Py_Statistics.cpp: Remove some obsolete code inadvertedly
	  copied from another file. Comment out some unused code to get rid
	  of a warning.

	* server/CommPSQLSocket.cpp: Clear the database connection from
	  destructor.

	* tests/python_class.cpp: A new test for experimenting with new
	  Python wrappers.
2006-05-06 21:36:57 +00:00
Al Riddoch
b4c3fdf21e 2006-04-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Task.cpp: Fix the name of the
	  TASKS attribute.

	* rulesets/mason/world/tasks/Logging.py: Make the logging task
	  progress in the right direction.
2006-04-30 01:12:10 +00:00
Al Riddoch
21478516e8 2006-04-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Set ID on the argument of set ops
	  used to handle tasks. Remove debug output.
2006-04-29 21:41:21 +00:00
Al Riddoch
cda06e34bf 2006-04-29 Al Riddoch <alriddoch@zepler.org>
* rulesets/Task.cpp, rulesets/Task.h: Add two members to task,
	  progress and rate which handle the progress towards completion,
	  and the rate at which it is changing. Add a member function which
	  adds an atlas representation of the task as an attribute to an
	  Atlas entity.

	* rulesets/Py_Task.cpp: Expose progress and rate attributes allowing
	  them to be set.

	* server/TaskFactory.cpp: Set the name of a task when it is created
	  by its factory.

	* rulesets/mason/world/tasks/Logging.py: Set the progress and rate
	  of the logging task as it progresses.

	* rulesets/Character.h, rulesets/Character.cpp: Add updateTask()
	  method to be called when task ticks. Make initTask, updateTask
	  and clearTask emit Set operations which set the TASK attribute
	  on the character to reflect the current status of the task.
2006-04-29 20:41:50 +00:00
Al Riddoch
f2582fecc9 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Ram.py: Use two move ops to give the
	  entity being hammered a short burst of velocity, so it being
	  hammered in is visible.

	* rulesets/Character.cpp: Don't process task tick ops if they have
	  no serial number.
2006-04-27 17:30:08 +00:00
Al Riddoch
1857b859a6 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Sharpen.py: Add serial numbers to
	  tick ups.

	* rulesets/mason/world/tasks/Combat.py: Fix the attacker initiative
	  and detect if combat is obsolete if a character has been defeated.

	* rulesets/Task.h: Add an accessor to return an incremented serial
	  number for a new tick op.

	* rulesets/Py_Task.cpp: Add python wrapper for new tick accessor.

	* rulesets/Character.cpp: Add debug output to code enforcing
	  old task ticks.
2006-04-27 17:04:09 +00:00
Al Riddoch
e8b5625cbb 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Re-write the way combat is initialised
	  so each participant owns its own combat task object.

	* rulesets/mason/world/tasks/Combat.py: Re-implement the example
	  combat system so it works with one instance per character instead
	  of one per battle.
2006-04-27 00:55:40 +00:00
Al Riddoch
c35bb178a4 2006-04-27 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Python_API.cpp: Remove last remaining remnants of
	  code using SUB_TO.
2006-04-26 23:40:34 +00:00
Al Riddoch
2f1eb7133a 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: When the client sends a Use op with
	  no args, stop the current task. A mechanism for testing the
	  task for interruptibility is still required, so characters can't
	  escape too easily from combat.
2006-04-26 20:19:51 +00:00
Al Riddoch
d33806e600 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Stop using SUB_TO for tick and setup ops to
	  subsystems, and use argument.NAME instead to indicate the subsystem
	  to be compatible with movement ticks.
2006-04-26 15:21:15 +00:00
Al Riddoch
f306be60c3 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: Simplify check tick ops for subsystem.

	* rulesets/Combat.h, rulesets/Fell.h: Remove obsolete hard coded
	  tasks from the build.

	* tests/Tasktest.cpp, tests/Fell.cpp, tests/Fell.h: Move old Fell
	  class into tests, and use it to verify tasks operate correctly.
2006-04-26 10:04:04 +00:00
Al Riddoch
53cfab0611 2006-04-26 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Task.cpp, rulesets/Task.h,
	  rulesets/TaskScript.cpp: Re-work tick ops to tasks so they use
	  argument, not sub_to to get routed to the task. Do the groundwork
	  for having a serial number for each op, which resets to zero when
	  a new task is started.

	* rulesets/mason/world/tasks/Combat.py,
	  rulesets/mason/world/tasks/Logging.py,
	  rulesets/mason/world/tasks/Raise.py,
	  rulesets/mason/world/tasks/Ram.py,
	  rulesets/mason/world/tasks/Sharpen.py: Modify all current tasks
	  to set their arg as required.
2006-04-26 01:20:47 +00:00
Al Riddoch
fe4330bedb 2006-04-24 Al Riddoch <alriddoch@zepler.org>
* common/BaseWorld.h, rulesets/Character.cpp,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/TaskFactory.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Specify the target base type that a given
	  task is valid for, and provide target type when activating a task.

	* data/mason.xml: Add target base types to most task rules.

	* rulesets/mason/world/tasks/Combat.py: Fix the copyright date.

	* rulesets/mason/world/tasks/Sharpen.py: Proof of concept task
	  for turning logs into stakes.
2006-04-24 19:51:54 +00:00
Al Riddoch
743e11a2f0 2006-04-19 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Vector3D.cpp: Fix incorrect METH_VARARGS function type
	  of the three rotateN methods, as it should have been converted to
	  METH_O. Add a new rotate method used to rotate a vector using a
	  quaternion.

	* rulesets/Py_Quaternion.cpp: Add a method to check the validity of
	  the quaternion, and a type method to create a string representation
	  of the quaternion.

	* rulesets/Character.cpp: Remove commented out legacy hard coded
	  combat task setup. Now all tasks are scripts.

	* rulesets/mason/world/tasks/Logging.py: Break logging down into
	  something that happens over many ticks, using the orientation of
	  the tree to determine if its felled yet.
2006-04-19 22:46:00 +00:00
Al Riddoch
b321b0657f 2006-04-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp: When tick ops are passed to mind, check
	  that SUB_TO=="mind" so that task ticks don't get treated as mind
	  ticks.

	* rulesets/mason/world/tasks/Combat.py: Clean up logic for checking
	  attacker stamina on initialisation.
2006-04-18 13:26:55 +00:00
Al Riddoch
21faff869f 2006-04-18 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/tasks/Combat.py: Re-work the way combat works
	  so all involved entities do their own tick ops, rather than the
	  whole thing being coordinated by only one entity. This simplifies
	  removing the task once obsolete.

	* rulesets/Py_Thing.cpp: Add get_task() on Character so task is
	  available to scripts.

	* rulesets/Py_Oplist.cpp: Allow an oplist to be appended to an
	  oplist as well as being added.

	* rulesets/Character.h: Add an accessor for task.

	* rulesets/Character.cpp: Ensure a task is cleared if it does not
	  get initialised.
2006-04-17 23:58:03 +00:00