@ -23,9 +23,9 @@ const parse = require('csv-parse/lib/sync')
const BACKEND _URL = process . env . REACT _APP _GITPOD _WORKSPACE _URL || process . env . REACT _APP _BACKEND _URL || 'https://projectdivar.com:4504' ; //You can specify a .env file locally with REACT_APP_BACKEND_URL defining a URL to retrieve data from.
const BACKEND _URL = process . env . REACT _APP _GITPOD _WORKSPACE _URL || process . env . REACT _APP _BACKEND _URL || 'https://projectdivar.com:4504' ; //You can specify a .env file locally with REACT_APP_BACKEND_URL defining a URL to retrieve data from.
const MELEE _DMG = 0
/ * c o n s t M E L E E _ D M G = 0
const RANGE _DMG = 1
const RANGE _DMG = 1
const TECH _DMG = 2
const TECH _DMG = 2 //NOT USED YET*/
function Col ( p ) {
function Col ( p ) {
return < div className = "con" >
return < div className = "con" >
@ -431,7 +431,6 @@ function TableEditor(p) {
const [ dependencies , setDependencies ] = useState ( [ ] )
const [ dependencies , setDependencies ] = useState ( [ ] )
const [ importAllowed , setImportAllowed ] = useState ( false )
const [ importAllowed , setImportAllowed ] = useState ( false )
const [ fileData , setFileData ] = useState ( undefined )
const [ fileData , setFileData ] = useState ( undefined )
const [ debugMessage , setDebugMessage ] = useState ( "" )
function SubmitBoxes ( ) {
function SubmitBoxes ( ) {
axios . post ( BACKEND _URL + p . path , submitVals )
axios . post ( BACKEND _URL + p . path , submitVals )
@ -461,7 +460,7 @@ function TableEditor(p) {
. then ( ( ) => {
. then ( ( ) => {
setUpdate ( true )
setUpdate ( true )
} )
} )
} , [ fileData ] )
} , [ fileData , p . path ] )
useEffect ( ( ) => {
useEffect ( ( ) => {
for ( var col of fields ) {
for ( var col of fields ) {
@ -513,7 +512,6 @@ function TableEditor(p) {
}
}
reader . readAsText ( f . target . files [ 0 ] )
reader . readAsText ( f . target . files [ 0 ] )
} } style = { { opacity : 0 } } id = "uploads" type = "file" accept = ".txt,.csv" / > < / c a p t i o n > }
} } style = { { opacity : 0 } } id = "uploads" type = "file" accept = ".txt,.csv" / > < / c a p t i o n > }
{ JSON . stringify ( debugMessage ) }
< thead >
< thead >
< tr >
< tr >
< th className = "table-padding" > < / t h >
< th className = "table-padding" > < / t h >
@ -649,7 +647,7 @@ function EditStatBox(p) {
function DamageCalculator ( p ) {
function DamageCalculator ( p ) {
const [ augmentData , setAugmentData ] = useState ( { } )
const [ augmentData , setAugmentData ] = useState ( { } )
const [ update , setUpdate ] = useState ( false )
//const [update,setUpdate] = useState(false)
useEffect ( ( ) => {
useEffect ( ( ) => {
axios . get ( BACKEND _URL + "/augment" )
axios . get ( BACKEND _URL + "/augment" )
@ -658,7 +656,7 @@ function DamageCalculator(p) {
data . data . rows . forEach ( ( entry ) => { augmentData [ entry . id ] = entry } )
data . data . rows . forEach ( ( entry ) => { augmentData [ entry . id ] = entry } )
setAugmentData ( augmentData )
setAugmentData ( augmentData )
} )
} )
} , [ update ] )
} , [ ] )
const character = {
const character = {
weapon : {
weapon : {
@ -677,22 +675,18 @@ function DamageCalculator(p) {
useEffect ( ( ) => {
useEffect ( ( ) => {
if ( Object . keys ( augmentData ) . length > 0 ) {
if ( Object . keys ( augmentData ) . length > 0 ) {
ParseAllAugments ( character )
var searchFields = [ { field : "variance" , variable : 0 } , { field : "mel_dmg" , variable : 0 } ]
}
for ( var equip of [ character . weapon , character . armor1 , character . armor2 , character . armor3 ] ) {
} , [ augmentData ] )
for ( var field of searchFields ) {
for ( var i = 0 ; i < equip . augments . length ; i ++ ) {
function ParseAllAugments ( character ) {
var variance = augmentData [ equip . augments [ i ] ] [ field . field ]
var searchFields = [ { field : "variance" , variable : 0 } , { field : "mel_dmg" , variable : 0 } ]
field . variable += variance
for ( var equip of [ character . weapon , character . armor1 , character . armor2 , character . armor3 ] ) {
}
for ( var field of searchFields ) {
for ( var i = 0 ; i < equip . augments . length ; i ++ ) {
var variance = augmentData [ equip . augments [ i ] ] [ field . field ]
field . variable += variance
}
}
}
}
setAugDmgVariance ( searchFields [ 0 ] . variable )
}
}
setAugDmgVariance ( searchFields [ 0 ] . variable )
} , [ augmentData , character . armor1 , character . armor2 , character . armor3 , character . weapon ] )
}
const [ rawDmg , setRawDmg ] = useState ( 0 )
const [ rawDmg , setRawDmg ] = useState ( 0 )