Advertisement
IHATEMICROWAVEOVEN

Jokedex Calc Project (base data)

May 18th, 2023 (edited)
1,351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.20 KB | None | 0 0
  1. -- MULTIPLIERS
  2. local N = 2/3
  3. local S = 1.5
  4. local I = 0
  5. local STAB = 1.25
  6.  
  7.  
  8. -- DATA DICTS
  9. local types = {
  10.     "None",      -- 1
  11.     "Normal",    -- 2
  12.     "Fire",      -- 3
  13.     "Water",     -- 4
  14.     "Electric",  -- 5
  15.     "Grass",     -- 6
  16.     "Ice",       -- 7
  17.     "Fighting",  -- 8
  18.     "Poison",    -- 9
  19.     "Ground",    -- 10
  20.     "Flying",    -- 11
  21.     "Psychic",   -- 12
  22.     "Bug",       -- 13
  23.     "Rock",      -- 14
  24.     "Ghost",     -- 15
  25.     "Dragon",    -- 16
  26.     "Dark",      -- 17
  27.     "Steel",     -- 18
  28.     "Fairy"      -- 19
  29. }
  30.  
  31. local dex = {
  32.     {"Meganium", 6, 1, 91, 84, "Absorb", "MagicLeaf", "MegaDrain", "Solarbeam"},
  33.     {"Typhlosion", 3, 1, 78, 100, "Tackle", "Ember", "Flamethrower", "FireBlast"},
  34.     {"Feraligatr", 4, 1, 83, 93, "Bubble", "Bubblebeam", "Surf", "HydroPump"},
  35.     {"Butterfree", 13, 11, 58, 73, "Tackle", "Absorb", "Confusion", "Psychic"},
  36.     {"Gloom", 6, 9, 60, 72, "Tackle", "RazorLeaf", "Absorb", "nil"},
  37.     {"Raticate", 2, 1, 62, 76, "Tackle", "QuickAttack", "HyperFang", "nil"},
  38.     {"Pikachu", 5, 1, 46, 61, "Tackle", "Thundershock", "Thunderbolt", "Thunder"},
  39.     {"Pidgeot", 11, 2, 80, 80, "Tackle", "Gust", "QuickAttack", "nil"},
  40.     {"Eevee", 2, 1, 56, 52, "Tackle", "nil", "nil", "nil"},
  41.     {"Vaporeon", 4, 1, 90, 85, "Bubble", "Bubblebeam", "Surf", "HydroPump"},
  42.     {"Jolteon", 5, 1, 73, 102, "Thundershock", "Thunderbolt", "QuickAttack", "Thunder"},
  43.     {"Flareon", 3, 1, 67, 108, "Ember", "Flamethrower", "QuickAttack", "FireBlast"},
  44.     {"Espeon", 12, 1, 67, 108, "Confusion", "Psychic", "QuickAttack", "Psybeam"},
  45.     {"Umbreon", 17, 1, 110, 65, "Bite", "ShadowBall", "QuickAttack", "DarkPulse"},
  46.     {"Leafeon", 6, 1, 80, 95, "Absorb", "RazorLeaf", "MagicLeaf", "Solarbeam"},
  47.     {"Glaceon", 7, 1, 75, 100, "QuickAttack", "Psychic", "Surf", "AuroraBeam"},
  48.     {"Golem", 14, 10, 76, 89, "Tackle", "RockThrow", "Flamethrower", "nil"},
  49.     {"Rhydon", 14, 10, 75, 87, "Tackle", "RockThrow", "nil", "nil"},
  50.     {"Golbat", 9, 11, 75, 77, "Confusion", "Gust", "Absorb", "Psychic"},
  51.     {"Crobat", 11, 9, 88, 90, "AirSlash", "LeechLife", "Psychic", "MegaDrain"},
  52.     {"Onix", 14, 10, 80, 48, "Tackle", "RockThrow", "nil", "nil"},
  53.     {"Dewgong", 4, 7, 89, 70, "Confusion", "Bubblebeam", "Psychic", "AuroraBeam"},
  54.     {"Piloswine", 7, 10, 73, 77, "Tackle", "Bubble", "Bubblebeam", "AuroraBeam"},
  55.     {"Lombre", 4, 6, 58, 55, "Tackle", "Bubble", "Absorb", "Bubblebeam"},
  56.     {"Ludicolo", 4, 6, 79, 89, "Bubblebeam", "MegaDrain", "Solarbeam", "nil"},
  57.     {"Whiscash", 4, 10, 84, 72, "Pound", "Tackle", "Bubble", "Bubblebeam"},
  58.     {"Lapras", 4, 7, 100, 78, "Bubblebeam", "HyperBeam", "HydroPump", "Surf"},
  59.     {"Aggron", 18, 14, 87, 89, "Tackle", "RockThrow", "MetalClaw", "IronTail"},
  60.     {"Magcargo", 3, 14, 69, 67, "Ember", "RockThrow", "Flamethrower", "FireBlast"},
  61.     {"Ninetales", 3, 1, 84, 84, "Flamethrower", "HyperBeam", "FireBlast", "SacredFire"},
  62.     {"Gyarados", 4, 11, 83, 97, "Bubblebeam", "Surf", "HydroPump", "nil"},
  63.     {"Wailord", 4, 1, 91, 76, "Bubblebeam", "Surf", "HydroPump", "nil"},
  64.     {"Electabuzz", 5, 1, 69, 94, "Tackle", "Thundershock", "Thunderbolt", "Thunder"},
  65.     {"Electivire", 5, 1, 71, 109, "Thundershock", "Thunderbolt", "Thunder", "BodySlam"},
  66.     {"Magneton", 5, 18, 60, 95, "Tackle", "Thundershock", "Thunderbolt", "nil"},
  67.     {"Ledian", 13, 11, 75, 55, "Confusion", "Gust", "MegaDrain", "nil"},
  68.     {"Heracross", 13, 8, 74, 93, "Tackle", "MegaDrain", "IronTail", "Gust"},
  69.     {"Scyther", 13, 11, 73, 94, "AirSlash", "Solarbeam", "FalseSwipe", "FuryCutter"},
  70.     {"Haunter", 15, 9, 44, 91, "Confusion", "Psychic", "DarkPulse", "ShadowBall"},
  71.     {"Gengar", 15, 9, 60, 107, "Confusion", "Psychic", "DarkPulse", "ShadowBall"},
  72.     {"Absol", 17, 1, 54, 101, "Psychic", "Slash", "QuickAttack", "DarkPulse"},
  73.     {"Lucario", 2, 18, 67, 108, "QuickAttack", "DarkPulse", "AuraSphere", "nil"},
  74.     {"Dragonite", 16, 11, 86, 114, "DarkPulse", "FireBlast", "Solarbeam", "Thunderbolt"},
  75.     {"Cresselia", 12, 1, 125, 75, "Psybeam", "AuroraBeam", "Psychic", "HyperBeam"},
  76.     {"Darkrai", 17, 1, 79, 121, "Psychic", "ShadowBall", "DarkPulse", "DarkVoid"},
  77.     {"Ho-oh", 3, 11, 108, 119, "Thunderbolt", "Thunder", "HyperBeam", "SacredFire"},
  78.     {"Jirachi", 18, 12, 100, 100, "Confusion", "Metronome", "Psychic", "Thunder"},
  79.     {"Regirock", 14, 1, 110, 84, "RockThrow", "BodySlam", "AncientPower", "nil"},
  80.     {"Registeel", 18, 1, 117, 76, "Thunderbolt", "Thunder", "ZapCannon", "nil"},
  81.     {"Regice", 7, 1, 110, 84, "IcyWind", "AuroraBeam", "Bubblebeam", "nil"},
  82.     {"Shaymin", 6, 1, 100, 100, "RazorLeaf", "MagicLeaf", "Solarbeam", "SeedFlare"},
  83.     {"Rayquaza", 16, 11, 89, 137, "Thunderbolt", "Thunder", "Dragonbreath", "HyperBeam"},
  84.     {"Mew", 12, 1, 100, 100, "Pound", "Confusion", "Metronome", "Psychic"},
  85.     {"Dialga", 18, 16, 96, 131, "MetalClaw", "RoarOfTime", "Dragonbreath", "Earthquake"},
  86.     {"Palkia", 4, 16, 93, 133, "Dragonbreath", "SpatialRend", "HydroPump", "DragonPulse"},
  87.     {"Giratina", 16, 15, 130, 96, "AncientPower", "ShadowForce", "Earthquake", "DracoMeteor"},
  88.     {"Arceus-99", 2, 1, 118.846, 118.846, "Thunderbolt", "Judgment", "FireBlast", "Recover", "TheTruth"},  -- 120*103/104
  89.     {"Arceus-100", 2, 1, 120, 120, "Judgment", "FireBlast", "Recover", "TheTruth"},
  90.     {"EndOfDex", 1, 1, 1, 1, "nil", "nil", "nil", "nil"},
  91.     {"Bro you are at the end of the dex", 1, 1, 1, 1, "nil", "nil", "nil", "nil"}
  92. }
  93.  
  94. local movedex = {
  95.     ["DracoMeteor"] = {150, 100, 16},
  96.     ["HyperBeam"] = {150, 100, 2},
  97.     ["Judgment"] = {120, 100, 2},
  98.     ["SacredFire"] = {120, 100, 3},
  99.     ["ShadowForce"] = {120, 100, 15},
  100.     ["Solarbeam"] = {120, 100, 6},
  101.     ["DarkVoid"] = {100, 100, 17},
  102.     ["Earthquake"] = {100, 100, 10},
  103.     ["SpatialRend"] = {100, 100, 16},
  104.     ["DragonPulse"] = {90, 100, 16},
  105.     ["Flamethrower"] = {90, 100, 3},
  106.     ["Psychic"] = {90, 100, 12},
  107.     ["Surf"] = {90, 100, 4},
  108.     ["Thunderbolt"] = {90, 100, 5},
  109.     ["AuraSphere"] = {80, 100, 8},
  110.     ["DarkPulse"] = {80, 100, 17},
  111.     ["HyperFang"] = {80, 100, 2},
  112.     ["ShadowBall"] = {80, 100, 15},
  113.     ["AirSlash"] = {75, 100, 11},
  114.     ["Bubblebeam"] = {75, 100, 4},
  115.     ["BodySlam"] = {70, 100, 2},
  116.     ["Slash"] = {70, 100, 2},
  117.     ["AuroraBeam"] = {65, 100, 7},
  118.     ["FalseSwipe"] = {65, 100, 2},
  119.     ["Psybeam"] = {65, 100, 12},
  120.     ["AncientPower"] = {60, 100, 14},
  121.     ["Bite"] = {60, 100, 17},
  122.     ["Dragonbreath"] = {60, 100, 16},
  123.     ["MagicLeaf"] = {60, 1000, 6},
  124.     ["RockThrow"] = {60, 100, 14},
  125.     ["IcyWind"] = {55, 100, 7},
  126.     ["MetalClaw"] = {55, 100, 18},
  127.     ["RazorLeaf"] = {55, 100, 6},
  128.     ["Bubble"] = {40, 100, 4},
  129.     ["Confusion"] = {40, 100, 12},
  130.     ["Ember"] = {40, 100, 3},
  131.     ["Gust"] = {40, 100, 11},
  132.     ["Pound"] = {40, 100, 2},
  133.     ["QuickAttack"] = {40, 100, 2},
  134.     ["Scratch"] = {40, 100, 2},
  135.     ["Tackle"] = {40, 100, 2},
  136.     ["Thundershock"] = {40, 100, 5},
  137.     ["FuryCutter"] = {40, 95, 13},
  138.     ["RoarOfTime"] = {150, 90, 16},
  139.     ["SeedFlare"] = {120, 85, 6},
  140.     ["FireBlast"] = {120, 80, 3},
  141.     ["HydroPump"] = {110, 80, 4},
  142.     ["IronTail"] = {100, 75, 18},
  143.     ["Thunder"] = {110, 70, 5},
  144.     ["ZapCannon"] = {120, 50, 5},
  145.     ["Absorb"] = {25, 100, 6},
  146.     ["LeechLife"] = {25, 100, 13},
  147.     ["Recover"] = {0, 100, 2},
  148.     ["MegaDrain"] = {50, 100, 6},
  149.     ["Metronome"] = {0, 100, 2},
  150.     ["TheTruth"] = {0, 100, 2},
  151.     ["nil"] = {0, 0, 1}
  152. }
  153.  
  154. local typechart = {
  155.    { -- NONE
  156.         1,    -- None
  157.         1,    -- Normal
  158.         1,    -- Fire
  159.         1,    -- Water
  160.         1,    -- Electric
  161.         1,    -- Grass
  162.         1,    -- Ice
  163.         1,    -- Fighting
  164.         1,    -- Poison
  165.         1,    -- Ground
  166.         1,    -- Flying
  167.         1,    -- Psychic
  168.         1,    -- Bug
  169.         1,    -- Rock
  170.         1,    -- Ghost
  171.         1,    -- Dragon
  172.         1,    -- Dark
  173.         1,    -- Steel
  174.         1,    -- Fairy
  175.     },
  176.     { -- NORMAL
  177.         1,    -- None
  178.         1,    -- Normal
  179.         1,    -- Fire
  180.         1,    -- Water
  181.         1,    -- Electric
  182.         1,    -- Grass
  183.         1,    -- Ice
  184.         1,    -- Fighting
  185.         1,    -- Poison
  186.         1,    -- Ground
  187.         1,    -- Flying
  188.         1,    -- Psychic
  189.         1,    -- Bug
  190.         N,    -- Rock
  191.         I,    -- Ghost
  192.         1,    -- Dragon
  193.         1,    -- Dark
  194.         N,    -- Steel
  195.         1,    -- Fairy
  196.     },
  197.     { -- FIRE
  198.         1,    -- None
  199.         1,    -- Normal
  200.         N,    -- Fire
  201.         N,    -- Water
  202.         1,    -- Electric
  203.         S,    -- Grass
  204.         S,    -- Ice
  205.         1,    -- Fighting
  206.         1,    -- Poison
  207.         1,    -- Ground
  208.         1,    -- Flying
  209.         1,    -- Psychic
  210.         S,    -- Bug
  211.         N,    -- Rock
  212.         1,    -- Ghost
  213.         N,    -- Dragon
  214.         1,    -- Dark
  215.         S,    -- Steel
  216.         1,    -- Fairy
  217.     },
  218.     { -- WATER
  219.         1,    -- None
  220.         1,    -- Normal
  221.         S,    -- Fire
  222.         N,    -- Water
  223.         1,    -- Electric
  224.         N,    -- Grass
  225.         1,    -- Ice
  226.         1,    -- Fighting
  227.         1,    -- Poison
  228.         S,    -- Ground
  229.         1,    -- Flying
  230.         1,    -- Psychic
  231.         1,    -- Bug
  232.         S,    -- Rock
  233.         1,    -- Ghost
  234.         N,    -- Dragon
  235.         1,    -- Dark
  236.         1,    -- Steel
  237.         1,    -- Fairy
  238.     },
  239.     { -- ELECTRIC
  240.         1,    -- None
  241.         1,    -- Normal
  242.         1,    -- Fire
  243.         S,    -- Water
  244.         N,    -- Electric
  245.         1,    -- Grass
  246.         1,    -- Ice
  247.         1,    -- Fighting
  248.         1,    -- Poison
  249.         I,    -- Ground
  250.         S,    -- Flying
  251.         1,    -- Psychic
  252.         1,    -- Bug
  253.         1,    -- Rock
  254.         1,    -- Ghost
  255.         N,    -- Dragon
  256.         1,    -- Dark
  257.         1,    -- Steel
  258.         1,    -- Fairy
  259.     },
  260.     { -- GRASS
  261.         1,    -- None
  262.         1,    -- Normal
  263.         N,    -- Fire
  264.         S,    -- Water
  265.         1,    -- Electric
  266.         N,    -- Grass
  267.         1,    -- Ice
  268.         1,    -- Fighting
  269.         N,    -- Poison
  270.         S,    -- Ground
  271.         N,    -- Flying
  272.         1,    -- Psychic
  273.         N,    -- Bug
  274.         S,    -- Rock
  275.         1,    -- Ghost
  276.         N,    -- Dragon
  277.         1,    -- Dark
  278.         N,    -- Steel
  279.         1,    -- Fairy
  280.     },
  281.     { -- ICE
  282.         1,    -- None
  283.         1,    -- Normal
  284.         N,    -- Fire
  285.         N,    -- Water
  286.         1,    -- Electric
  287.         S,    -- Grass
  288.         N,    -- Ice
  289.         1,    -- Fighting
  290.         1,    -- Poison
  291.         S,    -- Ground
  292.         S,    -- Flying
  293.         1,    -- Psychic
  294.         1,    -- Bug
  295.         1,    -- Rock
  296.         1,    -- Ghost
  297.         S,    -- Dragon
  298.         1,    -- Dark
  299.         N,    -- Steel
  300.         1,    -- Fairy
  301.     },
  302.     { -- FIGHTING
  303.         1,    -- None
  304.         S,    -- Normal
  305.         1,    -- Fire
  306.         1,    -- Water
  307.         1,    -- Electric
  308.         1,    -- Grass
  309.         S,    -- Ice
  310.         1,    -- Fighting
  311.         N,    -- Poison
  312.         1,    -- Ground
  313.         N,    -- Flying
  314.         N,    -- Psychic
  315.         N,    -- Bug
  316.         S,    -- Rock
  317.         I,    -- Ghost
  318.         1,    -- Dragon
  319.         S,    -- Dark
  320.         S,    -- Steel
  321.         N,    -- Fairy
  322.     },
  323.     { -- POISON
  324.         1,    -- None
  325.         1,    -- Normal
  326.         1,    -- Fire
  327.         1,    -- Water
  328.         1,    -- Electric
  329.         S,    -- Grass
  330.         1,    -- Ice
  331.         1,    -- Fighting
  332.         N,    -- Poison
  333.         N,    -- Ground
  334.         1,    -- Flying
  335.         1,    -- Psychic
  336.         1,    -- Bug
  337.         N,    -- Rock
  338.         N,    -- Ghost
  339.         1,    -- Dragon
  340.         1,    -- Dark
  341.         I,    -- Steel
  342.         S,    -- Fairy
  343.     },
  344.     { -- GROUND
  345.         1,    -- None
  346.         1,    -- Normal
  347.         S,    -- Fire
  348.         1,    -- Water
  349.         S,    -- Electric
  350.         N,    -- Grass
  351.         1,    -- Ice
  352.         1,    -- Fighting
  353.         S,    -- Poison
  354.         1,    -- Ground
  355.         I,    -- Flying
  356.         1,    -- Psychic
  357.         N,    -- Bug
  358.         S,    -- Rock
  359.         1,    -- Ghost
  360.         1,    -- Dragon
  361.         1,    -- Dark
  362.         S,    -- Steel
  363.         1,    -- Fairy
  364.     },
  365.     { -- FLYING
  366.         1,    -- None
  367.         1,    -- Normal
  368.         1,    -- Fire
  369.         1,    -- Water
  370.         N,    -- Electric
  371.         S,    -- Grass
  372.         1,    -- Ice
  373.         S,    -- Fighting
  374.         1,    -- Poison
  375.         1,    -- Ground
  376.         1,    -- Flying
  377.         1,    -- Psychic
  378.         S,    -- Bug
  379.         N,    -- Rock
  380.         1,    -- Ghost
  381.         1,    -- Dragon
  382.         1,    -- Dark
  383.         N,    -- Steel
  384.         1,    -- Fairy
  385.     },
  386.     { -- PSYCHIC
  387.         1,    -- None
  388.         1,    -- Normal
  389.         1,    -- Fire
  390.         1,    -- Water
  391.         1,    -- Electric
  392.         1,    -- Grass
  393.         1,    -- Ice
  394.         S,    -- Fighting
  395.         S,    -- Poison
  396.         1,    -- Ground
  397.         1,    -- Flying
  398.         N,    -- Psychic
  399.         N,    -- Bug
  400.         1,    -- Rock
  401.         1,    -- Ghost
  402.         1,    -- Dragon
  403.         I,    -- Dark
  404.         N,    -- Steel
  405.         1,    -- Fairy
  406.     },
  407.     { -- BUG
  408.         1,    -- None
  409.         1,    -- Normal
  410.         N,    -- Fire
  411.         1,    -- Water
  412.         1,    -- Electric
  413.         S,    -- Grass
  414.         1,    -- Ice
  415.         1,    -- Fighting
  416.         N,    -- Poison
  417.         1,    -- Ground
  418.         N,    -- Flying
  419.         S,    -- Psychic
  420.         1,    -- Bug
  421.         1,    -- Rock
  422.         N,    -- Ghost
  423.         1,    -- Dragon
  424.         S,    -- Dark
  425.         N,    -- Steel
  426.         N,    -- Fairy
  427.     },
  428.     { -- ROCK
  429.         1,    -- None
  430.         1,    -- Normal
  431.         S,    -- Fire
  432.         1,    -- Water
  433.         1,    -- Electric
  434.         1,    -- Grass
  435.         S,    -- Ice
  436.         N,    -- Fighting
  437.         1,    -- Poison
  438.         N,    -- Ground
  439.         S,    -- Flying
  440.         1,    -- Psychic
  441.         S,    -- Bug
  442.         N,    -- Rock
  443.         1,    -- Ghost
  444.         1,    -- Dragon
  445.         1,    -- Dark
  446.         N,    -- Steel
  447.         1,    -- Fairy
  448.     },
  449.     { -- GHOST
  450.         1,    -- None
  451.         I,    -- Normal
  452.         1,    -- Fire
  453.         1,    -- Water
  454.         1,    -- Electric
  455.         1,    -- Grass
  456.         1,    -- Ice
  457.         1,    -- Fighting
  458.         1,    -- Poison
  459.         1,    -- Ground
  460.         1,    -- Flying
  461.         S,    -- Psychic
  462.         1,    -- Bug
  463.         1,    -- Rock
  464.         S,    -- Ghost
  465.         1,    -- Dragon
  466.         N,    -- Dark
  467.         1,    -- Steel
  468.         1,    -- Fairy
  469.     },
  470.     { -- DRAGON
  471.         1,    -- None
  472.         1,    -- Normal
  473.         1,    -- Fire
  474.         1,    -- Water
  475.         1,    -- Electric
  476.         1,    -- Grass
  477.         1,    -- Ice
  478.         1,    -- Fighting
  479.         1,    -- Poison
  480.         1,    -- Ground
  481.         1,    -- Flying
  482.         1,    -- Psychic
  483.         1,    -- Bug
  484.         1,    -- Rock
  485.         1,    -- Ghost
  486.         S,    -- Dragon
  487.         1,    -- Dark
  488.         N,    -- Steel
  489.         I,    -- Fairy
  490.     },
  491.     { -- DARK
  492.         1,    -- None
  493.         1,    -- Normal
  494.         1,    -- Fire
  495.         1,    -- Water
  496.         1,    -- Electric
  497.         1,    -- Grass
  498.         1,    -- Ice
  499.         N,    -- Fighting
  500.         1,    -- Poison
  501.         1,    -- Ground
  502.         1,    -- Flying
  503.         S,    -- Psychic
  504.         1,    -- Bug
  505.         1,    -- Rock
  506.         S,    -- Ghost
  507.         1,    -- Dragon
  508.         N,    -- Dark
  509.         1,    -- Steel
  510.         N,    -- Fairy
  511.     },
  512.     { -- STEEL
  513.         1,    -- None
  514.         1,    -- Normal
  515.         N,    -- Fire
  516.         N,    -- Water
  517.         N,    -- Electric
  518.         1,    -- Grass
  519.         S,    -- Ice
  520.         N,    -- Fighting
  521.         1,    -- Poison
  522.         1,    -- Ground
  523.         1,    -- Flying
  524.         1,    -- Psychic
  525.         1,    -- Bug
  526.         S,    -- Rock
  527.         1,    -- Ghost
  528.         1,    -- Dragon
  529.         1,    -- Dark
  530.         N,    -- Steel
  531.         S,    -- Fairy
  532.     },
  533.     { -- FAIRY
  534.         1,    -- None
  535.         1,    -- Normal
  536.         N,    -- Fire
  537.         1,    -- Water
  538.         1,    -- Electric
  539.         1,    -- Grass
  540.         1,    -- Ice
  541.         S,    -- Fighting
  542.         N,    -- Poison
  543.         1,    -- Ground
  544.         1,    -- Flying
  545.         1,    -- Psychic
  546.         1,    -- Bug
  547.         1,    -- Rock
  548.         1,    -- Ghost
  549.         S,    -- Dragon
  550.         S,    -- Dark
  551.         N,    -- Steel
  552.         1,    -- Fairy
  553.     }
  554. }
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564. -- Prints the data of every Pokemon (commenting formatting has to be weird sry)
  565. --for n, data in ipairs(dex) do
  566. --    io.write(data[1].." - "..types[data[2]])
  567. --    if data[3] ~= 1 then io.write("/"..types[data[3]]) end
  568. --[[    io.write(" - "..data[4].." HP / "..data[5].." ATK - ")
  569.     for i = 6, 9 do
  570.         io.write(data[i])
  571.         if i~=9 then io.write(", ") else io.write("\n") end
  572.     end
  573. end
  574. print()
  575. --]]
  576.  
  577.  
  578. -- Prints the data of every move (commenting formatting has to be weird sry)
  579. --for n, data in ipairs(movedex) do
  580. --    io.write(data[1].." - "..types[data[4]].." - "..data[2].." POW, "..data[3].."% ACC\n")
  581. --end
  582.  
  583.  
  584. -- Verifies that every move on every Pokemon is a move with data in the movedex (commenting formatting has to be weird sry)
  585. --for n, data in ipairs(dex) do
  586. --    for i = 6, 9 do
  587. --        if not movedex[data[i]] then print("Error! Move \""..data[i].."\" not found in movedex. This move is on "..data[1]..".") end
  588. --[[    end
  589. end
  590. ]]
  591.  
  592.  
  593. -- Actual calculator code
  594. local unc = "zxc" -- only make it 3 characters
  595.  
  596. -- Prints the data of two given mons and returns move dmg
  597. local function printData(index1, index2)
  598.     local m1 = dex[index1]
  599.     local m2 = dex[index2]
  600.     local s1 = {}
  601.     local s2 = {}
  602.     print("Monster 1: "..m1[1].." - "..m1[4].." HP, "..m1[5].." ATK")
  603.     for i = 1, 4 do
  604.         local move = m1[i+5]
  605.         local myType = movedex[move][3]
  606.         local dmg = 0
  607.         if move == "FoulPlay" then
  608.           dmg = m2[5]*movedex[move][1]*typechart[myType][m2[2]]*typechart[myType][m2[3]]/400
  609.         else
  610.           dmg = m1[5]*movedex[move][1]*typechart[myType][m2[2]]*typechart[myType][m2[3]]/400
  611.         end
  612.         if myType == m1[2] or myType == m1[3] then dmg=dmg*STAB end
  613.         print(i..": "..move.." - "..dmg)
  614.         s1[i] = {move, dmg}
  615.     end
  616.     print("\nMonster 2: "..m2[1].." - "..m2[4].." HP, "..m2[5].." ATK")
  617.     for i = 1, 4 do
  618.         local move = m2[i+5]
  619.         local myType = movedex[move][3]
  620.         local dmg = m2[5]*movedex[move][1]*typechart[myType][m1[2]]*typechart[myType][m1[3]]/400
  621.         if myType == m2[2] or myType == m2[3] then dmg=dmg*STAB end
  622.         print(i..": "..move.." - "..dmg.."")
  623.         s2[i] = {move, dmg}
  624.     end
  625.     print()
  626.     return s1, s2
  627. end
  628.  
  629. local saveMode = 0  -- 0 is auto, 1 is manual
  630. local printMode = 0 -- 0 is dashes, 1 is brackets, 2 is both
  631. local lotsaData = {}
  632. -- Format of lotsaData (a dictionary):
  633. -- Suppose Ho-oh is me and Lugia and Mewtwo was the enemy
  634. -- ["Lugia"] = {hoohChain, hoohSum, lugiaChain, lugiaSum},
  635. -- ["Mewtwo"] = {hoohChain, hoohSum, mewtwoChain, mewtwoSum}
  636.  
  637. -- Adds an entry to lotsaData
  638. local function saveTo(myData)
  639.     if not lotsaData[myData[2]] then lotsaData[myData[2]] = {nil, nil, nil, nil} end
  640.     local place = lotsaData[myData[2]]
  641.     local n = 1
  642.     if myData[1] == 2 then n = 3 end
  643.     place[n] = string.sub(myData[3], 3)
  644.     place[n+1] = myData[4]
  645. end
  646.  
  647. -- Returns damage and formatted string of a move chain
  648. local function printWithMode(chain, moveInfo, nmeI)
  649.     local moveString = ""
  650.     local sum = 0
  651.     if (printMode == 1 or printMode == 2) then moveString = "[" end
  652.     for i = 1, string.len(chain) do
  653.         if string.sub(chain, i, i) == "0" then
  654.             moveString = moveString.."nothing "
  655.         else
  656.             local place = moveInfo[tonumber(string.sub(chain, i, i))]
  657.             moveString = moveString..place[1].." "
  658.             if place[1] == "SuperFang" then
  659.                 sum = (sum + dex[nmeI][4])/2
  660.             else
  661.                 sum = sum + place[2]
  662.             end
  663.         end
  664.         if (printMode == 0 or printMode == 2) and i<string.len(chain) then
  665.             moveString = moveString.."- "
  666.         end
  667.     end
  668.     if (printMode == 1 or printMode == 2) then moveString = string.sub(moveString, 1, string.len(moveString)-1).."]" end
  669.     return moveString, sum
  670. end
  671.  
  672.  
  673. print("Welcome to the Jokemon Matchup Calc Tool! This tool is for the game \"Pocket Monsters Reborn RPG\" on Roblox. Try it some time!\nTo start, choose a Pokemon. (no spaces)")
  674. local myIndex
  675. local oppIndex = 1
  676. repeat
  677.     myIndex = 1
  678.     local m = io.read()
  679.     while dex[myIndex]~=nil and dex[myIndex][1]~=m do myIndex=myIndex+1 end
  680.     if dex[myIndex]==nil then
  681.         print("not found")
  682.     end
  683. until dex[myIndex]~=nil
  684. print("We will begin at "..dex[1][1]..". Type \"help\" to see a tutorial.\n")
  685. local s1, s2 = printData(myIndex, 1)
  686. local toSave = {}
  687. while true do
  688.     local c = string.upper(io.read())
  689.     for n = string.len(c), 1, -1 do
  690.         if string.sub(c, n, n) == " " then c = string.sub(c, 1, n-1)..string.sub(c, n+1) end
  691.     end
  692.     if c == "HELP" then
  693.         print("COMMAND LIST\nhelp - Guide on how to use the tool\nn (or next) - Moves to the next mon in the dex\ns (or search) - Sets Monster 2 to an inputted mon\nmode->print - Changes the mode that strings are printed as\nmode->save - Changes the mode between autosave and manual save\nsavehelp - Guide on how to use the save feature")
  694.         print("\nTo simulate a move string, use the following format:\n\"M: string of numbers, no spaces\"\nM is either 1 or 2. It is the mon you are using moves as.\nThe string of numbers represents the moves of the mon.")
  695.         print("Here is an example. Suppose I am Vaporeon (:fearful:). I type this in:\n1: 1421\nThis indicates that Monster 1 uses moves 1, 4, 2, and 1 in that order. In this specific situation, Vaporeon uses Bubble - HydroPump - BubbleBeam - Bubble.")
  696.         print("\nThe program ignores spaces when receiving command inputs.\nYou can also put 0 in place of a move usage to indicate nothing.\nThe program will error if you reach the end of the dex, but you can just restart it at any time.")
  697.         print("Hopefully this helped! Match data will be reprinted below.\n")
  698.         printData(myIndex, oppIndex)
  699.     elseif c == "SAVEHELP" then
  700.         print("COMMAND LIST\nsavehelp - Guide on how to use the save feature\nsave - Manually saves data in the correct place\ndata - Prints all available data\nkey - Generates a save key for you to copy\nload - Asks for a save key, and creates data with it\nmode->save - Changes the mode between autosave and manual save")
  701.         print("\nAutosave will automatically save the \"best\" string available.\nIf you have a string that is a more minimalist way to defeat the opponent (less length and/or closer to an exact kill), it will save it over whatever's there.\nAdditionally, you can manually save when autosave is still on.\nIn a sense, manual save mode is just a no-autosave mode.")
  702.         print("\nThe save key will keep track of your print mode and save mode.")
  703.         print("Hopefully this helped! Match data will be reprinted below.\n")
  704.         printData(myIndex, oppIndex)
  705.     elseif c == "N" or c == "NEXT" then
  706.         oppIndex = oppIndex+1
  707.         s1, s2 = printData(myIndex, oppIndex)
  708.     elseif c == "S" or c == "SEARCH" then
  709.         print("What mon? (no spaces)")
  710.         local tempMon = io.read()
  711.         local temp = 1
  712.         while dex[temp]~=nil and dex[temp][1]~=tempMon do temp=temp+1 end
  713.         if dex[temp]==nil then
  714.             print("not found")
  715.         else
  716.             oppIndex = temp
  717.         end
  718.         s1, s2 = printData(myIndex, oppIndex)
  719.     elseif (string.sub(c, 1, 2) == "1:" or string.sub(c, 1, 2) == "2:") and tonumber(string.sub(c, 3)) then
  720.         local passable = true
  721.         for i = 3, string.len(c) do
  722.             local f = string.sub(c,i,i)
  723.             if not (f=="1" or f=="2" or f=="3" or f=="4") then
  724.                 passable = false
  725.             end
  726.         end
  727.         if passable then
  728.             local user = s1
  729.             local userI = myIndex
  730.             local nmeI = oppIndex
  731.             if string.sub(c, 1, 1) == "2" then user = s2 userI =     oppIndex nmeI = myIndex end
  732.             local moveString, sum = printWithMode(string.sub(c, 3), user, nmeI)
  733.             io.write(moveString.."\n"..sum.." DMG, ")
  734.             local diff = dex[nmeI][4]-sum
  735.             if diff>0 then
  736.                 print(diff.." HP left")
  737.             else
  738.                 print("Overkill by "..diff*-1)
  739.             end
  740.             print("This number is equal to a move of raw POW "..math.abs(diff*400/dex[userI][5]))
  741.             toSave = {tonumber(string.sub(c, 1, 1)), dex[oppIndex][1], c, sum}
  742.             local curName = lotsaData[dex[oppIndex][1]]
  743.             local sumSpot = toSave[1]*2
  744.             if diff<=0 and (not curName or not curName[sumSpot] or
  745.               (curName[sumSpot]>=sum and
  746.               string.len(c)-2<=string.len(curName[sumSpot-1]))) then
  747.                 print("Saving the latest movestring.")
  748.                 saveTo(toSave)
  749.             end
  750.             print()
  751.         else
  752.             print("Invalid, try again.\n")
  753.         end
  754.     elseif c == "MODE" then
  755.         print("What mode to switch? (either print or save)")
  756.         local took = string.upper(io.read())
  757.         if took == "PRINT" then
  758.             print("To what? (0 is dash, 1 is brackets, 2 is both)")
  759.             took = tonumber(io.read())
  760.             if took and (took == 0 or took == 1 or took == 2) then
  761.                 printMode = took
  762.                 print("Updated successfully.")
  763.             else
  764.                 print("Invalid, try again.\n")
  765.             end
  766.         elseif took == "SAVE" then
  767.             print("To what? (0 is auto, 1 is manual)")
  768.             took = tonumber(io.read())
  769.             if took and (took == 0 or took == 1) then
  770.                 print("Updated successfully.")
  771.             else
  772.                 print("Invalid, try again.\n")
  773.             end
  774.         else
  775.             print("Invalid, try again.\n")
  776.         end
  777.     elseif c == "SAVE" then
  778.         print("Saving the latest movestring.\n")
  779.         saveTo(toSave)
  780.     elseif c == "DATA" then
  781.         print("Printing data now...\n--------------------\n")
  782.         local i = 1
  783.         local me = dex[myIndex][1]
  784.         local mine = {{dex[myIndex][6], 0}, {dex[myIndex][7], 0}, {dex[myIndex][8], 0}, {dex[myIndex][9], 0}}
  785.         local wins = ""
  786.         local losses = ""
  787.         local ties = ""
  788.         repeat
  789.             local him = dex[i][1]
  790.             if lotsaData[him] then
  791.                 local his = {{dex[i][6], 0}, {dex[i][7], 0}, {dex[i][8], 0}, {dex[i][9], 0}}
  792.                 local hisLen = math.huge
  793.                 local myLen = math.huge
  794.                 io.write(me.." vs "..him.."\n"..me..": ")
  795.                 local n = "nil"
  796.                 if lotsaData[him][1] then
  797.                     n = printWithMode(lotsaData[him][1], mine, i)
  798.                     myLen = string.len(lotsaData[him][1])
  799.                 end
  800.                 io.write(n.."\n"..him..": ")
  801.                 n = "nil"
  802.                 if lotsaData[him][3] then
  803.                     n = printWithMode(lotsaData[him][3], his, i)
  804.                     hisLen = string.len(lotsaData[him][3])
  805.                 end
  806.                 print(n)
  807.                 if myLen>hisLen then
  808.                     print(him.." wins\n")
  809.                     losses = losses..him.." "
  810.                 elseif myLen<hisLen then
  811.                     print(me.." wins\n")
  812.                     wins = wins..him.." "
  813.                 else
  814.                     print("Tie (probably)")
  815.                     ties = ties..him.." "
  816.                 end
  817.             end
  818.             i=i+1
  819.         until i>=#dex
  820.         print("\n"..me.."\'s Counters:\n"..losses.."\n\n"..me.."\'s Equals:\n"..ties.."\n\n"..me.."\'s Victims:\n"..wins)
  821.         print("\n------------------\nDone printing all the data!\n")
  822.     elseif c == "KEY" then
  823.         local key = unc..saveMode..printMode
  824.         for k, v in pairs(lotsaData) do
  825.             key = key..k..unc
  826.             for i = 1, 4 do
  827.                 if v[i] then
  828.                     key = key..v[i]..unc
  829.                 else
  830.                     key = key.."nil"..unc
  831.                 end
  832.             end
  833.         end
  834.         print("Key's done making!!! Here you go:\n"..key.."\n")
  835.     elseif c == "LOAD" then
  836.         print("Got a key?")
  837.         local key = io.read()
  838.         unc = string.sub(key, 1, 3)
  839.         saveMode = tonumber(string.sub(key, 4, 4))
  840.         printMode = tonumber(string.sub(key, 5, 5))
  841.         key = string.sub(key, 6)
  842.         while string.len(key)>0 do
  843.             local n = 1
  844.             while string.sub(key, n, n+2)~=unc do n=n+1 end
  845.             local theName = string.sub(key, 0, n-1)
  846.             if not lotsaData[theName] then
  847.                 lotsaData[theName] = {nil, nil, nil, nil}
  848.             end
  849.             key = string.sub(key, n+3)
  850.             for i = 1, 4 do
  851.                 n = 1
  852.                 while string.sub(key, n, n+2)~=unc do n=n+1 end
  853.                 lotsaData[theName][i] = tonumber(string.sub(key, 0, n-1))
  854.                 key = string.sub(key, n+3)
  855.             end
  856.         end
  857.         print("All loaded!\n")
  858.     elseif c == "FUN" or c == "TERMINATE" then
  859.         print("Connection terminated. I'm sorry to interrupt you, Elizabeth, if you still even remember that name, But I'm afraid you've been misinformed. You are not here to receive a gift, nor have you been called here by the individual you assume, although, you have indeed been called. You have all been called here, into a labyrinth of sounds and smells, misdirection and misfortune. A labyrinth with no exit, a maze with no prize. You don't even realize that you are trapped. Your lust for blood has driven you in endless circles, chasing the cries of children in some unseen chamber, always seeming so near, yet somehow out of reach, but you will never find them. None of you will. This is where your story ends. And to you, my brave volunteer, who somehow found this job listing not intended for you, although there was a way out planned for you, I have a feeling that's not what you want. I have a feeling that you are right where you want to be. I am remaining as well. I am nearby. This place will not be remembered, and the memory of everything that started this can finally begin to fade away. As the agony of every tragedy should. And to you monsters trapped in the corridors, be still and give up your spirits. They don't belong to you. For most of you, I believe there is peace and perhaps more waiting for you after the smoke clears. Although, for one of you, the darkest pit of Hell has opened to swallow you whole, so don't keep the devil waiting, old friend. My daughter, if you can hear me, I knew you would return as well. It's in your nature to protect the innocent. I'm sorry that on that day, the day you were shut out and left to die, no one was there to lift you up into their arms the way you lifted others into yours, and then, what became of you. I should have known you wouldn't be content to disappear, not my daughter. I couldn't save you then, so let me save you now. It's time to rest - for you, and for those you have carried in your arms. This ends for all of us. End communication.")
  860.     else
  861.       print("Invalid, try again.\n")
  862.     end
  863. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement