Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imoxto/priconne-cb
A priconne cb simulator
https://github.com/imoxto/priconne-cb
Last synced: 21 days ago
JSON representation
A priconne cb simulator
- Host: GitHub
- URL: https://github.com/imoxto/priconne-cb
- Owner: imoxto
- License: mit
- Created: 2021-10-23T09:48:18.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T07:17:00.000Z (about 2 years ago)
- Last Synced: 2024-10-12T11:10:09.661Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 188 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Princess Connect! Re:Dive Clanbattle
## Contents:
- [About](#About)
- [Usage](#Usage)
- [To-do](#To-do)## About:
A small package intended to simulate the clan battle game mode of Princess Connect! Re:DIVE. It can be used by discord bots, etc for example by extending the `CB` class.
## Usage:
#### constructor:
`const cb = new CB() // create a new cb instace all bosses will start at round 1`
`new CB([1, 2, 3, 2, 3]) // will create an instance with Boss 1 starting at 1, Boss 2 at 2, and so on`#### Forcefully adjusting rounds:
`cb.adjustRounds([1, 2, 3, 2, 3]) // will adjust all boss rounds according to the array provided`
#### interaction with bosses:
`hit(boss: 0 | 1 | 2 | 3 | 4, amount: number) // hits boss for an amount`
`kill(boss: 0 | 1 | 2 | 3 | 4) // kills boss`
`setHp(boss: 0 | 1 | 2 | 3 | 4, amount: number) // force set the hp of a boss to an amount`#### change max HPs and Tier change infos
`setMaxHp(arr: number[][]) // customises maxHP instead of using the hard coded default one`
`setTierChanges(arr: number[]) // Customises tier changes instead of using the hard coded default one`
`getMaxHp() // returns a 2d array with max HPs of bosses in the format arr[boss number][tier]`
`getTierChanges() // returns Array with each element denoting the first round of a tier`#### restoring previous cb progress
```js
// for example from a database
db.store({
TierChanges: cb.getTierChanges(),
HP: cb.getMaxHp(),
rounds: cb.rounds,
boss: cb.boss,
tier: cb.tier,
minRound: cb.minRound,
maxRound: cb.maxRound,
});// then restore same progress from the database
const cb = loadProgess(await db.find(/*query*/));
```## To-do:
- custom error class to use CB-related Errors
- tracking user hits