-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from sebastianluczak/feature/dungeons-dlc
Feature/dungeons dlc
- Loading branch information
Showing
20 changed files
with
307 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
framework: | ||
messenger: | ||
transports: | ||
redis: "%env(MESSENGER_TRANSPORT_DSN)%" | ||
sync: 'sync://' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ZoneTransfer] | ||
LastWriterPackageFamilyName=Microsoft.ScreenSketch_8wekyb3d8bbwe | ||
ZoneId=3 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ZoneTransfer] | ||
LastWriterPackageFamilyName=Microsoft.ScreenSketch_8wekyb3d8bbwe | ||
ZoneId=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\Command; | ||
|
||
use App\Service\GameService; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class GameTestCommand extends Command | ||
{ | ||
protected static $defaultName = 'game:test'; | ||
protected GameService $gameService; | ||
|
||
public function __construct(GameService $gameService, string $name = null) | ||
{ | ||
parent::__construct($name); | ||
$this->gameService = $gameService; | ||
} | ||
|
||
protected function configure(): void | ||
{ | ||
$this->setHelp('Test of Game'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$output->writeln('<fg=#00ff00;bg=#00f>... contents ...</>'); | ||
|
||
return Command::SUCCESS; | ||
} | ||
|
||
private function clearScreen() | ||
{ | ||
echo chr(27).chr(91).'H'.chr(27).chr(91).'J'; //^[H^[J | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace App\Model\Loot\Keystone; | ||
|
||
use App\Enum\GameIconEnum; | ||
use App\Enum\Loot\LootTypeEnum; | ||
use App\Model\Loot\AbstractLoot; | ||
|
||
abstract class AbstractKeystone extends AbstractLoot | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->lootType = LootTypeEnum::KEYSTONE(); | ||
} | ||
|
||
public function isWeapon(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function isArmor(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return sprintf( | ||
"%s %s", | ||
GameIconEnum::GEM(), | ||
$this->getName() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Model\Loot\Keystone; | ||
|
||
use App\Enum\GameIconEnum; | ||
use App\Model\Stats\Stats; | ||
|
||
class BrokenKeystone extends AbstractKeystone | ||
{ | ||
protected string $name = "Broken keystone"; | ||
|
||
public function __construct(Stats $stats) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->lootPickupMessage = "You've picked up " . GameIconEnum::GEM() . " " . $this->getName(); | ||
$this->dice = '1d1'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace App\Model\Loot\Keystone; | ||
|
||
use App\Enum\GameIconEnum; | ||
use App\Model\Stats\Stats; | ||
|
||
class ChromaticKeystone extends AbstractKeystone | ||
{ | ||
protected string $name = "Chromatic keystone"; | ||
|
||
public function __construct(Stats $stats) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->lootPickupMessage = "You've picked up " . GameIconEnum::GEM() . " " . $this->getName(); | ||
|
||
$this->dice = '2d' . random_int(1, $stats->getIntelligence() + 1) . '+' . $stats->getLuck(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace App\Model\Loot\Keystone; | ||
|
||
use App\Enum\GameIconEnum; | ||
use App\Model\Stats\Stats; | ||
|
||
class ColorlessKeystone extends AbstractKeystone | ||
{ | ||
protected string $name = "Colorless keystone"; | ||
|
||
public function __construct(Stats $stats) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->lootPickupMessage = "You've picked up " . GameIconEnum::GEM() . " " . $this->getName(); | ||
|
||
$this->dice = '5d' . random_int(1, $stats->getIntelligence() + 8) . '+' . $stats->getLuck(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace App\Model\Loot\Keystone; | ||
|
||
use App\Enum\GameIconEnum; | ||
use App\Model\Stats\Stats; | ||
|
||
class PrismaticKeystone extends AbstractKeystone | ||
{ | ||
protected string $name = "Prismatic keystone"; | ||
|
||
public function __construct(Stats $stats) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->lootPickupMessage = "You've picked up " . GameIconEnum::GEM() . " " . $this->getName(); | ||
|
||
$this->dice = '1d' . random_int(1, $stats->getIntelligence()) . '+' . $stats->getLuck(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Model\Tile; | ||
|
||
use App\Model\Stats\StatsInterface; | ||
use App\Model\Tile\TileLogic\BossRoomTileLogic; | ||
use App\Model\Tile\TileLogic\TileLogicInterface; | ||
|
||
class BossRoomTile extends AbstractTile | ||
{ | ||
public function isInteractable(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function isPassable(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function isSpawn(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function hasLogic(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function handleLogic(int $scale, StatsInterface $stats): TileLogicInterface | ||
{ | ||
return new BossRoomTileLogic($scale); | ||
} | ||
|
||
public function draw(): string | ||
{ | ||
return "<fg=bright-red>*</>"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace App\Model\Tile\TileLogic; | ||
|
||
use App\Enum\MessageClassEnum; | ||
use App\Model\Creature\CreatureInterface; | ||
use App\Model\Creature\Dragon; | ||
use App\Model\Player\PlayerInterface; | ||
use App\Model\RandomEvent\RandomEventInterface; | ||
use App\Model\RandomEvent\ThiefArrivedGameEvent; | ||
|
||
class BossRoomTileLogic implements TileLogicInterface | ||
{ | ||
protected int $scale; | ||
protected string $rawMessage; | ||
protected string $messageClass; | ||
protected CreatureInterface $creature; | ||
protected RandomEventInterface $event; | ||
|
||
public function __construct(int $scale) | ||
{ | ||
$this->scale = $scale; | ||
$this->rawMessage = "You've entered a dark room..."; | ||
$this->messageClass = MessageClassEnum::IMPORTANT(); | ||
} | ||
|
||
public function process(PlayerInterface $player) | ||
{ | ||
if ($player->getInventory()->getKeystone()->getAverageRoll() > 3) { | ||
$this->creature = new Dragon($this->scale * 1.8); | ||
} else { | ||
$this->event = new ThiefArrivedGameEvent($player); | ||
} | ||
} | ||
|
||
public function hasAdventureLogMessage(): bool | ||
{ | ||
return !empty($this->rawMessage); | ||
} | ||
|
||
public function getAdventureLogMessage(): string | ||
{ | ||
return $this->rawMessage; | ||
} | ||
|
||
public function getAdventureLogMessageClass(): string | ||
{ | ||
return $this->messageClass; | ||
} | ||
|
||
public function hasEncounter(): bool | ||
{ | ||
return !empty($this->creature); | ||
} | ||
|
||
public function getEncounteredCreature(): ?CreatureInterface | ||
{ | ||
return $this->creature; | ||
} | ||
|
||
public function getEvent(): RandomEventInterface | ||
{ | ||
return $this->event; | ||
} | ||
|
||
public function hasEvent(): bool | ||
{ | ||
return !empty($this->event); | ||
} | ||
} |
Oops, something went wrong.