mirror of
https://github.com/motajs/template.git
synced 2026-11-19 10:44:30 +08:00
feat: 道具效果存储
This commit is contained in:
1 parent
6029d038c6
commit
9b3c3a4e40
8 files changed
+179
-265
No files matched your search
@@ -136,6 +136,31 @@ export const enum ItemCategory {
|
||||
Equipment
|
||||
}
|
||||
|
||||
export interface IItemEffect {
|
||||
/** 即捡即用事件内容(Pick 类型) */
|
||||
readonly pickEvent: unknown;
|
||||
/** 道具使用事件内容(Constant 和 Consumable 类型) */
|
||||
readonly useEvent: unknown;
|
||||
|
||||
/**
|
||||
* 即捡即用效果,拾取道具时调用
|
||||
* @param item 当前道具数据
|
||||
*/
|
||||
pickEffect(item: IItemRawData): void;
|
||||
|
||||
/**
|
||||
* 道具使用效果,使用道具时调用
|
||||
* @param item 当前道具数据
|
||||
*/
|
||||
useEffect(item: IItemRawData): void;
|
||||
|
||||
/**
|
||||
* 能否使用道具
|
||||
* @param item 当前道具数据
|
||||
*/
|
||||
canUse(item: IItemRawData): boolean;
|
||||
}
|
||||
|
||||
export interface IItemRawData {
|
||||
/** 道具在地图上的图块数字 */
|
||||
readonly num: number;
|
||||
@@ -148,16 +173,11 @@ export interface IItemRawData {
|
||||
/** 道具描述文本 */
|
||||
readonly text: string;
|
||||
|
||||
/** 即捡即用效果(Pick 类型) */
|
||||
readonly pickEffect: string;
|
||||
/** 即捡即用事件(Pick 类型) */
|
||||
readonly pickEvent: unknown;
|
||||
/** 道具使用效果(Constant 和 Consumable 类型) */
|
||||
readonly useEffect: string;
|
||||
/** 道具使用事件(Constant 和 Consumable 类型) */
|
||||
readonly useEvent: unknown;
|
||||
/** 是否能够使用道具(Constant 和 Consumable 类型) */
|
||||
readonly canUse: string;
|
||||
/** 是否在道具栏中隐藏 */
|
||||
readonly hideInToolbox: boolean;
|
||||
|
||||
/** 道具效果对象(非 Equipment 类型) */
|
||||
readonly effect: IItemEffect;
|
||||
/** 装备道具属性(Equipment 类型) */
|
||||
readonly equip: unknown;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export interface IDataCommon {
|
||||
/** 图块定义存储 */
|
||||
readonly tileStore: ITileStore<MapDataOf<keyof NumberToId>>;
|
||||
/** 道具定义存储 */
|
||||
readonly itemStore: IItemStore;
|
||||
readonly itemStore: IItemStore<Item<AllIdsOf<'items'>>>;
|
||||
/** 朝向绑定 */
|
||||
readonly roleFace: IRoleFaceBinder;
|
||||
/** 朝向管理 */
|
||||
|
||||
Reference in new issue
Block a user