From 728debca63dee06adf815201652d55e8992e5f65 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 27 Mar 2022 09:21:19 -0500 Subject: [PATCH] Fix false start detection to actually update the file. Include detonations via silvers. --- src/backend/data.json | 179 ++++++++++++++++++----------------- src/backend/data.json.bak | 37 ++++---- src/backend/logreader.js | 46 +++++---- src/backend/logreader.js.bak | 49 ++++++---- 4 files changed, 169 insertions(+), 142 deletions(-) diff --git a/src/backend/data.json b/src/backend/data.json index f9668e7..af4faed 100644 --- a/src/backend/data.json +++ b/src/backend/data.json @@ -1,94 +1,94 @@ { "pomander": [ [ - 0, - 0, - 95 + 3, + 12, + 109 ], [ - 0, - 0, - 132 + 3, + 17, + 151 ], [ - 0, - 0, - 191 + 3, + 26, + 220 ], [ - 0, - 0, - 176 + 3, + 33, + 210 ], [ - 0, - 0, - 61 + 3, + 14, + 76 ], [ - 0, - 0, - 75 + 3, + 10, + 85 ], [ - 0, - 0, - 84 + 3, + 7, + 91 ], [ - 0, - 0, - 84 + 3, + 9, + 93 ], [ - 0, - 0, - 121 + 3, + 17, + 140 ], [ - 0, - 0, - 116 + 3, + 13, + 130 ], [ - 0, - 0, - 90 + 2, + 13, + 103 ], [ - 0, - 0, - 95 + 3, + 13, + 108 ], [ - 0, - 0, - 110 + 2, + 15, + 127 ], [ - 0, - 0, - 117 + 3, + 20, + 137 ], [ - 0, - 0, - 34 + 1, + 1, + 35 ], [ - 0, - 0, - 45 + 1, + 1, + 46 ] ], "accursed_hoard": [ [ - 0, - 19 + 8, + 27 ], [ - 0, - 35 + 4, + 39 ], [ 0, @@ -100,63 +100,63 @@ ] ], "mimics": [ - 0, - 0 + 221, + 10 ], "traps": [ [ - 0, - 26 + 5, + 31 ], [ - 0, - 19 + 3, + 22 ], [ - 0, - 43 + 8, + 51 ], [ - 0, - 37 + 8, + 46 ], [ - 0, - 20 + 3, + 23 ] ], "floor_effects": [ [ - 0, - 24 + 5, + 30 ], [ - 0, - 30 + 1, + 32 ], [ - 0, - 21 + 1, + 22 ], [ - 0, - 26 + 4, + 30 ], [ - 0, - 14 + 2, + 16 ], [ - 0, - 9 + 1, + 10 ], [ - 0, - 23 + 2, + 26 ], [ - 0, - 16 + 2, + 18 ], [ 0, @@ -167,26 +167,27 @@ 12 ], [ - 0, - 17 + 2, + 19 ] ], "death_count": [ 1, 10 ], - "floor": 0, + "floor": 70, "accursed_hoard_detected": false, "previous_pomander": "", "floor_storage": {}, "floor_buff_storage": {}, - "kills": 0, + "kills": 781, "rare_kills": 0, - "mimic": 0, - "mandragora": 0, - "currentLevel": 1, + "mimic": 18, + "mandragora": 2, + "currentLevel": 60, "startLevel": 1, - "points": 0, + "points": 893806, "fully_explored": true, - "time_bonus": true + "time_bonus": true, + "started": true } \ No newline at end of file diff --git a/src/backend/data.json.bak b/src/backend/data.json.bak index 21e6702..df7239d 100644 --- a/src/backend/data.json.bak +++ b/src/backend/data.json.bak @@ -3,27 +3,27 @@ [ 0, 0, - 95 + 97 ], [ 0, 0, - 132 + 134 ], [ + 0 0, - 0, - 191 + 194 ], [ 0, 0, - 176 + 177 ], [ 0, 0, - 61 + 62 ], [ 0, @@ -43,12 +43,12 @@ [ 0, 0, - 121 + 123 ], [ 0, 0, - 116 + 117 ], [ 0, @@ -63,7 +63,7 @@ [ 0, 0, - 110 + 112 ], [ 0, @@ -117,8 +117,8 @@ 43 ], [ - 1, - 37 + 0, + 38 ], [ 0, @@ -127,12 +127,12 @@ ], "floor_effects": [ [ - 1, - 24 + 0, + 25 ], [ - 1, - 30 + 0, + 31 ], [ 0, @@ -151,8 +151,8 @@ 9 ], [ - 1, - 23 + 0, + 24 ], [ 0, @@ -188,5 +188,6 @@ "startLevel": 1, "points": 0, "fully_explored": true, - "time_bonus": true + "time_bonus": true, + "started": false } \ No newline at end of file diff --git a/src/backend/logreader.js b/src/backend/logreader.js index e944073..76ea72c 100644 --- a/src/backend/logreader.js +++ b/src/backend/logreader.js @@ -456,12 +456,19 @@ function ParseString(str) { } else if (split[4].includes("This floor is being marked as incomplete.")) { fully_explored=false + update_file=true; } else if (split[4].includes("30 minutes remaining")) { time_bonus=false; + update_file=true; } else if (split[4].includes("You obtain ")&&split[4].includes(" gil.")) { started=false; + update_file=true; + } else + if (split[4].includes("The detonator is triggered! The treasure coffer is no more...")) { + points-=101 + update_file=true; } } else if (split.length==9 && split[0]==="33"&&split[3]==="10000007"&&split[6]==="FF"&&started) { @@ -470,6 +477,7 @@ function ParseString(str) { } else if (split.length==22&&started) { if (split[0]==="04") { + const blacklist=["trap","ruby carbuncle","topaz carbuncle","emerald carbuncle"] const RareMonsterNames=[ "bloated conjurer", "bloated archer", "bloated pugilist", "sword-swinging adventurer", "staff-spinning adventurer", "spear-shaking adventurer", "roughspun ruffian", "frenzied freebooter", "ishgardian pikeman", "duskwight lancer", "mortifying magnate", "insentient inquisitor", "moldering merchant", @@ -479,24 +487,28 @@ function ParseString(str) { //A kill is recorded. /*04|2022-03-26T08:59:44.8220000-05:00|4000C5B3|Palace Ziz|00|3|0000|00||4983|5775|0|125|0|10000|||201.28|-298.63|0.25|-1.78|9b83e6b7aea20b6b*/ var name = split[3] - if (RareMonsterNames.includes(name.toLowerCase())) { - rare_kills++ - points+=2020 - } else - if (name.toLowerCase()==="mimic"){ - mimic++; - points+=505 - } - if (name.toLowerCase()==="korrigan"|| - name.toLowerCase()==="mandragora"|| - name.toLowerCase()==="pygmaioi"){ - mandragora++; - points+=505 - } else { - points+=100+Math.floor(floor/2)+(floor>=101?101:0) - kills++; + if (!blacklist.includes(name.toLowerCase())&&split[11]==="0") { + if (RareMonsterNames.includes(name.toLowerCase())) { + rare_kills++ + points+=2020 + } else + if (name.toLowerCase()==="mimic"){ + mimic++; + points+=505 + } + if (name.toLowerCase()==="korrigan"|| + name.toLowerCase()==="mandragora"|| + name.toLowerCase()==="pygmaioi"){ + mandragora++; + points+=505 + } else { + points+=100+Math.floor(floor/2)+(floor>=101?101:0) + kills++; + } + console.log("Death for "+name+". ("+split[11]+"/"+split[12]+" HP)") + update_file=true; + } - update_file=true; } } if (update_file) { diff --git a/src/backend/logreader.js.bak b/src/backend/logreader.js.bak index 8833ef0..53abf05 100644 --- a/src/backend/logreader.js.bak +++ b/src/backend/logreader.js.bak @@ -132,6 +132,7 @@ if (fs.existsSync('./data.json')) { points=master_obj.points??0 fully_explored=master_obj.fully_explored??true time_bonus=master_obj.time_bonus??true + started=master_obj.started??false } @@ -167,6 +168,7 @@ function CreateMasterObj() { points:Math.max(points,0), fully_explored:fully_explored, time_bonus:time_bonus, + started:started, } } @@ -457,14 +459,21 @@ function ParseString(str) { } else if (split[4].includes("30 minutes remaining")) { time_bonus=false; + } else + if (split[4].includes("You obtain ")&&split[4].includes(" gil.")) { + started=false; + } else + if (split[4].includes("The detonator is triggered! The treasure coffer is no more...")) { + points-=101 } } else - if (split.length==9 && split[0]==="33"&&split[3]==="10000007"&&split[6]==="FF") { + if (split.length==9 && split[0]==="33"&&split[3]==="10000007"&&split[6]==="FF"&&started) { points+=101 //console.log("Treasure coffer: "+points) } else if (split.length==22&&started) { if (split[0]==="04") { + const blacklist=["trap","ruby carbuncle","topaz carbuncle","emerald carbuncle"] const RareMonsterNames=[ "bloated conjurer", "bloated archer", "bloated pugilist", "sword-swinging adventurer", "staff-spinning adventurer", "spear-shaking adventurer", "roughspun ruffian", "frenzied freebooter", "ishgardian pikeman", "duskwight lancer", "mortifying magnate", "insentient inquisitor", "moldering merchant", @@ -474,24 +483,28 @@ function ParseString(str) { //A kill is recorded. /*04|2022-03-26T08:59:44.8220000-05:00|4000C5B3|Palace Ziz|00|3|0000|00||4983|5775|0|125|0|10000|||201.28|-298.63|0.25|-1.78|9b83e6b7aea20b6b*/ var name = split[3] - if (RareMonsterNames.includes(name.toLowerCase())) { - rare_kills++ - points+=2020 - } else - if (name.toLowerCase()==="mimic"){ - mimic++; - points+=505 - } - if (name.toLowerCase()==="korrigan"|| - name.toLowerCase()==="mandragora"|| - name.toLowerCase()==="pygmaioi"){ - mandragora++; - points+=505 - } else { - points+=100+Math.floor(floor/2)+(floor>=101?101:0) - kills++; + if (!blacklist.includes(name.toLowerCase())&&split[11]==="0") { + if (RareMonsterNames.includes(name.toLowerCase())) { + rare_kills++ + points+=2020 + } else + if (name.toLowerCase()==="mimic"){ + mimic++; + points+=505 + } + if (name.toLowerCase()==="korrigan"|| + name.toLowerCase()==="mandragora"|| + name.toLowerCase()==="pygmaioi"){ + mandragora++; + points+=505 + } else { + points+=100+Math.floor(floor/2)+(floor>=101?101:0) + kills++; + } + console.log("Death for "+name+". ("+split[11]+"/"+split[12]+" HP)") + update_file=true; + } - update_file=true; } } if (update_file) {