@malib/gear 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class H{constructor(){this.id=0,this.origin=[0,0]}}class I{constructor(){this.base=0,this.bonus=0,this.upgrade=0,this.enchant=0}get empty(){return this.base===0&&this.bonus===0&&this.upgrade===0&&this.enchant===0}get sum(){return Math.max(0,this.base+this.bonus+this.upgrade+this.enchant)}get diff(){return this.bonus+this.upgrade+this.enchant}}var n=(t=>(t[t.incSTR=1]="incSTR",t[t.incSTRr=2]="incSTRr",t[t.incDEX=3]="incDEX",t[t.incDEXr=4]="incDEXr",t[t.incINT=5]="incINT",t[t.incINTr=6]="incINTr",t[t.incLUK=7]="incLUK",t[t.incLUKr=8]="incLUKr",t[t.incAllStat=9]="incAllStat",t[t.incMHP=10]="incMHP",t[t.incMMP=11]="incMMP",t[t.incMHPr=12]="incMHPr",t[t.incMMPr=13]="incMMPr",t[t.incMDF=14]="incMDF",t[t.incARC=15]="incARC",t[t.incAUT=16]="incAUT",t[t.incPAD=17]="incPAD",t[t.incMAD=18]="incMAD",t[t.incAD=19]="incAD",t[t.incPDD=20]="incPDD",t[t.incSpeed=21]="incSpeed",t[t.incJump=22]="incJump",t[t.knockback=23]="knockback",t[t.bdR=24]="bdR",t[t.incBDR=25]="incBDR",t[t.imdR=26]="imdR",t[t.incIMDR=27]="incIMDR",t[t.damR=28]="damR",t[t.nbdR=29]="nbdR",t[t.statR=30]="statR",t[t.incCHUC=31]="incCHUC",t[t.incPADr=100]="incPADr",t[t.incMADr=101]="incMADr",t[t.incPDDr=102]="incPDDr",t[t.incCr=103]="incCr",t[t.incDAMr=104]="incDAMr",t[t.RecoveryHP=105]="RecoveryHP",t[t.RecoveryMP=106]="RecoveryMP",t[t.face=107]="face",t[t.prop=108]="prop",t[t.time=109]="time",t[t.HP=110]="HP",t[t.MP=111]="MP",t[t.attackType=112]="attackType",t[t.ignoreTargetDEF=113]="ignoreTargetDEF",t[t.ignoreDAM=114]="ignoreDAM",t[t.ignoreDAMr=115]="ignoreDAMr",t[t.DAMreflect=116]="DAMreflect",t[t.mpconReduce=117]="mpconReduce",t[t.incMesoProp=118]="incMesoProp",t[t.incRewardProp=119]="incRewardProp",t[t.incAllskill=120]="incAllskill",t[t.RecoveryUP=121]="RecoveryUP",t[t.boss=122]="boss",t[t.level=123]="level",t[t.incTerR=124]="incTerR",t[t.incAsrR=125]="incAsrR",t[t.incEXPr=126]="incEXPr",t[t.reduceCooltime=127]="reduceCooltime",t[t.incSTRlv=128]="incSTRlv",t[t.incDEXlv=129]="incDEXlv",t[t.incINTlv=130]="incINTlv",t[t.incLUKlv=131]="incLUKlv",t[t.incMHPlv=132]="incMHPlv",t[t.incPADlv=133]="incPADlv",t[t.incMADlv=134]="incMADlv",t[t.incCriticaldamage=135]="incCriticaldamage",t[t.attackSpeed=200]="attackSpeed",t[t.setItemID=201]="setItemID",t[t.durability=202]="durability",t[t.reduceReq=203]="reduceReq",t[t.only=1100]="only",t[t.tradeBlock=1101]="tradeBlock",t[t.accountSharable=1102]="accountSharable",t[t.onlyEquip=1103]="onlyEquip",t[t.tradeAvailable=1104]="tradeAvailable",t[t.equipTradeBlock=1105]="equipTradeBlock",t[t.sharableOnce=1106]="sharableOnce",t[t.charismaEXP=1107]="charismaEXP",t[t.senseEXP=1108]="senseEXP",t[t.insightEXP=1109]="insightEXP",t[t.willEXP=1110]="willEXP",t[t.craftEXP=1111]="craftEXP",t[t.charmEXP=1112]="charmEXP",t[t.accountShareTag=1113]="accountShareTag",t[t.bossReward=1114]="bossReward",t[t.noPotential=1115]="noPotential",t[t.fixedPotential=1116]="fixedPotential",t[t.specialGrade=1117]="specialGrade",t[t.fixedGrade=1118]="fixedGrade",t[t.superiorEqp=1119]="superiorEqp",t[t.incPQEXPr=1120]="incPQEXPr",t[t.jokerToSetItem=1121]="jokerToSetItem",t[t.blockGoldHammer=1122]="blockGoldHammer",t[t.exceptUpgrade=1123]="exceptUpgrade",t[t.onlyUpgrade=1124]="onlyUpgrade",t[t.noLookChange=1125]="noLookChange",t[t.tucIgnoreForPotential=1126]="tucIgnoreForPotential",t))(n||{});class K{constructor(){this.level=0,this.str=0,this.luk=0,this.dex=0,this.int=0,this.job=0,this.specJob=0}}var o=(t=>(t[t.cap=100]="cap",t[t.faceAccessory=101]="faceAccessory",t[t.eyeAccessory=102]="eyeAccessory",t[t.earrings=103]="earrings",t[t.coat=104]="coat",t[t.longcoat=105]="longcoat",t[t.pants=106]="pants",t[t.shoes=107]="shoes",t[t.glove=108]="glove",t[t.cape=110]="cape",t[t.ring=111]="ring",t[t.pendant=112]="pendant",t[t.belt=113]="belt",t[t.medal=114]="medal",t[t.shoulder=115]="shoulder",t[t.pocket=116]="pocket",t[t.badge=118]="badge",t[t.android=166]="android",t[t.machineHeart=167]="machineHeart",t[t.shield=109]="shield",t[t.emblem=119]="emblem",t[t.powerSource=119020]="powerSource",t[t.shiningRod=1212]="shiningRod",t[t.tuner=1213]="tuner",t[t.breathShooter=1214]="breathShooter",t[t.soulShooter=122]="soulShooter",t[t.desperado=123]="desperado",t[t.energySword=124]="energySword",t[t.espLimiter=126]="espLimiter",t[t.chain=127]="chain",t[t.magicGauntlet=128]="magicGauntlet",t[t.ritualFan=129]="ritualFan",t[t.ohSword=130]="ohSword",t[t.ohAxe=131]="ohAxe",t[t.ohBlunt=132]="ohBlunt",t[t.dagger=133]="dagger",t[t.katara=134]="katara",t[t.cane=136]="cane",t[t.wand=137]="wand",t[t.staff=138]="staff",t[t.thSword=140]="thSword",t[t.chakram=1404]="chakram",t[t.thAxe=141]="thAxe",t[t.thBlunt=142]="thBlunt",t[t.spear=143]="spear",t[t.polearm=144]="polearm",t[t.bow=145]="bow",t[t.crossbow=146]="crossbow",t[t.claw=147]="claw",t[t.knuckle=148]="knuckle",t[t.gun=149]="gun",t[t.shovel=150]="shovel",t[t.pickaxe=151]="pickaxe",t[t.dualBowguns=152]="dualBowguns",t[t.handCannon=153]="handCannon",t[t.heavySword=156]="heavySword",t[t.longSword=157]="longSword",t[t.gauntletRevolver=158]="gauntletRevolver",t[t.ancientBow=159]="ancientBow",t[t.soulShield=1098]="soulShield",t[t.demonShield=1099]="demonShield",t[t.magicArrow=135200]="magicArrow",t[t.card=135210]="card",t[t.medallion=135220]="medallion",t[t.rosary=135221]="rosary",t[t.ironChain=135222]="ironChain",t[t.magicBook1=135223]="magicBook1",t[t.magicBook2=135224]="magicBook2",t[t.magicBook3=135225]="magicBook3",t[t.arrowFletching=135226]="arrowFletching",t[t.bowThimble=135227]="bowThimble",t[t.daggerScabbard=135228]="daggerScabbard",t[t.charm=135229]="charm",t[t.orb=135240]="orb",t[t.dragonEssence=135250]="dragonEssence",t[t.soulRing=135260]="soulRing",t[t.magnum=135270]="magnum",t[t.wristBand=135290]="wristBand",t[t.farSight=135291]="farSight",t[t.powderKeg=135292]="powderKeg",t[t.mass=135293]="mass",t[t.document=135294]="document",t[t.magicMarble=135295]="magicMarble",t[t.arrowhead=135296]="arrowhead",t[t.jewel=135297]="jewel",t[t.powderKeg2=135298]="powderKeg2",t[t.controller=135300]="controller",t[t.foxMarble=135310]="foxMarble",t[t.chessPiece=135320]="chessPiece",t[t.transmitter=135330]="transmitter",t[t.charge=135340]="charge",t[t.magicWing=135350]="magicWing",t[t.pathOfAbyss=135360]="pathOfAbyss",t[t.relic=135370]="relic",t[t.fanTassel=135380]="fanTassel",t[t.bracelet=135400]="bracelet",t[t.weaponBelt=135401]="weaponBelt",t[t.ornament=135402]="ornament",t[t.hexSeeker=135403]="hexSeeker",t[t.petEquip=180]="petEquip",t[t.machineEngine=161]="machineEngine",t[t.machineArms=162]="machineArms",t[t.machineLegs=163]="machineLegs",t[t.machineBody=164]="machineBody",t[t.machineTransistors=165]="machineTransistors",t[t.dragonMask=194]="dragonMask",t[t.dragonPendant=195]="dragonPendant",t[t.dragonWings=196]="dragonWings",t[t.dragonTail=197]="dragonTail",t))(o||{}),U=(t=>(t[t.normal=0]="normal",t[t.rare=1]="rare",t[t.epic=2]="epic",t[t.unique=3]="unique",t[t.legendary=4]="legendary",t[t.special=5]="special",t))(U||{});class N{constructor(i){this.enchanted=!1,this.charge=0,this.chargeOption=new Map,this.gear=i}enchant(){return this.enchanted||!M.isWeapon(this.gear.type)?!1:(this.enchanted=!0,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0)}disenchant(){return this.enchanted?(this.enchanted=!1,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0):!1}setSoul(i){return this.enchanted?(this.soul=i,this.setCharge(this.charge),!0):!1}removeSoul(){return!this.enchanted||!this.soul?!1:(this.soul=void 0,this.setCharge(this.charge),!0)}setCharge(i){if(!this.enchanted||i<0||i>1e3)return!1;this.charge=i;const s=this.gear.option(n.incPAD).base<this.gear.option(n.incMAD).base?n.incMAD:n.incPAD;return this.chargeOption.clear(),this.chargeOption.set(s,this.getChargeAD()),!0}getChargeAD(){if(!this.enchanted||this.charge===0)return 0;const i=Math.min(Math.ceil(this.charge/100)-1,5);if(this.soul){const c=this.soul.multiplier;return 10+i*c}return 5+i}}class j{constructor(){this.name="",this.skill="",this.option=new Map,this.multiplier=0}}const E=class{constructor(){this.itemID=0,this.name="",this.desc="",this.icon=new H,this.type=0,this.req=new K,this.props=new Map,this.options=new Map,this.totalUpgradeCount=0,this.upgradeCount=0,this.upgradeFailCount=0,this.hammerCount=0,this.maxStar=0,this.star=0,this.amazing=!1,this.canPotential=!1,this.grade=U.normal,this.potentials=[],this.additionalGrade=U.normal,this.additionalPotentials=[],this.soulWeapon=new N(this)}get upgradeCountLeft(){return this.totalUpgradeCount+this.hammerCount-this.upgradeCount-this.upgradeFailCount}get diff(){let t=0;for(const[i,c]of this.options)t+=Math.floor(c.diff/E.getPropTypeWeight(i));return t}option(t){return this.options.has(t)||this.options.set(t,new I),this.options.get(t)}getPropValue(t){return this.props.get(t)??0}getBooleanValue(t){return(this.props.get(t)??0)>0}static isWeapon(t){return this.isLeftWeapon(t)||this.isDoubleHandWeapon(t)}static isLeftWeapon(t){return t>=121&&t<=139&&t!==o.katara||Math.floor(t/10)===121}static isDoubleHandWeapon(t){return t>=140&&t<=149||t>=152&&t<=159||Math.floor(t/10)===140}static isSubWeapon(t){switch(t){case o.katara:case o.shield:case o.demonShield:case o.soulShield:return!0;default:return Math.floor(t/1e3)===135}}static isShield(t){switch(t){case o.shield:case o.demonShield:case o.soulShield:return!0;default:return!1}}static isArmor(t){return t===100||t>=104&&t<=110}static isAccessory(t){return t>=101&&t<=103||t>=111&&t<=113||t===115}static isMechanicGear(t){return t>=161&&t<=165}static isDragonGear(t){return t>=194&&t<=197}static getGearType(t){switch(Math.floor(t/1e3)){case 1098:return o.soulShield;case 1099:return o.demonShield;case 1212:return o.shiningRod;case 1213:return o.tuner;case 1214:return o.breathShooter;case 1404:return o.chakram}if(Math.floor(t/1e4)===135)switch(Math.floor(t/100)){case 13522:case 13528:case 13529:case 13540:return Math.floor(t/10);default:return Math.floor(t/100)*10}if(Math.floor(t/1e4)===119)switch(Math.floor(t/100)){case 11902:return Math.floor(t/10)}return Math.floor(t/1e4)}static getMaxStar(t){if(t.totalUpgradeCount<=0||t.getBooleanValue(n.onlyUpgrade)||E.isMechanicGear(t.type)||E.isDragonGear(t.type))return 0;let i;const c=t.req.level;for(const s of E.starData)if(c>=s[0])i=s;else break;return i===void 0?0:t.getBooleanValue(n.superiorEqp)?i[2]:i[1]}static getPropTypeWeight(t){if(t<100)switch(t){case n.incSTR:case n.incDEX:case n.incINT:case n.incLUK:case n.incPAD:case n.incMAD:case n.incSpeed:case n.incJump:return 1;case n.incMHP:case n.incMMP:return 100;case n.incPDD:return 10;case n.incAD:return 2}return Number.MAX_VALUE}};let M=E;M.starData=[[0,5,3],[95,8,5],[110,10,8],[120,15,10],[130,20,12],[140,25,15]];class X{constructor(){this.code=0,this.optionType=0,this.reqLevel=0,this.summary="",this.option=new Map}get convertSummary(){const i=[...this.option.keys()];i.sort((s,d)=>n[d].length-n[s].length);let c=this.summary;for(const s of i)c=c.replace(`#${n[s]}`,(this.option.get(s)??0).toString());return c}static getPotentialLevel(i){return i<=0?1:i>=250?25:Math.floor((i+9)/10)}static checkOptionType(i,c){switch(i){case 0:return!0;case 10:return M.isWeapon(c)||M.isSubWeapon(c)||c===o.emblem;case 11:return!X.checkOptionType(10,c);case 20:return M.isSubWeapon(c)||c===o.cap||c===o.coat||c===o.longcoat||c===o.pants||c===o.shoes||c===o.glove||c===o.cape||c===o.belt||c===o.shoulder;case 40:return c===o.faceAccessory||c===o.eyeAccessory||c===o.earrings||c===o.ring||c===o.pendant;case 51:return c===o.cap;case 52:return c===o.coat||c===o.longcoat;case 53:return c===o.pants;case 54:return c===o.glove;case 55:return c===o.shoes;default:return!1}}}var l=(t=>(t[t.STR=0]="STR",t[t.DEX=1]="DEX",t[t.INT=2]="INT",t[t.LUK=3]="LUK",t[t.STR_DEX=4]="STR_DEX",t[t.STR_INT=5]="STR_INT",t[t.STR_LUK=6]="STR_LUK",t[t.DEX_INT=7]="DEX_INT",t[t.DEX_LUK=8]="DEX_LUK",t[t.INT_LUK=9]="INT_LUK",t[t.PDD=10]="PDD",t[t.PAD=11]="PAD",t[t.MAD=12]="MAD",t[t.MHP=13]="MHP",t[t.MMP=14]="MMP",t[t.speed=15]="speed",t[t.jump=16]="jump",t[t.damR=17]="damR",t[t.bdR=18]="bdR",t[t.allStatR=19]="allStatR",t[t.reduceReq=20]="reduceReq",t))(l||{});function z(t,i,c){const s=q(t,i,c);if(s.size===0)return!1;for(const[d,a]of s)t.option(d).bonus+=a;return!0}function B(t){for(const[,i]of t.options)i.bonus=0;return!0}function q(t,i,c){const s=J(i),d=W(t,i,c);return d===0?new Map:new Map(s.map(a=>[a,d]))}function W(t,i,c){const s=t.req.level,d=t.getBooleanValue(n.bossReward),a=t.type;if(s<0||d&&c<3)return 0;switch(i){case l.STR:case l.DEX:case l.INT:case l.LUK:return(Math.floor(s/20)+1)*c;case l.STR_DEX:case l.STR_INT:case l.STR_LUK:case l.DEX_INT:case l.DEX_LUK:case l.INT_LUK:return(Math.floor(s/40)+1)*c;case l.PDD:return(Math.floor(s/20)+1)*c;case l.PAD:case l.MAD:if(M.isWeapon(a)){const m=d?[0,0,1,1.4666,2.0166,2.663,3.4166]:[1,2.222,3.63,5.325,7.32,8.777,10.25];let e=t.option(n.incPAD).base;if(a===o.heavySword||a===o.longSword){if(a===o.longSword)switch(e){case 100:e=102;break;case 103:e=105;break;case 105:e=107;break;case 112:e=114;break;case 117:e=121;break;case 135:e=139;break;case 169:e=173;break;case 203:e=207;break;case 293:e=297;break;case 337:e=342;break}const u=s>180?6:s>160?5:s>110?4:3;return Math.ceil(e*m[c-1]*u/100)}else{const u=t.option(n.incMAD).base;if(i===l.MAD&&u>=e&&(e=u),d){const f=s>160?18:s>150?15:s>110?12:9;return Math.ceil(e*m[c-1]*f/100)}else{const f=s>110?4:3;return Math.ceil(e*m[c-1]*f/100)}}}else if(s<60)return 0;return c;case l.MHP:case l.MMP:return Math.floor(s/10)*30*c;case l.speed:case l.jump:return M.isWeapon(a)?0:c;case l.damR:return M.isWeapon(a)?c:0;case l.bdR:return s<90||!M.isWeapon(a)?0:2*c;case l.allStatR:return s<70&&!M.isWeapon(a)?0:c;case l.reduceReq:return Math.min(5*c,s);default:return 0}}function J(t){switch(t){case l.STR:return[n.incSTR];case l.DEX:return[n.incDEX];case l.INT:return[n.incINT];case l.LUK:return[n.incLUK];case l.STR_DEX:return[n.incSTR,n.incDEX];case l.STR_INT:return[n.incSTR,n.incINT];case l.STR_LUK:return[n.incSTR,n.incLUK];case l.DEX_INT:return[n.incDEX,n.incINT];case l.DEX_LUK:return[n.incDEX,n.incLUK];case l.INT_LUK:return[n.incINT,n.incLUK];case l.PDD:return[n.incPDD];case l.PAD:return[n.incPAD];case l.MAD:return[n.incMAD];case l.MHP:return[n.incMHP];case l.MMP:return[n.incMMP];case l.speed:return[n.incSpeed];case l.jump:return[n.incJump];case l.damR:return[n.damR];case l.bdR:return[n.bdR];case l.allStatR:return[n.statR];case l.reduceReq:return[n.reduceReq];default:return[]}}const Q=25,g=15;function V(t,i=!1){if(t.getBooleanValue(n.incCHUC))return!1;if(t.getBooleanValue(n.superiorEqp))return Z(t);if(t.star>=t.maxStar&&!i||t.star>=Q)return!1;t.star+=1;const c=t.star,s=w(t,!1,!1),d=w(t,!1,!0),a=M.isWeapon(t.type)||t.type===o.katara,m=[[n.incSTR,n.incDEX],[n.incINT,n.incLUK],[n.incDEX,n.incSTR],[n.incLUK,n.incDEX],[n.incSTR,n.incDEX]],e=[n.incSTR,n.incDEX,n.incINT,n.incLUK];let u;const f=t.req.job;if(f===0)u=new Set([n.incSTR,n.incDEX,n.incINT,n.incLUK]);else{u=new Set;for(let h=0;h<5;h++)if(f&1<<h)for(const r of m[h])u.add(r)}for(const h of e)(u.has(h)||c>15&&(t.option(h).base>0||t.option(h).upgrade>0))&&(t.option(h).enchant+=s[c]);if(a){const h=f===0||Math.floor(f/2)%2===1||t.option(n.incMAD).upgrade>0;if(c>15)t.option(n.incPAD).enchant+=d[c],h&&(t.option(n.incMAD).enchant+=d[c]);else{const r=t.option(n.incPAD).sum-t.option(n.incPAD).bonus;if(t.option(n.incPAD).enchant+=Math.floor(r/50)+1,h){const A=t.option(n.incMAD).sum-t.option(n.incMAD).bonus;t.option(n.incMAD).enchant+=Math.floor(A/50)+1}}}else t.option(n.incPAD).enchant+=d[c],t.option(n.incMAD).enchant+=d[c],t.type===o.glove&&(f===0?(t.option(n.incPAD).enchant+=v[c],t.option(n.incMAD).enchant+=v[c]):Math.floor(f/2)%2===1?t.option(n.incMAD).enchant+=v[c]:t.option(n.incPAD).enchant+=v[c]);if(!a&&t.type!==o.machineHeart){const h=t.option(n.incPDD).sum-t.option(n.incPDD).bonus;t.option(n.incPDD).enchant+=Math.floor(h/20)+1}const D=[o.cap,o.coat,o.longcoat,o.pants,o.cape,o.ring,o.pendant,o.belt,o.shoulder,o.shield];return a?(t.option(n.incMHP).enchant+=C[c],t.option(n.incMMP).enchant+=C[c]):D.includes(t.type)&&(t.option(n.incMHP).enchant+=C[c]),t.type===o.shoes&&(t.option(n.incSpeed).enchant+=L[c],t.option(n.incJump).enchant+=L[c]),!0}function Z(t){if(t.star>=t.maxStar)return!1;t.star+=1;const i=t.star,c=w(t,!1,!1),s=w(t,!1,!0),d=[n.incSTR,n.incDEX,n.incINT,n.incLUK];for(const e of d)t.option(e).base>0&&(t.option(e).enchant+=c[i]);const a=[n.incPAD,n.incMAD];for(const e of a)t.option(e).base>0&&(t.option(e).enchant+=s[i]);const m=t.option(n.incPDD).sum-t.option(n.incPDD).bonus;return t.option(n.incPDD).enchant+=Math.floor(m/20)+1,!0}function Y(t,i=!1,c=!1){if(t.getBooleanValue(n.incCHUC)||t.getBooleanValue(n.superiorEqp)||t.star>=t.maxStar&&!c||t.star>=g)return!1;t.amazing||(t.amazing=!0,t.maxStar=Math.min(t.maxStar,g)),t.star+=1;const s=t.star,d=w(t,!0,!1),a=w(t,!0,!0),m=M.isWeapon(t.type)||t.type===o.katara,e=[n.incSTR,n.incDEX,n.incINT,n.incLUK];for(const D of e)if(t.option(D).sum>0){let r=d[s];i&&M.isAccessory(t.type)&&(r+=s>5?2:1),t.option(D).enchant+=r}const u=[n.incPAD,n.incMAD];for(const D of u){const h=t.option(D).sum;if(h>0){m&&(t.option(D).enchant+=Math.floor(h/50)+1);let r=a[s];i&&(m||t.type===o.shield)&&(r+=1),t.option(D).enchant+=r}}i&&M.isArmor(t.type)&&(t.option(n.incMHP).enchant+=50);const f=t.option(n.incPDD).sum;return t.option(n.incPDD).enchant+=Math.floor(f/20)+1,!0}function x(t){if(t.getBooleanValue(n.incCHUC))return!1;t.star=0,t.amazing=!1,t.maxStar=M.getMaxStar(t);for(const[,i]of t.options)i.enchant=0;return!0}function P(t){if(t.getBooleanValue(n.incCHUC)||t.amazing)return!1;const i=t.star;x(t);for(let c=0;c<i;c++)V(t,!0);return!0}function w(t,i,c){let s;t.getBooleanValue(n.superiorEqp)?c?s=p:s=T:i?c?s=nt:s=ct:c?M.isWeapon(t.type)||t.type===o.katara?s=G:s=y:s=tt;const d=t.req.level;for(const a of[...s].reverse())if(d>=a[0])return a;throw Error(`Gear has invalid reqLevel.
2
- `+t)}const p=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[110,0,0,0,0,0,5,6,7,0,0,0,0,0,0,0],[150,0,0,0,0,0,9,10,11,12,13,15,17,19,21,23]],T=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],G=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,5,6,7,8,9,27,28,29],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,6,7,8,9,10,28,29,30],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,7,8,9,10,11,29,30,31],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,8,9,10,11,12,30,31,32],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,9,10,11,12,13,31,32,33],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,10,11,12,13,14,32,33,34],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,13,14,14,15,16,17,34,35,36],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,15,16,16,17,18,19,36,37,38]],y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,8,9,10,12,13,15,17],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,13,14,16,18],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11,12,13,14,15,17,19,21,23],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,13,14,15,16,17,19,21,23,25],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16,17,18,19,21,23,25,27]],tt=[[0,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0],[108,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],[118,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,0,0,0],[128,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,7,7,7,7,7,7,7,0,0,0],[138,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,9,9,9,9,9,9,9,0,0,0],[148,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,11,11,11,11,11,11,11,0,0,0],[158,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,13,13,13,13,13,13,13,0,0,0],[198,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,15,15,15,15,15,15,15,0,0,0],[248,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,17,17,17,17,17,17,17,0,0,0]],nt=[[0,0,0,0,0,0,1,2,3,4,5,6,8,10,12,14],[80,0,0,0,0,0,2,3,4,5,6,7,9,11,13,15],[90,0,0,0,0,0,3,4,5,6,7,8,10,12,14,16],[100,0,0,0,0,0,4,5,6,7,8,9,11,13,15,17],[110,0,0,0,0,0,5,6,7,8,9,10,12,14,16,18],[120,0,0,0,0,0,6,7,8,9,10,11,13,15,17,19],[130,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[140,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[150,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22]],ct=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[85,3,4,6,9,13,0,0,0,0,0,0,0,0,0,0],[90,4,5,7,10,14,0,0,0,0,0,0,0,0,0,0],[95,5,6,8,11,15,0,0,0,0,0,0,0,0,0,0],[100,7,8,10,13,17,0,0,0,0,0,0,0,0,0,0],[105,8,9,11,14,18,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[115,10,11,13,16,20,0,0,0,0,0,0,0,0,0,0],[120,12,13,15,18,22,0,0,0,0,0,0,0,0,0,0],[125,13,14,16,19,23,0,0,0,0,0,0,0,0,0,0],[130,14,15,17,20,24,0,0,0,0,0,0,0,0,0,0],[135,15,16,18,21,25,0,0,0,0,0,0,0,0,0,0],[140,17,18,20,23,27,0,0,0,0,0,0,0,0,0,0],[145,18,19,21,24,28,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],v=[0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0],C=[0,5,5,5,10,10,15,15,20,20,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0],L=[0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0];class S{constructor(i="",c){this.name=i,this.stat=c??new Map}static getSpellTraceScroll(i,c,s){const d=c===n.incINT?n.incMAD:n.incPAD,a=i.req.level>=115?2:i.req.level>=75?1:0;let m;const e=d===n.incMAD?"마력":"공격력";switch(c){case n.incSTR:m="힘";break;case n.incDEX:m="민첩";break;case n.incINT:m="지력";break;case n.incLUK:m="운";break;case n.incAllStat:m="올스탯";break;case n.incMHP:m="체력";break}if(M.isWeapon(i.type)||i.type===o.katara){if(c===n.incAllStat)return;let u;switch(s){case 100:u=[[1,0],[2,0],[3,1]];break;case 70:u=[[2,0],[3,1],[5,2]];break;case 30:u=[[3,1],[5,2],[7,3]];break;case 15:u=[[5,2],[7,3],[9,4]];break}const f=u[a][0],D=u[a][1]*(c===n.incMHP?50:1),h=D>0?`${s}% ${e}(${m}) 주문서`:`${s}% ${e} 주문서`,r=new Map([[c,D],[d,f]]);return new S(h,r)}else if(s===15)return;if(i.type===o.glove){let u;switch(s){case 100:u=[0,1,1];break;case 70:u=[1,2,2];break;case 30:u=[2,3,3];break}const f=u[a];let D,h;return f===0?(D=`${s}% 방어력 주문서`,h=new Map([[n.incPDD,3]])):(D=`${s}% ${e} 주문서`,h=new Map([[d,f]])),new S(D,h)}if(M.isArmor(i.type)||i.type===o.shoulder){if(c===n.incAllStat){if(s!==30)return;const b=[[1,30,4],[2,70,7],[3,120,10]],R=b[a][0],F=b[a][1],$=b[a][2],O=`${s}% ${m} 주문서`,k=new Map([[n.incSTR,R],[n.incDEX,R],[n.incINT,R],[n.incLUK,R],[n.incMHP,F],[n.incPDD,$]]);return i.upgradeCount===3&&(i.req.job===0?(k.set(n.incMAD,1),k.set(n.incPAD,1)):Math.floor(i.req.job/2)%2===1?k.set(n.incMAD,1):k.set(n.incPAD,1)),new S(O,k)}let u;switch(s){case 100:u=[[1,5,1],[2,20,2],[3,30,3]];break;case 70:u=[[2,15,2],[3,40,4],[4,70,5]];break;case 30:u=[[3,30,4],[5,70,7],[7,120,10]];break}const f=c!==n.incMHP?u[a][0]:0,D=u[a][1]+(c===n.incMHP?u[a][0]*50:0),h=u[a][2],r=`${s}% ${m} 주문서`,A=new Map([[n.incMHP,D],[n.incPDD,h]]);return f>0&&A.set(c,f),i.upgradeCount===3&&(i.req.job===0?(A.set(n.incMAD,1),A.set(n.incPAD,1)):Math.floor(i.req.job/2)%2===1?A.set(n.incMAD,1):A.set(n.incPAD,1)),new S(r,A)}if(M.isAccessory(i.type)){if(c===n.incAllStat){if(s!==30)return;const A=[[1,30,4],[2,70,7],[3,120,10]][a][0],b=`${s}% ${m} 주문서`,R=new Map([[n.incSTR,A],[n.incDEX,A],[n.incINT,A],[n.incLUK,A]]);return new S(b,R)}let u;switch(s){case 100:u=[1,1,2];break;case 70:u=[2,2,3];break;case 30:u=[3,4,5];break}const f=u[a]*(c===n.incMHP?50:1),D=`${s}% ${m} 주문서`,h=new Map([[c,f]]);return new S(D,h)}if(i.type===o.machineHeart){let u;switch(s){case 100:u=[1,2,3];break;case 70:u=[2,3,5];break;case 30:u=[3,5,7];break}const f=u[a],D=`${s}% ${m} 주문서`,h=new Map([[d,f]]);return new S(D,h)}}}function it(t){return t.getBooleanValue(n.blockGoldHammer)||t.getBooleanValue(n.onlyUpgrade)||t.totalUpgradeCount<=0||t.hammerCount>0?!1:(t.hammerCount=1,!0)}function _(t,i){if(t.upgradeCountLeft<1)return!1;t.upgradeCount+=1;for(const[c,s]of i.stat)t.option(c).upgrade+=s;return!0}function st(t,i,c){const s=S.getSpellTraceScroll(t,i,c);return s?_(t,s):!1}function ot(t){return t.upgradeCountLeft<1?!1:(t.upgradeFailCount+=1,!0)}function lt(t){return t.upgradeFailCount<1?!1:(t.upgradeFailCount-=1,!0)}function ut(t){t.upgradeCount=0,t.upgradeFailCount=0,t.hammerCount=0;for(const[,i]of t.options)i.upgrade=0;return!0}exports.BonusStatType=l;exports.Gear=M;exports.GearIcon=H;exports.GearOption=I;exports.GearPropType=n;exports.GearReq=K;exports.GearType=o;exports.Potential=X;exports.PotentialGrade=U;exports.Scroll=S;exports.Soul=j;exports.SoulWeapon=N;exports.addAmazingEnhancement=Y;exports.addBonusStat=z;exports.addStarforce=V;exports.addUpgradeFailCount=ot;exports.applyGoldHammer=it;exports.applyScroll=_;exports.applySpellTrace=st;exports.getBonusStatOption=q;exports.getBonusStatValue=W;exports.recalculateStarforce=P;exports.resetBonusStat=B;exports.resetEnhancement=x;exports.resetUpgrade=ut;exports.restoreUpgradeCount=lt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class H{constructor(){this.id=0,this.origin=[0,0]}}class I{constructor(){this.base=0,this.bonus=0,this.upgrade=0,this.enchant=0}get empty(){return this.base===0&&this.bonus===0&&this.upgrade===0&&this.enchant===0}get sum(){return Math.max(0,this.base+this.bonus+this.upgrade+this.enchant)}get diff(){return this.bonus+this.upgrade+this.enchant}}var n=(t=>(t[t.incSTR=1]="incSTR",t[t.incSTRr=2]="incSTRr",t[t.incDEX=3]="incDEX",t[t.incDEXr=4]="incDEXr",t[t.incINT=5]="incINT",t[t.incINTr=6]="incINTr",t[t.incLUK=7]="incLUK",t[t.incLUKr=8]="incLUKr",t[t.incAllStat=9]="incAllStat",t[t.incMHP=10]="incMHP",t[t.incMMP=11]="incMMP",t[t.incMHPr=12]="incMHPr",t[t.incMMPr=13]="incMMPr",t[t.incMDF=14]="incMDF",t[t.incARC=15]="incARC",t[t.incAUT=16]="incAUT",t[t.incPAD=17]="incPAD",t[t.incMAD=18]="incMAD",t[t.incAD=19]="incAD",t[t.incPDD=20]="incPDD",t[t.incSpeed=21]="incSpeed",t[t.incJump=22]="incJump",t[t.knockback=23]="knockback",t[t.bdR=24]="bdR",t[t.incBDR=25]="incBDR",t[t.imdR=26]="imdR",t[t.incIMDR=27]="incIMDR",t[t.damR=28]="damR",t[t.nbdR=29]="nbdR",t[t.statR=30]="statR",t[t.incCHUC=31]="incCHUC",t[t.incPADr=100]="incPADr",t[t.incMADr=101]="incMADr",t[t.incPDDr=102]="incPDDr",t[t.incCr=103]="incCr",t[t.incDAMr=104]="incDAMr",t[t.RecoveryHP=105]="RecoveryHP",t[t.RecoveryMP=106]="RecoveryMP",t[t.face=107]="face",t[t.prop=108]="prop",t[t.time=109]="time",t[t.HP=110]="HP",t[t.MP=111]="MP",t[t.attackType=112]="attackType",t[t.ignoreTargetDEF=113]="ignoreTargetDEF",t[t.ignoreDAM=114]="ignoreDAM",t[t.ignoreDAMr=115]="ignoreDAMr",t[t.DAMreflect=116]="DAMreflect",t[t.mpconReduce=117]="mpconReduce",t[t.incMesoProp=118]="incMesoProp",t[t.incRewardProp=119]="incRewardProp",t[t.incAllskill=120]="incAllskill",t[t.RecoveryUP=121]="RecoveryUP",t[t.boss=122]="boss",t[t.level=123]="level",t[t.incTerR=124]="incTerR",t[t.incAsrR=125]="incAsrR",t[t.incEXPr=126]="incEXPr",t[t.reduceCooltime=127]="reduceCooltime",t[t.incSTRlv=128]="incSTRlv",t[t.incDEXlv=129]="incDEXlv",t[t.incINTlv=130]="incINTlv",t[t.incLUKlv=131]="incLUKlv",t[t.incMHPlv=132]="incMHPlv",t[t.incPADlv=133]="incPADlv",t[t.incMADlv=134]="incMADlv",t[t.incCriticaldamage=135]="incCriticaldamage",t[t.attackSpeed=200]="attackSpeed",t[t.setItemID=201]="setItemID",t[t.durability=202]="durability",t[t.reduceReq=203]="reduceReq",t[t.only=1100]="only",t[t.tradeBlock=1101]="tradeBlock",t[t.accountSharable=1102]="accountSharable",t[t.onlyEquip=1103]="onlyEquip",t[t.tradeAvailable=1104]="tradeAvailable",t[t.equipTradeBlock=1105]="equipTradeBlock",t[t.sharableOnce=1106]="sharableOnce",t[t.charismaEXP=1107]="charismaEXP",t[t.senseEXP=1108]="senseEXP",t[t.insightEXP=1109]="insightEXP",t[t.willEXP=1110]="willEXP",t[t.craftEXP=1111]="craftEXP",t[t.charmEXP=1112]="charmEXP",t[t.accountShareTag=1113]="accountShareTag",t[t.bossReward=1114]="bossReward",t[t.noPotential=1115]="noPotential",t[t.fixedPotential=1116]="fixedPotential",t[t.specialGrade=1117]="specialGrade",t[t.fixedGrade=1118]="fixedGrade",t[t.superiorEqp=1119]="superiorEqp",t[t.incPQEXPr=1120]="incPQEXPr",t[t.jokerToSetItem=1121]="jokerToSetItem",t[t.blockGoldHammer=1122]="blockGoldHammer",t[t.exceptUpgrade=1123]="exceptUpgrade",t[t.onlyUpgrade=1124]="onlyUpgrade",t[t.noLookChange=1125]="noLookChange",t[t.tucIgnoreForPotential=1126]="tucIgnoreForPotential",t))(n||{});class N{constructor(){this.level=0,this.str=0,this.luk=0,this.dex=0,this.int=0,this.job=0,this.specJob=0}}var o=(t=>(t[t.cap=100]="cap",t[t.faceAccessory=101]="faceAccessory",t[t.eyeAccessory=102]="eyeAccessory",t[t.earrings=103]="earrings",t[t.coat=104]="coat",t[t.longcoat=105]="longcoat",t[t.pants=106]="pants",t[t.shoes=107]="shoes",t[t.glove=108]="glove",t[t.cape=110]="cape",t[t.ring=111]="ring",t[t.pendant=112]="pendant",t[t.belt=113]="belt",t[t.medal=114]="medal",t[t.shoulder=115]="shoulder",t[t.pocket=116]="pocket",t[t.badge=118]="badge",t[t.android=166]="android",t[t.machineHeart=167]="machineHeart",t[t.shield=109]="shield",t[t.emblem=119]="emblem",t[t.powerSource=119020]="powerSource",t[t.shiningRod=1212]="shiningRod",t[t.tuner=1213]="tuner",t[t.breathShooter=1214]="breathShooter",t[t.soulShooter=122]="soulShooter",t[t.desperado=123]="desperado",t[t.energySword=124]="energySword",t[t.espLimiter=126]="espLimiter",t[t.chain=127]="chain",t[t.magicGauntlet=128]="magicGauntlet",t[t.ritualFan=129]="ritualFan",t[t.ohSword=130]="ohSword",t[t.ohAxe=131]="ohAxe",t[t.ohBlunt=132]="ohBlunt",t[t.dagger=133]="dagger",t[t.katara=134]="katara",t[t.cane=136]="cane",t[t.wand=137]="wand",t[t.staff=138]="staff",t[t.thSword=140]="thSword",t[t.chakram=1404]="chakram",t[t.thAxe=141]="thAxe",t[t.thBlunt=142]="thBlunt",t[t.spear=143]="spear",t[t.polearm=144]="polearm",t[t.bow=145]="bow",t[t.crossbow=146]="crossbow",t[t.claw=147]="claw",t[t.knuckle=148]="knuckle",t[t.gun=149]="gun",t[t.shovel=150]="shovel",t[t.pickaxe=151]="pickaxe",t[t.dualBowguns=152]="dualBowguns",t[t.handCannon=153]="handCannon",t[t.heavySword=156]="heavySword",t[t.longSword=157]="longSword",t[t.gauntletRevolver=158]="gauntletRevolver",t[t.ancientBow=159]="ancientBow",t[t.soulShield=1098]="soulShield",t[t.demonShield=1099]="demonShield",t[t.magicArrow=135200]="magicArrow",t[t.card=135210]="card",t[t.medallion=135220]="medallion",t[t.rosary=135221]="rosary",t[t.ironChain=135222]="ironChain",t[t.magicBook1=135223]="magicBook1",t[t.magicBook2=135224]="magicBook2",t[t.magicBook3=135225]="magicBook3",t[t.arrowFletching=135226]="arrowFletching",t[t.bowThimble=135227]="bowThimble",t[t.daggerScabbard=135228]="daggerScabbard",t[t.charm=135229]="charm",t[t.orb=135240]="orb",t[t.dragonEssence=135250]="dragonEssence",t[t.soulRing=135260]="soulRing",t[t.magnum=135270]="magnum",t[t.wristBand=135290]="wristBand",t[t.farSight=135291]="farSight",t[t.powderKeg=135292]="powderKeg",t[t.mass=135293]="mass",t[t.document=135294]="document",t[t.magicMarble=135295]="magicMarble",t[t.arrowhead=135296]="arrowhead",t[t.jewel=135297]="jewel",t[t.powderKeg2=135298]="powderKeg2",t[t.controller=135300]="controller",t[t.foxMarble=135310]="foxMarble",t[t.chessPiece=135320]="chessPiece",t[t.transmitter=135330]="transmitter",t[t.charge=135340]="charge",t[t.magicWing=135350]="magicWing",t[t.pathOfAbyss=135360]="pathOfAbyss",t[t.relic=135370]="relic",t[t.fanTassel=135380]="fanTassel",t[t.bracelet=135400]="bracelet",t[t.weaponBelt=135401]="weaponBelt",t[t.ornament=135402]="ornament",t[t.hexSeeker=135403]="hexSeeker",t[t.petEquip=180]="petEquip",t[t.machineEngine=161]="machineEngine",t[t.machineArms=162]="machineArms",t[t.machineLegs=163]="machineLegs",t[t.machineBody=164]="machineBody",t[t.machineTransistors=165]="machineTransistors",t[t.dragonMask=194]="dragonMask",t[t.dragonPendant=195]="dragonPendant",t[t.dragonWings=196]="dragonWings",t[t.dragonTail=197]="dragonTail",t))(o||{}),U=(t=>(t[t.normal=0]="normal",t[t.rare=1]="rare",t[t.epic=2]="epic",t[t.unique=3]="unique",t[t.legendary=4]="legendary",t[t.special=5]="special",t))(U||{});class K{constructor(i){this.enchanted=!1,this.charge=0,this.chargeOption=new Map,this.gear=i}enchant(){return this.enchanted||!r.isWeapon(this.gear.type)?!1:(this.enchanted=!0,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0)}disenchant(){return this.enchanted?(this.enchanted=!1,this.soul=void 0,this.charge=0,this.chargeOption.clear(),!0):!1}setSoul(i){return this.enchanted?(this.soul=i,this.setCharge(this.charge),!0):!1}removeSoul(){return!this.enchanted||!this.soul?!1:(this.soul=void 0,this.setCharge(this.charge),!0)}setCharge(i){if(!this.enchanted||i<0||i>1e3)return!1;this.charge=i;const s=this.gear.option(n.incPAD).base<this.gear.option(n.incMAD).base?n.incMAD:n.incPAD;return this.chargeOption.clear(),this.chargeOption.set(s,this.getChargeAD()),!0}getChargeAD(){if(!this.enchanted||this.charge===0)return 0;const i=Math.min(Math.ceil(this.charge/100)-1,5);if(this.soul){const c=this.soul.multiplier;return 10+i*c}return 5+i}}class j{constructor(){this.name="",this.skill="",this.option=new Map,this.multiplier=0}}const v=class{constructor(){this.itemID=0,this.name="",this.desc="",this.icon=new H,this.type=0,this.req=new N,this.props=new Map,this.options=new Map,this.totalUpgradeCount=0,this.upgradeCount=0,this.upgradeFailCount=0,this.hammerCount=0,this.maxStar=0,this.star=0,this.amazing=!1,this.canPotential=!1,this.grade=U.normal,this.potentials=[],this.additionalGrade=U.normal,this.additionalPotentials=[],this.soulWeapon=new K(this)}get upgradeCountLeft(){return this.totalUpgradeCount+this.hammerCount-this.upgradeCount-this.upgradeFailCount}get diff(){let t=0;for(const[i,c]of this.options)t+=Math.floor(c.diff/v.getPropTypeWeight(i));return t}get isNewBonusType(){return!!([...this.options.values()].some(i=>i.bonus>0)&&this.getPropValue(n.tradeAvailable)!==1)}option(t){return this.options.has(t)||this.options.set(t,new I),this.options.get(t)}getPropValue(t){return this.props.get(t)??0}getBooleanValue(t){return(this.props.get(t)??0)>0}static isWeapon(t){return this.isLeftWeapon(t)||this.isDoubleHandWeapon(t)}static isLeftWeapon(t){return t>=121&&t<=139&&t!==o.katara||Math.floor(t/10)===121}static isDoubleHandWeapon(t){return t>=140&&t<=149||t>=152&&t<=159||Math.floor(t/10)===140}static isSubWeapon(t){switch(t){case o.katara:case o.shield:case o.demonShield:case o.soulShield:return!0;default:return Math.floor(t/1e3)===135}}static isShield(t){switch(t){case o.shield:case o.demonShield:case o.soulShield:return!0;default:return!1}}static isArmor(t){return t===100||t>=104&&t<=110}static isAccessory(t){return t>=101&&t<=103||t>=111&&t<=113||t===115}static isMechanicGear(t){return t>=161&&t<=165}static isDragonGear(t){return t>=194&&t<=197}static getGearType(t){switch(Math.floor(t/1e3)){case 1098:return o.soulShield;case 1099:return o.demonShield;case 1212:return o.shiningRod;case 1213:return o.tuner;case 1214:return o.breathShooter;case 1404:return o.chakram}if(Math.floor(t/1e4)===135)switch(Math.floor(t/100)){case 13522:case 13528:case 13529:case 13540:return Math.floor(t/10);default:return Math.floor(t/100)*10}if(Math.floor(t/1e4)===119)switch(Math.floor(t/100)){case 11902:return Math.floor(t/10)}return Math.floor(t/1e4)}static getMaxStar(t){if(t.totalUpgradeCount<=0||t.getBooleanValue(n.onlyUpgrade)||v.isMechanicGear(t.type)||v.isDragonGear(t.type))return 0;let i;const c=t.req.level;for(const s of v.starData)if(c>=s[0])i=s;else break;return i===void 0?0:t.getBooleanValue(n.superiorEqp)?i[2]:i[1]}static getPropTypeWeight(t){if(t<100)switch(t){case n.incSTR:case n.incDEX:case n.incINT:case n.incLUK:case n.incPAD:case n.incMAD:case n.incSpeed:case n.incJump:return 1;case n.incMHP:case n.incMMP:return 100;case n.incPDD:return 10;case n.incAD:return 2}return Number.MAX_VALUE}};let r=v;r.starData=[[0,5,3],[95,8,5],[110,10,8],[120,15,10],[130,20,12],[140,25,15]];class X{constructor(){this.code=0,this.optionType=0,this.reqLevel=0,this.summary="",this.option=new Map}get convertSummary(){const i=[...this.option.keys()];i.sort((s,d)=>n[d].length-n[s].length);let c=this.summary;for(const s of i)c=c.replace(`#${n[s]}`,(this.option.get(s)??0).toString());return c}static getPotentialLevel(i){return i<=0?1:i>=250?25:Math.floor((i+9)/10)}static checkOptionType(i,c){switch(i){case 0:return!0;case 10:return r.isWeapon(c)||r.isSubWeapon(c)||c===o.emblem;case 11:return!X.checkOptionType(10,c);case 20:return r.isSubWeapon(c)||c===o.cap||c===o.coat||c===o.longcoat||c===o.pants||c===o.shoes||c===o.glove||c===o.cape||c===o.belt||c===o.shoulder;case 40:return c===o.faceAccessory||c===o.eyeAccessory||c===o.earrings||c===o.ring||c===o.pendant;case 51:return c===o.cap;case 52:return c===o.coat||c===o.longcoat;case 53:return c===o.pants;case 54:return c===o.glove;case 55:return c===o.shoes;default:return!1}}}var l=(t=>(t[t.STR=0]="STR",t[t.DEX=1]="DEX",t[t.INT=2]="INT",t[t.LUK=3]="LUK",t[t.STR_DEX=4]="STR_DEX",t[t.STR_INT=5]="STR_INT",t[t.STR_LUK=6]="STR_LUK",t[t.DEX_INT=7]="DEX_INT",t[t.DEX_LUK=8]="DEX_LUK",t[t.INT_LUK=9]="INT_LUK",t[t.PDD=10]="PDD",t[t.PAD=11]="PAD",t[t.MAD=12]="MAD",t[t.MHP=13]="MHP",t[t.MMP=14]="MMP",t[t.speed=15]="speed",t[t.jump=16]="jump",t[t.damR=17]="damR",t[t.bdR=18]="bdR",t[t.allStatR=19]="allStatR",t[t.reduceReq=20]="reduceReq",t))(l||{});function B(t,i,c){const s=q(t,i,c);if(s.size===0)return!1;for(const[d,a]of s)t.option(d).bonus+=a;return!0}function z(t){for(const[,i]of t.options)i.bonus=0;return!0}function q(t,i,c){const s=J(i),d=W(t,i,c);return d===0?new Map:new Map(s.map(a=>[a,d]))}function W(t,i,c){const s=t.req.level,d=t.getBooleanValue(n.bossReward),a=t.type;if(s<0||d&&c<3)return 0;switch(i){case l.STR:case l.DEX:case l.INT:case l.LUK:return(Math.floor(s/20)+1)*c;case l.STR_DEX:case l.STR_INT:case l.STR_LUK:case l.DEX_INT:case l.DEX_LUK:case l.INT_LUK:return(Math.floor(s/40)+1)*c;case l.PDD:return(Math.floor(s/20)+1)*c;case l.PAD:case l.MAD:if(r.isWeapon(a)){const m=d?[0,0,1,1.4666,2.0166,2.663,3.4166]:[1,2.222,3.63,5.325,7.32,8.777,10.25];let e=t.option(n.incPAD).base;if(a===o.heavySword||a===o.longSword){if(a===o.longSword)switch(e){case 100:e=102;break;case 103:e=105;break;case 105:e=107;break;case 112:e=114;break;case 117:e=121;break;case 135:e=139;break;case 169:e=173;break;case 203:e=207;break;case 293:e=297;break;case 337:e=342;break}const u=s>180?6:s>160?5:s>110?4:3;return Math.ceil(e*m[c-1]*u/100)}else{const u=t.option(n.incMAD).base;if(i===l.MAD&&u>=e&&(e=u),d){const f=s>160?18:s>150?15:s>110?12:9;return Math.ceil(e*m[c-1]*f/100)}else{const f=s>110?4:3;return Math.ceil(e*m[c-1]*f/100)}}}else if(s<60)return 0;return c;case l.MHP:case l.MMP:return Math.floor(s/10)*30*c;case l.speed:case l.jump:return r.isWeapon(a)?0:c;case l.damR:return r.isWeapon(a)?c:0;case l.bdR:return s<90||!r.isWeapon(a)?0:2*c;case l.allStatR:return s<70&&!r.isWeapon(a)?0:c;case l.reduceReq:return Math.min(5*c,s);default:return 0}}function J(t){switch(t){case l.STR:return[n.incSTR];case l.DEX:return[n.incDEX];case l.INT:return[n.incINT];case l.LUK:return[n.incLUK];case l.STR_DEX:return[n.incSTR,n.incDEX];case l.STR_INT:return[n.incSTR,n.incINT];case l.STR_LUK:return[n.incSTR,n.incLUK];case l.DEX_INT:return[n.incDEX,n.incINT];case l.DEX_LUK:return[n.incDEX,n.incLUK];case l.INT_LUK:return[n.incINT,n.incLUK];case l.PDD:return[n.incPDD];case l.PAD:return[n.incPAD];case l.MAD:return[n.incMAD];case l.MHP:return[n.incMHP];case l.MMP:return[n.incMMP];case l.speed:return[n.incSpeed];case l.jump:return[n.incJump];case l.damR:return[n.damR];case l.bdR:return[n.bdR];case l.allStatR:return[n.statR];case l.reduceReq:return[n.reduceReq];default:return[]}}const Q=25,g=15;function V(t,i=!1){if(t.getBooleanValue(n.incCHUC))return!1;if(t.getBooleanValue(n.superiorEqp))return Z(t);if(t.star>=t.maxStar&&!i||t.star>=Q)return!1;t.star+=1;const c=t.star,s=b(t,!1,!1),d=b(t,!1,!0),a=r.isWeapon(t.type)||t.type===o.katara,m=[[n.incSTR,n.incDEX],[n.incINT,n.incLUK],[n.incDEX,n.incSTR],[n.incLUK,n.incDEX],[n.incSTR,n.incDEX]],e=[n.incSTR,n.incDEX,n.incINT,n.incLUK];let u;const f=t.req.job;if(f===0)u=new Set([n.incSTR,n.incDEX,n.incINT,n.incLUK]);else{u=new Set;for(let h=0;h<5;h++)if(f&1<<h)for(const M of m[h])u.add(M)}for(const h of e)(u.has(h)||c>15&&(t.option(h).base>0||t.option(h).upgrade>0))&&(t.option(h).enchant+=s[c]);if(a){const h=f===0||Math.floor(f/2)%2===1||t.option(n.incMAD).upgrade>0;if(c>15)t.option(n.incPAD).enchant+=d[c],h&&(t.option(n.incMAD).enchant+=d[c]);else{const M=t.option(n.incPAD).sum-t.option(n.incPAD).bonus;if(t.option(n.incPAD).enchant+=Math.floor(M/50)+1,h){const A=t.option(n.incMAD).sum-t.option(n.incMAD).bonus;t.option(n.incMAD).enchant+=Math.floor(A/50)+1}}}else t.option(n.incPAD).enchant+=d[c],t.option(n.incMAD).enchant+=d[c],t.type===o.glove&&(f===0?(t.option(n.incPAD).enchant+=E[c],t.option(n.incMAD).enchant+=E[c]):Math.floor(f/2)%2===1?t.option(n.incMAD).enchant+=E[c]:t.option(n.incPAD).enchant+=E[c]);if(!a&&t.type!==o.machineHeart){const h=t.option(n.incPDD).sum-t.option(n.incPDD).bonus;t.option(n.incPDD).enchant+=Math.floor(h/20)+1}const D=[o.cap,o.coat,o.longcoat,o.pants,o.cape,o.ring,o.pendant,o.belt,o.shoulder,o.shield];return a?(t.option(n.incMHP).enchant+=C[c],t.option(n.incMMP).enchant+=C[c]):D.includes(t.type)&&(t.option(n.incMHP).enchant+=C[c]),t.type===o.shoes&&(t.option(n.incSpeed).enchant+=L[c],t.option(n.incJump).enchant+=L[c]),!0}function Z(t){if(t.star>=t.maxStar)return!1;t.star+=1;const i=t.star,c=b(t,!1,!1),s=b(t,!1,!0),d=[n.incSTR,n.incDEX,n.incINT,n.incLUK];for(const e of d)t.option(e).base>0&&(t.option(e).enchant+=c[i]);const a=[n.incPAD,n.incMAD];for(const e of a)t.option(e).base>0&&(t.option(e).enchant+=s[i]);const m=t.option(n.incPDD).sum-t.option(n.incPDD).bonus;return t.option(n.incPDD).enchant+=Math.floor(m/20)+1,!0}function Y(t,i=!1,c=!1){if(t.getBooleanValue(n.incCHUC)||t.getBooleanValue(n.superiorEqp)||t.star>=t.maxStar&&!c||t.star>=g)return!1;t.amazing||(t.amazing=!0,t.maxStar=Math.min(t.maxStar,g)),t.star+=1;const s=t.star,d=b(t,!0,!1),a=b(t,!0,!0),m=r.isWeapon(t.type)||t.type===o.katara,e=[n.incSTR,n.incDEX,n.incINT,n.incLUK];for(const D of e)if(t.option(D).sum>0){let M=d[s];i&&r.isAccessory(t.type)&&(M+=s>5?2:1),t.option(D).enchant+=M}const u=[n.incPAD,n.incMAD];for(const D of u){const h=t.option(D).sum;if(h>0){m&&(t.option(D).enchant+=Math.floor(h/50)+1);let M=a[s];i&&(m||t.type===o.shield)&&(M+=1),t.option(D).enchant+=M}}i&&r.isArmor(t.type)&&(t.option(n.incMHP).enchant+=50);const f=t.option(n.incPDD).sum;return t.option(n.incPDD).enchant+=Math.floor(f/20)+1,!0}function x(t){if(t.getBooleanValue(n.incCHUC))return!1;t.star=0,t.amazing=!1,t.maxStar=r.getMaxStar(t);for(const[,i]of t.options)i.enchant=0;return!0}function P(t){if(t.getBooleanValue(n.incCHUC)||t.amazing)return!1;const i=t.star;x(t);for(let c=0;c<i;c++)V(t,!0);return!0}function b(t,i,c){let s;t.getBooleanValue(n.superiorEqp)?c?s=p:s=T:i?c?s=nt:s=ct:c?r.isWeapon(t.type)||t.type===o.katara?s=G:s=y:s=tt;const d=t.req.level;for(const a of[...s].reverse())if(d>=a[0])return a;throw Error(`Gear has invalid reqLevel.
2
+ `+t)}const p=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[110,0,0,0,0,0,5,6,7,0,0,0,0,0,0,0],[150,0,0,0,0,0,9,10,11,12,13,15,17,19,21,23]],T=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],G=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,5,6,7,8,9,27,28,29],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,6,7,8,9,10,28,29,30],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,7,8,9,10,11,29,30,31],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,8,9,10,11,12,30,31,32],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,9,10,11,12,13,31,32,33],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,10,11,12,13,14,32,33,34],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,13,14,14,15,16,17,34,35,36],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,15,16,16,17,18,19,36,37,38]],y=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,8,9,10,12,13,15,17],[118,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,8,9,10,11,13,14,16,18],[128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22],[158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,11,12,13,14,15,17,19,21,23],[198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,13,14,15,16,17,19,21,23,25],[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16,17,18,19,21,23,25,27]],tt=[[0,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0],[108,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],[118,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,0,0,0],[128,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,7,7,7,7,7,7,7,0,0,0],[138,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,9,9,9,9,9,9,9,0,0,0],[148,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,11,11,11,11,11,11,11,0,0,0],[158,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,13,13,13,13,13,13,13,0,0,0],[198,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,15,15,15,15,15,15,15,0,0,0],[248,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,17,17,17,17,17,17,17,0,0,0]],nt=[[0,0,0,0,0,0,1,2,3,4,5,6,8,10,12,14],[80,0,0,0,0,0,2,3,4,5,6,7,9,11,13,15],[90,0,0,0,0,0,3,4,5,6,7,8,10,12,14,16],[100,0,0,0,0,0,4,5,6,7,8,9,11,13,15,17],[110,0,0,0,0,0,5,6,7,8,9,10,12,14,16,18],[120,0,0,0,0,0,6,7,8,9,10,11,13,15,17,19],[130,0,0,0,0,0,7,8,9,10,11,12,14,16,18,20],[140,0,0,0,0,0,8,9,10,11,12,13,15,17,19,21],[150,0,0,0,0,0,9,10,11,12,13,14,16,18,20,22]],ct=[[0,1,2,4,7,11,0,0,0,0,0,0,0,0,0,0],[80,2,3,5,8,12,0,0,0,0,0,0,0,0,0,0],[85,3,4,6,9,13,0,0,0,0,0,0,0,0,0,0],[90,4,5,7,10,14,0,0,0,0,0,0,0,0,0,0],[95,5,6,8,11,15,0,0,0,0,0,0,0,0,0,0],[100,7,8,10,13,17,0,0,0,0,0,0,0,0,0,0],[105,8,9,11,14,18,0,0,0,0,0,0,0,0,0,0],[110,9,10,12,15,19,0,0,0,0,0,0,0,0,0,0],[115,10,11,13,16,20,0,0,0,0,0,0,0,0,0,0],[120,12,13,15,18,22,0,0,0,0,0,0,0,0,0,0],[125,13,14,16,19,23,0,0,0,0,0,0,0,0,0,0],[130,14,15,17,20,24,0,0,0,0,0,0,0,0,0,0],[135,15,16,18,21,25,0,0,0,0,0,0,0,0,0,0],[140,17,18,20,23,27,0,0,0,0,0,0,0,0,0,0],[145,18,19,21,24,28,0,0,0,0,0,0,0,0,0,0],[150,19,20,22,25,29,0,0,0,0,0,0,0,0,0,0]],E=[0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0],C=[0,5,5,5,10,10,15,15,20,20,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0],L=[0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0];class S{constructor(i="",c){this.name=i,this.stat=c??new Map}static getSpellTraceScroll(i,c,s){const d=c===n.incINT?n.incMAD:n.incPAD,a=i.req.level>=115?2:i.req.level>=75?1:0;let m;const e=d===n.incMAD?"마력":"공격력";switch(c){case n.incSTR:m="힘";break;case n.incDEX:m="민첩";break;case n.incINT:m="지력";break;case n.incLUK:m="운";break;case n.incAllStat:m="올스탯";break;case n.incMHP:m="체력";break}if(r.isWeapon(i.type)||i.type===o.katara){if(c===n.incAllStat)return;let u;switch(s){case 100:u=[[1,0],[2,0],[3,1]];break;case 70:u=[[2,0],[3,1],[5,2]];break;case 30:u=[[3,1],[5,2],[7,3]];break;case 15:u=[[5,2],[7,3],[9,4]];break}const f=u[a][0],D=u[a][1]*(c===n.incMHP?50:1),h=D>0?`${s}% ${e}(${m}) 주문서`:`${s}% ${e} 주문서`,M=new Map([[c,D],[d,f]]);return new S(h,M)}else if(s===15)return;if(i.type===o.glove){let u;switch(s){case 100:u=[0,1,1];break;case 70:u=[1,2,2];break;case 30:u=[2,3,3];break}const f=u[a];let D,h;return f===0?(D=`${s}% 방어력 주문서`,h=new Map([[n.incPDD,3]])):(D=`${s}% ${e} 주문서`,h=new Map([[d,f]])),new S(D,h)}if(r.isArmor(i.type)||i.type===o.shoulder){if(c===n.incAllStat){if(s!==30)return;const w=[[1,30,4],[2,70,7],[3,120,10]],R=w[a][0],F=w[a][1],$=w[a][2],O=`${s}% ${m} 주문서`,k=new Map([[n.incSTR,R],[n.incDEX,R],[n.incINT,R],[n.incLUK,R],[n.incMHP,F],[n.incPDD,$]]);return i.upgradeCount===3&&(i.req.job===0?(k.set(n.incMAD,1),k.set(n.incPAD,1)):Math.floor(i.req.job/2)%2===1?k.set(n.incMAD,1):k.set(n.incPAD,1)),new S(O,k)}let u;switch(s){case 100:u=[[1,5,1],[2,20,2],[3,30,3]];break;case 70:u=[[2,15,2],[3,40,4],[4,70,5]];break;case 30:u=[[3,30,4],[5,70,7],[7,120,10]];break}const f=c!==n.incMHP?u[a][0]:0,D=u[a][1]+(c===n.incMHP?u[a][0]*50:0),h=u[a][2],M=`${s}% ${m} 주문서`,A=new Map([[n.incMHP,D],[n.incPDD,h]]);return f>0&&A.set(c,f),i.upgradeCount===3&&(i.req.job===0?(A.set(n.incMAD,1),A.set(n.incPAD,1)):Math.floor(i.req.job/2)%2===1?A.set(n.incMAD,1):A.set(n.incPAD,1)),new S(M,A)}if(r.isAccessory(i.type)){if(c===n.incAllStat){if(s!==30)return;const A=[[1,30,4],[2,70,7],[3,120,10]][a][0],w=`${s}% ${m} 주문서`,R=new Map([[n.incSTR,A],[n.incDEX,A],[n.incINT,A],[n.incLUK,A]]);return new S(w,R)}let u;switch(s){case 100:u=[1,1,2];break;case 70:u=[2,2,3];break;case 30:u=[3,4,5];break}const f=u[a]*(c===n.incMHP?50:1),D=`${s}% ${m} 주문서`,h=new Map([[c,f]]);return new S(D,h)}if(i.type===o.machineHeart){let u;switch(s){case 100:u=[1,2,3];break;case 70:u=[2,3,5];break;case 30:u=[3,5,7];break}const f=u[a],D=`${s}% ${m} 주문서`,h=new Map([[d,f]]);return new S(D,h)}}}function it(t){return t.getBooleanValue(n.blockGoldHammer)||t.getBooleanValue(n.onlyUpgrade)||t.totalUpgradeCount<=0||t.hammerCount>0?!1:(t.hammerCount=1,!0)}function _(t,i){if(t.upgradeCountLeft<1)return!1;t.upgradeCount+=1;for(const[c,s]of i.stat)t.option(c).upgrade+=s;return!0}function st(t,i,c){const s=S.getSpellTraceScroll(t,i,c);return s?_(t,s):!1}function ot(t){return t.upgradeCountLeft<1?!1:(t.upgradeFailCount+=1,!0)}function lt(t){return t.upgradeFailCount<1?!1:(t.upgradeFailCount-=1,!0)}function ut(t){t.upgradeCount=0,t.upgradeFailCount=0,t.hammerCount=0;for(const[,i]of t.options)i.upgrade=0;return!0}exports.BonusStatType=l;exports.Gear=r;exports.GearIcon=H;exports.GearOption=I;exports.GearPropType=n;exports.GearReq=N;exports.GearType=o;exports.Potential=X;exports.PotentialGrade=U;exports.Scroll=S;exports.Soul=j;exports.SoulWeapon=K;exports.addAmazingEnhancement=Y;exports.addBonusStat=B;exports.addStarforce=V;exports.addUpgradeFailCount=ot;exports.applyGoldHammer=it;exports.applyScroll=_;exports.applySpellTrace=st;exports.getBonusStatOption=q;exports.getBonusStatValue=W;exports.recalculateStarforce=P;exports.resetBonusStat=z;exports.resetEnhancement=x;exports.resetUpgrade=ut;exports.restoreUpgradeCount=lt;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- class N {
1
+ class K {
2
2
  constructor() {
3
3
  this.id = 0, this.origin = [0, 0];
4
4
  }
@@ -27,9 +27,9 @@ class W {
27
27
  }
28
28
  }
29
29
  var o = /* @__PURE__ */ ((t) => (t[t.cap = 100] = "cap", t[t.faceAccessory = 101] = "faceAccessory", t[t.eyeAccessory = 102] = "eyeAccessory", t[t.earrings = 103] = "earrings", t[t.coat = 104] = "coat", t[t.longcoat = 105] = "longcoat", t[t.pants = 106] = "pants", t[t.shoes = 107] = "shoes", t[t.glove = 108] = "glove", t[t.cape = 110] = "cape", t[t.ring = 111] = "ring", t[t.pendant = 112] = "pendant", t[t.belt = 113] = "belt", t[t.medal = 114] = "medal", t[t.shoulder = 115] = "shoulder", t[t.pocket = 116] = "pocket", t[t.badge = 118] = "badge", t[t.android = 166] = "android", t[t.machineHeart = 167] = "machineHeart", t[t.shield = 109] = "shield", t[t.emblem = 119] = "emblem", t[t.powerSource = 119020] = "powerSource", t[t.shiningRod = 1212] = "shiningRod", t[t.tuner = 1213] = "tuner", t[t.breathShooter = 1214] = "breathShooter", t[t.soulShooter = 122] = "soulShooter", t[t.desperado = 123] = "desperado", t[t.energySword = 124] = "energySword", t[t.espLimiter = 126] = "espLimiter", t[t.chain = 127] = "chain", t[t.magicGauntlet = 128] = "magicGauntlet", t[t.ritualFan = 129] = "ritualFan", t[t.ohSword = 130] = "ohSword", t[t.ohAxe = 131] = "ohAxe", t[t.ohBlunt = 132] = "ohBlunt", t[t.dagger = 133] = "dagger", t[t.katara = 134] = "katara", t[t.cane = 136] = "cane", t[t.wand = 137] = "wand", t[t.staff = 138] = "staff", t[t.thSword = 140] = "thSword", t[t.chakram = 1404] = "chakram", t[t.thAxe = 141] = "thAxe", t[t.thBlunt = 142] = "thBlunt", t[t.spear = 143] = "spear", t[t.polearm = 144] = "polearm", t[t.bow = 145] = "bow", t[t.crossbow = 146] = "crossbow", t[t.claw = 147] = "claw", t[t.knuckle = 148] = "knuckle", t[t.gun = 149] = "gun", t[t.shovel = 150] = "shovel", t[t.pickaxe = 151] = "pickaxe", t[t.dualBowguns = 152] = "dualBowguns", t[t.handCannon = 153] = "handCannon", t[t.heavySword = 156] = "heavySword", t[t.longSword = 157] = "longSword", t[t.gauntletRevolver = 158] = "gauntletRevolver", t[t.ancientBow = 159] = "ancientBow", t[t.soulShield = 1098] = "soulShield", t[t.demonShield = 1099] = "demonShield", t[t.magicArrow = 135200] = "magicArrow", t[t.card = 135210] = "card", t[t.medallion = 135220] = "medallion", t[t.rosary = 135221] = "rosary", t[t.ironChain = 135222] = "ironChain", t[t.magicBook1 = 135223] = "magicBook1", t[t.magicBook2 = 135224] = "magicBook2", t[t.magicBook3 = 135225] = "magicBook3", t[t.arrowFletching = 135226] = "arrowFletching", t[t.bowThimble = 135227] = "bowThimble", t[t.daggerScabbard = 135228] = "daggerScabbard", t[t.charm = 135229] = "charm", t[t.orb = 135240] = "orb", t[t.dragonEssence = 135250] = "dragonEssence", t[t.soulRing = 135260] = "soulRing", t[t.magnum = 135270] = "magnum", t[t.wristBand = 135290] = "wristBand", t[t.farSight = 135291] = "farSight", t[t.powderKeg = 135292] = "powderKeg", t[t.mass = 135293] = "mass", t[t.document = 135294] = "document", t[t.magicMarble = 135295] = "magicMarble", t[t.arrowhead = 135296] = "arrowhead", t[t.jewel = 135297] = "jewel", t[t.powderKeg2 = 135298] = "powderKeg2", t[t.controller = 135300] = "controller", t[t.foxMarble = 135310] = "foxMarble", t[t.chessPiece = 135320] = "chessPiece", t[t.transmitter = 135330] = "transmitter", t[t.charge = 135340] = "charge", t[t.magicWing = 135350] = "magicWing", t[t.pathOfAbyss = 135360] = "pathOfAbyss", t[t.relic = 135370] = "relic", t[t.fanTassel = 135380] = "fanTassel", t[t.bracelet = 135400] = "bracelet", t[t.weaponBelt = 135401] = "weaponBelt", t[t.ornament = 135402] = "ornament", t[t.hexSeeker = 135403] = "hexSeeker", t[t.petEquip = 180] = "petEquip", t[t.machineEngine = 161] = "machineEngine", t[t.machineArms = 162] = "machineArms", t[t.machineLegs = 163] = "machineLegs", t[t.machineBody = 164] = "machineBody", t[t.machineTransistors = 165] = "machineTransistors", t[t.dragonMask = 194] = "dragonMask", t[t.dragonPendant = 195] = "dragonPendant", t[t.dragonWings = 196] = "dragonWings", t[t.dragonTail = 197] = "dragonTail", t))(o || {}), C = /* @__PURE__ */ ((t) => (t[t.normal = 0] = "normal", t[t.rare = 1] = "rare", t[t.epic = 2] = "epic", t[t.unique = 3] = "unique", t[t.legendary = 4] = "legendary", t[t.special = 5] = "special", t))(C || {});
30
- class x {
31
- constructor(i) {
32
- this.enchanted = !1, this.charge = 0, this.chargeOption = /* @__PURE__ */ new Map(), this.gear = i;
30
+ class V {
31
+ constructor(c) {
32
+ this.enchanted = !1, this.charge = 0, this.chargeOption = /* @__PURE__ */ new Map(), this.gear = c;
33
33
  }
34
34
  /**
35
35
  * 소울 인챈트를 적용합니다.
@@ -55,8 +55,8 @@ class x {
55
55
  * @returns 장착했을 경우 `true`; 아닐 경우 `false`.
56
56
  * 소울 인챈트 상태가 아닐 경우 `false`를 반환합니다.
57
57
  */
58
- setSoul(i) {
59
- return this.enchanted ? (this.soul = i, this.setCharge(this.charge), !0) : !1;
58
+ setSoul(c) {
59
+ return this.enchanted ? (this.soul = c, this.setCharge(this.charge), !0) : !1;
60
60
  }
61
61
  /**
62
62
  * 장착된 소울을 제거합니다.
@@ -74,22 +74,22 @@ class x {
74
74
  * @returns 적용했을 경우 `true`; 아닐 경우 `false`.
75
75
  * 소울 인챈트 상태가 아니거나 설정할 소울 충전량이 0과 1000 사이의 값이 아닐 경우 `false`를 반환합니다.
76
76
  */
77
- setCharge(i) {
78
- if (!this.enchanted || i < 0 || i > 1e3)
77
+ setCharge(c) {
78
+ if (!this.enchanted || c < 0 || c > 1e3)
79
79
  return !1;
80
- this.charge = i;
80
+ this.charge = c;
81
81
  const s = this.gear.option(n.incPAD).base < this.gear.option(n.incMAD).base ? n.incMAD : n.incPAD;
82
82
  return this.chargeOption.clear(), this.chargeOption.set(s, this.getChargeAD()), !0;
83
83
  }
84
84
  getChargeAD() {
85
85
  if (!this.enchanted || this.charge === 0)
86
86
  return 0;
87
- const i = Math.min(Math.ceil(this.charge / 100) - 1, 5);
87
+ const c = Math.min(Math.ceil(this.charge / 100) - 1, 5);
88
88
  if (this.soul) {
89
- const c = this.soul.multiplier;
90
- return 10 + i * c;
89
+ const i = this.soul.multiplier;
90
+ return 10 + c * i;
91
91
  }
92
- return 5 + i;
92
+ return 5 + c;
93
93
  }
94
94
  }
95
95
  class G {
@@ -97,9 +97,9 @@ class G {
97
97
  this.name = "", this.skill = "", this.option = /* @__PURE__ */ new Map(), this.multiplier = 0;
98
98
  }
99
99
  }
100
- const E = class {
100
+ const v = class {
101
101
  constructor() {
102
- this.itemID = 0, this.name = "", this.desc = "", this.icon = new N(), this.type = 0, this.req = new W(), this.props = /* @__PURE__ */ new Map(), this.options = /* @__PURE__ */ new Map(), this.totalUpgradeCount = 0, this.upgradeCount = 0, this.upgradeFailCount = 0, this.hammerCount = 0, this.maxStar = 0, this.star = 0, this.amazing = !1, this.canPotential = !1, this.grade = C.normal, this.potentials = [], this.additionalGrade = C.normal, this.additionalPotentials = [], this.soulWeapon = new x(this);
102
+ this.itemID = 0, this.name = "", this.desc = "", this.icon = new K(), this.type = 0, this.req = new W(), this.props = /* @__PURE__ */ new Map(), this.options = /* @__PURE__ */ new Map(), this.totalUpgradeCount = 0, this.upgradeCount = 0, this.upgradeFailCount = 0, this.hammerCount = 0, this.maxStar = 0, this.star = 0, this.amazing = !1, this.canPotential = !1, this.grade = C.normal, this.potentials = [], this.additionalGrade = C.normal, this.additionalPotentials = [], this.soulWeapon = new V(this);
103
103
  }
104
104
  /**
105
105
  * 업그레이드 가능 횟수
@@ -112,10 +112,20 @@ const E = class {
112
112
  */
113
113
  get diff() {
114
114
  let t = 0;
115
- for (const [i, c] of this.options)
116
- t += Math.floor(c.diff / E.getPropTypeWeight(i));
115
+ for (const [c, i] of this.options)
116
+ t += Math.floor(i.diff / v.getPropTypeWeight(c));
117
117
  return t;
118
118
  }
119
+ /**
120
+ * 장비를 처음 획득했을 때 추가옵션이 존재했는지 여부
121
+ *
122
+ * *일부 저레벨 장비의 경우 인게임과 차이가 있습니다.*
123
+ *
124
+ * 장비 아이콘 왼쪽 위의 원이 채워져있으면 `true`; 아니면 `false`입니다.
125
+ */
126
+ get isNewBonusType() {
127
+ return !!([...this.options.values()].some((c) => c.bonus > 0) && this.getPropValue(n.tradeAvailable) !== 1);
128
+ }
119
129
  /**
120
130
  * 지정된 장비 옵션 종류과 연결된 옵션을 가져옵니다.
121
131
  * @param type 장비 옵션 종류.
@@ -271,16 +281,16 @@ const E = class {
271
281
  * 최대 업그레이드 가능 횟수가 `0`이거나 `onlyUpgrade` 속성이 존재하거나 메카닉 장비 또는 드래곤 장비일 경우 `0`입니다.
272
282
  */
273
283
  static getMaxStar(t) {
274
- if (t.totalUpgradeCount <= 0 || t.getBooleanValue(n.onlyUpgrade) || E.isMechanicGear(t.type) || E.isDragonGear(t.type))
284
+ if (t.totalUpgradeCount <= 0 || t.getBooleanValue(n.onlyUpgrade) || v.isMechanicGear(t.type) || v.isDragonGear(t.type))
275
285
  return 0;
276
- let i;
277
- const c = t.req.level;
278
- for (const s of E.starData)
279
- if (c >= s[0])
280
- i = s;
286
+ let c;
287
+ const i = t.req.level;
288
+ for (const s of v.starData)
289
+ if (i >= s[0])
290
+ c = s;
281
291
  else
282
292
  break;
283
- return i === void 0 ? 0 : t.getBooleanValue(n.superiorEqp) ? i[2] : i[1];
293
+ return c === void 0 ? 0 : t.getBooleanValue(n.superiorEqp) ? c[2] : c[1];
284
294
  }
285
295
  static getPropTypeWeight(t) {
286
296
  if (t < 100)
@@ -305,7 +315,7 @@ const E = class {
305
315
  return Number.MAX_VALUE;
306
316
  }
307
317
  };
308
- let M = E;
318
+ let M = v;
309
319
  M.starData = [
310
320
  [0, 5, 3],
311
321
  [95, 8, 5],
@@ -322,23 +332,23 @@ class g {
322
332
  * 장비에 표시되는 문자열
323
333
  */
324
334
  get convertSummary() {
325
- const i = [...this.option.keys()];
326
- i.sort((s, d) => n[d].length - n[s].length);
327
- let c = this.summary;
328
- for (const s of i)
329
- c = c.replace(
335
+ const c = [...this.option.keys()];
336
+ c.sort((s, d) => n[d].length - n[s].length);
337
+ let i = this.summary;
338
+ for (const s of c)
339
+ i = i.replace(
330
340
  `#${n[s]}`,
331
341
  (this.option.get(s) ?? 0).toString()
332
342
  );
333
- return c;
343
+ return i;
334
344
  }
335
345
  /**
336
346
  * 장비의 착용 가능 레벨로부터 잠재옵션의 레벨을 계산합니다.
337
347
  * @param gearReqLevel 장비의 착용 가능 레벨.
338
348
  * @returns 잠재옵션 레벨. 1부터 25까지의 값입니다.
339
349
  */
340
- static getPotentialLevel(i) {
341
- return i <= 0 ? 1 : i >= 250 ? 25 : Math.floor((i + 9) / 10);
350
+ static getPotentialLevel(c) {
351
+ return c <= 0 ? 1 : c >= 250 ? 25 : Math.floor((c + 9) / 10);
342
352
  }
343
353
  /**
344
354
  * 잠재옵션 분류와 장비 분류를 비교합니다.
@@ -346,36 +356,36 @@ class g {
346
356
  * @param gearType 장비 분류.
347
357
  * @returns 잠재옵션 분류가 장비 분류에 적용 가능한 경우 `true`; 아닌 경우 `false`.
348
358
  */
349
- static checkOptionType(i, c) {
350
- switch (i) {
359
+ static checkOptionType(c, i) {
360
+ switch (c) {
351
361
  case 0:
352
362
  return !0;
353
363
  case 10:
354
- return M.isWeapon(c) || M.isSubWeapon(c) || c === o.emblem;
364
+ return M.isWeapon(i) || M.isSubWeapon(i) || i === o.emblem;
355
365
  case 11:
356
- return !g.checkOptionType(10, c);
366
+ return !g.checkOptionType(10, i);
357
367
  case 20:
358
- return M.isSubWeapon(c) || c === o.cap || c === o.coat || c === o.longcoat || c === o.pants || c === o.shoes || c === o.glove || c === o.cape || c === o.belt || c === o.shoulder;
368
+ return M.isSubWeapon(i) || i === o.cap || i === o.coat || i === o.longcoat || i === o.pants || i === o.shoes || i === o.glove || i === o.cape || i === o.belt || i === o.shoulder;
359
369
  case 40:
360
- return c === o.faceAccessory || c === o.eyeAccessory || c === o.earrings || c === o.ring || c === o.pendant;
370
+ return i === o.faceAccessory || i === o.eyeAccessory || i === o.earrings || i === o.ring || i === o.pendant;
361
371
  case 51:
362
- return c === o.cap;
372
+ return i === o.cap;
363
373
  case 52:
364
- return c === o.coat || c === o.longcoat;
374
+ return i === o.coat || i === o.longcoat;
365
375
  case 53:
366
- return c === o.pants;
376
+ return i === o.pants;
367
377
  case 54:
368
- return c === o.glove;
378
+ return i === o.glove;
369
379
  case 55:
370
- return c === o.shoes;
380
+ return i === o.shoes;
371
381
  default:
372
382
  return !1;
373
383
  }
374
384
  }
375
385
  }
376
386
  var l = /* @__PURE__ */ ((t) => (t[t.STR = 0] = "STR", t[t.DEX = 1] = "DEX", t[t.INT = 2] = "INT", t[t.LUK = 3] = "LUK", t[t.STR_DEX = 4] = "STR_DEX", t[t.STR_INT = 5] = "STR_INT", t[t.STR_LUK = 6] = "STR_LUK", t[t.DEX_INT = 7] = "DEX_INT", t[t.DEX_LUK = 8] = "DEX_LUK", t[t.INT_LUK = 9] = "INT_LUK", t[t.PDD = 10] = "PDD", t[t.PAD = 11] = "PAD", t[t.MAD = 12] = "MAD", t[t.MHP = 13] = "MHP", t[t.MMP = 14] = "MMP", t[t.speed = 15] = "speed", t[t.jump = 16] = "jump", t[t.damR = 17] = "damR", t[t.bdR = 18] = "bdR", t[t.allStatR = 19] = "allStatR", t[t.reduceReq = 20] = "reduceReq", t))(l || {});
377
- function y(t, i, c) {
378
- const s = V(t, i, c);
387
+ function y(t, c, i) {
388
+ const s = x(t, c, i);
379
389
  if (s.size === 0)
380
390
  return !1;
381
391
  for (const [d, a] of s)
@@ -383,33 +393,33 @@ function y(t, i, c) {
383
393
  return !0;
384
394
  }
385
395
  function t0(t) {
386
- for (const [, i] of t.options)
387
- i.bonus = 0;
396
+ for (const [, c] of t.options)
397
+ c.bonus = 0;
388
398
  return !0;
389
399
  }
390
- function V(t, i, c) {
391
- const s = $(i), d = _(t, i, c);
400
+ function x(t, c, i) {
401
+ const s = $(c), d = _(t, c, i);
392
402
  return d === 0 ? /* @__PURE__ */ new Map() : new Map(s.map((a) => [a, d]));
393
403
  }
394
- function _(t, i, c) {
404
+ function _(t, c, i) {
395
405
  const s = t.req.level, d = t.getBooleanValue(n.bossReward), a = t.type;
396
- if (s < 0 || d && c < 3)
406
+ if (s < 0 || d && i < 3)
397
407
  return 0;
398
- switch (i) {
408
+ switch (c) {
399
409
  case l.STR:
400
410
  case l.DEX:
401
411
  case l.INT:
402
412
  case l.LUK:
403
- return (Math.floor(s / 20) + 1) * c;
413
+ return (Math.floor(s / 20) + 1) * i;
404
414
  case l.STR_DEX:
405
415
  case l.STR_INT:
406
416
  case l.STR_LUK:
407
417
  case l.DEX_INT:
408
418
  case l.DEX_LUK:
409
419
  case l.INT_LUK:
410
- return (Math.floor(s / 40) + 1) * c;
420
+ return (Math.floor(s / 40) + 1) * i;
411
421
  case l.PDD:
412
- return (Math.floor(s / 20) + 1) * c;
422
+ return (Math.floor(s / 20) + 1) * i;
413
423
  case l.PAD:
414
424
  case l.MAD:
415
425
  if (M.isWeapon(a)) {
@@ -450,34 +460,34 @@ function _(t, i, c) {
450
460
  break;
451
461
  }
452
462
  const u = s > 180 ? 6 : s > 160 ? 5 : s > 110 ? 4 : 3;
453
- return Math.ceil(f * m[c - 1] * u / 100);
463
+ return Math.ceil(f * m[i - 1] * u / 100);
454
464
  } else {
455
465
  const u = t.option(n.incMAD).base;
456
- if (i === l.MAD && u >= f && (f = u), d) {
466
+ if (c === l.MAD && u >= f && (f = u), d) {
457
467
  const e = s > 160 ? 18 : s > 150 ? 15 : s > 110 ? 12 : 9;
458
- return Math.ceil(f * m[c - 1] * e / 100);
468
+ return Math.ceil(f * m[i - 1] * e / 100);
459
469
  } else {
460
470
  const e = s > 110 ? 4 : 3;
461
- return Math.ceil(f * m[c - 1] * e / 100);
471
+ return Math.ceil(f * m[i - 1] * e / 100);
462
472
  }
463
473
  }
464
474
  } else if (s < 60)
465
475
  return 0;
466
- return c;
476
+ return i;
467
477
  case l.MHP:
468
478
  case l.MMP:
469
- return Math.floor(s / 10) * 30 * c;
479
+ return Math.floor(s / 10) * 30 * i;
470
480
  case l.speed:
471
481
  case l.jump:
472
- return M.isWeapon(a) ? 0 : c;
482
+ return M.isWeapon(a) ? 0 : i;
473
483
  case l.damR:
474
- return M.isWeapon(a) ? c : 0;
484
+ return M.isWeapon(a) ? i : 0;
475
485
  case l.bdR:
476
- return s < 90 || !M.isWeapon(a) ? 0 : 2 * c;
486
+ return s < 90 || !M.isWeapon(a) ? 0 : 2 * i;
477
487
  case l.allStatR:
478
- return s < 70 && !M.isWeapon(a) ? 0 : c;
488
+ return s < 70 && !M.isWeapon(a) ? 0 : i;
479
489
  case l.reduceReq:
480
- return Math.min(5 * c, s);
490
+ return Math.min(5 * i, s);
481
491
  default:
482
492
  return 0;
483
493
  }
@@ -531,15 +541,15 @@ function $(t) {
531
541
  }
532
542
  }
533
543
  const F = 25, X = 15;
534
- function j(t, i = !1) {
544
+ function j(t, c = !1) {
535
545
  if (t.getBooleanValue(n.incCHUC))
536
546
  return !1;
537
547
  if (t.getBooleanValue(n.superiorEqp))
538
548
  return O(t);
539
- if (t.star >= t.maxStar && !i || t.star >= F)
549
+ if (t.star >= t.maxStar && !c || t.star >= F)
540
550
  return !1;
541
551
  t.star += 1;
542
- const c = t.star, s = b(t, !1, !1), d = b(t, !1, !0), a = M.isWeapon(t.type) || t.type === o.katara, m = [
552
+ const i = t.star, s = b(t, !1, !1), d = b(t, !1, !0), a = M.isWeapon(t.type) || t.type === o.katara, m = [
543
553
  [n.incSTR, n.incDEX],
544
554
  [n.incINT, n.incLUK],
545
555
  [n.incDEX, n.incSTR],
@@ -568,11 +578,11 @@ function j(t, i = !1) {
568
578
  u.add(r);
569
579
  }
570
580
  for (const h of f)
571
- (u.has(h) || c > 15 && (t.option(h).base > 0 || t.option(h).upgrade > 0)) && (t.option(h).enchant += s[c]);
581
+ (u.has(h) || i > 15 && (t.option(h).base > 0 || t.option(h).upgrade > 0)) && (t.option(h).enchant += s[i]);
572
582
  if (a) {
573
583
  const h = e === 0 || Math.floor(e / 2) % 2 === 1 || t.option(n.incMAD).upgrade > 0;
574
- if (c > 15)
575
- t.option(n.incPAD).enchant += d[c], h && (t.option(n.incMAD).enchant += d[c]);
584
+ if (i > 15)
585
+ t.option(n.incPAD).enchant += d[i], h && (t.option(n.incMAD).enchant += d[i]);
576
586
  else {
577
587
  const r = t.option(n.incPAD).sum - t.option(n.incPAD).bonus;
578
588
  if (t.option(n.incPAD).enchant += Math.floor(r / 50) + 1, h) {
@@ -581,7 +591,7 @@ function j(t, i = !1) {
581
591
  }
582
592
  }
583
593
  } else
584
- t.option(n.incPAD).enchant += d[c], t.option(n.incMAD).enchant += d[c], t.type === o.glove && (e === 0 ? (t.option(n.incPAD).enchant += v[c], t.option(n.incMAD).enchant += v[c]) : Math.floor(e / 2) % 2 === 1 ? t.option(n.incMAD).enchant += v[c] : t.option(n.incPAD).enchant += v[c]);
594
+ t.option(n.incPAD).enchant += d[i], t.option(n.incMAD).enchant += d[i], t.type === o.glove && (e === 0 ? (t.option(n.incPAD).enchant += E[i], t.option(n.incMAD).enchant += E[i]) : Math.floor(e / 2) % 2 === 1 ? t.option(n.incMAD).enchant += E[i] : t.option(n.incPAD).enchant += E[i]);
585
595
  if (!a && t.type !== o.machineHeart) {
586
596
  const h = t.option(n.incPDD).sum - t.option(n.incPDD).bonus;
587
597
  t.option(n.incPDD).enchant += Math.floor(h / 20) + 1;
@@ -598,28 +608,28 @@ function j(t, i = !1) {
598
608
  o.shoulder,
599
609
  o.shield
600
610
  ];
601
- return a ? (t.option(n.incMHP).enchant += U[c], t.option(n.incMMP).enchant += U[c]) : D.includes(t.type) && (t.option(n.incMHP).enchant += U[c]), t.type === o.shoes && (t.option(n.incSpeed).enchant += L[c], t.option(n.incJump).enchant += L[c]), !0;
611
+ return a ? (t.option(n.incMHP).enchant += U[i], t.option(n.incMMP).enchant += U[i]) : D.includes(t.type) && (t.option(n.incMHP).enchant += U[i]), t.type === o.shoes && (t.option(n.incSpeed).enchant += L[i], t.option(n.incJump).enchant += L[i]), !0;
602
612
  }
603
613
  function O(t) {
604
614
  if (t.star >= t.maxStar)
605
615
  return !1;
606
616
  t.star += 1;
607
- const i = t.star, c = b(t, !1, !1), s = b(t, !1, !0), d = [
617
+ const c = t.star, i = b(t, !1, !1), s = b(t, !1, !0), d = [
608
618
  n.incSTR,
609
619
  n.incDEX,
610
620
  n.incINT,
611
621
  n.incLUK
612
622
  ];
613
623
  for (const f of d)
614
- t.option(f).base > 0 && (t.option(f).enchant += c[i]);
624
+ t.option(f).base > 0 && (t.option(f).enchant += i[c]);
615
625
  const a = [n.incPAD, n.incMAD];
616
626
  for (const f of a)
617
- t.option(f).base > 0 && (t.option(f).enchant += s[i]);
627
+ t.option(f).base > 0 && (t.option(f).enchant += s[c]);
618
628
  const m = t.option(n.incPDD).sum - t.option(n.incPDD).bonus;
619
629
  return t.option(n.incPDD).enchant += Math.floor(m / 20) + 1, !0;
620
630
  }
621
- function n0(t, i = !1, c = !1) {
622
- if (t.getBooleanValue(n.incCHUC) || t.getBooleanValue(n.superiorEqp) || t.star >= t.maxStar && !c || t.star >= X)
631
+ function n0(t, c = !1, i = !1) {
632
+ if (t.getBooleanValue(n.incCHUC) || t.getBooleanValue(n.superiorEqp) || t.star >= t.maxStar && !i || t.star >= X)
623
633
  return !1;
624
634
  t.amazing || (t.amazing = !0, t.maxStar = Math.min(t.maxStar, X)), t.star += 1;
625
635
  const s = t.star, d = b(t, !0, !1), a = b(t, !0, !0), m = M.isWeapon(t.type) || t.type === o.katara, f = [
@@ -631,7 +641,7 @@ function n0(t, i = !1, c = !1) {
631
641
  for (const D of f)
632
642
  if (t.option(D).sum > 0) {
633
643
  let r = d[s];
634
- i && M.isAccessory(t.type) && (r += s > 5 ? 2 : 1), t.option(D).enchant += r;
644
+ c && M.isAccessory(t.type) && (r += s > 5 ? 2 : 1), t.option(D).enchant += r;
635
645
  }
636
646
  const u = [n.incPAD, n.incMAD];
637
647
  for (const D of u) {
@@ -639,10 +649,10 @@ function n0(t, i = !1, c = !1) {
639
649
  if (h > 0) {
640
650
  m && (t.option(D).enchant += Math.floor(h / 50) + 1);
641
651
  let r = a[s];
642
- i && (m || t.type === o.shield) && (r += 1), t.option(D).enchant += r;
652
+ c && (m || t.type === o.shield) && (r += 1), t.option(D).enchant += r;
643
653
  }
644
654
  }
645
- i && M.isArmor(t.type) && (t.option(n.incMHP).enchant += 50);
655
+ c && M.isArmor(t.type) && (t.option(n.incMHP).enchant += 50);
646
656
  const e = t.option(n.incPDD).sum;
647
657
  return t.option(n.incPDD).enchant += Math.floor(e / 20) + 1, !0;
648
658
  }
@@ -650,22 +660,22 @@ function z(t) {
650
660
  if (t.getBooleanValue(n.incCHUC))
651
661
  return !1;
652
662
  t.star = 0, t.amazing = !1, t.maxStar = M.getMaxStar(t);
653
- for (const [, i] of t.options)
654
- i.enchant = 0;
663
+ for (const [, c] of t.options)
664
+ c.enchant = 0;
655
665
  return !0;
656
666
  }
657
- function c0(t) {
667
+ function i0(t) {
658
668
  if (t.getBooleanValue(n.incCHUC) || t.amazing)
659
669
  return !1;
660
- const i = t.star;
670
+ const c = t.star;
661
671
  z(t);
662
- for (let c = 0; c < i; c++)
672
+ for (let i = 0; i < c; i++)
663
673
  j(t, !0);
664
674
  return !0;
665
675
  }
666
- function b(t, i, c) {
676
+ function b(t, c, i) {
667
677
  let s;
668
- t.getBooleanValue(n.superiorEqp) ? c ? s = J : s = B : i ? c ? s = P : s = T : c ? M.isWeapon(t.type) || t.type === o.katara ? s = Q : s = Z : s = Y;
678
+ t.getBooleanValue(n.superiorEqp) ? i ? s = J : s = B : c ? i ? s = P : s = T : i ? M.isWeapon(t.type) || t.type === o.katara ? s = Q : s = Z : s = Y;
669
679
  const d = t.req.level;
670
680
  for (const a of [...s].reverse())
671
681
  if (d >= a[0])
@@ -1468,7 +1478,7 @@ const J = [
1468
1478
  [140, 17, 18, 20, 23, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
1469
1479
  [145, 18, 19, 21, 24, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
1470
1480
  [150, 19, 20, 22, 25, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
1471
- ], v = [
1481
+ ], E = [
1472
1482
  0,
1473
1483
  0,
1474
1484
  0,
@@ -1551,8 +1561,8 @@ const J = [
1551
1561
  0
1552
1562
  ];
1553
1563
  class R {
1554
- constructor(i = "", c) {
1555
- this.name = i, this.stat = c ?? /* @__PURE__ */ new Map();
1564
+ constructor(c = "", i) {
1565
+ this.name = c, this.stat = i ?? /* @__PURE__ */ new Map();
1556
1566
  }
1557
1567
  /**
1558
1568
  * 주문의 흔적 주문서를 생성합니다.
@@ -1562,11 +1572,11 @@ class R {
1562
1572
  * @param probability 주문의 흔적 성공 확률. `100` / `70` / `30` / `15` 중 하나입니다.
1563
1573
  * @returns 주문의 흔적 주문서. 지정된 장비, 스탯, 확률을 만족하는 주문서가 존재하지 않을 경우 `undefined`를 반환합니다.
1564
1574
  */
1565
- static getSpellTraceScroll(i, c, s) {
1566
- const d = c === n.incINT ? n.incMAD : n.incPAD, a = i.req.level >= 115 ? 2 : i.req.level >= 75 ? 1 : 0;
1575
+ static getSpellTraceScroll(c, i, s) {
1576
+ const d = i === n.incINT ? n.incMAD : n.incPAD, a = c.req.level >= 115 ? 2 : c.req.level >= 75 ? 1 : 0;
1567
1577
  let m;
1568
1578
  const f = d === n.incMAD ? "마력" : "공격력";
1569
- switch (c) {
1579
+ switch (i) {
1570
1580
  case n.incSTR:
1571
1581
  m = "힘";
1572
1582
  break;
@@ -1586,8 +1596,8 @@ class R {
1586
1596
  m = "체력";
1587
1597
  break;
1588
1598
  }
1589
- if (M.isWeapon(i.type) || i.type === o.katara) {
1590
- if (c === n.incAllStat)
1599
+ if (M.isWeapon(c.type) || c.type === o.katara) {
1600
+ if (i === n.incAllStat)
1591
1601
  return;
1592
1602
  let u;
1593
1603
  switch (s) {
@@ -1620,14 +1630,14 @@ class R {
1620
1630
  ];
1621
1631
  break;
1622
1632
  }
1623
- const e = u[a][0], D = u[a][1] * (c === n.incMHP ? 50 : 1), h = D > 0 ? `${s}% ${f}(${m}) 주문서` : `${s}% ${f} 주문서`, r = /* @__PURE__ */ new Map([
1624
- [c, D],
1633
+ const e = u[a][0], D = u[a][1] * (i === n.incMHP ? 50 : 1), h = D > 0 ? `${s}% ${f}(${m}) 주문서` : `${s}% ${f} 주문서`, r = /* @__PURE__ */ new Map([
1634
+ [i, D],
1625
1635
  [d, e]
1626
1636
  ]);
1627
1637
  return new R(h, r);
1628
1638
  } else if (s === 15)
1629
1639
  return;
1630
- if (i.type === o.glove) {
1640
+ if (c.type === o.glove) {
1631
1641
  let u;
1632
1642
  switch (s) {
1633
1643
  case 100:
@@ -1644,15 +1654,15 @@ class R {
1644
1654
  let D, h;
1645
1655
  return e === 0 ? (D = `${s}% 방어력 주문서`, h = /* @__PURE__ */ new Map([[n.incPDD, 3]])) : (D = `${s}% ${f} 주문서`, h = /* @__PURE__ */ new Map([[d, e]])), new R(D, h);
1646
1656
  }
1647
- if (M.isArmor(i.type) || i.type === o.shoulder) {
1648
- if (c === n.incAllStat) {
1657
+ if (M.isArmor(c.type) || c.type === o.shoulder) {
1658
+ if (i === n.incAllStat) {
1649
1659
  if (s !== 30)
1650
1660
  return;
1651
1661
  const k = [
1652
1662
  [1, 30, 4],
1653
1663
  [2, 70, 7],
1654
1664
  [3, 120, 10]
1655
- ], w = k[a][0], H = k[a][1], I = k[a][2], K = `${s}% ${m} 주문서`, S = /* @__PURE__ */ new Map([
1665
+ ], w = k[a][0], H = k[a][1], I = k[a][2], N = `${s}% ${m} 주문서`, S = /* @__PURE__ */ new Map([
1656
1666
  [n.incSTR, w],
1657
1667
  [n.incDEX, w],
1658
1668
  [n.incINT, w],
@@ -1660,7 +1670,7 @@ class R {
1660
1670
  [n.incMHP, H],
1661
1671
  [n.incPDD, I]
1662
1672
  ]);
1663
- return i.upgradeCount === 3 && (i.req.job === 0 ? (S.set(n.incMAD, 1), S.set(n.incPAD, 1)) : Math.floor(i.req.job / 2) % 2 === 1 ? S.set(n.incMAD, 1) : S.set(n.incPAD, 1)), new R(K, S);
1673
+ return c.upgradeCount === 3 && (c.req.job === 0 ? (S.set(n.incMAD, 1), S.set(n.incPAD, 1)) : Math.floor(c.req.job / 2) % 2 === 1 ? S.set(n.incMAD, 1) : S.set(n.incPAD, 1)), new R(N, S);
1664
1674
  }
1665
1675
  let u;
1666
1676
  switch (s) {
@@ -1686,14 +1696,14 @@ class R {
1686
1696
  ];
1687
1697
  break;
1688
1698
  }
1689
- const e = c !== n.incMHP ? u[a][0] : 0, D = u[a][1] + (c === n.incMHP ? u[a][0] * 50 : 0), h = u[a][2], r = `${s}% ${m} 주문서`, A = /* @__PURE__ */ new Map([
1699
+ const e = i !== n.incMHP ? u[a][0] : 0, D = u[a][1] + (i === n.incMHP ? u[a][0] * 50 : 0), h = u[a][2], r = `${s}% ${m} 주문서`, A = /* @__PURE__ */ new Map([
1690
1700
  [n.incMHP, D],
1691
1701
  [n.incPDD, h]
1692
1702
  ]);
1693
- return e > 0 && A.set(c, e), i.upgradeCount === 3 && (i.req.job === 0 ? (A.set(n.incMAD, 1), A.set(n.incPAD, 1)) : Math.floor(i.req.job / 2) % 2 === 1 ? A.set(n.incMAD, 1) : A.set(n.incPAD, 1)), new R(r, A);
1703
+ return e > 0 && A.set(i, e), c.upgradeCount === 3 && (c.req.job === 0 ? (A.set(n.incMAD, 1), A.set(n.incPAD, 1)) : Math.floor(c.req.job / 2) % 2 === 1 ? A.set(n.incMAD, 1) : A.set(n.incPAD, 1)), new R(r, A);
1694
1704
  }
1695
- if (M.isAccessory(i.type)) {
1696
- if (c === n.incAllStat) {
1705
+ if (M.isAccessory(c.type)) {
1706
+ if (i === n.incAllStat) {
1697
1707
  if (s !== 30)
1698
1708
  return;
1699
1709
  const A = [
@@ -1720,10 +1730,10 @@ class R {
1720
1730
  u = [3, 4, 5];
1721
1731
  break;
1722
1732
  }
1723
- const e = u[a] * (c === n.incMHP ? 50 : 1), D = `${s}% ${m} 주문서`, h = /* @__PURE__ */ new Map([[c, e]]);
1733
+ const e = u[a] * (i === n.incMHP ? 50 : 1), D = `${s}% ${m} 주문서`, h = /* @__PURE__ */ new Map([[i, e]]);
1724
1734
  return new R(D, h);
1725
1735
  }
1726
- if (i.type === o.machineHeart) {
1736
+ if (c.type === o.machineHeart) {
1727
1737
  let u;
1728
1738
  switch (s) {
1729
1739
  case 100:
@@ -1741,19 +1751,19 @@ class R {
1741
1751
  }
1742
1752
  }
1743
1753
  }
1744
- function i0(t) {
1754
+ function c0(t) {
1745
1755
  return t.getBooleanValue(n.blockGoldHammer) || t.getBooleanValue(n.onlyUpgrade) || t.totalUpgradeCount <= 0 || t.hammerCount > 0 ? !1 : (t.hammerCount = 1, !0);
1746
1756
  }
1747
- function p(t, i) {
1757
+ function p(t, c) {
1748
1758
  if (t.upgradeCountLeft < 1)
1749
1759
  return !1;
1750
1760
  t.upgradeCount += 1;
1751
- for (const [c, s] of i.stat)
1752
- t.option(c).upgrade += s;
1761
+ for (const [i, s] of c.stat)
1762
+ t.option(i).upgrade += s;
1753
1763
  return !0;
1754
1764
  }
1755
- function s0(t, i, c) {
1756
- const s = R.getSpellTraceScroll(t, i, c);
1765
+ function s0(t, c, i) {
1766
+ const s = R.getSpellTraceScroll(t, c, i);
1757
1767
  return s ? p(t, s) : !1;
1758
1768
  }
1759
1769
  function o0(t) {
@@ -1764,14 +1774,14 @@ function l0(t) {
1764
1774
  }
1765
1775
  function u0(t) {
1766
1776
  t.upgradeCount = 0, t.upgradeFailCount = 0, t.hammerCount = 0;
1767
- for (const [, i] of t.options)
1768
- i.upgrade = 0;
1777
+ for (const [, c] of t.options)
1778
+ c.upgrade = 0;
1769
1779
  return !0;
1770
1780
  }
1771
1781
  export {
1772
1782
  l as BonusStatType,
1773
1783
  M as Gear,
1774
- N as GearIcon,
1784
+ K as GearIcon,
1775
1785
  q as GearOption,
1776
1786
  n as GearPropType,
1777
1787
  W as GearReq,
@@ -1780,17 +1790,17 @@ export {
1780
1790
  C as PotentialGrade,
1781
1791
  R as Scroll,
1782
1792
  G as Soul,
1783
- x as SoulWeapon,
1793
+ V as SoulWeapon,
1784
1794
  n0 as addAmazingEnhancement,
1785
1795
  y as addBonusStat,
1786
1796
  j as addStarforce,
1787
1797
  o0 as addUpgradeFailCount,
1788
- i0 as applyGoldHammer,
1798
+ c0 as applyGoldHammer,
1789
1799
  p as applyScroll,
1790
1800
  s0 as applySpellTrace,
1791
- V as getBonusStatOption,
1801
+ x as getBonusStatOption,
1792
1802
  _ as getBonusStatValue,
1793
- c0 as recalculateStarforce,
1803
+ i0 as recalculateStarforce,
1794
1804
  t0 as resetBonusStat,
1795
1805
  z as resetEnhancement,
1796
1806
  u0 as resetUpgrade,
package/lib/gear.d.ts CHANGED
@@ -18,6 +18,8 @@ export declare class Gear {
18
18
  desc: string;
19
19
  /** 아이콘 */
20
20
  icon: GearIcon;
21
+ /** 신비의 모루 */
22
+ anvil: GearIcon | undefined;
21
23
  /** 장비 분류 */
22
24
  type: GearType;
23
25
  /** 장비 착용 제한 */
@@ -44,6 +46,12 @@ export declare class Gear {
44
46
  star: number;
45
47
  /** 놀라운 장비 강화 적용 여부 */
46
48
  amazing: boolean;
49
+ /**
50
+ * 가위 사용 가능 횟수
51
+ *
52
+ * `0` 이상의 값; 카르마의 가위를 사용할 수 없는 장비는 `undefined`.
53
+ */
54
+ karma: number | undefined;
47
55
  /** 잠재능력 설정 가능 여부 */
48
56
  canPotential: boolean;
49
57
  /** 잠재능력 등급 */
@@ -64,6 +72,14 @@ export declare class Gear {
64
72
  * 가중치를 포함하여 계산한 현재 옵션과 기본 옵션의 차이
65
73
  */
66
74
  get diff(): number;
75
+ /**
76
+ * 장비를 처음 획득했을 때 추가옵션이 존재했는지 여부
77
+ *
78
+ * *일부 저레벨 장비의 경우 인게임과 차이가 있습니다.*
79
+ *
80
+ * 장비 아이콘 왼쪽 위의 원이 채워져있으면 `true`; 아니면 `false`입니다.
81
+ */
82
+ get isNewBonusType(): boolean;
67
83
  /**
68
84
  * 지정된 장비 옵션 종류과 연결된 옵션을 가져옵니다.
69
85
  * @param type 장비 옵션 종류.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malib/gear",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",