mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-07 02:26:43 +01:00
Add support for v3.5.0 (#2090)
* Fix Dvalin battle See https://github.com/Anime-Game-Servers/Grasscutter-Quests/pull/25. This is entirely untested and there's a 99% chance it's broken, I'm just submitting it as a draft PR so that I don't forget about its existence. Co-Authored-By: mjolsic <21289772+mjolsic@users.noreply.github.com> * Update protos * 3.4 protos * Fix Now builds successfully, don't have the time to check if I should have specified true instead of false for withChildQuests, or if this functions as intended. * Change from false to true Per what smileoflove has been told on Discord * 3.5 * Remove the Dvalin crap from this PR Git is so confusing * Update version * Apply README changes from `origin/development` * Remove unnecessary debugging information --------- Co-authored-by: mjolsic <21289772+mjolsic@users.noreply.github.com> Co-authored-by: KingRainbow44 <kobedo11@gmail.com>
This commit is contained in:
@@ -2,9 +2,12 @@ package emu.grasscutter.game.player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
|
||||
import emu.grasscutter.data.excels.BuffData;
|
||||
import emu.grasscutter.game.avatar.Avatar;
|
||||
import emu.grasscutter.game.props.FightProperty;
|
||||
@@ -97,27 +100,24 @@ public class PlayerBuffManager extends BasePlayerManager {
|
||||
.map(data -> data.modifiers.get(buffData.getModifierName()))
|
||||
.map(modifier -> modifier.onAdded)
|
||||
.map(onAdded -> {
|
||||
System.out.println("onAdded exists");
|
||||
boolean s = false;
|
||||
|
||||
var s = false;
|
||||
for (var a: onAdded) {
|
||||
switch (a.type) {
|
||||
case HealHP:
|
||||
System.out.println("Attempting heal");
|
||||
if (target == null) break;
|
||||
float maxHp = target.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP);
|
||||
float amount = a.amount.get() + a.amountByTargetMaxHPRatio.get() * maxHp;
|
||||
target.getAsEntity().heal(amount);
|
||||
s = true;
|
||||
System.out.printf("Healed {}", amount);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
Grasscutter.getLogger().debug("onAdded exists");
|
||||
if (Objects.requireNonNull(a.type) == AbilityModifierAction.Type.HealHP) {
|
||||
Grasscutter.getLogger().debug("Attempting heal");
|
||||
if (target == null) continue;
|
||||
var maxHp = target.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP);
|
||||
var amount = a.amount.get() + a.amountByTargetMaxHPRatio.get() * maxHp;
|
||||
target.getAsEntity().heal(amount);
|
||||
s = true;
|
||||
Grasscutter.getLogger().debug("Healed {}", amount);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
})
|
||||
.orElse(false);
|
||||
System.out.println("Oh no");
|
||||
Grasscutter.getLogger().debug("Oh no");
|
||||
|
||||
// Set duration
|
||||
if (duration < 0f) {
|
||||
|
||||
Reference in New Issue
Block a user