Playtest
This commit is contained in:
+4
-3
@@ -1,6 +1,7 @@
|
||||
import type { GameObjectRegister } from "."
|
||||
import type { Effect } from "./Effect"
|
||||
import type { GameObjectNetcode } from "./GameObject"
|
||||
import type { Turn } from "./Turn"
|
||||
|
||||
enum CardRole {
|
||||
PERSONAL = "personal",
|
||||
@@ -8,7 +9,7 @@ enum CardRole {
|
||||
FIRE_GEM = "fire_gem"
|
||||
}
|
||||
|
||||
enum CardType {
|
||||
export enum CardType {
|
||||
HERO = "hero",
|
||||
HERO_ABILITY = "hero_ability",
|
||||
CURRENCY = "currency",
|
||||
@@ -48,10 +49,10 @@ export function create_card(input: CardNetcode, register: GameObjectRegister) {
|
||||
const card = new Proxy<any>(input, {
|
||||
get(target: CardNetcode, prop, reciever) {
|
||||
if (prop == "effects") {
|
||||
return target.effects.map((e) => register.effects[e])
|
||||
return target.effects.map((e) => register.effects.get(e))
|
||||
}
|
||||
if (prop == "health_as_champion") {
|
||||
return Object.values(register.turns).find(e => e.champions_health.has(card))?.champions_health.get(card)
|
||||
return Array.from(register.turns.values()).find(e => e.champions_health.has(card.uuid))?.champions_health.get(card.uuid)
|
||||
}
|
||||
return Reflect.get(target, prop, reciever);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user