Skip to content

Commit

Permalink
Merge pull request #3135 from builder-247/universal
Browse files Browse the repository at this point in the history
Add support for universal heroes
  • Loading branch information
howardchung committed Jan 4, 2024
2 parents db7abea + bf8d513 commit 0172b01
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 3 deletions.
131 changes: 131 additions & 0 deletions src/components/Icons/AttrUniversal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import React from 'react';

export default props => (
// Generated with vectorizer.ai
<svg viewBox='0.00 0.00 46.00 46.00' {...props}>
<g stroke-width='2.00' fill='none' stroke-linecap='butt'>
<path stroke='#898f1b' vector-effect='non-scaling-stroke' d='
M 43.94 24.25
L 40.55 21.73'
/>
<path stroke='#898f1b' vector-effect='non-scaling-stroke' d='
M 23.35 22.02
L 23.27 22.55'
/>
<path stroke='#13dd8e' vector-effect='non-scaling-stroke' d='
M 13.16 8.28
Q 13.58 5.86 12.88 4.62'
/>
<path stroke='#768b79' vector-effect='non-scaling-stroke' d='
M 15.31 38.70
L 11.52 40.56'
/>
</g>
<path fill='#26e030' d='
M 43.94 24.25
L 40.55 21.73
Q 39.61 13.59 33.10 8.64
Q 32.62 8.28 32.09 8.55
Q 25.76 11.81 23.63 19.12
Q 23.40 19.91 23.13 20.65
Q 22.72 21.80 22.70 20.58
Q 22.59 12.49 28.57 6.81
A 0.40 0.40 0.0 0 0 28.53 6.20
L 28.26 6.01
Q 28.00 5.82 27.75 6.03
Q 24.89 8.36 23.75 11.76
Q 23.53 12.41 23.30 11.76
Q 23.12 11.22 23.34 10.68
Q 24.41 8.17 26.02 5.92
Q 26.16 5.73 25.97 5.58
L 25.77 5.42
Q 25.64 5.33 25.53 5.44
Q 22.59 8.45 22.19 12.53
Q 21.89 15.54 21.82 18.14
Q 21.82 18.27 21.78 18.14
Q 19.99 11.88 22.62 6.09
Q 22.91 5.44 22.21 5.48
L 20.50 5.57
Q 19.77 5.61 19.55 6.32
Q 17.16 14.11 21.51 21.23
Q 21.84 21.77 23.35 22.02
L 23.27 22.55
C 22.55 22.53 22.00 22.56 21.37 22.16
Q 13.89 17.46 13.16 8.28
Q 13.58 5.86 12.88 4.62
A 20.98 20.95 35.9 0 1 26.91 2.39
A 21.03 21.01 77.7 0 1 40.12 10.87
A 21.00 20.99 29.1 0 1 43.94 24.25
Z'
/>
<path fill='#00d9ec' d='
M 12.88 4.62
Q 13.58 5.86 13.16 8.28
C 8.81 12.28 6.26 15.31 5.58 21.08
A 1.00 0.99 20.1 0 0 6.03 22.04
C 10.63 25.06 16.79 25.38 21.52 23.32
Q 22.45 22.91 21.74 23.64
Q 21.16 24.24 20.47 24.61
Q 13.53 28.32 6.07 25.74
Q 5.57 25.57 5.72 26.07
L 5.92 26.76
A 0.71 0.69 89.0 0 0 6.41 27.25
Q 9.26 27.98 12.31 28.06
Q 12.43 28.06 12.39 28.17
L 12.29 28.46
Q 12.26 28.53 12.18 28.55
Q 9.47 28.99 6.97 28.50
A 0.35 0.34 8.5 0 0 6.56 28.80
L 6.52 29.08
A 0.35 0.35 0.0 0 0 6.83 29.47
Q 13.85 30.30 19.54 26.24
Q 19.65 26.16 19.74 26.27
L 19.74 26.28
Q 19.81 26.37 19.73 26.44
Q 14.89 30.92 8.19 31.43
Q 7.53 31.49 7.91 32.03
L 9.03 33.65
Q 9.46 34.26 10.19 34.09
Q 19.08 32.02 22.63 24.22
Q 23.49 22.34 23.43 24.41
Q 23.19 33.11 15.31 38.70
L 11.52 40.56
A 20.98 20.97 -61.3 0 1 3.88 14.38
A 20.98 20.96 -2.3 0 1 12.88 4.62
Z'
/>
<path fill='#ec3d06' d='
M 40.55 21.73
L 43.94 24.25
A 20.98 20.98 0.0 0 1 27.95 43.39
A 20.99 20.98 -35.2 0 1 11.52 40.56
L 15.31 38.70
Q 22.67 42.22 30.19 38.95
Q 30.86 38.66 30.85 37.93
Q 30.67 30.06 25.33 24.79
Q 23.03 22.53 25.79 24.20
Q 32.26 28.13 34.01 35.98
A 0.39 0.39 0.0 0 0 34.63 36.20
L 34.84 36.04
A 0.82 0.81 64.0 0 0 35.13 35.18
Q 34.06 31.16 31.60 28.10
Q 30.93 27.27 31.86 27.80
C 33.52 28.75 35.21 32.44 36.18 34.06
Q 36.75 34.99 36.65 33.91
Q 36.55 32.82 35.96 31.79
Q 32.97 26.55 27.98 24.39
Q 27.80 24.32 27.88 24.14
L 27.88 24.13
Q 27.95 23.97 28.11 24.03
Q 34.46 26.25 37.78 31.36
Q 38.21 32.02 38.53 31.29
L 39.27 29.55
Q 39.52 28.97 39.11 28.49
Q 33.10 21.57 23.27 22.55
L 23.35 22.02
C 24.84 21.83 26.10 20.87 27.32 20.51
Q 34.09 18.50 40.55 21.73
Z'
/>
</svg>
);
11 changes: 8 additions & 3 deletions src/components/Visualizations/Table/HeroImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ import constants from '../../constants';
import AttrStrength from '../../Icons/AttrStrength';
import AttrIntelligent from '../../Icons/AttrIntelligent';
import AttrAgility from '../../Icons/AttrAgility';
import AttrUniversal from '../../Icons/AttrUniversal';
import HeroImage from '../HeroImage';

// hero to use as background image in tooltip
const backgroundMapping = {
str: 2,
agi: 47,
int: 10,
str: 2, // Axe
agi: 47, // Viper
int: 10, // Morphling
all: 91, // Io
};

const Styled = styled.div`
Expand Down Expand Up @@ -684,6 +686,9 @@ class TableHeroImage extends React.Component {
{hero.primary_attr === 'int' && (
<AttrIntelligent id="heroImg-attribute" />
)}
{hero.primary_attr === 'all' && (
<AttrUniversal id="heroImg-attribute" />
)}
<div className="health-mana">
<span id="health">{Math.floor(hero.base_health)}</span>
<span id="mana">{Math.floor(hero.base_mana)}</span>
Expand Down

0 comments on commit 0172b01

Please sign in to comment.