类型修复
This commit is contained in:
parent
cb34cd1e46
commit
d47bd0e0ea
|
@ -33,6 +33,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
clan_zhong:['clan_zhongyan','clan_zhonghui','clan_zhongyu'],
|
||||
},
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
//族吴乔
|
||||
clanqiajue:{
|
||||
|
@ -42,7 +43,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return player.countCards('he',card=>{
|
||||
if(_status.connectMode&&get.position(card)=='h') return true;
|
||||
return get.color(card,player)=='black'&&lib.filter.cardDiscardable(card,player);
|
||||
});
|
||||
})>0;
|
||||
},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
|
|
|
@ -44,6 +44,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
collab_remake:['dc_caocao','dc_liubei','dc_sunquan','nezha','dc_sunce','dc_zhaoyun'],
|
||||
},
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
//新InitFilter测试高达一号
|
||||
//打赢复活赛的牢达[哭]
|
||||
|
@ -52,7 +53,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
enable:['chooseToUse','chooseToRespond'],
|
||||
prompt:'将♦牌当做火【杀】,♥牌当做【桃】,♣牌当做【闪】,♠牌当做【无懈可击】使用或打出',
|
||||
viewAs(cards,player){
|
||||
var name=false;
|
||||
var name;
|
||||
var nature=null;
|
||||
switch(get.suit(cards[0],player)){
|
||||
case 'club':name='shan';break;
|
||||
|
|
|
@ -4572,7 +4572,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
const skills=player.getStockSkills(true,true).filter(skill=>{
|
||||
return !player.hasSkill(skill,null,false,false);
|
||||
});
|
||||
return skills.length;
|
||||
return skills.length>0;
|
||||
},
|
||||
filter_old(event,player){
|
||||
var evt=event.getParent();
|
||||
|
@ -4677,7 +4677,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
trigger:{global:'phaseUseBegin'},
|
||||
filter(event,player){
|
||||
return player.countCards('h')&&event.player!=player;
|
||||
return player.countCards('h')>0&&event.player!=player;
|
||||
},
|
||||
direct:true,
|
||||
content(){
|
||||
|
@ -4791,7 +4791,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
trigger:{player:'useCardAfter'},
|
||||
filter(event,player){
|
||||
return event.cards.filterInD('od').length&&get.color(event.card)=='red';
|
||||
return event.cards.filterInD('od').length>0&&get.color(event.card)=='red';
|
||||
},
|
||||
content(){
|
||||
'step 0'
|
||||
|
|
|
@ -547,6 +547,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
key_chihaya:['key_sakuya'],
|
||||
key_lucia:['key_shizuru'],
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
//伊吹风子
|
||||
fuuko_xingdiao:{
|
||||
|
|
|
@ -90,7 +90,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return mode=='identity'&&_status.mode!='purple';
|
||||
},
|
||||
},
|
||||
/** @type { SMap<Skill> } */
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
//神鲁肃
|
||||
dingzhou:{
|
||||
|
|
|
@ -213,6 +213,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
qingshu:{
|
||||
ai:{
|
||||
|
|
|
@ -81,6 +81,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
gw_luoqi:'是个爱国者…还是个货真价实的王八蛋。',
|
||||
gw_yioufeisi:'国王还是乞丐,两者有何区别,人类少一个算一个',
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
sqlongyin:{
|
||||
trigger:{player:'phaseBeginStart'},
|
||||
|
|
|
@ -218,6 +218,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
hs_jaina:['hs_antonidas'],
|
||||
hs_malfurion:['hs_malorne'],
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
hshuanyu:{
|
||||
trigger:{player:'damageEnd'},
|
||||
|
|
|
@ -115,6 +115,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
sp_zhengyin:['yue_caiwenji','yue_zhoufei','yue_caiyong','yue_xiaoqiao','yue_daqiao'],
|
||||
}
|
||||
},
|
||||
/** @type { importCharacterConfig['skill'] } */
|
||||
skill:{
|
||||
dcshengxi:{
|
||||
inherit:'reshengxi',
|
||||
|
@ -201,7 +202,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return card.hasGaintag('dcqiqin_tag')&&lib.skill.dczixi.zixiList.some(name=>{
|
||||
return game.hasPlayer(target=>target.canAddJudge(get.autoViewAs({name:'dczixi_'+name},[card])));
|
||||
});
|
||||
});
|
||||
})>0;
|
||||
},
|
||||
zixiList:['lebu','bingliang','shandian'],
|
||||
direct:true,
|
||||
|
|
|
@ -2,7 +2,7 @@ declare type CardBaseUIData = {
|
|||
name?: string;
|
||||
suit?: string;
|
||||
number?: number;
|
||||
nature?: string;
|
||||
nature?: string | null;
|
||||
|
||||
//用于某些方法,用于过滤卡牌的额外结构
|
||||
type?: string | string[];
|
||||
|
|
|
@ -863,7 +863,7 @@ declare interface Skill {
|
|||
*
|
||||
* 【v1.9.102】扩展:可以使用函数式viewAs,目前核心支持使用地方:backup,ok;
|
||||
*/
|
||||
viewAs?: string | CardBaseUIData | ((cards: Card[], player: Player) => string | VCard | CardBaseUIData);
|
||||
viewAs?: string | CardBaseUIData | ((cards: Card[], player: Player) => string | VCard | CardBaseUIData | null);
|
||||
/**
|
||||
* 视为技按钮出现条件(即发动条件)
|
||||
* @param player
|
||||
|
@ -923,7 +923,7 @@ declare interface Skill {
|
|||
*
|
||||
* 取值false(因为undefined != false结果为true,故默认不填和true效果一致)
|
||||
*/
|
||||
discard?: boolean;
|
||||
discard?: boolean | ContentFuncByAll | OldContentFuncByAll;
|
||||
/**
|
||||
* 是否失去牌(是否调用player.lose)
|
||||
*
|
||||
|
@ -1590,7 +1590,7 @@ declare interface SkillAI {
|
|||
* ai发动技能的优先度 【也用于卡牌的优先度】
|
||||
* 要具体比什么先发发动,可以使用函数返回结果
|
||||
*/
|
||||
order?: number | TwoParmFun<SkillOrCard, Player, number | void>;
|
||||
order?: number | ((item: SkillOrCard, player: Player) => number | void);
|
||||
/**
|
||||
* 发动技能是身份暴露度(0~1,相当于概率)
|
||||
* 取值范围为0~1,用于帮助AI判断身份,AI中未写expose其他AI将会无法判断其身份
|
||||
|
|
|
@ -2041,15 +2041,15 @@ export class Get extends Uninstantable {
|
|||
return card;
|
||||
}
|
||||
/**
|
||||
* @template T
|
||||
* @overload
|
||||
* @returns {GameEvent}
|
||||
*/
|
||||
/**
|
||||
* @template { keyof GameEvent } T
|
||||
* @overload
|
||||
* @param {T} key
|
||||
* @returns {GameEvent[T]}
|
||||
*/
|
||||
/**
|
||||
* @overload
|
||||
* @returns {GameEvent}
|
||||
*/
|
||||
static event(key) { return key ? _status.event[key] : _status.event; }
|
||||
static player() { return _status.event.player; }
|
||||
static players(sort, dead, out) {
|
||||
|
@ -4205,6 +4205,9 @@ export class Get extends Uninstantable {
|
|||
let cache = CacheContext.requireCacheContext();
|
||||
return cache.get.order(item);
|
||||
}
|
||||
/**
|
||||
* @returns { number }
|
||||
*/
|
||||
static order(item) {
|
||||
let cache = CacheContext.requireCacheContext();
|
||||
var info = get.info(item);
|
||||
|
|
Loading…
Reference in New Issue