Format code [skip actions]

This commit is contained in:
github-actions 2023-11-03 02:02:24 +00:00
parent 24874e7fba
commit d461ee2eb3
5 changed files with 23 additions and 15 deletions

View File

@ -37,11 +37,11 @@ public class TowerDungeonSettleListener implements DungeonSettleListener {
var challenge = scene.getChallenge();
var finishedTime = challenge == null ? challenge.getFinishedTime() : 0;
var dungeonStats =
new DungeonEndStats(
scene.getKilledMonsterCount(), finishedTime, 0, endReason);
var result = endReason == DungeonEndReason.COMPLETED ?
new TowerResult(dungeonData, dungeonStats, towerManager, challenge, stars) :
new BaseDungeonResult(dungeonData, dungeonStats);
new DungeonEndStats(scene.getKilledMonsterCount(), finishedTime, 0, endReason);
var result =
endReason == DungeonEndReason.COMPLETED
? new TowerResult(dungeonData, dungeonStats, towerManager, challenge, stars)
: new BaseDungeonResult(dungeonData, dungeonStats);
scene.broadcastPacket(new PacketDungeonSettleNotify(result));
}

View File

@ -159,7 +159,9 @@ public class WorldChallenge {
public int getGuardEntityHpPercent() {
if (guardEntity == null) {
Grasscutter.getLogger().warn("getGuardEntityHpPercent: Could not find guardEntity for this challenge = {}", this);
Grasscutter.getLogger()
.warn(
"getGuardEntityHpPercent: Could not find guardEntity for this challenge = {}", this);
return 100;
}

View File

@ -2,7 +2,6 @@ package emu.grasscutter.game.dungeons.challenge.trigger;
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.server.packet.send.PacketChallengeDataNotify;
public class GuardTrigger extends ChallengeTrigger {
@ -14,9 +13,12 @@ public class GuardTrigger extends ChallengeTrigger {
}
public void onBegin(WorldChallenge challenge) {
challenge.setGuardEntity(challenge.getScene().getEntityByConfigId(entityToProtectCFGId, challenge.getGroup().id));
challenge.setGuardEntity(
challenge.getScene().getEntityByConfigId(entityToProtectCFGId, challenge.getGroup().id));
lastSendPercent = challenge.getGuardEntityHpPercent();
challenge.getScene().broadcastPacket(new PacketChallengeDataNotify(challenge, 2, lastSendPercent));
challenge
.getScene()
.broadcastPacket(new PacketChallengeDataNotify(challenge, 2, lastSendPercent));
}
@Override

View File

@ -4,7 +4,6 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.binout.config.ConfigEntityGadget;
import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
import emu.grasscutter.data.common.PropGrowCurve;
import emu.grasscutter.data.excels.GadgetData;
import emu.grasscutter.data.excels.monster.MonsterCurveData;
import emu.grasscutter.game.entity.gadget.*;
@ -113,9 +112,14 @@ public class EntityGadget extends EntityBaseGadget {
if (gadgetData.getJsonName().equals("SceneObj_Gear_Operator_Mamolu_Entity")) {
MonsterCurveData curve = GameData.getMonsterCurveDataMap().get(11);
if (curve != null) {
FightProperty[] hpProps = {FightProperty.FIGHT_PROP_MAX_HP, FightProperty.FIGHT_PROP_BASE_HP, FightProperty.FIGHT_PROP_CUR_HP};
FightProperty[] hpProps = {
FightProperty.FIGHT_PROP_MAX_HP,
FightProperty.FIGHT_PROP_BASE_HP,
FightProperty.FIGHT_PROP_CUR_HP
};
for (var prop : hpProps) {
setFightProperty(prop, this.getFightProperty(prop) * curve.getMultByProp("GROW_CURVE_HP_ENVIRONMENT"));
setFightProperty(
prop, this.getFightProperty(prop) * curve.getMultByProp("GROW_CURVE_HP_ENVIRONMENT"));
}
}
}

View File

@ -971,8 +971,7 @@ public class SceneScriptManager {
// or the trigger should be preserved after a RefreshGroup call
if (trigger.isPreserved()) {
trigger.setPreserved(false);
}
else if (ret.isboolean() && !ret.checkboolean()
} else if (ret.isboolean() && !ret.checkboolean()
|| ret.isint() && ret.checkint() != 0
|| trigger.getTrigger_count() > 0 && invocations >= trigger.getTrigger_count()) {
deregisterTrigger(trigger);
@ -1122,7 +1121,8 @@ public class SceneScriptManager {
}
public void removeMonstersInGroup(SceneGroup group) {
var configSet = group.monsters.values().stream().map(m -> m.config_id).collect(Collectors.toSet());
var configSet =
group.monsters.values().stream().map(m -> m.config_id).collect(Collectors.toSet());
var toRemove =
getScene().getEntities().values().stream()
.filter(e -> e instanceof EntityMonster)