Fix AX references
This commit is contained in:
parent
9d5d67601c
commit
eac805106a
4 changed files with 13 additions and 12 deletions
|
|
@ -80,7 +80,7 @@ const WeaponHovercard = (props: Props) => {
|
|||
}
|
||||
|
||||
const createPrimaryAxSkillString = () => {
|
||||
const primaryAxSkills = axData[props.gridWeapon.object.ax - 1]
|
||||
const primaryAxSkills = axData[props.gridWeapon.object.ax_type - 1]
|
||||
|
||||
if (props.gridWeapon.ax) {
|
||||
const simpleAxSkill = props.gridWeapon.ax[0]
|
||||
|
|
@ -97,7 +97,7 @@ const WeaponHovercard = (props: Props) => {
|
|||
}
|
||||
|
||||
const createSecondaryAxSkillString = () => {
|
||||
const primaryAxSkills = axData[props.gridWeapon.object.ax - 1]
|
||||
const primaryAxSkills = axData[props.gridWeapon.object.ax_type - 1]
|
||||
|
||||
if (props.gridWeapon.ax) {
|
||||
const primarySimpleAxSkill = props.gridWeapon.ax[0]
|
||||
|
|
@ -230,7 +230,7 @@ const WeaponHovercard = (props: Props) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{props.gridWeapon.object.ax > 0 &&
|
||||
{props.gridWeapon.object.ax &&
|
||||
props.gridWeapon.ax &&
|
||||
props.gridWeapon.ax[0].modifier &&
|
||||
props.gridWeapon.ax[0].strength
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ const WeaponModal = (props: Props) => {
|
|||
if (props.gridWeapon.object.series == 17 && weaponKey3Id)
|
||||
object.weapon.weapon_key3_id = weaponKey3Id
|
||||
|
||||
if (props.gridWeapon.object.ax > 0) {
|
||||
if (props.gridWeapon.object.ax && props.gridWeapon.object.ax_type > 0) {
|
||||
object.weapon.ax_modifier1 = primaryAxModifier
|
||||
object.weapon.ax_modifier2 = secondaryAxModifier
|
||||
object.weapon.ax_strength1 = primaryAxValue
|
||||
|
|
@ -287,7 +287,7 @@ const WeaponModal = (props: Props) => {
|
|||
<section>
|
||||
<h3>{t('modals.weapon.subtitles.ax_skills')}</h3>
|
||||
<AXSelect
|
||||
axType={props.gridWeapon.object.ax}
|
||||
axType={props.gridWeapon.object.ax_type}
|
||||
currentSkills={props.gridWeapon.ax}
|
||||
onOpenChange={receiveAxOpen}
|
||||
sendValidity={receiveValidity}
|
||||
|
|
@ -314,7 +314,7 @@ const WeaponModal = (props: Props) => {
|
|||
}
|
||||
|
||||
function openChange(open: boolean) {
|
||||
if (props.gridWeapon.object.ax > 0 || props.gridWeapon.object.awakening) {
|
||||
if (props.gridWeapon.object.ax || props.gridWeapon.object.awakening) {
|
||||
setFormValid(false)
|
||||
} else {
|
||||
setFormValid(true)
|
||||
|
|
@ -369,7 +369,7 @@ const WeaponModal = (props: Props) => {
|
|||
{[2, 3, 17, 24].includes(props.gridWeapon.object.series)
|
||||
? keySelect()
|
||||
: ''}
|
||||
{props.gridWeapon.object.ax > 0 ? axSelect() : ''}
|
||||
{props.gridWeapon.object.ax ? axSelect() : ''}
|
||||
{props.gridWeapon.awakening ? awakeningSelect() : ''}
|
||||
<Button
|
||||
contained={true}
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ const WeaponUnit = (props: Props) => {
|
|||
if (
|
||||
props.gridWeapon &&
|
||||
props.gridWeapon.object.ax &&
|
||||
props.gridWeapon.object.ax > 0 &&
|
||||
props.gridWeapon.object.ax_type > 0 &&
|
||||
props.gridWeapon.ax &&
|
||||
axSkill
|
||||
) {
|
||||
|
|
@ -310,7 +310,7 @@ const WeaponUnit = (props: Props) => {
|
|||
let images: JSX.Element[] = []
|
||||
if (
|
||||
props.gridWeapon &&
|
||||
props.gridWeapon.object.ax > 0 &&
|
||||
props.gridWeapon.object.ax &&
|
||||
props.gridWeapon.ax &&
|
||||
props.gridWeapon.ax.length > 0
|
||||
) {
|
||||
|
|
@ -327,10 +327,10 @@ const WeaponUnit = (props: Props) => {
|
|||
if (
|
||||
props.gridWeapon &&
|
||||
props.gridWeapon.object.ax &&
|
||||
props.gridWeapon.object.ax > 0 &&
|
||||
props.gridWeapon.object.ax_type > 0 &&
|
||||
props.gridWeapon.ax
|
||||
) {
|
||||
const axOptions = axData[props.gridWeapon.object.ax - 1]
|
||||
const axOptions = axData[props.gridWeapon.object.ax_type - 1]
|
||||
const weaponAxSkill: SimpleAxSkill = props.gridWeapon.ax[0]
|
||||
|
||||
let axSkill = axOptions.find((ax) => ax.id === weaponAxSkill.modifier)
|
||||
|
|
|
|||
3
types/Weapon.d.ts
vendored
3
types/Weapon.d.ts
vendored
|
|
@ -8,7 +8,8 @@ interface Weapon {
|
|||
max_level: number
|
||||
max_skill_level: number
|
||||
series: number
|
||||
ax: number
|
||||
ax: boolean
|
||||
ax_type: number
|
||||
awakening: boolean
|
||||
name: {
|
||||
[key: string]: string
|
||||
|
|
|
|||
Loading…
Reference in a new issue