Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- MULTIPLIERS
- local N = 2/3
- local S = 1.5
- local I = 0
- local STAB = 1.25
- -- DATA DICTS
- local types = {
- "None", -- 1
- "Normal", -- 2
- "Fire", -- 3
- "Water", -- 4
- "Electric", -- 5
- "Grass", -- 6
- "Ice", -- 7
- "Fighting", -- 8
- "Poison", -- 9
- "Ground", -- 10
- "Flying", -- 11
- "Psychic", -- 12
- "Bug", -- 13
- "Rock", -- 14
- "Ghost", -- 15
- "Dragon", -- 16
- "Dark", -- 17
- "Steel", -- 18
- "Fairy" -- 19
- }
- local dex = {
- {"Meganium", 6, 1, 91, 84, "Absorb", "MagicLeaf", "MegaDrain", "Solarbeam"},
- {"Typhlosion", 3, 1, 78, 100, "Tackle", "Ember", "Flamethrower", "FireBlast"},
- {"Feraligatr", 4, 1, 83, 93, "Bubble", "Bubblebeam", "Surf", "HydroPump"},
- {"Butterfree", 13, 11, 58, 73, "Tackle", "Absorb", "Confusion", "Psychic"},
- {"Gloom", 6, 9, 60, 72, "Tackle", "RazorLeaf", "Absorb", "nil"},
- {"Raticate", 2, 1, 62, 76, "Tackle", "QuickAttack", "HyperFang", "nil"},
- {"Pikachu", 5, 1, 46, 61, "Tackle", "Thundershock", "Thunderbolt", "Thunder"},
- {"Pidgeot", 11, 2, 80, 80, "Tackle", "Gust", "QuickAttack", "nil"},
- {"Eevee", 2, 1, 56, 52, "Tackle", "nil", "nil", "nil"},
- {"Vaporeon", 4, 1, 90, 85, "Bubble", "Bubblebeam", "Surf", "HydroPump"},
- {"Jolteon", 5, 1, 73, 102, "Thundershock", "Thunderbolt", "QuickAttack", "Thunder"},
- {"Flareon", 3, 1, 67, 108, "Ember", "Flamethrower", "QuickAttack", "FireBlast"},
- {"Espeon", 12, 1, 67, 108, "Confusion", "Psychic", "QuickAttack", "Psybeam"},
- {"Umbreon", 17, 1, 110, 65, "Bite", "ShadowBall", "QuickAttack", "DarkPulse"},
- {"Leafeon", 6, 1, 80, 95, "Absorb", "RazorLeaf", "MagicLeaf", "Solarbeam"},
- {"Glaceon", 7, 1, 75, 100, "QuickAttack", "Psychic", "Surf", "AuroraBeam"},
- {"Golem", 14, 10, 76, 89, "Tackle", "RockThrow", "Flamethrower", "nil"},
- {"Rhydon", 14, 10, 75, 87, "Tackle", "RockThrow", "nil", "nil"},
- {"Golbat", 9, 11, 75, 77, "Confusion", "Gust", "Absorb", "Psychic"},
- {"Crobat", 11, 9, 88, 90, "AirSlash", "LeechLife", "Psychic", "MegaDrain"},
- {"Onix", 14, 10, 80, 48, "Tackle", "RockThrow", "nil", "nil"},
- {"Dewgong", 4, 7, 89, 70, "Confusion", "Bubblebeam", "Psychic", "AuroraBeam"},
- {"Piloswine", 7, 10, 73, 77, "Tackle", "Bubble", "Bubblebeam", "AuroraBeam"},
- {"Lombre", 4, 6, 58, 55, "Tackle", "Bubble", "Absorb", "Bubblebeam"},
- {"Ludicolo", 4, 6, 79, 89, "Bubblebeam", "MegaDrain", "Solarbeam", "nil"},
- {"Whiscash", 4, 10, 84, 72, "Pound", "Tackle", "Bubble", "Bubblebeam"},
- {"Lapras", 4, 7, 100, 78, "Bubblebeam", "HyperBeam", "HydroPump", "Surf"},
- {"Aggron", 18, 14, 87, 89, "Tackle", "RockThrow", "MetalClaw", "IronTail"},
- {"Magcargo", 3, 14, 69, 67, "Ember", "RockThrow", "Flamethrower", "FireBlast"},
- {"Ninetales", 3, 1, 84, 84, "Flamethrower", "HyperBeam", "FireBlast", "SacredFire"},
- {"Gyarados", 4, 11, 83, 97, "Bubblebeam", "Surf", "HydroPump", "nil"},
- {"Wailord", 4, 1, 91, 76, "Bubblebeam", "Surf", "HydroPump", "nil"},
- {"Electabuzz", 5, 1, 69, 94, "Tackle", "Thundershock", "Thunderbolt", "Thunder"},
- {"Electivire", 5, 1, 71, 109, "Thundershock", "Thunderbolt", "Thunder", "BodySlam"},
- {"Magneton", 5, 18, 60, 95, "Tackle", "Thundershock", "Thunderbolt", "nil"},
- {"Ledian", 13, 11, 75, 55, "Confusion", "Gust", "MegaDrain", "nil"},
- {"Heracross", 13, 8, 74, 93, "Tackle", "MegaDrain", "IronTail", "Gust"},
- {"Scyther", 13, 11, 73, 94, "AirSlash", "Solarbeam", "FalseSwipe", "FuryCutter"},
- {"Haunter", 15, 9, 44, 91, "Confusion", "Psychic", "DarkPulse", "ShadowBall"},
- {"Gengar", 15, 9, 60, 107, "Confusion", "Psychic", "DarkPulse", "ShadowBall"},
- {"Absol", 17, 1, 54, 101, "Psychic", "Slash", "QuickAttack", "DarkPulse"},
- {"Lucario", 2, 18, 67, 108, "QuickAttack", "DarkPulse", "AuraSphere", "nil"},
- {"Dragonite", 16, 11, 86, 114, "DarkPulse", "FireBlast", "Solarbeam", "Thunderbolt"},
- {"Cresselia", 12, 1, 125, 75, "Psybeam", "AuroraBeam", "Psychic", "HyperBeam"},
- {"Darkrai", 17, 1, 79, 121, "Psychic", "ShadowBall", "DarkPulse", "DarkVoid"},
- {"Ho-oh", 3, 11, 108, 119, "Thunderbolt", "Thunder", "HyperBeam", "SacredFire"},
- {"Jirachi", 18, 12, 100, 100, "Confusion", "Metronome", "Psychic", "Thunder"},
- {"Regirock", 14, 1, 110, 84, "RockThrow", "BodySlam", "AncientPower", "nil"},
- {"Registeel", 18, 1, 117, 76, "Thunderbolt", "Thunder", "ZapCannon", "nil"},
- {"Regice", 7, 1, 110, 84, "IcyWind", "AuroraBeam", "Bubblebeam", "nil"},
- {"Shaymin", 6, 1, 100, 100, "RazorLeaf", "MagicLeaf", "Solarbeam", "SeedFlare"},
- {"Rayquaza", 16, 11, 89, 137, "Thunderbolt", "Thunder", "Dragonbreath", "HyperBeam"},
- {"Mew", 12, 1, 100, 100, "Pound", "Confusion", "Metronome", "Psychic"},
- {"Dialga", 18, 16, 96, 131, "MetalClaw", "RoarOfTime", "Dragonbreath", "Earthquake"},
- {"Palkia", 4, 16, 93, 133, "Dragonbreath", "SpatialRend", "HydroPump", "DragonPulse"},
- {"Giratina", 16, 15, 130, 96, "AncientPower", "ShadowForce", "Earthquake", "DracoMeteor"},
- {"Arceus-99", 2, 1, 118.846, 118.846, "Thunderbolt", "Judgment", "FireBlast", "Recover", "TheTruth"}, -- 120*103/104
- {"Arceus-100", 2, 1, 120, 120, "Judgment", "FireBlast", "Recover", "TheTruth"},
- {"EndOfDex", 1, 1, 1, 1, "nil", "nil", "nil", "nil"},
- {"Bro you are at the end of the dex", 1, 1, 1, 1, "nil", "nil", "nil", "nil"}
- }
- local movedex = {
- ["DracoMeteor"] = {150, 100, 16},
- ["HyperBeam"] = {150, 100, 2},
- ["Judgment"] = {120, 100, 2},
- ["SacredFire"] = {120, 100, 3},
- ["ShadowForce"] = {120, 100, 15},
- ["Solarbeam"] = {120, 100, 6},
- ["DarkVoid"] = {100, 100, 17},
- ["Earthquake"] = {100, 100, 10},
- ["SpatialRend"] = {100, 100, 16},
- ["DragonPulse"] = {90, 100, 16},
- ["Flamethrower"] = {90, 100, 3},
- ["Psychic"] = {90, 100, 12},
- ["Surf"] = {90, 100, 4},
- ["Thunderbolt"] = {90, 100, 5},
- ["AuraSphere"] = {80, 100, 8},
- ["DarkPulse"] = {80, 100, 17},
- ["HyperFang"] = {80, 100, 2},
- ["ShadowBall"] = {80, 100, 15},
- ["AirSlash"] = {75, 100, 11},
- ["Bubblebeam"] = {75, 100, 4},
- ["BodySlam"] = {70, 100, 2},
- ["Slash"] = {70, 100, 2},
- ["AuroraBeam"] = {65, 100, 7},
- ["FalseSwipe"] = {65, 100, 2},
- ["Psybeam"] = {65, 100, 12},
- ["AncientPower"] = {60, 100, 14},
- ["Bite"] = {60, 100, 17},
- ["Dragonbreath"] = {60, 100, 16},
- ["MagicLeaf"] = {60, 1000, 6},
- ["RockThrow"] = {60, 100, 14},
- ["IcyWind"] = {55, 100, 7},
- ["MetalClaw"] = {55, 100, 18},
- ["RazorLeaf"] = {55, 100, 6},
- ["Bubble"] = {40, 100, 4},
- ["Confusion"] = {40, 100, 12},
- ["Ember"] = {40, 100, 3},
- ["Gust"] = {40, 100, 11},
- ["Pound"] = {40, 100, 2},
- ["QuickAttack"] = {40, 100, 2},
- ["Scratch"] = {40, 100, 2},
- ["Tackle"] = {40, 100, 2},
- ["Thundershock"] = {40, 100, 5},
- ["FuryCutter"] = {40, 95, 13},
- ["RoarOfTime"] = {150, 90, 16},
- ["SeedFlare"] = {120, 85, 6},
- ["FireBlast"] = {120, 80, 3},
- ["HydroPump"] = {110, 80, 4},
- ["IronTail"] = {100, 75, 18},
- ["Thunder"] = {110, 70, 5},
- ["ZapCannon"] = {120, 50, 5},
- ["Absorb"] = {25, 100, 6},
- ["LeechLife"] = {25, 100, 13},
- ["Recover"] = {0, 100, 2},
- ["MegaDrain"] = {50, 100, 6},
- ["Metronome"] = {0, 100, 2},
- ["TheTruth"] = {0, 100, 2},
- ["nil"] = {0, 0, 1}
- }
- local typechart = {
- { -- NONE
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- 1, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- 1, -- Rock
- 1, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- 1, -- Steel
- 1, -- Fairy
- },
- { -- NORMAL
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- 1, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- N, -- Rock
- I, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- N, -- Steel
- 1, -- Fairy
- },
- { -- FIRE
- 1, -- None
- 1, -- Normal
- N, -- Fire
- N, -- Water
- 1, -- Electric
- S, -- Grass
- S, -- Ice
- 1, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- S, -- Bug
- N, -- Rock
- 1, -- Ghost
- N, -- Dragon
- 1, -- Dark
- S, -- Steel
- 1, -- Fairy
- },
- { -- WATER
- 1, -- None
- 1, -- Normal
- S, -- Fire
- N, -- Water
- 1, -- Electric
- N, -- Grass
- 1, -- Ice
- 1, -- Fighting
- 1, -- Poison
- S, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- S, -- Rock
- 1, -- Ghost
- N, -- Dragon
- 1, -- Dark
- 1, -- Steel
- 1, -- Fairy
- },
- { -- ELECTRIC
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- S, -- Water
- N, -- Electric
- 1, -- Grass
- 1, -- Ice
- 1, -- Fighting
- 1, -- Poison
- I, -- Ground
- S, -- Flying
- 1, -- Psychic
- 1, -- Bug
- 1, -- Rock
- 1, -- Ghost
- N, -- Dragon
- 1, -- Dark
- 1, -- Steel
- 1, -- Fairy
- },
- { -- GRASS
- 1, -- None
- 1, -- Normal
- N, -- Fire
- S, -- Water
- 1, -- Electric
- N, -- Grass
- 1, -- Ice
- 1, -- Fighting
- N, -- Poison
- S, -- Ground
- N, -- Flying
- 1, -- Psychic
- N, -- Bug
- S, -- Rock
- 1, -- Ghost
- N, -- Dragon
- 1, -- Dark
- N, -- Steel
- 1, -- Fairy
- },
- { -- ICE
- 1, -- None
- 1, -- Normal
- N, -- Fire
- N, -- Water
- 1, -- Electric
- S, -- Grass
- N, -- Ice
- 1, -- Fighting
- 1, -- Poison
- S, -- Ground
- S, -- Flying
- 1, -- Psychic
- 1, -- Bug
- 1, -- Rock
- 1, -- Ghost
- S, -- Dragon
- 1, -- Dark
- N, -- Steel
- 1, -- Fairy
- },
- { -- FIGHTING
- 1, -- None
- S, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- S, -- Ice
- 1, -- Fighting
- N, -- Poison
- 1, -- Ground
- N, -- Flying
- N, -- Psychic
- N, -- Bug
- S, -- Rock
- I, -- Ghost
- 1, -- Dragon
- S, -- Dark
- S, -- Steel
- N, -- Fairy
- },
- { -- POISON
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- S, -- Grass
- 1, -- Ice
- 1, -- Fighting
- N, -- Poison
- N, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- N, -- Rock
- N, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- I, -- Steel
- S, -- Fairy
- },
- { -- GROUND
- 1, -- None
- 1, -- Normal
- S, -- Fire
- 1, -- Water
- S, -- Electric
- N, -- Grass
- 1, -- Ice
- 1, -- Fighting
- S, -- Poison
- 1, -- Ground
- I, -- Flying
- 1, -- Psychic
- N, -- Bug
- S, -- Rock
- 1, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- S, -- Steel
- 1, -- Fairy
- },
- { -- FLYING
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- N, -- Electric
- S, -- Grass
- 1, -- Ice
- S, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- S, -- Bug
- N, -- Rock
- 1, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- N, -- Steel
- 1, -- Fairy
- },
- { -- PSYCHIC
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- S, -- Fighting
- S, -- Poison
- 1, -- Ground
- 1, -- Flying
- N, -- Psychic
- N, -- Bug
- 1, -- Rock
- 1, -- Ghost
- 1, -- Dragon
- I, -- Dark
- N, -- Steel
- 1, -- Fairy
- },
- { -- BUG
- 1, -- None
- 1, -- Normal
- N, -- Fire
- 1, -- Water
- 1, -- Electric
- S, -- Grass
- 1, -- Ice
- 1, -- Fighting
- N, -- Poison
- 1, -- Ground
- N, -- Flying
- S, -- Psychic
- 1, -- Bug
- 1, -- Rock
- N, -- Ghost
- 1, -- Dragon
- S, -- Dark
- N, -- Steel
- N, -- Fairy
- },
- { -- ROCK
- 1, -- None
- 1, -- Normal
- S, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- S, -- Ice
- N, -- Fighting
- 1, -- Poison
- N, -- Ground
- S, -- Flying
- 1, -- Psychic
- S, -- Bug
- N, -- Rock
- 1, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- N, -- Steel
- 1, -- Fairy
- },
- { -- GHOST
- 1, -- None
- I, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- 1, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- S, -- Psychic
- 1, -- Bug
- 1, -- Rock
- S, -- Ghost
- 1, -- Dragon
- N, -- Dark
- 1, -- Steel
- 1, -- Fairy
- },
- { -- DRAGON
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- 1, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- 1, -- Rock
- 1, -- Ghost
- S, -- Dragon
- 1, -- Dark
- N, -- Steel
- I, -- Fairy
- },
- { -- DARK
- 1, -- None
- 1, -- Normal
- 1, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- N, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- S, -- Psychic
- 1, -- Bug
- 1, -- Rock
- S, -- Ghost
- 1, -- Dragon
- N, -- Dark
- 1, -- Steel
- N, -- Fairy
- },
- { -- STEEL
- 1, -- None
- 1, -- Normal
- N, -- Fire
- N, -- Water
- N, -- Electric
- 1, -- Grass
- S, -- Ice
- N, -- Fighting
- 1, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- S, -- Rock
- 1, -- Ghost
- 1, -- Dragon
- 1, -- Dark
- N, -- Steel
- S, -- Fairy
- },
- { -- FAIRY
- 1, -- None
- 1, -- Normal
- N, -- Fire
- 1, -- Water
- 1, -- Electric
- 1, -- Grass
- 1, -- Ice
- S, -- Fighting
- N, -- Poison
- 1, -- Ground
- 1, -- Flying
- 1, -- Psychic
- 1, -- Bug
- 1, -- Rock
- 1, -- Ghost
- S, -- Dragon
- S, -- Dark
- N, -- Steel
- 1, -- Fairy
- }
- }
- -- Prints the data of every Pokemon (commenting formatting has to be weird sry)
- --for n, data in ipairs(dex) do
- -- io.write(data[1].." - "..types[data[2]])
- -- if data[3] ~= 1 then io.write("/"..types[data[3]]) end
- --[[ io.write(" - "..data[4].." HP / "..data[5].." ATK - ")
- for i = 6, 9 do
- io.write(data[i])
- if i~=9 then io.write(", ") else io.write("\n") end
- end
- end
- print()
- --]]
- -- Prints the data of every move (commenting formatting has to be weird sry)
- --for n, data in ipairs(movedex) do
- -- io.write(data[1].." - "..types[data[4]].." - "..data[2].." POW, "..data[3].."% ACC\n")
- --end
- -- Verifies that every move on every Pokemon is a move with data in the movedex (commenting formatting has to be weird sry)
- --for n, data in ipairs(dex) do
- -- for i = 6, 9 do
- -- if not movedex[data[i]] then print("Error! Move \""..data[i].."\" not found in movedex. This move is on "..data[1]..".") end
- --[[ end
- end
- ]]
- -- Actual calculator code
- local unc = "zxc" -- only make it 3 characters
- -- Prints the data of two given mons and returns move dmg
- local function printData(index1, index2)
- local m1 = dex[index1]
- local m2 = dex[index2]
- local s1 = {}
- local s2 = {}
- print("Monster 1: "..m1[1].." - "..m1[4].." HP, "..m1[5].." ATK")
- for i = 1, 4 do
- local move = m1[i+5]
- local myType = movedex[move][3]
- local dmg = 0
- if move == "FoulPlay" then
- dmg = m2[5]*movedex[move][1]*typechart[myType][m2[2]]*typechart[myType][m2[3]]/400
- else
- dmg = m1[5]*movedex[move][1]*typechart[myType][m2[2]]*typechart[myType][m2[3]]/400
- end
- if myType == m1[2] or myType == m1[3] then dmg=dmg*STAB end
- print(i..": "..move.." - "..dmg)
- s1[i] = {move, dmg}
- end
- print("\nMonster 2: "..m2[1].." - "..m2[4].." HP, "..m2[5].." ATK")
- for i = 1, 4 do
- local move = m2[i+5]
- local myType = movedex[move][3]
- local dmg = m2[5]*movedex[move][1]*typechart[myType][m1[2]]*typechart[myType][m1[3]]/400
- if myType == m2[2] or myType == m2[3] then dmg=dmg*STAB end
- print(i..": "..move.." - "..dmg.."")
- s2[i] = {move, dmg}
- end
- print()
- return s1, s2
- end
- local saveMode = 0 -- 0 is auto, 1 is manual
- local printMode = 0 -- 0 is dashes, 1 is brackets, 2 is both
- local lotsaData = {}
- -- Format of lotsaData (a dictionary):
- -- Suppose Ho-oh is me and Lugia and Mewtwo was the enemy
- -- ["Lugia"] = {hoohChain, hoohSum, lugiaChain, lugiaSum},
- -- ["Mewtwo"] = {hoohChain, hoohSum, mewtwoChain, mewtwoSum}
- -- Adds an entry to lotsaData
- local function saveTo(myData)
- if not lotsaData[myData[2]] then lotsaData[myData[2]] = {nil, nil, nil, nil} end
- local place = lotsaData[myData[2]]
- local n = 1
- if myData[1] == 2 then n = 3 end
- place[n] = string.sub(myData[3], 3)
- place[n+1] = myData[4]
- end
- -- Returns damage and formatted string of a move chain
- local function printWithMode(chain, moveInfo, nmeI)
- local moveString = ""
- local sum = 0
- if (printMode == 1 or printMode == 2) then moveString = "[" end
- for i = 1, string.len(chain) do
- if string.sub(chain, i, i) == "0" then
- moveString = moveString.."nothing "
- else
- local place = moveInfo[tonumber(string.sub(chain, i, i))]
- moveString = moveString..place[1].." "
- if place[1] == "SuperFang" then
- sum = (sum + dex[nmeI][4])/2
- else
- sum = sum + place[2]
- end
- end
- if (printMode == 0 or printMode == 2) and i<string.len(chain) then
- moveString = moveString.."- "
- end
- end
- if (printMode == 1 or printMode == 2) then moveString = string.sub(moveString, 1, string.len(moveString)-1).."]" end
- return moveString, sum
- end
- 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)")
- local myIndex
- local oppIndex = 1
- repeat
- myIndex = 1
- local m = io.read()
- while dex[myIndex]~=nil and dex[myIndex][1]~=m do myIndex=myIndex+1 end
- if dex[myIndex]==nil then
- print("not found")
- end
- until dex[myIndex]~=nil
- print("We will begin at "..dex[1][1]..". Type \"help\" to see a tutorial.\n")
- local s1, s2 = printData(myIndex, 1)
- local toSave = {}
- while true do
- local c = string.upper(io.read())
- for n = string.len(c), 1, -1 do
- if string.sub(c, n, n) == " " then c = string.sub(c, 1, n-1)..string.sub(c, n+1) end
- end
- if c == "HELP" then
- 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")
- 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.")
- 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.")
- 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.")
- print("Hopefully this helped! Match data will be reprinted below.\n")
- printData(myIndex, oppIndex)
- elseif c == "SAVEHELP" then
- 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")
- 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.")
- print("\nThe save key will keep track of your print mode and save mode.")
- print("Hopefully this helped! Match data will be reprinted below.\n")
- printData(myIndex, oppIndex)
- elseif c == "N" or c == "NEXT" then
- oppIndex = oppIndex+1
- s1, s2 = printData(myIndex, oppIndex)
- elseif c == "S" or c == "SEARCH" then
- print("What mon? (no spaces)")
- local tempMon = io.read()
- local temp = 1
- while dex[temp]~=nil and dex[temp][1]~=tempMon do temp=temp+1 end
- if dex[temp]==nil then
- print("not found")
- else
- oppIndex = temp
- end
- s1, s2 = printData(myIndex, oppIndex)
- elseif (string.sub(c, 1, 2) == "1:" or string.sub(c, 1, 2) == "2:") and tonumber(string.sub(c, 3)) then
- local passable = true
- for i = 3, string.len(c) do
- local f = string.sub(c,i,i)
- if not (f=="1" or f=="2" or f=="3" or f=="4") then
- passable = false
- end
- end
- if passable then
- local user = s1
- local userI = myIndex
- local nmeI = oppIndex
- if string.sub(c, 1, 1) == "2" then user = s2 userI = oppIndex nmeI = myIndex end
- local moveString, sum = printWithMode(string.sub(c, 3), user, nmeI)
- io.write(moveString.."\n"..sum.." DMG, ")
- local diff = dex[nmeI][4]-sum
- if diff>0 then
- print(diff.." HP left")
- else
- print("Overkill by "..diff*-1)
- end
- print("This number is equal to a move of raw POW "..math.abs(diff*400/dex[userI][5]))
- toSave = {tonumber(string.sub(c, 1, 1)), dex[oppIndex][1], c, sum}
- local curName = lotsaData[dex[oppIndex][1]]
- local sumSpot = toSave[1]*2
- if diff<=0 and (not curName or not curName[sumSpot] or
- (curName[sumSpot]>=sum and
- string.len(c)-2<=string.len(curName[sumSpot-1]))) then
- print("Saving the latest movestring.")
- saveTo(toSave)
- end
- print()
- else
- print("Invalid, try again.\n")
- end
- elseif c == "MODE" then
- print("What mode to switch? (either print or save)")
- local took = string.upper(io.read())
- if took == "PRINT" then
- print("To what? (0 is dash, 1 is brackets, 2 is both)")
- took = tonumber(io.read())
- if took and (took == 0 or took == 1 or took == 2) then
- printMode = took
- print("Updated successfully.")
- else
- print("Invalid, try again.\n")
- end
- elseif took == "SAVE" then
- print("To what? (0 is auto, 1 is manual)")
- took = tonumber(io.read())
- if took and (took == 0 or took == 1) then
- print("Updated successfully.")
- else
- print("Invalid, try again.\n")
- end
- else
- print("Invalid, try again.\n")
- end
- elseif c == "SAVE" then
- print("Saving the latest movestring.\n")
- saveTo(toSave)
- elseif c == "DATA" then
- print("Printing data now...\n--------------------\n")
- local i = 1
- local me = dex[myIndex][1]
- local mine = {{dex[myIndex][6], 0}, {dex[myIndex][7], 0}, {dex[myIndex][8], 0}, {dex[myIndex][9], 0}}
- local wins = ""
- local losses = ""
- local ties = ""
- repeat
- local him = dex[i][1]
- if lotsaData[him] then
- local his = {{dex[i][6], 0}, {dex[i][7], 0}, {dex[i][8], 0}, {dex[i][9], 0}}
- local hisLen = math.huge
- local myLen = math.huge
- io.write(me.." vs "..him.."\n"..me..": ")
- local n = "nil"
- if lotsaData[him][1] then
- n = printWithMode(lotsaData[him][1], mine, i)
- myLen = string.len(lotsaData[him][1])
- end
- io.write(n.."\n"..him..": ")
- n = "nil"
- if lotsaData[him][3] then
- n = printWithMode(lotsaData[him][3], his, i)
- hisLen = string.len(lotsaData[him][3])
- end
- print(n)
- if myLen>hisLen then
- print(him.." wins\n")
- losses = losses..him.." "
- elseif myLen<hisLen then
- print(me.." wins\n")
- wins = wins..him.." "
- else
- print("Tie (probably)")
- ties = ties..him.." "
- end
- end
- i=i+1
- until i>=#dex
- print("\n"..me.."\'s Counters:\n"..losses.."\n\n"..me.."\'s Equals:\n"..ties.."\n\n"..me.."\'s Victims:\n"..wins)
- print("\n------------------\nDone printing all the data!\n")
- elseif c == "KEY" then
- local key = unc..saveMode..printMode
- for k, v in pairs(lotsaData) do
- key = key..k..unc
- for i = 1, 4 do
- if v[i] then
- key = key..v[i]..unc
- else
- key = key.."nil"..unc
- end
- end
- end
- print("Key's done making!!! Here you go:\n"..key.."\n")
- elseif c == "LOAD" then
- print("Got a key?")
- local key = io.read()
- unc = string.sub(key, 1, 3)
- saveMode = tonumber(string.sub(key, 4, 4))
- printMode = tonumber(string.sub(key, 5, 5))
- key = string.sub(key, 6)
- while string.len(key)>0 do
- local n = 1
- while string.sub(key, n, n+2)~=unc do n=n+1 end
- local theName = string.sub(key, 0, n-1)
- if not lotsaData[theName] then
- lotsaData[theName] = {nil, nil, nil, nil}
- end
- key = string.sub(key, n+3)
- for i = 1, 4 do
- n = 1
- while string.sub(key, n, n+2)~=unc do n=n+1 end
- lotsaData[theName][i] = tonumber(string.sub(key, 0, n-1))
- key = string.sub(key, n+3)
- end
- end
- print("All loaded!\n")
- elseif c == "FUN" or c == "TERMINATE" then
- 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.")
- else
- print("Invalid, try again.\n")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement