Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jerakin/pokemontypes
Lua module to figure out what move type a Pokemon of a given type pair is weak and strong against
https://github.com/jerakin/pokemontypes
defold defold-library p5e pokemon5e
Last synced: 3 days ago
JSON representation
Lua module to figure out what move type a Pokemon of a given type pair is weak and strong against
- Host: GitHub
- URL: https://github.com/jerakin/pokemontypes
- Owner: Jerakin
- Created: 2019-11-22T16:26:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-04T19:05:53.000Z (about 5 years ago)
- Last Synced: 2025-01-31T17:04:00.540Z (8 days ago)
- Topics: defold, defold-library, p5e, pokemon5e
- Language: Lua
- Homepage: https://www.pokemon5e.com/
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pTypes
Pokemon Types is a lua module to figure out what move type a Pokemon of a given type pair
is weak and strong against.### Installation
You can use pTypes in your own project by adding this project as a [Defold library dependency](http://www.defold.com/manuals/libraries/). Open your game.project file and in the dependencies field under project add:
https://github.com/Jerakin/PokemonTypes/archive/master.zip### Usage
```lua
-- Require the module
local ptypes = require "ptypes.main"local pokemon
-- Creates a "model" of a Normal type pokemon.
pokemon = ptype.Model("Normal")-- You can create a model of dual type Pokemon too.
pokemon = ptype.Model("Ghost", "Electric")-- If you prefer you can use the enum.
pokemon = ptype.Model(ptype.Fairy)-- After the model is constructed you can find out which resitances it have by looking
-- at the corresponding table.
pprint(pokemon.vulnerabilities)
pprint(pokemon.resistances)
pprint(pokemon.immunities)```