mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-14 07:55:57 +01:00
Fix tower mob level and hp scaling (#2430)
This commit is contained in:
@@ -355,6 +355,28 @@ public class EntityMonster extends GameEntity {
|
||||
+ (this.getFightProperty(c.getBase())
|
||||
* (1f + this.getFightProperty(c.getPercent())))));
|
||||
|
||||
// If in tower, scale max hp by
|
||||
// +50%: Floors 3 – 7
|
||||
// +100%: Floors 8 – 11
|
||||
// +150%: Floor 12
|
||||
var dungeonManager = getScene().getDungeonManager();
|
||||
var towerManager = getScene().getPlayers().get(0).getTowerManager();
|
||||
if (dungeonManager != null && dungeonManager.isTowerDungeon() && towerManager != null) {
|
||||
var floor = towerManager.getCurrentFloorNumber();
|
||||
float additionalScaleFactor = 0f;
|
||||
if (floor >= 12) {
|
||||
additionalScaleFactor = 1.5f;
|
||||
} else if (floor >= 8) {
|
||||
additionalScaleFactor = 1.f;
|
||||
} else if (floor >= 3) {
|
||||
additionalScaleFactor = .5f;
|
||||
}
|
||||
|
||||
this.setFightProperty(
|
||||
FightProperty.FIGHT_PROP_MAX_HP,
|
||||
this.getFightProperty(FightProperty.FIGHT_PROP_MAX_HP) * (1 + additionalScaleFactor));
|
||||
}
|
||||
|
||||
// Set current hp
|
||||
this.setFightProperty(
|
||||
FightProperty.FIGHT_PROP_CUR_HP,
|
||||
|
||||
Reference in New Issue
Block a user