Skip to content

Commit

Permalink
add blessings to inventory screen
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisinajar committed Aug 1, 2024
1 parent 156ff5d commit 789a5c9
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 69 deletions.
148 changes: 79 additions & 69 deletions src/game/inventory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
itemAllowsCrafting,
itemAllowsVoidTravel,
getEnchantmentDisplay,
pureEnchantmentDisplayName,
} from "src/helpers";
import { ArtifactModifiers } from "src/components/artifact-modifiers";

Expand Down Expand Up @@ -141,75 +142,84 @@ export function Inventory(): JSX.Element | null {
</Grid>

<Grid item xs={6}>
<React.Fragment>
<ArtifactModifiers
title={hero.equipment.artifact?.name}
artifact={hero.equipment.artifact}
/>
<ArtifactModifiers
title={
hero.equipment.leftHand
? itemDisplayName(hero.equipment.leftHand, null)
: null
}
artifact={hero.equipment.leftHand?.imbue?.artifact}
affixes={hero.equipment.leftHand?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.rightHand
? itemDisplayName(hero.equipment.rightHand, null)
: null
}
artifact={hero.equipment.rightHand?.imbue?.artifact}
affixes={hero.equipment.rightHand?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.bodyArmor
? itemDisplayName(hero.equipment.bodyArmor, null)
: null
}
artifact={hero.equipment.bodyArmor?.imbue?.artifact}
affixes={hero.equipment.bodyArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.handArmor
? itemDisplayName(hero.equipment.handArmor, null)
: null
}
artifact={hero.equipment.handArmor?.imbue?.artifact}
affixes={hero.equipment.handArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.legArmor
? itemDisplayName(hero.equipment.legArmor, null)
: null
}
artifact={hero.equipment.legArmor?.imbue?.artifact}
affixes={hero.equipment.legArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.headArmor
? itemDisplayName(hero.equipment.headArmor, null)
: null
}
artifact={hero.equipment.headArmor?.imbue?.artifact}
affixes={hero.equipment.headArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.footArmor
? itemDisplayName(hero.equipment.footArmor, null)
: null
}
artifact={hero.equipment.footArmor?.imbue?.artifact}
affixes={hero.equipment.footArmor?.imbue?.affixes}
/>
</React.Fragment>
{!!hero.buffs.blessing && (
<React.Fragment>
<Typography>
{pureEnchantmentDisplayName(hero.buffs.blessing)}
</Typography>
<Typography variant="body1">
{getEnchantmentDisplay(hero.buffs.blessing)}
</Typography>
</React.Fragment>
)}

<ArtifactModifiers
title={hero.equipment.artifact?.name}
artifact={hero.equipment.artifact}
/>
<ArtifactModifiers
title={
hero.equipment.leftHand
? itemDisplayName(hero.equipment.leftHand, null)
: null
}
artifact={hero.equipment.leftHand?.imbue?.artifact}
affixes={hero.equipment.leftHand?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.rightHand
? itemDisplayName(hero.equipment.rightHand, null)
: null
}
artifact={hero.equipment.rightHand?.imbue?.artifact}
affixes={hero.equipment.rightHand?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.bodyArmor
? itemDisplayName(hero.equipment.bodyArmor, null)
: null
}
artifact={hero.equipment.bodyArmor?.imbue?.artifact}
affixes={hero.equipment.bodyArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.handArmor
? itemDisplayName(hero.equipment.handArmor, null)
: null
}
artifact={hero.equipment.handArmor?.imbue?.artifact}
affixes={hero.equipment.handArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.legArmor
? itemDisplayName(hero.equipment.legArmor, null)
: null
}
artifact={hero.equipment.legArmor?.imbue?.artifact}
affixes={hero.equipment.legArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.headArmor
? itemDisplayName(hero.equipment.headArmor, null)
: null
}
artifact={hero.equipment.headArmor?.imbue?.artifact}
affixes={hero.equipment.headArmor?.imbue?.affixes}
/>
<ArtifactModifiers
title={
hero.equipment.footArmor
? itemDisplayName(hero.equipment.footArmor, null)
: null
}
artifact={hero.equipment.footArmor?.imbue?.artifact}
affixes={hero.equipment.footArmor?.imbue?.affixes}
/>
</Grid>

{hero.level === hero.levelCap &&
Expand Down
12 changes: 12 additions & 0 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,18 @@ export function getEnchantmentDisplay(enchantment: string): string {
case EnchantmentType.SuperAllStats:
return "+100% All Stats, Leech 20% Constitution, CounterSpell, Minus Armor, Bonus Armor";
break;
case EnchantmentType.RubyBlessing:
return "+20% Physical Resistance";
break;
case EnchantmentType.EmeraldBlessing:
return "+20% Magical Resistance";
break;
case EnchantmentType.SapphireBlessing:
return "+20% Elemental Resistance";
break;
case EnchantmentType.DiamondBlessing:
return "+10% All Resistances";
break;
default:
return "???";
break;
Expand Down
5 changes: 5 additions & 0 deletions src/me.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ query Me {

skillPercent
activeSkill

buffs {
blessing
}

skills {
attackingAccuracy
castingAccuracy
Expand Down

0 comments on commit 789a5c9

Please sign in to comment.