From 9d2e14e7447bcd5048837876294df2f264211976 Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Mon, 27 Apr 2015 23:22:24 -0700 Subject: [PATCH] Update data tracking --- ai/control.lua | 1 + ai/red/strategies.lua | 13 +++++++++---- ai/strategies.lua | 2 +- data/data.lua | 21 ++++++++++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ai/control.lua b/ai/control.lua index 2652ebd..d1ddabe 100644 --- a/ai/control.lua +++ b/ai/control.lua @@ -327,6 +327,7 @@ function Control.encounter(battleState) encounters = encounters + 1 Paint.wildEncounters(encounters) Bridge.encounter() + Data.increment("encounters") if encountersSection then Data.increment(encountersSection) diff --git a/ai/red/strategies.lua b/ai/red/strategies.lua index ff04739..b8fc86e 100644 --- a/ai/red/strategies.lua +++ b/ai/red/strategies.lua @@ -304,14 +304,19 @@ end strategyFunctions.fightBulbasaur = function() if status.tries < 9000 and Pokemon.index(0, "level") == 6 then if status.tries > 200 then - stats.squirtle = { + local attDV, defDV, spdDV, sclDV = Pokemon.getDVs("squirtle") + stats.starter = { attack = Pokemon.index(0, "attack"), defense = Pokemon.index(0, "defense"), speed = Pokemon.index(0, "speed"), special = Pokemon.index(0, "special"), + attackDV = attDV, + defenseDV = defDV, + speedDV = spdDV, + specialDV = sclDV, } - if stats.squirtle.attack < 11 and stats.squirtle.special < 12 then - return Strategies.reset("stats", "Bad Squirtle - "..stats.squirtle.attack.." attack, "..stats.squirtle.special.." special") + if stats.starter.attack < 11 and stats.starter.special < 12 then + return Strategies.reset("stats", "Bad Squirtle - "..stats.starter.attack.." attack, "..stats.starter.special.." special") end status.tries = 9001 else @@ -2028,7 +2033,7 @@ end function Strategies.initGame(midGame) if midGame then Strategies.setYolo("bulbasaur", true) - stats.squirtle = { + stats.starter = { attack = 11, defense = 11, speed = 11, diff --git a/ai/strategies.lua b/ai/strategies.lua index 90c7582..9b4bc35 100644 --- a/ai/strategies.lua +++ b/ai/strategies.lua @@ -49,7 +49,7 @@ function Strategies.hardReset(reason, message, extra, wait) end local map, px, py = Memory.value("game", "map"), Player.position() - Data.reset(reason, Control.areaName, map, px, py) + Data.reset(reason, Control.areaName, map, px, py, stats) Bridge.chat(message, false, extra) if wait and INTERNAL and not STREAMING_MODE then diff --git a/data/data.lua b/data/data.lua index 62fb242..7ea28ec 100644 --- a/data/data.lua +++ b/data/data.lua @@ -42,7 +42,7 @@ end -- REPORT -function Data.reset(reason, areaName, map, px, py) +function Data.reset(reason, areaName, map, px, py, stats) if STREAMING_MODE then local report = Data.run report.cutter = require("storage.pokemon").inParty("paras", "oddish", "sandshrew", "charmander") @@ -53,9 +53,24 @@ function Data.reset(reason, areaName, map, px, py) end end - report.version = Data.versionNumber - report.gameName = Data.gameName + local ns = stats.nidoran + if ns then + report.nido_attack = ns.attackDV + report.nido_defense = ns.defenseDV + report.nido_speed = ns.speedDV + report.nido_special = ns.specialDV + report.nido_level = ns.level4 and 4 or 3 + end + local ss = stats.starter + if ss then + report.starter_attack = ss.attackDV + report.starter_defense = ss.defenseDV + report.starter_speed = ss.speedDV + report.starter_special = ss.specialDV + end + + report.version = Data.versionNumber report.reset_area = areaName report.reset_map = map report.reset_x = px