晕眩测试

2020-04-14  本文已影响0人  听闻不见

晕眩公式

成功率=(基本机率\times \frac{(100-VIT)}{100} + \frac{(施予着LV-被施予者LV-被施予者LUK)}{10})\times \frac{100-晕眩抗性}{100}

测试

为了验证上面的公式,我们做以下测试

惊声尖叫次数 眩晕次数 眩晕机率
103 10 9.70%

我们带入公式计算出推测的理论眩晕机率
成功率=(50\times \frac{(100-50)}{100} + \frac{(99-99-8)}{10})\times \frac{100-70}{100} = 7.26

由于样本量较少,实验所得的 9.70% 与理论计算的 7.26% 之间的差距可看作合理的误差

查询源码

我们来读一下从GM拿到的源代码

惊声尖叫的技能描述

  - Id: 326
    Name: DC_SCREAM
    Description: Dazzler
    MaxLevel: 5
    Type: Misc
    TargetType: Self
    DamageFlags:
      NoDamage: true
      Splash: true
    Hit: Single
    HitCount: 1
    SplashArea: -1
    AfterCastActDelay: 4000
    Duration2: 5000
    Requires:
      SpCost:
        - Level: 1
          Amount: 12
        - Level: 2
          Amount: 14
        - Level: 3
          Amount: 16
        - Level: 4
          Amount: 18
        - Level: 5
          Amount: 20

惊声尖叫的眩晕基础概率

case DC_SCREAM:
    sc_start(src,bl,SC_STUN,(25+5*skill_lv),skill_lv,skill_get_time2(skill_id,skill_lv));
    break;

眩晕状态的机率计算

/// Resistance rate: 10000 = 100%
/// Example:    50% (5000) -> sc_def = 5000 -> 25%;
///             5000ms -> tick_def = 5000 -> 2500ms
int sc_def = 0, tick_def = -1; // -1 = use sc_def
/// Fixed resistance value (after rate calculation)
/// Example:    25% (2500) -> sc_def2 = 2000 -> 5%;
///             2500ms -> tick_def2=2000 -> 500ms
int sc_def2 = 0, tick_def2 = 0;

......
......

case SC_STUN:
    sc_def = status->vit*100;
    sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
    tick_def2 = status->luk*10;
    break;

最终眩晕的机率计算

if (!(flag&SCSTART_NORATEDEF)) {
    rate -= rate*sc_def/10000;
    rate -= sc_def2;

    // Minimum chances
    switch (type) {
        case SC_BITE:
            rate = max(rate, 5000); // Minimum of 50%
            break;
    }

    // Item resistance (only applies to rate%)
    if (sd) {
        for (const auto &it : sd->reseff) {
            if (it.id == type)
                rate -= rate * it.val / 10000;
        }
        if (sd->sc.data[SC_COMMONSC_RESIST] && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX)
            rate -= rate*sd->sc.data[SC_COMMONSC_RESIST]->val1/100;
    }

    // Aegis accuracy
    if(rate > 0 && rate%10 != 0) rate += (10 - rate%10);
}

总结

上一篇 下一篇

猜你喜欢

热点阅读