-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix protect calculations #324
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,10 +49,9 @@ class Protect extends AffectableAction implements PreAffect { | |
const attackValue = initiator.stats.val('patk') * initiator.proc; | ||
const protectValue = target.flags.isProtected.length > 0 ? target.stats.val('pdef') : 0.1; | ||
const ratio = floatNumber(Math.round(attackValue / protectValue)); | ||
console.log('at', ratio); | ||
|
||
const randomValue = MiscService.rndm('1d100'); | ||
const chance = 20 * ratio + 50; | ||
const chance = Math.round(Math.sqrt(ratio) + (10 * ratio) + 5); | ||
const result = chance > randomValue; | ||
console.log('chance', chance, 'random', randomValue, 'result', result); | ||
|
||
|
@@ -82,7 +81,7 @@ class Protect extends AffectableAction implements PreAffect { | |
} | ||
|
||
const protect = Math.floor(flag.val * 100) / pdef; | ||
const exp = Math.round(expMultiplier * 0.8 * protect); | ||
const exp = Math.round(expMultiplier * 0.08 * protect); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Вроде договаривались про 0.4, или много получилось ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. С 0.08 получается 40, 0.4 будет 200 соответственно для игрока первого уровня There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Но у игрока первого уровня нет стены :) |
||
defender.stats.up('exp', exp); | ||
|
||
return { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
При соотношение 1:1 мы получим 16% пробития :/
При 2:1 = 29
Один фиг формула выглядит кривой :)