PHPackages                             chestersa/yugioh-pegasus-castle-sprint - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. chestersa/yugioh-pegasus-castle-sprint

AbandonedLibrary

chestersa/yugioh-pegasus-castle-sprint
======================================

A breakdown of the Yu-Gi-Oh Pegasus' Castle Sprint board game

0.3(2y ago)091MITPHP

Since Mar 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ChesterSA/YuGiOh-Pegasus-Castle-Sprint)[ Packagist](https://packagist.org/packages/chestersa/yugioh-pegasus-castle-sprint)[ RSS](/packages/chestersa-yugioh-pegasus-castle-sprint/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

YuGiOh Pegasus' Castle Sprint
=============================

[](#yugioh-pegasus-castle-sprint)

A simple package to compare different decks of cards in the board game Pegasus' Castle Sprint

Creating a Deck.
----------------

[](#creating-a-deck)

Creating a Deck uses the `Chestersa\Yugioh\Deck` class,

### Initialising a Deck

[](#initialising-a-deck)

```
$deck = new Deck('Name');

```

This will create a new deck with the name set to whatever you've passed into the constructor, names are used when outputting results between 2 decks.

```
$deck->getName();

```

Will then return the deck's name to use elsewhere

### Adding Cards

[](#adding-cards)

Then there are two ways to add a new card:

```
$deck->addCard($name, $atk, $type);
$deck->addCard('Dark Magician', 2500, Chestersa\Yugioh\Field::$DARK);

```

Where `$name` is the name of the card, `$atk` is the card's attack level, and `$type` is the card's field type, there are constants defined for this in the `Chestersa\Yugioh\Field` class which will be explained later, but you can use any values.

To bulk add cards you can use the addCards method:

```
$deck->addCards([
  ['name' => 'Dark Magician', 'atk' => 2500, 'type' => Chestersa\Yugioh\Field::$DARK]
]);

```

The keys for `name`, `atk`, and `type` are all required and should be the same as for the addCard method

### Dealing with Wins

[](#dealing-with-wins)

Each deck will have a wins property set to 0 when it is initialised, which will be increased whenever it wins a head-to-head contest with another

```
$deck->addWin()

```

will increase the wins by one

```
$deck->getWins()

```

will return the current wins for the deck

Creating a field.
-----------------

[](#creating-a-field)

The field in this game is created of tokens for different field locations, which can double a monster's attack if the field types match.

All field objects use the `Chestersa\Yugioh\Field` which has constants for the 5 field types used in the game

```
Field::$NIGHT
Field::$DAY
Field::$GRASS
Field::$FOREST
Field::$WATER

```

### Creating a field

[](#creating-a-field-1)

```
$field = new Field();

```

### Adding to Fields

[](#adding-to-fields)

```
$field->addToField($type, $amount);

```

Where $type is the key of the field type and $amount is how many to add, defaults to 1

To make things easier there are 5 helpers functions, one for each default field type:

```
$field->addNight($amount)
$field->addDay($amount)
$field->addGrass($amount)
$field->addForest($amount)
$field->addWater($amount)

```

### Retrieving a Field

[](#retrieving-a-field)

To retrieve the field setup use:

```
$field->getField();

```

Comparing Decks
---------------

[](#comparing-decks)

### Setup

[](#setup)

To compare the decks, use the `Chestersa\Yugioh\YuGiOh` class

To initialise a simulation first of all you need to set the Field:

```
YuGiOh::setField($field)

```

where $field is a Field object

Then you can compare 2 deck using:

```
YuGiOh::compareDecks($deck1, $deck2)

```

Which returns a string with the outputs and if $deck1 wins more than it loses, its Wins property will be incremented by 1.

### Comparing multiple at a time

[](#comparing-multiple-at-a-time)

To compare multiple character decks use the helper:

```
YuGiOh::runSimulation([$deck1, $deck2, $deck3, $deck4]);

```

Which will run every deck in the array against all the others and return an array with all of the output strings.

### Comparing multiple to the opponents

[](#comparing-multiple-to-the-opponents)

To compare multiple character decks to the opponent deck at the same time use the helper:

```
YuGiOh::runVsOpponents([$deck1, $deck2, $deck3, $deck4], $opponents);

```

Which will run every deck in the array against the opponents and return an array of the output strings.

The YuGiOhFactory
-----------------

[](#the-yugiohfactory)

There is a `Chestersa\Yugioh\YuGiOhFactory` class with helpers to get all the decks and field setup as in the base board game:

```
YuGiOhFactory::getYugisDeck();
YuGiOhFactory::getKaibasDeck();
YuGiOhFactory::getJoeysDeck();
YuGiOhFactory::getMaisDeck();
YuGiOhFactory::getOpponentsDeck();
YuGiOhFactory::getDefaultField();

```

All return Deck or Field objects as appropriate

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~80 days

Total

3

Last Release

998d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b09d13295902554b7c472c92447b87c9d5c4ba9e9e35f5f8d021836b077613e?d=identicon)[ChesterSA](/maintainers/ChesterSA)

---

Top Contributors

[![ChesterSA](https://avatars.githubusercontent.com/u/23403613?v=4)](https://github.com/ChesterSA "ChesterSA (9 commits)")

### Embed Badge

![Health badge](/badges/chestersa-yugioh-pegasus-castle-sprint/health.svg)

```
[![Health](https://phpackages.com/badges/chestersa-yugioh-pegasus-castle-sprint/health.svg)](https://phpackages.com/packages/chestersa-yugioh-pegasus-castle-sprint)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
