You've already forked KF-MMO-Server
Quest syncing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { enemyDamageInfo } from "./enemyDamageInfo";
|
||||
import { physicsObject } from "./physicsObject";
|
||||
import { playerInventory } from "./playerInventory";
|
||||
import { questBook } from "./questBook";
|
||||
|
||||
export class playerData{
|
||||
id : number
|
||||
@@ -9,8 +10,14 @@ export class playerData{
|
||||
characterId : number
|
||||
inventory : playerInventory = new playerInventory()
|
||||
rigidbody : physicsObject = new physicsObject()
|
||||
questBook : questBook = new questBook()
|
||||
damageInfo : enemyDamageInfo[] = []
|
||||
|
||||
constructor(init?: Partial<playerData>) {
|
||||
Object.assign(this, init);
|
||||
this.questBook = new questBook(this.questBook)
|
||||
}
|
||||
|
||||
copyStart(){
|
||||
let player : any = {}
|
||||
player.id = this.id
|
||||
@@ -47,8 +54,4 @@ export class playerData{
|
||||
this.inventory.equipment = [-1, -1, -1]
|
||||
}
|
||||
}
|
||||
|
||||
constructor(init?: Partial<playerData>) {
|
||||
Object.assign(this, init);
|
||||
}
|
||||
}
|
||||
13
Classes/questBook.ts
Normal file
13
Classes/questBook.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { questProgressData } from "./questProgressData";
|
||||
|
||||
export class questBook{
|
||||
quests = {}
|
||||
|
||||
constructor(init?: Partial<questBook>) {
|
||||
Object.assign(this, init);
|
||||
}
|
||||
|
||||
updateQuest(quest : questProgressData){
|
||||
this.quests[quest.id] = quest
|
||||
}
|
||||
}
|
||||
6
Classes/questProgressData.ts
Normal file
6
Classes/questProgressData.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export class questProgressData{
|
||||
id : number
|
||||
state : number
|
||||
repeatCount : number
|
||||
objectives : []
|
||||
}
|
||||
Reference in New Issue
Block a user