rpd:attack_skill_mechanic
Differences
This shows you the differences between two versions of the page.
| rpd:attack_skill_mechanic [2025/12/29 09:28] – Update wiki pages: rename files to follow naming convention, add missing pages, fix formatting issues mike | rpd:attack_skill_mechanic [2025/12/29 09:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Attack Skill Mechanic ====== | ||
| + | Attack Skill is a core combat mechanic in Remixed Dungeon that determines the chance of successfully hitting an enemy with attacks. | ||
| + | |||
| + | ==== Attack Skill Formula ==== | ||
| + | The attack skill is calculated in the '' | ||
| + | |||
| + | <code java> | ||
| + | public int attackSkill(Char target) { | ||
| + | |||
| + | int[] bf = {0}; | ||
| + | forEachBuff(b -> bf[0] += b.attackSkillBonus(this)); | ||
| + | |||
| + | int bonus = bf[0]; | ||
| + | |||
| + | float accuracy = (float) Math.pow(1.4, | ||
| + | |||
| + | if (target == null) { // Mainly to mask bug in Remixed RPG | ||
| + | target = CharsList.DUMMY; | ||
| + | } | ||
| + | |||
| + | if (rangedWeapon.valid() && level().distance(getPos(), | ||
| + | accuracy *= 0.5f; | ||
| + | } | ||
| + | |||
| + | float mainAccuracyFactor = getActiveWeapon().accuracyFactor(this); | ||
| + | float secondaryAccuracyFactor = getSecondaryWeapon().accuracyFactor(this); | ||
| + | |||
| + | float skillFactor = Utils.min(20f, | ||
| + | |||
| + | int aSkill = (int) ((baseAttackSkill + lvl()) * accuracy * skillFactor); | ||
| + | |||
| + | GLog.debug(" | ||
| + | |||
| + | return aSkill; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Attack Skill Components ==== | ||
| + | |||
| + | ==== Base Attack Skill ==== | ||
| + | * **Definition**: | ||
| + | * **Storage**: | ||
| + | * **Examples**: | ||
| + | * Rat: 8 | ||
| + | * Warrior: 10 (in Hero class) | ||
| + | * Thief: 12 | ||
| + | * Goo: 11 | ||
| + | * King: 32 | ||
| + | * Yog's Heart: 26 | ||
| + | * **Function**: | ||
| + | |||
| + | ==== Level Bonus ==== | ||
| + | * **Formula**: | ||
| + | * **Effect**: Each level increases attack skill by 1 point | ||
| + | * **Implementation**: | ||
| + | |||
| + | ==== Buff Bonuses ==== | ||
| + | * **Mechanism**: | ||
| + | * **Formula**: | ||
| + | * **Examples**: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | |||
| + | ==== Accuracy Factors ==== | ||
| + | * **Weapon Accuracy**: '' | ||
| + | * **Calculation**: | ||
| + | * **Examples**: | ||
| + | * **[[rpd: | ||
| + | * **[[rpd: | ||
| + | * **[[rpd: | ||
| + | |||
| + | ==== Ranged Penalty ==== | ||
| + | * **Condition**: | ||
| + | * **Effect**: Accuracy is halved (0.5f multiplier) | ||
| + | * **Purpose**: | ||
| + | |||
| + | ==== Defense Comparison ==== | ||
| + | * **Usage**: Attack skill is compared to the target' | ||
| + | * **Implementation**: | ||
| + | |||
| + | ==== Hero Attack Skill Enhancement ==== | ||
| + | The Hero class has a special attack skill calculation that can be enhanced by subclass: | ||
| + | |||
| + | <code java> | ||
| + | // In Hero.java | ||
| + | public int attackSkill(Char target) { | ||
| + | float attackSkillFactor = 1; | ||
| + | | ||
| + | if (getSubClass() == HeroSubClass.GLADIATOR) { | ||
| + | attackSkillFactor *= 1.2; | ||
| + | } | ||
| + | | ||
| + | return (int) (super.attackSkill(target) * attackSkillFactor); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Attack Skill in Combat ==== | ||
| + | * **Hit Chance**: The attacker' | ||
| + | * **Calculation**: | ||
| + | * **Result**: If true, the attack hits; if false, the attack misses | ||
| + | |||
| + | ==== Code References ==== | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | |||
| + | ==== Related ==== | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | * [[rpd: | ||
| + | |||
| + | {{tag> rpd mechanics combat attack skill }} | ||
