删除character下的extra,gujian,gwent,hearth的function写法,修正部分类型
This commit is contained in:
parent
cbedfddddc
commit
1e5a2fbb61
1087
character/extra.js
1087
character/extra.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1608
character/hearth.js
1608
character/hearth.js
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@ declare type CardBaseUIData = {
|
||||||
nature?: string;
|
nature?: string;
|
||||||
|
|
||||||
//用于某些方法,用于过滤卡牌的额外结构
|
//用于某些方法,用于过滤卡牌的额外结构
|
||||||
type?: string;
|
type?: string | string[];
|
||||||
subtype?: string;
|
subtype?: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
|
|
||||||
|
|
|
@ -291,6 +291,9 @@ declare interface Mod {
|
||||||
|
|
||||||
aiValue?(player: Player, card: Card, num: number): number | void;
|
aiValue?(player: Player, card: Card, num: number): number | void;
|
||||||
aiUseful?(player: Player, card: Card, num: number): number | void;
|
aiUseful?(player: Player, card: Card, num: number): number | void;
|
||||||
|
|
||||||
|
attackRange?(player: Player, num: number): number | void;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 技能 */
|
/** 技能 */
|
||||||
|
@ -790,7 +793,7 @@ declare interface Skill {
|
||||||
*
|
*
|
||||||
* 也可以是个自定义的方法
|
* 也可以是个自定义的方法
|
||||||
*/
|
*/
|
||||||
content?: string | ThreeParmFun<GameStorageItem, Player, string, string>;
|
content?: string | ((storage: GameStorageItem, player: Player, skill: string) => string | void);
|
||||||
/**
|
/**
|
||||||
* 标记数
|
* 标记数
|
||||||
*
|
*
|
||||||
|
@ -808,7 +811,7 @@ declare interface Skill {
|
||||||
*
|
*
|
||||||
* 注:该参数原本只在把整个标记移除时执行,后续可能自己扩展;
|
* 注:该参数原本只在把整个标记移除时执行,后续可能自己扩展;
|
||||||
*/
|
*/
|
||||||
onunmark?: TwoParmFun<GameStorageItem, Player, void> | string;
|
onunmark?: TwoParmFun<GameStorageItem, Player, void> | string | boolean;
|
||||||
// id?:string; //id名字需带“subplayer”,用于特殊模式显示信息用
|
// id?:string; //id名字需带“subplayer”,用于特殊模式显示信息用
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -937,9 +940,9 @@ declare interface Skill {
|
||||||
*
|
*
|
||||||
* 若不是字符串,则执行该方法
|
* 若不是字符串,则执行该方法
|
||||||
*/
|
*/
|
||||||
prepare?: string | ThreeParmFun<Card[], Player, Target[], string>;
|
prepare?: string | ((cards: Card[], player: Player, targets: Target[]) => string | void);
|
||||||
/** 在lose事件中使用,触发执行“lose_卡牌名”事件的content */
|
/** 在lose事件中使用,触发执行“lose_卡牌名”事件的content */
|
||||||
onLose?: ContentFunc | ContentFunc[];
|
onLose?: OldContentFuncByAll | OldContentFuncByAll[];
|
||||||
/**
|
/**
|
||||||
* 在lose事件中使用,必须要失去的卡牌为“equips”(装备牌),有onLose才生效。
|
* 在lose事件中使用,必须要失去的卡牌为“equips”(装备牌),有onLose才生效。
|
||||||
* 若符合以上条件,则检测该牌是否需要后续触发执行“lose_卡牌名”事件,既上面配置的onLose
|
* 若符合以上条件,则检测该牌是否需要后续触发执行“lose_卡牌名”事件,既上面配置的onLose
|
||||||
|
@ -1033,7 +1036,7 @@ declare interface Skill {
|
||||||
* 指向线的颜色枚举:
|
* 指向线的颜色枚举:
|
||||||
* fire(橙红色FF9244),thunder(浅蓝色8DD8FF),green(青色8DFFD8),
|
* fire(橙红色FF9244),thunder(浅蓝色8DD8FF),green(青色8DFFD8),
|
||||||
*/
|
*/
|
||||||
line?: string | { color: number[] };
|
line?: string | { color: number[] } | boolean;
|
||||||
/** 是否显示多条指引线 */
|
/** 是否显示多条指引线 */
|
||||||
multiline?: boolean;
|
multiline?: boolean;
|
||||||
|
|
||||||
|
@ -1109,7 +1112,7 @@ declare interface Skill {
|
||||||
*
|
*
|
||||||
* 为数组时,这个数组就是选择目标数的区间
|
* 为数组时,这个数组就是选择目标数的区间
|
||||||
*/
|
*/
|
||||||
selectTarget?: number | Select | NoneParmFum<number | Select>;
|
selectTarget?: number | Select | (() => number | Select);
|
||||||
/**
|
/**
|
||||||
* 选择的牌需要满足的条件
|
* 选择的牌需要满足的条件
|
||||||
*
|
*
|
||||||
|
@ -1147,11 +1150,8 @@ declare interface Skill {
|
||||||
ignoreMod?: boolean;
|
ignoreMod?: boolean;
|
||||||
/**
|
/**
|
||||||
* 选择的目标需要满足的条件
|
* 选择的目标需要满足的条件
|
||||||
* @param card
|
|
||||||
* @param player
|
|
||||||
* @param target
|
|
||||||
*/
|
*/
|
||||||
filterTarget?(card: Card, player: Player, target: Player): boolean;
|
filterTarget?: ((card: Card, player: Player, target: Player) => boolean) | boolean;
|
||||||
/**
|
/**
|
||||||
* 指定位置:
|
* 指定位置:
|
||||||
* 'h':手牌区, 'e':装备区, 'j':判定区
|
* 'h':手牌区, 'e':装备区, 'j':判定区
|
||||||
|
@ -1211,7 +1211,7 @@ declare interface Skill {
|
||||||
* @param player
|
* @param player
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
hiddenCard?(player: Player, name: string): boolean;
|
hiddenCard?(player: Player, name: string): boolean | void;
|
||||||
|
|
||||||
/** 录像相关,game.videoContent.skill中相关 */
|
/** 录像相关,game.videoContent.skill中相关 */
|
||||||
video?(player: Player, data: string | any[]): void;
|
video?(player: Player, data: string | any[]): void;
|
||||||
|
@ -1282,7 +1282,7 @@ declare interface Skill {
|
||||||
*
|
*
|
||||||
* 若没有配置prompt,显示该配置的提示
|
* 若没有配置prompt,显示该配置的提示
|
||||||
*/
|
*/
|
||||||
logTarget?: string | TwoParmFun<Trigger, Player, string | Player>;
|
logTarget?: string | TwoParmFun<GameEventPromise, Player, string | Player | Player[] | null>;
|
||||||
/**
|
/**
|
||||||
* 是否通过logTarget显示触发者的目标日志;
|
* 是否通过logTarget显示触发者的目标日志;
|
||||||
*
|
*
|
||||||
|
@ -1365,9 +1365,9 @@ declare interface Skill {
|
||||||
*
|
*
|
||||||
* 无参,简洁写法;
|
* 无参,简洁写法;
|
||||||
*/
|
*/
|
||||||
check?: OneParmFun<Card, number | boolean>;
|
check?: (card: Card) => number | boolean | void;
|
||||||
check?: TwoParmFun<GameEventPromise, Player, number | boolean>;
|
check?: (event: GameEventPromise, player: Player) => number | boolean | void;
|
||||||
check?: NoneParmFum<number | boolean>;
|
check?: () => number | boolean | void;
|
||||||
// check?(...any:any):number|boolean;
|
// check?(...any:any):number|boolean;
|
||||||
// /** ai用于检测的方法:用于主动使用触发技能 */
|
// /** ai用于检测的方法:用于主动使用触发技能 */
|
||||||
// check?(card:Card):number|boolean;
|
// check?(card:Card):number|boolean;
|
||||||
|
@ -1593,7 +1593,7 @@ declare interface SkillAI {
|
||||||
* 嘲讽值:
|
* 嘲讽值:
|
||||||
* 嘲讽值越大的角色越容易遭受到敌方的攻击,默认为1,一般在0~4中取值即可(缔盟threaten值为3)
|
* 嘲讽值越大的角色越容易遭受到敌方的攻击,默认为1,一般在0~4中取值即可(缔盟threaten值为3)
|
||||||
*/
|
*/
|
||||||
threaten?: number | TwoParmFun<Player, Target, number>;
|
threaten?: number | ((player: Player, target: Target) => number | void);
|
||||||
/**
|
/**
|
||||||
* 态度:
|
* 态度:
|
||||||
* 态度只由identity决定。不同身份对不同身份的att不同。
|
* 态度只由identity决定。不同身份对不同身份的att不同。
|
||||||
|
@ -1669,14 +1669,14 @@ declare interface SkillAI {
|
||||||
* 返回结果的字符串:"zeroplayer","zerotarget","zeroplayertarget",指定最终结果的:对使用者的收益值,对目标的收益值为0
|
* 返回结果的字符串:"zeroplayer","zerotarget","zeroplayertarget",指定最终结果的:对使用者的收益值,对目标的收益值为0
|
||||||
* @param result1 即当前ai.result.player的结果
|
* @param result1 即当前ai.result.player的结果
|
||||||
*/
|
*/
|
||||||
player?(card: Card, player: Player, target: Player, result1: number): string | number | number[] | void;
|
player?(card: Card, player: Player, target: Player, result1: number): string | number | number[] | void | boolean;
|
||||||
/**
|
/**
|
||||||
* 一名角色以你为牌的目标时对你的影响(牌/技能对你的影响)
|
* 一名角色以你为牌的目标时对你的影响(牌/技能对你的影响)
|
||||||
*
|
*
|
||||||
* 返回结果的字符串:"zeroplayer","zerotarget","zeroplayertarget",指定最终结果的:对使用者的收益值,对目标的收益值为0
|
* 返回结果的字符串:"zeroplayer","zerotarget","zeroplayertarget",指定最终结果的:对使用者的收益值,对目标的收益值为0
|
||||||
* @param result2 即当前ai.result.target的结果
|
* @param result2 即当前ai.result.target的结果
|
||||||
*/
|
*/
|
||||||
target?(card: Card, player: Player, target: Player, result2: number): string | number | number[] | void;
|
target?(card: Card, player: Player, target: Player, result2: number): string | number | number[] | void | boolean;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 收益:
|
* 收益:
|
||||||
|
@ -1694,21 +1694,21 @@ declare interface SkillAI {
|
||||||
* 没有返回值则不选;
|
* 没有返回值则不选;
|
||||||
* 注:写了这个就不用写player(player){}了,因为player可以在这里进行判断......先继续研究好,再下定论;
|
* 注:写了这个就不用写player(player){}了,因为player可以在这里进行判断......先继续研究好,再下定论;
|
||||||
*/
|
*/
|
||||||
target?: ThreeParmFun<Player, Target, Card, number> | number;
|
target?: number | ((player: Player, taregt: Player, card: Card) => number | void | boolean);
|
||||||
/**
|
/**
|
||||||
* 主要用于get.effect_use中,优先于上面的target;
|
* 主要用于get.effect_use中,优先于上面的target;
|
||||||
*/
|
*/
|
||||||
target_use?: ThreeParmFun<Player, Target, Card, number> | number;
|
target_use?: number | ((player: Player, taregt: Player, card: Card) => number | void) | boolean;
|
||||||
/**
|
/**
|
||||||
* ai是否发动此技能(对玩家(自身)的收益):
|
* ai是否发动此技能(对玩家(自身)的收益):
|
||||||
* 返回正,发动,否则不发动;
|
* 返回正,发动,否则不发动;
|
||||||
* 注:最终
|
* 注:最终
|
||||||
*/
|
*/
|
||||||
player?: ThreeParmFun<Player, Target, Card, number> | number;
|
player?: number | ((player: Player, taregt: Player, card: Card) => number | void | boolean);
|
||||||
/**
|
/**
|
||||||
* 主要用于get.effect_use中,优先于上面的player;
|
* 主要用于get.effect_use中,优先于上面的player;
|
||||||
*/
|
*/
|
||||||
player_use?: ThreeParmFun<Player, Target, Card, number> | number;
|
player_use?: number | ((player: Player, taregt: Player, card: Card) => number | void | boolean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取值为true时,不默认为“equip(装备)”卡牌,默认设置“card.ai.result.target”方法
|
* 取值为true时,不默认为“equip(装备)”卡牌,默认设置“card.ai.result.target”方法
|
||||||
|
|
|
@ -181,6 +181,11 @@ export class Player extends HTMLDivElement {
|
||||||
*/
|
*/
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.hp;
|
this.hp;
|
||||||
|
/**
|
||||||
|
* @type { number }
|
||||||
|
*/
|
||||||
|
// @ts-ignore
|
||||||
|
this.hujia;
|
||||||
throw new Error('Do not call this method');
|
throw new Error('Do not call this method');
|
||||||
}
|
}
|
||||||
build(noclick) {
|
build(noclick) {
|
||||||
|
|
Loading…
Reference in New Issue