Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Killian
Pokemon battle simulator
Commits
661c1350
Commit
661c1350
authored
Feb 12, 2018
by
Quentin
Browse files
add pokemon definition
parent
58a8758e
Changes
2
Hide whitespace changes
Inline
Side-by-side
pokedex.ts
0 → 100644
View file @
661c1350
import
{
Pokemon
}
from
"
./pokemon
"
;
export
let
Bulbizare
:
Pokemon
=
{
name
:
"
Bulbizare
"
,
type
:
"
grass
"
,
health
:
100
,
force
:
40
,
armor
:
5
,
celerity
:
20
};
export
let
Salameche
:
Pokemon
=
{
name
:
"
Salamèche
"
,
type
:
"
fire
"
,
health
:
95
,
force
:
43
,
armor
:
4
,
celerity
:
30
};
export
let
Carapuce
:
Pokemon
=
{
name
:
"
Carapuce
"
,
type
:
"
water
"
,
health
:
100
,
force
:
39
,
armor
:
7
,
celerity
:
20
};
export
let
Goupix
:
Pokemon
=
{
name
:
"
Goupix
"
,
type
:
"
fire
"
,
health
:
80
,
force
:
45
,
armor
:
5
,
celerity
:
25
};
export
let
Tentacool
:
Pokemon
=
{
name
:
"
Tentacool
"
,
type
:
"
water
"
,
health
:
150
,
force
:
30
,
armor
:
7
,
celerity
:
10
};
export
let
Krabby
:
Pokemon
=
{
name
:
"
Krabby
"
,
type
:
"
water
"
,
health
:
175
,
force
:
30
,
armor
:
8
,
celerity
:
10
};
export
let
Pyroli
:
Pokemon
=
{
name
:
"
Pyroli
"
,
type
:
"
fire
"
,
health
:
110
,
force
:
50
,
armor
:
2
,
celerity
:
35
};
export
let
Empiflor
:
Pokemon
=
{
name
:
"
Empiflor
"
,
type
:
"
grass
"
,
health
:
100
,
force
:
40
,
armor
:
6
,
celerity
:
35
};
export
let
Ortide
:
Pokemon
=
{
name
:
"
Ortide
"
,
type
:
"
grass
"
,
health
:
130
,
force
:
37
,
armor
:
6
,
celerity
:
37
};
pokemon.ts
0 → 100644
View file @
661c1350
export
interface
Pokemon
{
name
:
string
//Nom
health
:
number
//Vie
force
:
number
//Force
armor
:
number
//Défense
type
:
string
//eau feu plante
celerity
:
number
//vitesse d'attaque
}
export
function
display
(
p
:
Pokemon
)
:
string
{
return
p
.
name
+
'
(
'
+
p
.
health
+
'
)
'
;
}
/* Joue une attaque du pokemon p1 vers le pokemon p2
* retourne le pokemon p2 mis à jour après l'attaque
*/
export
function
attack
(
p1
:
Pokemon
,
p2
:
Pokemon
)
:
Pokemon
{
console
.
log
(
display
(
p1
)
+
"
attaque
"
+
display
(
p2
));
//TODO Compléter cette fonction
return
p2
;
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment