查看: 386|回复: 6

武器强化到一定程度(+9)后额外增加伤害

[复制链接]

22

主题

123

帖子

530

积分

高级会员

Rank: 4

积分
530
发表于 2023-10-2 09:52:45 | 显示全部楼层 |阅读模式
L1Attack(伊薇版L1AttackPc) 中新增


  1. // 武器+9(含)以上附加额外增加伤害值
  2.             if ((this._weaponEnchant >= 9) {
  3.                 this._damage += Config.WEAPON_POWER_LIST[Math.min(this._weaponEnchant - 9,
  4.                         Config.WEAPON_POWER_LIST.length - 1)];
  5.             }
复制代码


Config中新增


  1.     public static int[] WEAPON_POWER_LIST;


  2.     WEAPON_POWER_LIST = new int[]{
  3.             Integer.parseInt(set.getProperty("WeaponPower09", "0")), // +9
  4.             Integer.parseInt(set.getProperty("WeaponPower10", "0")), // +10
  5.             Integer.parseInt(set.getProperty("WeaponPower11", "0")),
  6.             Integer.parseInt(set.getProperty("WeaponPower12", "0")),
  7.             Integer.parseInt(set.getProperty("WeaponPower13", "0")),}; // +13
  8. // 你喜欢的话,可以一路写到+32767
复制代码


properties外部设定新增

  1. #  ---各阶段强化值附加伤害---
  2. WeaponPower09 = 2
  3. WeaponPower10 = 4
  4. WeaponPower11 = 6
  5. WeaponPower12 = 8
  6. WeaponPower13 = 10
复制代码


这是隐藏伤害,不会显示在武器说明内,如果要显示,就得修改物品描述相关的文件了。

当然,还有更简洁的写法,但这种比较适合新手,简单易懂。
回复

使用道具 举报

3

主题

141

帖子

529

积分

高级会员

Rank: 4

积分
529
发表于 2023-10-2 23:01:38 | 显示全部楼层

谢谢分享~~~
回复

使用道具 举报

0

主题

8

帖子

43

积分

注册会员

Rank: 2

积分
43
发表于 2023-11-13 19:06:42 | 显示全部楼层
大哥 想跟你請教程式碼的問題請問有聯繫方式嗎
回复 支持 反对

使用道具 举报

0

主题

109

帖子

114

积分

中级会员

Rank: 3Rank: 3

积分
114
发表于 2024-1-23 17:26:06 | 显示全部楼层
谢谢圣子大人分享!~~~~~~~~~~~~~~
回复 支持 反对

使用道具 举报

0

主题

109

帖子

114

积分

中级会员

Rank: 3Rank: 3

积分
114
发表于 2024-1-23 17:26:44 | 显示全部楼层
mark一下
L1Attack(伊薇版L1AttackPc) 中新增


// 武器+9(含)以上附加额外增加伤害值
            if ((this._weaponEnchant >= 9) {
                this._damage += Config.WEAPON_POWER_LIST[Math.min(this._weaponEnchant - 9,
                        Config.WEAPON_POWER_LIST.length - 1)];
            }
复制代码


Config中新增


    public static int[] WEAPON_POWER_LIST;


    WEAPON_POWER_LIST = new int[]{
            Integer.parseInt(set.getProperty("WeaponPower09", "0")), // +9
            Integer.parseInt(set.getProperty("WeaponPower10", "0")), // +10
            Integer.parseInt(set.getProperty("WeaponPower11", "0")),
            Integer.parseInt(set.getProperty("WeaponPower12", "0")),
            Integer.parseInt(set.getProperty("WeaponPower13", "0")),}; // +13
// 你喜欢的话,可以一路写到+32767
复制代码


properties外部设定新增

#  ---各阶段强化值附加伤害---
WeaponPower09 = 2
WeaponPower10 = 4
WeaponPower11 = 6
WeaponPower12 = 8
WeaponPower13 = 10
复制代码
回复 支持 反对

使用道具 举报

4

主题

2895

帖子

3890

积分

论坛元老

Rank: 8Rank: 8

积分
3890
发表于 2024-2-28 13:18:56 | 显示全部楼层
我去,这个有点牛了!
回复 支持 反对

使用道具 举报

2

主题

147

帖子

454

积分

中级会员

Rank: 3Rank: 3

积分
454
发表于 2024-2-28 14:56:11 | 显示全部楼层
感谢分享!
赚点积分!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表