The object was to make it easier to follow, and to also remove fruit
spamming.
The attribute "fruitsMax" now denotes the maximum number of fruits in
the plant at any given time.
"fruitsChance" now denotes a percentage, i.e. [0, 100]. The closer to
100 the greater the chance of a fruit being created or dropped each
tick.
The existing fruiting entities were also altered to make them produce
less fruits, to prevent spamming.
If a server is shut down and restarted multiple time it will lead to
plants withering since they will be getting Tick operations when there
has been no time for the Eat operation to give it nourishment.
This prevents the plants from spamming the clients about changed areas
(something which can cause the client to regenerate the terrain
materials again and again.)
The semantics of getAttrType was changed to C style return values, so
that you need to check for "0" for success. These calls seems to never
have been properly changed, resulting in fruits never being dropped.
* common/Identified.cpp, common/Identified.h:
Flatten down the base classes into one called Router.
* client/CharacterClient.cpp, client/CreatorClient.cpp,
rulesets/BaseMind.cpp, rulesets/Character.cpp,
rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/LocatedEntity.cpp, rulesets/MemEntity.cpp,
rulesets/Plant.cpp, rulesets/Stackable.cpp,
rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/Admin.cpp,
server/Connection.cpp, server/ExternalMind.cpp,
server/Lobby.cpp, server/Master.cpp,
server/Peer.cpp, server/Player.cpp,
server/ServerRouting.cpp, server/SlaveClientConnection.cpp,
server/TrustedConnection.cpp, tests/LocatedEntitytest.cpp,
tests/ThingupdatePropertiestest.cpp: Update all the operation
routing classes to use the modified base class correctly.
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Make all the
property access functions that should never be used to modify a
property const. Remove requirePropertyClass() as it pretty much
can't be const.
* rulesets/Entity.cpp, rulesets/Entity.h: Make overriden
getProperty() const as it is in the base class. Add new
property access functions for code that needs to modify the
properties which ensures class properties never get modified
through the Entity interface.
* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
rulesets/TerrainModProperty.cpp, server/CorePropertyManager.cpp:
Change all the code that accesses properties to use the right
functions.
* rulesets/LocatedEntity.h: Rename some member functions and templates
to make more sense and be consistent.
* rulesets/Character.cpp, rulesets/Plant.cpp,
server/CorePropertyManager.cpp: Fix the code to use the new names.
* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Plant.h:
Update the metabolism code to access properties in the cleanest
most type safe way possible.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Plant.cpp,
rulesets/Stackable.cpp: Fix up places that use the property
manager interface. Fix explicit reference to DynamicProperty.
* rulesets/Plant.cpp, rulesets/Plant.h, data/plants.xml:
Add a tick class property to the base class for trees, and
remove the setup handler from the core base class as it is no
longer needed.
* data/plants.xml, rulesets/Plant.cpp, rulesets/Plant.h: Remove the
last of the hard coded properties from Plant. Replace with soft
class properties in the data.
* rulesets/Plant.cpp, rulesets/Plant.h: Remove hard radius
and fruitName properties, and get the values by reading via
the standard mechanism. Add some debug output, and remove
needless complexity from the position calculation for dropped
fruit.
* rulesets/attributes.h: Remove old attribute flags used for
persistence from the build.
* rulesets/Entity.h: Replace obsolete update flags with a more
general flags field, and define three needed to track the
cleanness of basic location data.
* rulesets/Plant.cpp, rulesets/World.cpp: Remove now unused update
flags from property initialisation.
* rulesets/Entity.cpp, rulesets/Thing.cpp, server/EntityFactory.cpp:
Replace code which updated update flags with simpler changes to
the new flags field.
* data/animals.xml: Give all the animals BIOMASS.
* data/characters.xml: Add mass to some character classes that were
missing it.
* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Statistics.cpp,
rulesets/World.cpp, server/CorePropertyManager.cpp,
server/Persistor.cpp, server/Persistor_impl.h,
server/Restorer_impl.h: Remove the hard coded mass property from
Entity.
* rulesets/mason/world/statistics/Statistics.py: Fix scripts which
assume entities will have mass.
* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
rulesets/StatusProperty.cpp, rulesets/attributes.h,
server/CorePropertyManager.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer.cpp,
server/Restorer_impl.h: Remove the hard coded status property from
Entity, and the hard coded food property from character. Fix
the logic handling digestion and plants to use the new softer
properties.
* common/BaseEntity.cpp, common/BaseEntity.h, common/op_switch.h,
rulesets/Character.cpp, rulesets/Character.h: Remove the chop
operation completely from the core code. Remove some OOG
operations from the world to mind filter, as they should never
occur.
* rulesets/BaseMind.cpp, rulesets/Plant.cpp: Remove some obsolete
operation header includes.
* tests/EntityExerciser.h: Remove Chop from the test for entity.
* configure.ac: Increment version.
* rulesets/Plant.cpp, rulesets/Plant.h: Remove the chop operation
handler, now completely obsolete as that functionality is done
by the task script.
* rulesets/mason/world/tasks/Logging.py: Implement logging entirely
in the task, instead of relying on functionality in the plant
class.
* rulesets/Py_Quaternion.cpp: Implement rotation method as in the
the wfmath class, as required for Logging.
* rulesets/Plant.cpp: Add an error message if the old plant
functionality gets called.
* rulesets/basic/world/objects/tools/Axe.py: Add an error message
noting that this method should not be called.
* rulesets/Py_BBox.cpp, rulesets/Py_Statistics.cpp,
rulesets/Python_API.cpp: Replace calls to the cyphesis log
system with Python exceptions.
* rulesets/Py_Mind.cpp: Accept map and list atlas attributes on
the mind object.
* rulesets/Py_Property.cpp: Improve the wording of some log messags.
* rulesets/Py_RootEntity.cpp: Assert that attributes work correctly.
* rulesets/Plant.cpp: Add FIXME about an issue with plants eating
people.
* 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.
* rulesets/Thing.h, rulesets/Thing.cpp, rulesets/Plant.h,
rulesets/Plant.cpp: Remove SetupOperation from Thing
and implement in Plant, as not all entities need a starting
tick, but plants do.
* rulesets/basic/world/objects/elements/Fire.py,
rulesets/mason/world/objects/Weather.py: Add setup_operation
handlers as these scripts require ticks.