Martmists

Pkmn in cc

Jul 25th, 2015
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.63 KB | None | 0 0
  1. --[[
  2. Pokémon in cc
  3. By martmists
  4. made on a mobile phone, not yet explained well.
  5. NOTE: This is only the bèta version! Current options:
  6. Create pkmn
  7. Levelup pkmn
  8. Add to moveset
  9. Evolve pkmn
  10. --]]
  11.  
  12. Function newpkmn(typepkmn, lvl, moveset, abilitypkmn, statspkmn, nickname)
  13.   Newpkmn = {type = typepkmn, level = lvl, moves = moveset, ability = abilitypkmn, stats = statspkmn, nick = nickname}
  14. End
  15.  
  16. -- e.g. Newpkmn("Snivy",5,{upleft = "Tackle", upright = "Leer", downleft = nil, downright = nil},"Contrary",{Hp = 20, atk = 10, def = 10, spatk = 10, spdef = 10, spd = 10},"lolz grass starter")
  17. -- a pokemon must always have at least 2 moves. Also, a nickname is not required, so if you dont want one leave it nil.
  18.  
  19. Function LearnMove(move)
  20.   If not downright == nil then
  21.     Override = true
  22.   Else
  23.     Override = false
  24.   End
  25.   If not Override then
  26.     If Newpkmn.moves.downleft == nil then
  27.       Newpkmn.moves.downleft = move
  28.     Else
  29.       Newpkmn.moves.downright = move
  30.     End
  31.   Else
  32.     Print("Choose a move to delete.")
  33.     For i = 1,4 do
  34.       Print(Newpkmn.moves[i]\n)
  35.     End
  36.     While not correctmove do
  37.       Deletemove = read()
  38.       For i = 1,4 do
  39.         If Deletemove == Newpkmn.moves[i] then
  40.           Correctmove = true
  41.         End
  42.       End
  43.     End
  44.   For key, value in pairs(Newpkmn.moves) do
  45.     If value == Deletemove then
  46.       key = move
  47.     End
  48.   End
  49. End
  50.  
  51. Function CheckEvolve(pkmntype,pkmnlvl)
  52.   If pkmntype[pkmnlvl]["evolve"]["bool"] then
  53.     Evolve(pkmntype[pkmnlvl]["evolve"]["newpkmn"]
  54.   End
  55. end
  56. -- e.g. snivy evolves at lvl 17 into servine, do
  57. -- Snivy = {17 = {Evolve = {bool = true, newpkmn = "Servine"}}
  58.  
  59.  
  60. Function CheckMoves(pkmntype,pkmnlvl)
  61.   If pkmntype[pkmnlvl]["move"]["bool"] then
  62.     LearnMove(pkmntype[pkmnlvl]["move"]["move"])
  63.   End
  64. End
  65. -- to make e.g. snivy learn vine whip at lvl 7 and wrap at lvl 10, do this:
  66. -- Snivy = {7 = {move = {bool = true, move = "Vine Whip"}},10 = {move = {bool = true, move = "Wrap"}}}
  67. -- this can be combined with evolution, just remember evolution comes before moves.
  68. -- Snivy = {7 = {move = {bool = true, move = "Vine Whip"}},10 = {move = {bool = true, move = "Wrap"}}, 17 = {evolve = {bool = true, newpkmn = "Servine"}}}
  69. -- this can all be done in parts, e.g.
  70. --[[
  71. Snivy.7.move = {bool = true, move = "Vine Whip"}
  72. Snivy.17.evolve.newpkmn = "Servine"
  73. Snivy.17.evolve.bool = true
  74. etc.
  75. Note that if you want SERVINE to learn a move after it has evolved from snivy you need to do servine.17.etc.
  76. --]]
  77.  
  78. Function levelup()
  79.   Newpkmn.level = Newpkmn.level + 1
  80.   CheckEvolve(Newpkmn.type, Newpkmn.level)
  81.   CheckMoves(Newpkmn.type,Newpkmn.level)
  82. End
Advertisement
Add Comment
Please, Sign In to add comment