mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-12 12:24:35 +01:00
Spawn recovery npc after each battle in monolith
This commit is contained in:
@@ -3,6 +3,7 @@ package emu.nebula.game.tower.cases;
|
||||
import emu.nebula.GameConstants;
|
||||
import emu.nebula.data.GameData;
|
||||
import emu.nebula.game.player.PlayerChangeInfo;
|
||||
import emu.nebula.game.tower.room.StarTowerBattleRoom;
|
||||
import emu.nebula.proto.PublicStarTower.StarTowerRoomCase;
|
||||
import emu.nebula.proto.StarTowerInteract.StarTowerInteractReq;
|
||||
import emu.nebula.proto.StarTowerInteract.StarTowerInteractResp;
|
||||
@@ -91,6 +92,10 @@ public class StarTowerBattleCase extends StarTowerBaseCase {
|
||||
} else if (!this.getRoom().hasDoor()) {
|
||||
// Add door case here if door hasn't opened yet
|
||||
this.getGame().createExit(rsp.getMutableCases());
|
||||
// Create recovery npc
|
||||
if (this.getRoom() instanceof StarTowerBattleRoom) {
|
||||
this.getRoom().addCase(rsp.getMutableCases(), new StarTowerNpcRecoveryHPCase());
|
||||
}
|
||||
}
|
||||
|
||||
// Add sub note skills
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package emu.nebula.game.tower.cases;
|
||||
|
||||
import emu.nebula.proto.PublicStarTower.StarTowerRoomCase;
|
||||
import emu.nebula.proto.StarTowerInteract.StarTowerInteractReq;
|
||||
import emu.nebula.proto.StarTowerInteract.StarTowerInteractResp;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class StarTowerNpcRecoveryHPCase extends StarTowerBaseCase {
|
||||
private int effectId;
|
||||
|
||||
public StarTowerNpcRecoveryHPCase() {
|
||||
this(989970); // Restore Hp/Energy by 50%
|
||||
}
|
||||
|
||||
public StarTowerNpcRecoveryHPCase(int effectId) {
|
||||
this.effectId = effectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CaseType getType() {
|
||||
return CaseType.NpcRecoveryHP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StarTowerInteractResp interact(StarTowerInteractReq req, StarTowerInteractResp rsp) {
|
||||
return rsp;
|
||||
}
|
||||
|
||||
// Proto
|
||||
|
||||
@Override
|
||||
public void encodeProto(StarTowerRoomCase proto) {
|
||||
// Set case info
|
||||
proto.getMutableNpcRecoveryHPCase()
|
||||
.setEffectId(this.getEffectId());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package emu.nebula.game.tower.cases;
|
||||
|
||||
import emu.nebula.game.tower.room.StarTowerBattleRoom;
|
||||
import emu.nebula.proto.PublicStarTower.PotentialInfo;
|
||||
import emu.nebula.proto.PublicStarTower.StarTowerRoomCase;
|
||||
import emu.nebula.proto.StarTowerInteract.StarTowerInteractReq;
|
||||
@@ -57,6 +58,10 @@ public class StarTowerPotentialCase extends StarTowerBaseCase {
|
||||
} else if (!this.getRoom().hasDoor()) {
|
||||
// Add door case here if door hasn't opened yet
|
||||
this.getGame().createExit(rsp.getMutableCases());
|
||||
// Create recovery npc
|
||||
if (this.getRoom() instanceof StarTowerBattleRoom) {
|
||||
this.getRoom().addCase(rsp.getMutableCases(), new StarTowerNpcRecoveryHPCase());
|
||||
}
|
||||
}
|
||||
|
||||
return rsp;
|
||||
|
||||
Reference in New Issue
Block a user