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 1 month ago
src init core-php library from engine-php repository 1 month ago
.gitignore init core-php library from engine-php repository 1 month ago
LICENSE Initial commit 1 month ago
README.md init core-php library from engine-php repository 1 month ago
composer.json init core-php library from engine-php repository 1 month 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()
);