Skip to content

Commit

Permalink
Format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 3, 2023
1 parent 24874e7 commit d461ee2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public void onDungeonSettle(DungeonManager dungeonManager, DungeonEndReason endR
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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public int increaseScore() {

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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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 {
Expand All @@ -14,9 +13,12 @@ public GuardTrigger(int entityToProtectCFGId) {
}

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
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/emu/grasscutter/game/entity/EntityGadget.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
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.*;
Expand Down Expand Up @@ -113,9 +112,14 @@ public EntityGadget(
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"));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/emu/grasscutter/scripts/SceneScriptManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,7 @@ private void callTrigger(SceneTrigger trigger, ScriptArgs params) {
// 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);
Expand Down Expand Up @@ -1122,7 +1121,8 @@ public RTree<SceneBlock, Geometry> getBlocksIndex() {
}

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)
Expand Down

0 comments on commit d461ee2

Please sign in to comment.