Skip to content

Commit

Permalink
implement initial models b00tc4mp#84
Browse files Browse the repository at this point in the history
  • Loading branch information
Eden23 committed Aug 5, 2024
1 parent eff99a8 commit 5ea227f
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 33 deletions.
1 change: 1 addition & 0 deletions staff/marti-herms/project/PokemonSD/core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.json
188 changes: 157 additions & 31 deletions staff/marti-herms/project/PokemonSD/core/data/models.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,171 @@
import { Schema, model, ObjectId } from 'mongoose'
import { Schema, model, Types } from 'mongoose'

// const pokemonList = new Schema({
// count: {
// type: Number,
// },
// results: {
// type: [String]
// }
// })
const { ObjectId } = Types

const pokemon = new Schema({
id: {
const pokemonList = new Schema({
count: {
type: Number,
required: true
},
name: {
type: String,
required: true
list: {
type: [{
id: {
type: ObjectId,
ref: 'Pokemon'
},
name: { type: String }
}]
}
})

const pokemon = new Schema({
id: { type: Number },
name: { type: String },
moves: {
type: [{
id: {
type: ObjectId,
ref: 'Move'
},
name: { type: String }
}]
},
data: {
type: Object,
required: true
abilities: {
type: [{
id: {
type: ObjectId,
ref: 'Ability'
},
name: { type: String }
}]
},
forms: { type: [String] },
stats: {
type: {
hp: {
baseStat: { type: Number },
evs: { type: Number },
ivs: { type: Number }
},
atk: {
baseStat: { type: Number },
evs: { type: Number },
ivs: { type: Number }
},
def: {
baseStat: { type: Number },
evs: { type: Number },
ivs: { type: Number }
},
spA: {
baseStat: { type: Number },
evs: { type: Number },
ivs: { type: Number }
},
spD: {
baseStat: { type: Number },
evs: { type: Number },
ivs: { type: Number }
},
spe: {
baseStat: { type: Number },
evs: { type: Number },
ivs: { type: Number }
},
}
},
type: {
type: [{
id: {
type: ObjectId,
rer: 'Type'
},
name: { type: String }
}]
}
})

// const ability = new Schema({
// name: {
// type: String
// },
// isHidden: {
// type: Boolean
// }
// })
const type = new Schema({
name: { type: String },
superEffective: {
type: [{
id: {
type: ObjectId,
rer: 'Type'
},
name: { type: String }
}]
},
notVeryEffective: {
type: [{
id: {
type: ObjectId,
rer: 'Type'
},
name: { type: String }
}]
},
noEffect: {
type: [{
id: {
type: ObjectId,
rer: 'Type'
},
name: { type: String }
}]
},
})

const move = new Schema({
name: { type: String },
accuracy: { type: Number },
damageClass: { type: String }, // Physical, Special, Status
effectChance: { type: Number },
effect: { type: String },
meta: {
type: {
ailment: { type: String },
ailment_chance: { type: Number },
category: { type: String },
crit_rate: { type: Number },
drain: { type: Number },
flinch_chance: { type: Number },
healing: { type: Number },
max_hits: { type: Number },
max_turns: { type: Number },
min_hits: { type: Number },
min_turns: { type: Number },
stat_chance: { type: Number }
}
},
power: { type: Number },
powerPoints: { type: Number },
priority: { type: Number },
statChanges: {
type: [{
change: { type: Number },
stat: { type: String }
}]
},
target: { type: String },
type: { type: String }
})

const ability = new Schema({
name: { type: String },
effect: { type: String },
})

// const PokemonList = model('PokemonList', pokemonList)
const PokemonList = model('PokemonList', pokemonList)
const Pokemon = model('Pokemon', pokemon)
// const Ability = model('Ability', ability)
const Type = model('Type', type)
const Move = model('Move', move)
const Ability = model('Ability', ability)

export {
// PokemonList,
// Ability,
Pokemon
PokemonList,
Pokemon,
Type,
Move,
Ability
}

15 changes: 13 additions & 2 deletions staff/marti-herms/project/PokemonSD/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@

A game to build pokemon teams and fight with them

![Pokemon image](./images/)
![Pokemon image](https://media.giphy.com/media/Ml9qdzetfukLi7kCai/giphy.gif?cid=790b76112j9m649d1ezvbunwxado0yph46f46wyqdajfn0kr&ep=v1_gifs_search&rid=giphy.gif&ct=g)

## Functional

### Use Cases

[?]
V.01
- create Pokemon team
- edit Pokemon team
- add pokemon to team
- remove pokemon from team
- edit pokemon from team

V.02
- find battle
- select move
- cancel move
- exit battle

### UIUX Design

Expand Down

0 comments on commit 5ea227f

Please sign in to comment.