Lin-JN 发表于 2023-10-2 09:52:45

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

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


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

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

ttm007 发表于 2023-10-2 23:01:38


谢谢分享~~~

rock529 发表于 2023-11-13 19:06:42

大哥 想跟你請教程式碼的問題請問有聯繫方式嗎

rumengtingxue 发表于 2024-1-23 17:26:06

谢谢圣子大人分享!~~~~~~~~~~~~~~{:3_48:}

rumengtingxue 发表于 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
复制代码

anzhiyou 发表于 2024-2-28 13:18:56

我去,这个有点牛了!

REMAN 发表于 2024-2-28 14:56:11

感谢分享!
赚点积分!
页: [1]
查看完整版本: 武器强化到一定程度(+9)后额外增加伤害