Commit Graph

30 Commits

Author SHA1 Message Date
Vassyli 5c3fd4714d Adds fixes and tests for cascade=persist, remove for scene entities.
It still looks like doctrine doesn't "know" about the column names in a cascade=remove relationship and assumes the property name to be also the column name - which is usually not true (by default, it's propertyname_id).

This update changes the column name so that doctrine's assumptions are correct again and adds tests so any changes which invalidates this relationship can be gecocnized easily.
2017-03-11 12:51:25 +01:00
Vassyli 498f4965e6 Adds tests and support for Unidirectional connections.
Also fixes travis config.
2017-03-02 20:04:27 +01:00
Vassyli 2970bd09d7 Changed the scene parent<=>child relationship to connections.
The parent<=>child relationship of scenes was removed. Instead, this commit introduces the concept of a connection.

A connection is used to connect two scenes. Depending on which entity the connect-method is called, one is defined as the "outgoing" scene, the other as the ingoing scene:

```
$a->connect($b);
```

In this case, $a will be the outgoing part of the connection, $b the incoming.

Furthermore, in order to support action groups, this commit introduces SceneConnectionGroups which can be created in scenes and checked wether they exist or not. Using these, it is possible to specifiy to which part of the scenes are connected to each other.

```
$a->getConnectionGroup("scene-A/marketsquare")->connect($b);
```

In this case, $a will have the action to access $b under the ActionGroup of scene-A/marketsquare. On the other hand, $b, which doesn't have a connection group specified, will have the connection back to $a in the default group.

Connect also accepts the return value of getConnectionGroup as the argument, thus allowing the connection _to_ a certain part of $b as well:

```
$a->connect($b->getConnectionGroup("scene-B/back"));
```

The tests for scenes were updates in order to reflect this change.
2017-03-02 17:19:46 +01:00
Vassyli 1c89d8f204 Adds removal of exceptions as well as error handling. 2017-01-19 10:02:31 +01:00
Vassyli 3b8537fab6 Adds methods to read and check permissions. 2017-01-19 10:02:31 +01:00
Vassyli 3bf23f3ac7 Adds Permission model and framework for testing permission manager. 2017-01-19 10:02:31 +01:00
Austen McDonald 340d6d18fa Rename CharacterViewpoint to Viewpoint
As I was writing the documentation, this just feels like added complexity that we don't need.
2016-11-11 14:06:26 -08:00
Austen McDonald 4c5e1429b6 Build support for multiple parents (graph of scenes instead of tree) 2016-10-31 09:22:31 -07:00
Austen McDonald 4d61bbd348 Make properties cascade=remove for Character and Module 2016-09-16 05:26:19 +00:00
Austen McDonald f7e34162e8 Rename CharacterViewpoint::getActions() to CharacterViewpoint::getActionGroups() b/c that's what it is 2016-09-04 06:08:00 +00:00
Austen McDonald ccf51450b0 Add property support for modules. 2016-08-21 03:58:35 +00:00
Austen McDonald d82f3fc588 Change hook for setting up viewpoint to handle all actions, data and attachments 2016-08-02 20:11:36 +00:00
Austen McDonald a2fb425632 Fix bugs in Game and add some tests 2016-08-01 06:58:00 +00:00
Austen McDonald 5c7040d593 Add template to SceneBasics 2016-07-31 22:02:02 +00:00
Austen McDonald 50ea982985 Fix configuration bug with new game settings and add tests 2016-07-28 13:20:16 -07:00
Austen McDonald ffa65b3042 Change module configs to take lotgd-namespace and lotgd-subscriptions 2016-07-25 22:08:06 +00:00
Basilius Sauter 7b609e3b5c Add attack/defense/damage modifiers and invuln.
Adds attack, defense and damage modifiers for both "goodguy" (self) and
"badguy" (target) as well as a handler for goodguy/badguy invulnurability.

Modified the battle calculation to not recalculate if noone does damage as
long as at least 1 buff is active. This prevets infinite loops.
2016-06-09 23:31:23 +02:00
Basilius Sauter 4badaea249 Introduce general buff handling and tests
This commit introduces basic buff handling: Adding buffs, removing buffs,
expiring buffs. The Battle procedure controls the buffs and activates them
every round, expires them one round per round and removes the buff if the
number of rounds left is 0.

The BattleTest suite tests for the correct sequence and the correct
messages.
2016-06-09 23:31:22 +02:00
Austen McDonald 86426aacdb Store the module name along with event subscriptions 2016-06-04 12:01:54 -07:00
Basilius Sauter 2609d67e38 Added more methods to the Battle class and tests
If a battle is over or not can now be tested using this->isOver(). If the
battle is over, battle->getWinner() can be used to get the winner of this
fight, battle->getLooser() for the looser.
2016-05-25 22:13:16 +02:00
Basilius Sauter 38068dd0a5 Completed basic battle system.
The class Battle takes two participants (player and monster) that both
need to implement the FighterInterface. Right now, rounds are
completed by the fightNRounds method.

Since all enemies in the old code follow the same default scaling,
monsters and masters use a AutoScaleFighter trait for now.
2016-05-25 22:13:15 +02:00
Austen McDonald 6d962453b6 Fix up typos and syntax errors and add tests to Event system 2016-05-14 21:06:23 -07:00
Austen McDonald 86816f8666 Add Module model and tests 2016-05-14 21:06:23 -07:00
Basilius Sauter 0ff9958830 Adds MotD and Message model as well as tests
This commit adds the MotD model for storing and retrieving
messages-of-the-day.

It also adds a model for messages. Messages have an author as well as a
thread they belong to, the thread can be read by a specific number of
authors. FUrthermore, the message model supports system messages.

This commit introduces a number of needed changes:
- Character is now implementing the CharacterInterface
- MissingCharacter and SystemCharacter are supporting "pseudo-characters"
- trait MockCharacter implements non-implemented methods for
  MissingCharacter and SytemCharacter
- Characters are now soft-deletable. Models wanting to load soft-deleted
  characters need to fetch them eagerly.

Closes #17
2016-05-12 11:04:04 +02:00
Basilius Sauter 53d82646bf Refactored CharacterScene as CharacterViewpoint
closes #15
2016-04-29 19:03:48 +02:00
Basilius Sauter 7b21baee37 Introduction of the GameConfiguration model
This commit introduces the GameConfiguration, a model that is not an
entity. It also introduces GameConfigurationElement which is a doctrine
entity.
The two models make use of the traits introduced for CharacterProperty.
They also use the new OneToManyCollection class, which implements the
doctrine collection interface to a certain, limited extend. It mimicks
doctrine's PersisentCollection.
2016-04-27 22:51:16 +02:00
Basilius Sauter 6edd4cf9b1 Implemented Character->getCharacterModel() 2016-04-25 19:25:25 +02:00
Basilius Sauter 6a72a43cda Model changes
Adds basic Scene model
Extends Character model with reusable properties (Using the two traits
Properties and PropertyManager).
2016-04-19 21:51:40 +02:00
Basilius Sauter bd254f262e Closes #8 2016-04-18 07:06:34 +02:00
Basilius Sauter 3fbfc7692f Improved Tests and CharacterModel 2016-04-16 09:13:07 +02:00