npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jx3-dps-core

v3.3.0

Published

纯 Typescript 编写的计算器组件

Downloads

11

Readme

Jx3-dps-core

纯 Typescript 编写的计算器组件

服务于剑网三少林易筋经心法

初衷是希望把计算器的计算和公共部分抽离出来

这样可以做到最大程度的复用和简洁化

剑网三少林易筋经计算器Web版

剑网三少林易筋经计算器前端代码

Documents

Jx3-dps-core 使用文档

Jx3DpsCore

核心工具预先设置好的所有增益包括

  • 易筋经奇穴版本(心诤 or 醍醐)

  • 易经经大附魔

  • 加速段位

  • 阵法

  • 小队技能增益

  • 团队技能增益

  • 套装增益

  • 武器列表

  • 附魔列表

  • 特效腰椎

  • 宴席

  • 小吃小药

  • 目标选择等


class Jx3DpsCore {
  /**
   * 增益群组类型
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static GainGroupTypes = GainGroupTypes;
  /**
   * @param YiJinJingQiXueVersion 奇穴
   * @param YiJinJingSkillEnchant 大附魔
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static CalculatorVersions = {
    YiJinJingQiXueVersion: YiJinJingQiXueVersion,
    YiJinJingSkillEnchant: YiJinJingSkillEnchant,
  };
  /**
   * 加速档位
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static JiaSuList = JiaSuValue;
  /**
   * 阵法列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static Formations = FormationList;
  /**
   * 小队技能增益列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static TeamSkills = TeamSkillList;
  /**
   * 团队技能增益列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static GroupSkills = GroupSkillList;
  /**
   * 套装增益列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static SetBonusesGain = SetBonuseList;
  /**
   * 武器列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static Weapons = WeaponList;
  /**
   * 装备附魔增益列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static Enchants = EnChantsList;
  /**
   * 特效腰椎
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static EffectSpines = EffectSpineList;
  /**
   * 宴席增益列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static Banquet = BanquetList;
  /**
   * 目标列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static Target = TargetListKeys;
  /**
   * 小吃小药列表
   *
   * @static
   * @memberof Jx3DpsCore
   */
  static Food = {
    FoodEnhance: FoodEnhanceList,
    DrugEnhance: DrugEnhanceList,
    FoodSupport: FoodSupportList,
    DrugSupport: DrugSupportList,
    HomeFood: HomeFoodList,
    WeaponEnchant: WeaponEnchantList,
    HomeDrink: HomeDrinkList,
    FestivalFood: FestivalFoodList,
  };

  /**
   * 增益模块
   *
   * @type {GainModule}
   * @memberof Jx3DpsCore
   */
  public gainModule: GainModule;

  /**
   * 创建计算器的其他配置选项
   *
   * @private
   * @type {Jx3DpsCoreOptions}
   * @memberof Jx3DpsCore
   */
  public jx3DpsCoreOptions: Jx3DpsCoreOptions;
  /**
   * 计算器核心core
   *
   * @private
   * @type {DpsCore}
   * @memberof Jx3DpsCore
   */
  private core: DpsCore;
  /**
   * 计算器增益类support
   *
   * @private
   * @type {Support}
   * @memberof Jx3DpsCore
   */
  public support: Support;

  constructor(
    coreOptions: CreateDpsCoreOptions,
    supportOptions: SupportOptions,
    jx3DpsCoreOptions: Jx3DpsCoreOptions
  ) {
    this.core = createDpsCore(coreOptions);
    this.support = new Support(supportOptions);
    this.gainModule = new GainModule();
    this.jx3DpsCoreOptions = jx3DpsCoreOptions;
  }
}

Method calculate

/**
 * 计算dps结果
 * @method calculate
 * @memberof Jx3DpsCore
 */
public calculate = (): CalculatorResult => {
  return createCalculator(this.core, this.support, this.jx3DpsCoreOptions);
};

Method profit

/**
 * 计算收益结果
 * @method profit
 * @memberof Jx3DpsCore
 */
public profit = () => {
  const pf = new Profit({ core: this.core, support: this.support });
  return pf.calculatroProfit();
};

Usage

import Jx3DpsCore, { Support } from 'jx3-dps-core';

type CalculatorResult = {
  dps: number;
  total: number;
  seconds: number;
  skills: Skill[];
};

interface Jx3DpsCoreCalculateResult extends CalculatorResult {
  profit: ProfitCore[];
}

const jdcSupport = new Support({
    target: Jx3DpsCore.Target.MuZhuang113,
    CWTimes: 3,
  });
  jdcSupport.use(Jx3DpsCore.TeamSkills.JinGangNuMu);
  jdcSupport.use(Jx3DpsCore.TeamSkills.QinLongJue);
  jdcSupport.use({
    name: 'UPDATE08-30',
    type: 'Costom',
    data: [{ gainTarget: 'damageBonus', value: 0.03, coverage: 1 }],
  });
  jdcSupport.use({
    name: '少林常驻破防加成',
    type: 'Costom',
    data: [{ gainTarget: 'SolarOvercomePercent', value: 0.15, coverage: 1 }],
  });

const jdc = new Jx3DpsCore(
  {
    mainAttribute: 2904,
    JiChuGongJi: 15984,
    HuiXin: 32.93,
    HuiXiao: 189.28,
    PoFang: 54.05,
    PoZhao: 4480,
    WuShuang: 45.74,
    JiaSu: 'YiDuanJiaSu',
    WuQiShangHai: 2000,
  },
  jdcSupport,
  {
    qiXueVersion: Jx3DpsCore.CalculatorVersions.YiJinJingQiXueVersion.XinZheng,
    skillEnchant: Jx3DpsCore.CalculatorVersions.YiJinJingSkillEnchant.JinGangRiLun,
  }
);

const { dps, total, skills, profit } = jdc.calculate();