mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-20 01:29:54 +02:00
Implement heartlink invite
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package emu.nebula.game.dating;
|
||||
|
||||
public interface DatingEvent {
|
||||
|
||||
public int getId();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package emu.nebula.game.dating;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import lombok.Getter;
|
||||
|
||||
public enum DatingEventType {
|
||||
Start (1),
|
||||
End (2),
|
||||
Landmark (3),
|
||||
Regular (4),
|
||||
LimitedLandmark (5),
|
||||
BranchA (6),
|
||||
BranchB (7),
|
||||
BeforeBranch (8),
|
||||
AfterBranch (9);
|
||||
|
||||
@Getter
|
||||
private final int value;
|
||||
private final static Int2ObjectMap<DatingEventType> map = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
static {
|
||||
for (DatingEventType type : DatingEventType.values()) {
|
||||
map.put(type.getValue(), type);
|
||||
}
|
||||
}
|
||||
|
||||
private DatingEventType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static DatingEventType getByValue(int value) {
|
||||
return map.get(value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package emu.nebula.game.dating;
|
||||
|
||||
import emu.nebula.data.resources.DatingLandmarkDef;
|
||||
import emu.nebula.game.character.GameCharacter;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class DatingGame {
|
||||
private GameCharacter character;
|
||||
private DatingLandmarkDef landmark;
|
||||
|
||||
private int[] branchOptionsA;
|
||||
private int[] branchOptionsB;
|
||||
|
||||
public DatingGame(GameCharacter character, DatingLandmarkDef landmark) {
|
||||
this.character = character;
|
||||
this.landmark = landmark;
|
||||
this.branchOptionsA = new int[] {1, 2};
|
||||
this.branchOptionsB = new int[] {1, 2};
|
||||
}
|
||||
|
||||
public boolean selectDatingBranchA(int optionId) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean selectDatingBranchB(int optionId) {
|
||||
// TODO
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package emu.nebula.game.dating;
|
||||
|
||||
import emu.nebula.data.GameData;
|
||||
import emu.nebula.game.character.GameCharacter;
|
||||
import emu.nebula.game.player.Player;
|
||||
import emu.nebula.game.player.PlayerManager;
|
||||
import emu.nebula.game.quest.QuestCondType;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class DatingManager extends PlayerManager {
|
||||
private DatingGame game;
|
||||
|
||||
public DatingManager(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public DatingGame selectLandmark(GameCharacter character, int landmarkId) {
|
||||
// Get landmark data
|
||||
var data = GameData.getDatingLandmarkDataTable().get(landmarkId);
|
||||
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set landmark + character
|
||||
this.game = new DatingGame(character, data);
|
||||
|
||||
// Trigger quest
|
||||
this.getPlayer().triggerQuest(QuestCondType.CharactersDatingTotal, 1);
|
||||
|
||||
// Success
|
||||
return this.game;
|
||||
}
|
||||
|
||||
public void endDatingGame() {
|
||||
this.game = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user