Open Legends Core Library in PHP 8
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openlegends d644d835a2 init core-php library from engine-php repository 7 months ago
src init core-php library from engine-php repository 7 months ago
.gitignore init core-php library from engine-php repository 7 months ago
LICENSE Initial commit 7 months ago
README.md init core-php library from engine-php repository 7 months ago
composer.json init core-php library from engine-php repository 7 months ago

README.md

Open Legends Core

Project under development!

Install

composer require openlegends/core:dev-main

Test features

Cards

composer require openlegends/asset:dev-main

<?php

require_once __DIR__ . '/../vendor/autoload.php';

$mouse = new \OpenLegends\Asset\Test\Card\Mouse();
$rat = new \OpenLegends\Asset\Test\Card\Rat();

$damage = new \OpenLegends\Asset\Test\Card\Action\Damage(
    $mouse
);

$damage->card(
    $rat
);

var_dump(
    $mouse->getHealth()
);

var_dump(
    $rat->getHealth()
);

Pool

Useful for decks, hand, discard pile, etc

composer require openlegends/asset:dev-main

<?php

require_once __DIR__ . '/../vendor/autoload.php';

$deck = new \OpenLegends\Asset\Test\Pool\Card();

$deck->addCard(
    new \OpenLegends\Asset\Test\Card\Goblin()
);

$deck->addCard(
    new \OpenLegends\Asset\Test\Card\Mouse()
);

$deck->addCard(
    new \OpenLegends\Asset\Test\Card\Rat()
);

var_dump(
    $deck->getRandomCard()->getName()
);