Terasology / LightAndShadow

Light & Shadow is an experimental game type set in a quirky Alice in Wonderland inspired setting
Apache License 2.0
8 stars 22 forks source link

Integrate Towers into Light & Shadow #247

Open jdrueckert opened 2 years ago

jdrueckert commented 2 years ago

Apart from actively attacking the opposing team themselves, the player should be provided with defensive mechanisms, such as structures that can be placed in the arena, for instance near the player's team base. One example for such a defensive structure are towers we know from other games such as LoL (League of Legends) or DotA (Defence of the Ancients) as well as from our very own GooeyDefence. These towers attack players of the opposing team and thus defend the player's own team.

In comparison to GooeyDefence, the focus in Light & Shadow (LaS) as a fast-paced capture-the-flag should still be on reaching and bringing home the flag. This is why, instead of putting focus on constructing towers with various effects, target behaviors, etc., LaS should provide pre-assembled tower types that only need to be placed. Still, these structures can leverage parts of the tower implementation in Towers and the effects they use from CombatSystem.

In their GSoC 2021 project, @ahv15 started work on this in https://github.com/Terasology/Towers/pull/2 and https://github.com/Terasology/LightAndShadowResources/pull/74.

To manage a tower - a static structure that is composed of multiple blocks - as a single entity, we can utilize our MultiBlock module. MultiBlock currently automatically detects the region taken up by a structure using a recipe and creates a MultiBlock entity corresponding to that. As the towers will be provided as prefabs based on the concepts of StructureTemplates the necessary region for the structure is already present. So by using the regions calculated by systems of StructureTemplates, we can create the corresponding multi-block entity and use this entity to damage and destroy all blocks within the structure when the tower is attacked.

@ahv15 started work on this in https://github.com/Terasology/StructureTemplates/pull/68, https://github.com/Terasology/MultiBlock/pull/28, and https://github.com/Terasology/LightAndShadow/pull/231.

Finally, towers should be integrated properly as gameplay elements purchasable in the in-game store. On resetting the player inventory when restarting the game after a round has ended, unused towers should be removed from the player inventory. On destruction of a tower, the item for placing it should not be dropped.

Depends on https://github.com/Terasology/GooeyDefence/issues/70 Depends on https://github.com/Terasology/Towers/issues/4