Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
- Added EVERY weapon in the game, even some for 1.2.
- Full weapon editor, level presets, ascends, skills
- Enable/disable temporary weapon stats to see changes on character
- Shows raw damager of specific weapon damage skills
- Add "Misc Stats" to character page
- Replace unicode stars in artifact display with svgs
- Remove intermediary list that stores artfiact/character ids. It was "losing" items when they are still in storage.
- Reorder the titles of artifact display
- Update 5* crit rate mainstat values
  • Loading branch information
frzyc committed Dec 23, 2020
1 parent 040d9d8 commit c477f84
Show file tree
Hide file tree
Showing 242 changed files with 3,231 additions and 199 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": "https://frzyc.github.io/genshin-optimizer/",
"name": "genshin-optimizer",
"version": "2.1.1",
"version": "2.2.0",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.32",
Expand Down
38 changes: 21 additions & 17 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ $body-bg: $darkbg;
// }
html,
body {
height: 100%;
height: 100%;
}
#root {
min-height: 100%;
height: 100%;
min-height: 100%;
height: 100%;
}

.text-halfsize {
font-size: 50%;
}
$theme-colors: (
"lightcontent": $lightbg,
"darkcontent": $contentbg,
"darkercontent": $darkbg,
"lightfont": $lightfontcolor,
//gold
"5star": #ffd700,
//purple
"4star": #6a0dad,
//light blue
"3star": #4287f5,
//green
"2star": #008000,
//grey
"1star": #808080,
"lightcontent": $lightbg,
"darkcontent": $contentbg,
"darkercontent": $darkbg,
"lightfont": $lightfontcolor,
//gold
"5star": #ffd700,
//purple
"4star": #6a0dad,
//light blue
"3star": #4287f5,
//green
"2star": #008000,
//grey
"1star": #808080,
);

@import "node_modules/bootstrap/scss/bootstrap";
Expand Down
8 changes: 4 additions & 4 deletions src/Artifact/ArtifactCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ArtifactDatabase from './ArtifactDatabase';
import CharacterDatabase from '../Character/CharacterDatabase';
import { Dropdown, DropdownButton, OverlayTrigger, Tooltip } from 'react-bootstrap';
import Stat from '../Stat';
import { Stars } from '../Components/StarDisplay';
export default class ArtifactCard extends React.Component {
//the props is to update the artifacts in the list in the parent, which will update here.
equipOnChar(charId) {
Expand Down Expand Up @@ -46,12 +47,11 @@ export default class ArtifactCard extends React.Component {
</Card.Header>
<Card.Body className="d-flex flex-column">
<Card.Title>
<h6>{art.mainStatKey ? `${Stat.getStatName(art.mainStatKey).split("%")[0]} ${Artifact.getMainStatValue(art.mainStatKey, art.numStars, art.level)}${Stat.getStatUnit(art.mainStatKey)}` : null}</h6>
<div>{Artifact.getArtifactSetName(art.setKey, "Artifact Set")}</div>
<small className="text-halfsize"><Stars stars={art.numStars}/></small>
</Card.Title>
<Card.Subtitle>
<div>{Artifact.getArtifactSetName(art.setKey, "Artifact Set")}</div>
<div>{"🟊".repeat(art.numStars ? art.numStars : 0)}</div>

<b>{art.mainStatKey ? `${Stat.getStatName(art.mainStatKey).split("%")[0]} ${Artifact.getMainStatValue(art.mainStatKey, art.numStars, art.level)}${Stat.getStatUnit(art.mainStatKey)}` : null}</b>
</Card.Subtitle>
<ul className="mb-0">
{art.substats ? art.substats.map((stat, i) =>
Expand Down
43 changes: 14 additions & 29 deletions src/Artifact/ArtifactDatabase.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { deepClone, loadFromLocalStorage, saveToLocalStorage } from "../Util";

var initiated = false
var artifactDatabase = {};
var artifactIdList = [];
var artIdIndex = 1;
export default class ArtifactDatabase {
//do not instantiate.
Expand All @@ -12,28 +11,24 @@ export default class ArtifactDatabase {
}
static isInvalid = (art) =>
!art || !art.setKey || !art.numStars || !art.slotKey || !art.mainStatKey
static getIdListFromStorage = () => loadFromLocalStorage("artifact_id_list");
static saveIdListToStorage = () => saveToLocalStorage("artifact_id_list", artifactIdList);
static getArtifactDatabase = () => deepClone(artifactDatabase);
static getArtifactIdList = () => deepClone(artifactIdList);
static getArtifactIdList = () => Object.keys(artifactDatabase);
static populateDatebaseFromLocalStorage = () => {
if (artifactIdList.length > 0) return false;
if (initiated) return;
artIdIndex = parseInt(localStorage.getItem("artifact_highest_id"));
if (isNaN(artIdIndex)) artIdIndex = 0;
artifactIdList = ArtifactDatabase.getIdListFromStorage();
if (artifactIdList === null) artifactIdList = []
for (const id of artifactIdList) {
Object.keys(localStorage).filter(key => key.includes("artifact_")).forEach(id => {
if (!artifactDatabase[id]) {
let art = loadFromLocalStorage(id)
if (!art) break;
if (!art) return;
if (this.isInvalid(art)) {
this.removeArtifactById(id);
break;
return;
}
artifactDatabase[id] = art;
}
}
this.updateIdList();
})
initiated = true
return true
}
static getArtifact = (id) => id ? artifactDatabase[id] : null
Expand All @@ -46,33 +41,23 @@ export default class ArtifactDatabase {
let id = `artifact_${artIdIndex++}`
localStorage.setItem("artifact_highest_id", artIdIndex)
art.id = id;
art = deepClone(art)
saveToLocalStorage(id, art);
artifactDatabase[id] = art;
this.updateCacheData();
let dart = deepClone(art)
saveToLocalStorage(id, dart);
artifactDatabase[id] = dart;
return id;
}
static updateArtifact = (art) => {
if (this.isInvalid(art)) return;
let id = art.id;
art = deepClone(art)
saveToLocalStorage(id, art);
artifactDatabase[id] = art;
this.updateCacheData();
let dart = deepClone(art)
saveToLocalStorage(id, dart);
artifactDatabase[id] = dart;
}
static removeArtifactById = (artId) => {
delete artifactDatabase[artId];
localStorage.removeItem(artId);
this.updateCacheData();
}

static updateCacheData() {
this.updateIdList();
}
static updateIdList() {
artifactIdList = Object.keys(artifactDatabase)
this.saveIdListToStorage();
}
static moveToNewLocation = (artid, location) => {
if (!artid) return;
let art = this.getArtifact(artid)
Expand Down
4 changes: 3 additions & 1 deletion src/Assets/Assets.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import characters from './Characters/Characters'
import weapons from './Weapons/Weapons'

import anemo from './Element_Anemo.png'
import cryo from './Element_Cryo.png'
Expand All @@ -16,7 +17,8 @@ import sword from './Weapon-class-sword-icon.png'

let Assets = {
characters,
weapons,
elements: { anemo, cryo, dendro, electro, geo, hydro, pyro },
weapons: { bow, catalyst, claymore, polearm, sword }
weaponTypes: { bow, catalyst, claymore, polearm, sword }
};
export default Assets;
45 changes: 45 additions & 0 deletions src/Assets/Weapons/Bows/Bows.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import HuntersBow from './Weapon_Hunter\'s_Bow.png'
import SeasonedHuntersBow from './Weapon_Seasoned_Hunter\'s_Bow.png'
import EbonyBow from './Weapon_Ebony_Bow.png'
import Messenger from './Weapon_Messenger.png'
import RavenBow from './Weapon_Raven_Bow.png'
import RecurveBow from './Weapon_Recurve_Bow.png'
import SharpshootersOath from './Weapon_Sharpshooter\'s_Oath.png'
import Slingshot from './Weapon_Slingshot.png'
import TheStringless from './Weapon_The_Stringless.png'
import AlleyHunter from './Weapon_Alley_Hunter.png'
import BlackcliffWarbow from './Weapon_Blackcliff_Warbow.png'
import CompoundBow from './Weapon_Compound_Bow.png'
import FavoniusWarbow from './Weapon_Favonius_Warbow.png'
import PrototypeCrescent from './Weapon_Prototype_Crescent.png'
import RoyalBow from './Weapon_Royal_Bow.png'
import Rust from './Weapon_Rust.png'
import SacrificialBow from './Weapon_Sacrificial_Bow.png'
import TheViridescentHunt from './Weapon_The_Viridescent_Hunt.png'
import SkywardHarp from './Weapon_Skyward_Harp.png'
import AmosBow from './Weapon_Amos\'_Bow.png'
import DreamsOfDragonfell from './dreams_of_dragonfell.png'
const bows = {
HuntersBow,
SeasonedHuntersBow,
EbonyBow,
Messenger,
RavenBow,
RecurveBow,
SharpshootersOath,
Slingshot,
TheStringless,
AlleyHunter,
BlackcliffWarbow,
CompoundBow,
FavoniusWarbow,
PrototypeCrescent,
RoyalBow,
Rust,
SacrificialBow,
TheViridescentHunt,
SkywardHarp,
AmosBow,
DreamsOfDragonfell,
}
export default bows
Binary file added src/Assets/Weapons/Bows/Weapon_Alley_Hunter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Amos'_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Compound_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Ebony_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Hunter's_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Messenger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Raven_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Recurve_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Royal_Bow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Rust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Skyward_Harp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_Slingshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/Weapon_The_Stringless.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Weapons/Bows/dreams_of_dragonfell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions src/Assets/Weapons/Catalysts/Catalysts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import ApprenticesNotes from './Weapon_Apprentice\'s_Notes.png'
import PocketGrimoire from './Weapon_Pocket_Grimoire.png'
import AmberCatalyst from './Weapon_Amber_Catalyst.png'
import EmeraldOrb from './Weapon_Emerald_Orb.png'
import MagicGuide from './Weapon_Magic_Guide.png'
import OtherworldlyStory from './Weapon_Otherworldly_Story.png'
import ThrillingTalesOfDragonSlayers from './Weapon_Thrilling_Tales_of_Dragon_Slayers.png'
import TwinNephrite from './Weapon_Twin_Nephrite.png'
import BlackcliffAgate from './Weapon_Blackcliff_Amulet.png'
import FavoniusCodex from './Weapon_Favonius_Codex.png'
import MappaMare from './Weapon_Mappa_Mare.png'
import PrototypeMalice from './Weapon_Prototype_Malice.png'
import RoyalGrimoire from './Weapon_Royal_Grimoire.png'
import SacrificialFragments from './Weapon_Sacrificial_Fragments.png'
import SolarPearl from './Weapon_Solar_Pearl.png'
import TheWidsith from './Weapon_The_Widsith.png'
import WineAndSong from './Weapon_Wine_and_Song.png'
import Frostbearer from './Weapon_Frostbearer.png'
import LostPrayerToTheSacredWinds from './Weapon_Lost_Prayer_to_the_Sacred_Winds.png'
import SkywardAtlas from './Weapon_Skyward_Atlas.png'
import MemoryOfDust from './Weapon_Memory_of_Dust.png'
const catalysts = {
ApprenticesNotes,
PocketGrimoire,
AmberCatalyst,
EmeraldOrb,
MagicGuide,
OtherworldlyStory,
ThrillingTalesOfDragonSlayers,
TwinNephrite,
BlackcliffAgate,
FavoniusCodex,
MappaMare,
PrototypeMalice,
RoyalGrimoire,
SacrificialFragments,
SolarPearl,
TheWidsith,
WineAndSong,
Frostbearer,
LostPrayerToTheSacredWinds,
SkywardAtlas,
MemoryOfDust
}
export default catalysts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/Assets/Weapons/Claymores/Claymores.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import WasterGreatsword from './Weapon_Waster_Greatsword.png'
import OldMercsPal from './Weapon_Old_Merc\'s_Pal.png'
import BloodtaintedGreatsword from './Weapon_Bloodtainted_Greatsword.png'
import DebateClub from './Weapon_Debate_Club.png'
import FerrousShadow from './Weapon_Ferrous_Shadow.png'
import Quartz from './Weapon_Quartz.png'
import SkyriderGreatsword from './Weapon_Skyrider_Greatsword.png'
import WhiteIronGreatsword from './Weapon_White_Iron_Greatsword.png'
import BlackcliffSlasher from './Weapon_Blackcliff_Slasher.png'
import FavoniusGreatsword from './Weapon_Favonius_Greatsword.png'
import LithicBlade from './Weapon_Lithic_Blade.png'
import PrototypeAminus from './Weapon_Prototype_Aminus.png'
import Rainslasher from './Weapon_Rainslasher.png'
import RoyalGreatsword from './Weapon_Royal_Greatsword.png'
import SerpentSpine from './Weapon_Serpent_Spine.png'
import TheBell from './Weapon_The_Bell.png'
import Whiteblind from './Weapon_Whiteblind.png'
import SacrificialGreatsword from './Weapon_Sacrificial_Greatsword.png'
import SnowTombedStarsilver from './snow_tombed_starsilver.png'
import SkywardPride from './Weapon_Skyward_Pride.png'
import WolfsGravestone from './Weapon_Wolf\'s_Gravestone.png'
import TheUnforged from './Weapon_The_Unforged.png'
const claymore = {
WasterGreatsword,
OldMercsPal,
BloodtaintedGreatsword,
DebateClub,
FerrousShadow,
Quartz,
SkyriderGreatsword,
WhiteIronGreatsword,
BlackcliffSlasher,
FavoniusGreatsword,
LithicBlade,
PrototypeAminus,
Rainslasher,
RoyalGreatsword,
SerpentSpine,
TheBell,
Whiteblind,
SacrificialGreatsword,
SnowTombedStarsilver,
SkywardPride,
WolfsGravestone,
TheUnforged,
}
export default claymore
Binary file added src/Assets/Weapons/Claymores/Weapon_Quartz.png
Binary file added src/Assets/Weapons/Claymores/Weapon_The_Bell.png
37 changes: 37 additions & 0 deletions src/Assets/Weapons/Polearms/Polearms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import BeginnersProtector from './Weapon_Beginner\'s_Protector.png'
import IronPoint from './Weapon_Iron_Point.png'
import BlackTassel from './Weapon_Black_Tassel.png'
import Halberd from './Weapon_Halberd.png'
import WhiteTassel from './Weapon_White_Tassel.png'
import BlackcliffPole from './Weapon_Blackcliff_Pole.png'
import CrescentPike from './Weapon_Crescent_Pike.png'
import Deathmatch from './Weapon_Deathmatch.png'
import DragonsBane from './Weapon_Dragon\'s_Bane.png'
import LithicSpear from './Weapon_Lithic_Spear.png'
import PrototypeGrudge from './Weapon_Prototype_Grudge.png'
import FavoniusLance from './Weapon_Favonius_Lance.png'
import RoyalSpear from './Weapon_Royal_Spear.png'
import DragonspineSpear from './dragonspine_spear.png'
import VortexVanquisher from './Weapon_Vortex_Vanquisher.png'
import PrimordialJadeWingedSpear from './Weapon_Primordial_Jade_Winged-Spear.png'
import SkywardSpine from './Weapon_Skyward_Spine.png'
const polearms = {
BeginnersProtector,
IronPoint,
BlackTassel,
Halberd,
WhiteTassel,
BlackcliffPole,
CrescentPike,
Deathmatch,
DragonsBane,
LithicSpear,
PrototypeGrudge,
FavoniusLance,
RoyalSpear,
DragonspineSpear,
VortexVanquisher,
PrimordialJadeWingedSpear,
SkywardSpine,
}
export default polearms
Binary file added src/Assets/Weapons/Polearms/Weapon_Deathmatch.png
Binary file added src/Assets/Weapons/Polearms/Weapon_Halberd.png
Binary file added src/Assets/Weapons/Polearms/Weapon_Iron_Point.png
Binary file added src/Assets/Weapons/Polearms/dragonspine_spear.png
Loading

0 comments on commit c477f84

Please sign in to comment.