Merge pull request #36 from zxcPandora/test2

修正吸血鬼刀吸血超过上限
This commit is contained in:
JDSA Ling 2023-09-25 01:07:44 +08:00 committed by GitHub
commit 286861cc86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,8 +62,8 @@ public class Sai extends MeleeWeapon {
if(attacker.HP >= attacker.HT){
GLog.p("血量已满!无法回血");
} else if (Random.Int(10)<=4) {
R = (int) (attacker.HT * 0.1 + (buffedLvl() * 0.5) + 1.5);
attacker.HP +=attacker.HT * 0.1 + (buffedLvl()) + 1.5;
R = (int) Math.min(attacker.HT-attacker.HP,(attacker.HT * 0.1 + (buffedLvl() * 0.5) + 1.5));
attacker.HP +=R;
attacker.sprite.showStatus(CharSprite.POSITIVE, ("+" + R + "HP"));
GLog.p(attacker.name()+"的迅猛一击,回血成功!");
}