Highlight pomanders when they are used on a floor

main
sigonasr2 3 years ago
parent e1ef49e33b
commit cf66eb2378
  1. 10
      src/App.css
  2. 19
      src/App.css.bak
  3. 10
      src/App.js
  4. 11
      src/App.js.bak
  5. 130
      src/backend/data.json
  6. 3
      src/backend/logreader.js
  7. 22
      src/backend/logreader.js.bak

@ -12,6 +12,16 @@
width:56px;
height:56px;
}
.dotused {
background-color:rgba(0,0,0,0.0);
border:4px solid rgba(255,255,150,0.9);
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
width:56px;
height:56px;
}
.smoldotgreen {
background-color:rgba(0,0,0,0.0);
border:4px solid rgba(150,255,150,0.8);

@ -12,6 +12,25 @@
width:56px;
height:56px;
}
.dotused {
background-color:rgba(0,0,0,0.0);
border:4px solid rgba(255,255,150,0.6);
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
width:56px;
height:56px;
}
.smoldotgreen {
background-color:rgba(0,0,0,0.0);
border:4px solid rgba(150,255,150,0.8);
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
width:48px;
height:52px;
}
.smoldot {
background-color:rgba(0,0,0,0.0);
border:4px solid rgba(255,150,150,0.8);

@ -52,11 +52,13 @@ function App() {
(key==="raising"&&i===14)||
(key==="resolution"&&i===15)) {
if (data.floor_storage[key]>0) {
return true
return 1
} else {
return 2
}
}
}
return false
return 0
}
return (
<>
@ -69,7 +71,7 @@ function App() {
{
data.pomander.map((pom,i)=>{
return <>
{NameMatches(i)&&<div className="floating dot" style={{left:50+(i%6)*64,top:88+Math.floor(i/6)*64,fontSize:24}}/>}
{NameMatches(i)==1?<div className="floating dot" style={{left:50+(i%6)*64,top:88+Math.floor(i/6)*64,fontSize:24}}/>:NameMatches(i)==2&&<div className="floating dotused" style={{left:50+(i%6)*64,top:88+Math.floor(i/6)*64,fontSize:24}}/>}
<div className="floating current" style={{left:48+(i%6)*64,top:80+Math.floor(i/6)*64,fontSize:24}}>
{pom[1]}</div>
<div className="floating alltime" style={{left:48+(i%6)*64,top:104+Math.floor(i/6)*64,fontSize:24}}>
@ -114,7 +116,7 @@ function App() {
<div className="floating current" style={{left:345-CenterAlignAdjust(data.death_count[0],32),top:416,fontSize:32}}>
{data.death_count[0]}</div>
<div className="floating alltime" style={{left:422-CenterAlignAdjust(data.death_count[0],32),top:464,fontSize:32}}>
{data.death_count[0]}</div>
{data.death_count[1]}</div>
{
data.floor_effects.map((eff,i)=>{
return <>

@ -52,11 +52,13 @@ function App() {
(key==="raising"&&i===14)||
(key==="resolution"&&i===15)) {
if (data.floor_storage[key]>0) {
return true
return 1
} else {
return 2
}
}
}
return false
return 0
}
return (
<>
@ -69,7 +71,7 @@ function App() {
{
data.pomander.map((pom,i)=>{
return <>
{NameMatches(i)&&<div className="floating dot" style={{left:50+(i%6)*64,top:88+Math.floor(i/6)*64,fontSize:24}}/>}
{NameMatches(i)==2?<div className="floating dot" style={{left:50+(i%6)*64,top:88+Math.floor(i/6)*64,fontSize:24}}/>:NameMatches(i)==1&&<div className="floating dotused" style={{left:50+(i%6)*64,top:88+Math.floor(i/6)*64,fontSize:24}}/>}
<div className="floating current" style={{left:48+(i%6)*64,top:80+Math.floor(i/6)*64,fontSize:24}}>
{pom[1]}</div>
<div className="floating alltime" style={{left:48+(i%6)*64,top:104+Math.floor(i/6)*64,fontSize:24}}>
@ -114,10 +116,9 @@ function App() {
<div className="floating current" style={{left:345-CenterAlignAdjust(data.death_count[0],32),top:416,fontSize:32}}>
{data.death_count[0]}</div>
<div className="floating alltime" style={{left:422-CenterAlignAdjust(data.death_count[0],32),top:464,fontSize:32}}>
{data.death_count[0]}</div>
{data.death_count[1]}</div>
{
data.floor_effects.map((eff,i)=>{
console.log(data.floor_buff_storage)
return <>
{i in data.floor_buff_storage&&<div className={"floating "+((i<=1)?"smoldotgreen":"smoldot")} style={{left:48+Math.floor(i/3)*96,top:528+(i%3)*48+((i<=1)?-4:0),fontSize:16}}/>}
<div className="floating current" style={{left:96+Math.floor(i/3)*96,top:534+(i%3)*48,fontSize:16}}>

@ -1,84 +1,84 @@
{
"pomander": [
[
3,
1,
6
2,
4,
19
],
[
3,
3,
12
27
],
[
3,
1,
24
4,
51
],
[
3,
1,
17
6,
42
],
[
3,
0,
7
],
[
3,
1,
5
15
],
[
3,
0,
2,
2,
14
],
[
3,
0,
8
3,
23
],
[
3,
3,
14
2,
2,
16
],
[
3,
1,
20
3,
32
],
[
3,
0,
13
3,
27
],
[
3,
1,
13
3,
25
],
[
2,
0,
8
0,
25
],
[
3,
1,
13
4,
20
],
[
3,
3,
25
],
[
0,
4
0,
7
],
[
1,
1,
8
0,
0,
13
]
],
"accursed_hoard": [
@ -88,7 +88,7 @@
],
[
0,
0
4
],
[
0,
@ -100,21 +100,21 @@
]
],
"mimics": [
14,
43,
0
],
"traps": [
[
1,
2
3,
7
],
[
0,
2
6
],
[
1,
2
2,
4
],
[
0,
@ -122,49 +122,49 @@
],
[
0,
1
5
]
],
"floor_effects": [
[
0,
0
1,
5
],
[
0,
2
3,
9
],
[
0,
4
1,
6
],
[
1,
5
0,
7
],
[
1,
2
0,
3
],
[
0,
0
1
],
[
1,
2
5
],
[
0,
1
2
],
[
0,
1
3
],
[
0,
0
2
],
[
0,
@ -173,15 +173,11 @@
],
"death_count": [
0,
3
5
],
"floor": 64,
"floor": 20,
"accursed_hoard_detected": false,
"previous_pomander": "fortune",
"floor_storage": {
"fortune": 1
},
"floor_buff_storage": {
"4": true
}
"previous_pomander": "",
"floor_storage": {},
"floor_buff_storage": {}
}

@ -158,6 +158,9 @@ function ParseString(str) {
pomander_name=pomander_name.substring(0,pomander_name.length-1)
var pomander_slot = GetPomanderSlot(pomander_name)
pomander[pomander_slot][0]-=1
if (!floor_storage.hasOwnProperty(pomander_name)) {
floor_storage[pomander_name]=0
}
update_file=true
} else
if (split[4].includes("uses a pomander of ")) {

@ -301,67 +301,67 @@ function ParseString(str) {
if (split[4].includes("An ancient enchantment stimulates your humours, increasing the speed with which you act.")) {
floor_effects[0][0]++
floor_effects[0][1]++
floor_buff_storage={0:true}
floor_buff_storage={...floor_buff_storage,0:true}
update_file=true
} else
if (split[4].includes("An ancient enchantment revitalizes your body and mind.")) {
floor_effects[1][0]++
floor_effects[1][1]++
floor_buff_storage={1:true}
floor_buff_storage={...floor_buff_storage,1:true}
update_file=true
} else
if (split[4].includes("The gathering gloom appears to invigorate the floor's denizens.")) {
floor_effects[2][0]++
floor_effects[2][1]++
floor_buff_storage={2:true}
floor_buff_storage={...floor_buff_storage,2:true}
update_file=true
} else
if (split[4].includes("An ancient enchantment clouds your eyes, making it difficult to discern your quarry.")) {
floor_effects[3][0]++
floor_effects[3][1]++
floor_buff_storage={3:true}
floor_buff_storage={...floor_buff_storage,3:true}
update_file=true
} else
if (split[4].includes("The items in your bag have temporarily transformed into worthless stone.")) {
floor_effects[4][0]++
floor_effects[4][1]++
floor_buff_storage={4:true}
floor_buff_storage={...floor_buff_storage,4:true}
update_file=true
} else
if (split[4].includes("An ancient enchantment clouds your mind, making it impossible to remember previously learned abilities.")) {
floor_effects[5][0]++
floor_effects[5][1]++
floor_buff_storage={5:true}
floor_buff_storage={...floor_buff_storage,5:true}
update_file=true
} else
if (split[4].includes("An ancient enchantment saps your health.")) {
floor_effects[6][0]++
floor_effects[6][1]++
floor_buff_storage={6:true}
floor_buff_storage={...floor_buff_storage,6:true}
update_file=true
} else
if (split[4].includes("An ancient enchantment saps your very strength, weakening your blows.")) {
floor_effects[7][0]++
floor_effects[7][1]++
floor_buff_storage={7:true}
floor_buff_storage={...floor_buff_storage,7:true}
update_file=true
} else
if (split[4].includes("Your body is fatigued and wounds refuse to heal on their own.")) {
floor_effects[8][0]++
floor_effects[8][1]++
floor_buff_storage={8:true}
floor_buff_storage={...floor_buff_storage,8:true}
update_file=true
} else
if (split[4].includes("Your entire body feels heavy.")) {
floor_effects[9][0]++
floor_effects[9][1]++
floor_buff_storage={9:true}
floor_buff_storage={...floor_buff_storage,9:true}
update_file=true
} else
if (split[4].includes("You find yourself short of breath, unable to sprint.")) {
floor_effects[10][0]++
floor_effects[10][1]++
floor_buff_storage={10:true}
floor_buff_storage={...floor_buff_storage,10:true}
update_file=true
}

Loading…
Cancel
Save