npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@projectsophon/gamelogic

v0.1.3

Published

## Table of contents

Downloads

4

Readme

@projectsophon/gamelogic

Table of contents

Type Aliases

Variables

Functions

Type Aliases

ArtifactFileColor

Ƭ ArtifactFileColor: Abstract<number, "ArtifactFileColor">

Variables

ArtifactFileColor

ArtifactFileColor: Object

Type declaration

| Name | Type | | :------ | :------ | | APP_BACKGROUND | ArtifactFileColor | | BLUE | ArtifactFileColor |


RelicsList

Const RelicsList: ArtifactType[]

Functions

artifactAvailableTimestamp

artifactAvailableTimestamp(artifact): number

Parameters

| Name | Type | | :------ | :------ | | artifact | Artifact |

Returns

number


artifactBiomeName

artifactBiomeName(artifact): string

Parameters

| Name | Type | | :------ | :------ | | artifact | Artifact |

Returns

string


artifactFileName

artifactFileName(videoMode, thumb, artifact, color, debugProps?): string

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | videoMode | boolean | undefined | | thumb | boolean | undefined | | artifact | RenderedArtifact | undefined | | color | ArtifactFileColor | undefined | | debugProps | undefined | { forceAncient: boolean ; skipCaching: boolean } | undefined |

Returns

string


artifactRoll

artifactRoll(id): number

Parameters

| Name | Type | | :------ | :------ | | id | ArtifactId |

Returns

number


biomeName

biomeName(biome): string

Parameters

| Name | Type | | :------ | :------ | | biome | Biome |

Returns

string


canActivateArtifact

canActivateArtifact(artifact, planet, artifactsOnPlanet): undefined | boolean

Parameters

| Name | Type | | :------ | :------ | | artifact | Artifact | | planet | undefined | Planet | | artifactsOnPlanet | Artifact[] |

Returns

undefined | boolean


canDepositArtifact

canDepositArtifact(account, artifact, planet?): undefined | boolean

Parameters

| Name | Type | | :------ | :------ | | account | EthAddress | | artifact | Artifact | | planet? | Planet |

Returns

undefined | boolean


canWithdrawArtifact

canWithdrawArtifact(account, artifact, planet?): undefined | boolean

Parameters

| Name | Type | | :------ | :------ | | account | EthAddress | | artifact | Artifact | | planet? | Planet |

Returns

undefined | boolean


dateMintedAt

dateMintedAt(artifact): string

Parameters

| Name | Type | | :------ | :------ | | artifact | undefined | Artifact |

Returns

string


durationUntilArtifactAvailable

durationUntilArtifactAvailable(artifact): number

Parameters

| Name | Type | | :------ | :------ | | artifact | Artifact |

Returns

number


formatNumber

formatNumber(num, smallDec?): string

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | num | number | undefined | | smallDec | number | 0 |

Returns

string


getActivatedArtifact

getActivatedArtifact(artifacts): Artifact | undefined

Parameters

| Name | Type | | :------ | :------ | | artifacts | Artifact[] |

Returns

Artifact | undefined


getActiveBlackDomain

getActiveBlackDomain(artifacts): Artifact | undefined

Parameters

| Name | Type | | :------ | :------ | | artifacts | Artifact[] |

Returns

Artifact | undefined


getArtifactDebugName

getArtifactDebugName(a?): string

Parameters

| Name | Type | | :------ | :------ | | a? | Artifact |

Returns

string


getPlanetRank

getPlanetRank(planet): number

Parameters

| Name | Type | | :------ | :------ | | planet | undefined | Planet |

Returns

number


getPlayerControlledSpaceships

getPlayerControlledSpaceships(artifacts, owner): (undefined | Artifact)[]

Parameters

| Name | Type | | :------ | :------ | | artifacts | undefined | (undefined | Artifact)[] | | owner | undefined | EthAddress |

Returns

(undefined | Artifact)[]


getRange

getRange(planet, percentEnergySending?, rangeBoost?): number

Todo

  • planet class

Parameters

| Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | planet | Planet | undefined | - | | percentEnergySending | number | 100 | - | | rangeBoost | number | 1 | A multiplier to be applied to the resulting range. Currently used for calculating boost associated with abandoning a planet. |

Returns

number


hasOwner

hasOwner(planet): boolean

Parameters

| Name | Type | | :------ | :------ | | planet | Planet |

Returns

boolean


hasStatBoost

hasStatBoost(type): boolean

Parameters

| Name | Type | | :------ | :------ | | type | undefined | ArtifactType |

Returns

boolean


isActivated

isActivated(artifact): boolean

Parameters

| Name | Type | | :------ | :------ | | artifact | undefined | Artifact |

Returns

boolean


isAncient

isAncient(artifact): boolean

Parameters

| Name | Type | | :------ | :------ | | artifact | RenderedArtifact |

Returns

boolean


isBasic

isBasic(type): boolean

Parameters

| Name | Type | | :------ | :------ | | type | ArtifactType |

Returns

boolean


isEmojiFlagMessage

isEmojiFlagMessage(planetMessage): planetMessage is PlanetMessage<EmojiFlagBody>

Parameters

| Name | Type | | :------ | :------ | | planetMessage | PlanetMessage<unknown> |

Returns

planetMessage is PlanetMessage<EmojiFlagBody>


isLocatable

isLocatable(planet?): planet is LocatablePlanet

Parameters

| Name | Type | | :------ | :------ | | planet? | Planet |

Returns

planet is LocatablePlanet


isRelic

isRelic(type): boolean

Parameters

| Name | Type | | :------ | :------ | | type | ArtifactType |

Returns

boolean


isSpaceShip

isSpaceShip(type): boolean

Parameters

| Name | Type | | :------ | :------ | | type | undefined | ArtifactType |

Returns

boolean


levelFromRarity

levelFromRarity(rarity): PlanetLevel

Parameters

| Name | Type | | :------ | :------ | | rarity | ArtifactRarity |

Returns

PlanetLevel


rarityName

rarityName(rarity): string

Parameters

| Name | Type | | :------ | :------ | | rarity | ArtifactRarity |

Returns

string


rarityNameFromArtifact

rarityNameFromArtifact(a): string

Parameters

| Name | Type | | :------ | :------ | | a | Artifact |

Returns

string


setForceAncient

setForceAncient(force): void

Parameters

| Name | Type | | :------ | :------ | | force | boolean |

Returns

void


timeUntilNextBroadcastAvailable

timeUntilNextBroadcastAvailable(lastRevealTimestamp, locationRevealCooldown): number

Gets the time (ms) until we can broadcast the coordinates of a planet.

Parameters

| Name | Type | | :------ | :------ | | lastRevealTimestamp | undefined | number | | locationRevealCooldown | number |

Returns

number