diff --git a/audio/die/tw_zhanghong.mp3 b/audio/die/tw_zhanghong.mp3 new file mode 100644 index 000000000..5697300a6 Binary files /dev/null and b/audio/die/tw_zhanghong.mp3 differ diff --git a/audio/die/tw_zhangzhao.mp3 b/audio/die/tw_zhangzhao.mp3 new file mode 100644 index 000000000..1fadfce0b Binary files /dev/null and b/audio/die/tw_zhangzhao.mp3 differ diff --git a/audio/skill/twchungang1.mp3 b/audio/skill/twchungang1.mp3 new file mode 100644 index 000000000..300517a85 Binary files /dev/null and b/audio/skill/twchungang1.mp3 differ diff --git a/audio/skill/twchungang2.mp3 b/audio/skill/twchungang2.mp3 new file mode 100644 index 000000000..14a26e9bc Binary files /dev/null and b/audio/skill/twchungang2.mp3 differ diff --git a/audio/skill/twlijian1.mp3 b/audio/skill/twlijian1.mp3 new file mode 100644 index 000000000..b57e06c26 Binary files /dev/null and b/audio/skill/twlijian1.mp3 differ diff --git a/audio/skill/twlijian2.mp3 b/audio/skill/twlijian2.mp3 new file mode 100644 index 000000000..e67097e3f Binary files /dev/null and b/audio/skill/twlijian2.mp3 differ diff --git a/audio/skill/twquanqian1.mp3 b/audio/skill/twquanqian1.mp3 new file mode 100644 index 000000000..ccb9c6229 Binary files /dev/null and b/audio/skill/twquanqian1.mp3 differ diff --git a/audio/skill/twquanqian2.mp3 b/audio/skill/twquanqian2.mp3 new file mode 100644 index 000000000..ed3184c45 Binary files /dev/null and b/audio/skill/twquanqian2.mp3 differ diff --git a/audio/skill/twrouke1.mp3 b/audio/skill/twrouke1.mp3 new file mode 100644 index 000000000..85dc9a94d Binary files /dev/null and b/audio/skill/twrouke1.mp3 differ diff --git a/audio/skill/twrouke2.mp3 b/audio/skill/twrouke2.mp3 new file mode 100644 index 000000000..f8fbc480d Binary files /dev/null and b/audio/skill/twrouke2.mp3 differ diff --git a/character/huicui.js b/character/huicui.js index 1ac39b039..8c5d15c1c 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -4485,7 +4485,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ backup:{audio:'dcquanjian'}, damage:{ audio:'dcquanjian', - charlotte:true, selectTarget:2, filterTarget:function(card,player,target){ if(!ui.selected.targets.length) return target!=player; @@ -4530,7 +4529,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, draw:{ audio:'dcquanjian', - charlotte:true, filterTarget:function(card,player,target){ if(target==player) return false; var num=target.countCards('h'); diff --git a/character/refresh.js b/character/refresh.js index 84de5c643..2998b3e37 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -2538,6 +2538,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ targets[event.num].chooseBool("是否押杀?").ai=function(event,player){ var evt=_status.event.getParent(); if(get.attitude(targets[event.num],evt.player)>0) return evt.player.countCards('h','sha')?false:true; + if(evt.player.hasKnownCards(targets[event.num],c=>{return c.name == 'sha';})){ + return true; + } return Math.random()<0.5; }; "step 2" diff --git a/character/sp.js b/character/sp.js index 376981af0..57c3c1368 100755 --- a/character/sp.js +++ b/character/sp.js @@ -7,13 +7,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp:{ sp_tianji:["sunhao","liuxie","caoang","hetaihou","sunluyu",'ol_wangrong',"zuofen","ol_bianfuren","qinghegongzhu","tengfanglan","ruiji",'caoxiancaohua'], sp_sibi:["yangxiu","chenlin","chengyu","shixie","fuwan","wangyun","zhugejin","simalang","maliang","buzhi","dongyun","kanze","sunqian","xizhicai","sunshao",'duxi',"jianggan",'ol_dengzhi','ol_yangyi','ol_dongzhao','ol_chendeng','jin_yanghu','wangyan','xiahouxuan','quhuang','zhanghua','wangguan','sunhong','caoxi'], - sp_tianzhu:['niujin','hejin','hansui',"wutugu","yanbaihu","shamoke","panfeng","zhugedan",'huangzu','gaogan',"tadun","fanjiangzhangda","ahuinan","dongtuna",'ol_wenqin'], + sp_tianzhu:['zhangyan','niujin','hejin','hansui',"wutugu","yanbaihu","shamoke","panfeng","zhugedan",'huangzu','gaogan',"tadun","fanjiangzhangda","ahuinan","dongtuna",'ol_wenqin'], sp_nvshi:["lingju","guanyinping","zhangxingcai","mayunlu","dongbai","zhaoxiang",'ol_zhangchangpu',"daxiaoqiao","jin_guohuai"], sp_shaowei:["simahui","zhangbao","zhanglu","zhugeguo","xujing","zhangling",'huangchengyan','zhangzhi','lushi'], sp_huben:['duanjiong','ol_mengda',"caohong","xiahouba","zhugeke","zumao","wenpin","litong","mazhong","heqi","quyi","luzhi","zangba","yuejin","dingfeng","wuyan","ol_zhuling","tianyu","huojun",'zhaoyǎn','dengzhong','ol_furong','macheng','ol_zhangyì','ol_zhujun','maxiumatie','luoxian','ol_huban','haopu','ol_qianzhao'], sp_liesi:['mizhu','weizi','ol_liuba','zhangshiping'], sp_default:["sp_diaochan","sp_zhaoyun","sp_sunshangxiang","sp_caoren","sp_jiangwei","sp_machao","sp_caiwenji","jsp_guanyu","jsp_huangyueying","sp_pangde","sp_jiaxu","yuanshu",'sp_zhangliao','sp_ol_zhanghe','sp_menghuo'], - sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_feiyi','lvboshe','zhangyan','ol_dingshangwan','ol_liwan'], + sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_feiyi','lvboshe','ol_dingshangwan','ol_liwan'], sp_qifu:["caoying",'panshu',"caochun","yuantanyuanshang",'caoshuang','wolongfengchu','guansuo','baosanniang','fengfangnv','jin_zhouchu'], sp_wanglang:['ol_wanglang','ol_puyuan','ol_zhouqun'], sp_zhongdan:["cuiyan","huangfusong"], diff --git a/character/sp2.js b/character/sp2.js index d4494cea2..968379d2e 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -2063,14 +2063,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //卞喜 dunxi:{ audio:2, - trigger:{player:'useCardAfter'}, + trigger:{player:'useCard'}, direct:true, filter:function(event,player){ if(!get.tag(event.card,'damage')) return false; - for(var i of event.targets){ - if(i!=player&&i.isIn()) return true; - } - return false; + return event.targets.some(target=>target!=player&&target.isIn()); }, content:function(){ 'step 0' @@ -10527,7 +10524,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcbihuo_info:'①当你受到其他角色造成的伤害后,你可令一名角色下回合摸牌阶段的额定摸牌数+1。②当你对其他角色造成伤害后,你可令一名角色下回合摸牌阶段的额定摸牌数-1。', bianxi:'卞喜', dunxi:'钝袭', - dunxi_info:'①当你使用具有伤害标签的牌结算结束后,你可以令一名不为你的目标角色获得一枚“钝”。②有“钝”的角色使用基本牌或锦囊牌时,若此牌目标数为1且此时没有角色处于濒死状态,你令其移去一枚“钝”。系统随机选择一名角色,并将此牌的目标改为该角色。若该角色和原目标相同,则其失去1点体力。若其正处于出牌阶段内,则结束此阶段。', + dunxi_info:'①当你使用具有伤害标签的牌时,你可以令一名不为你的目标角色获得一枚“钝”。②有“钝”的角色使用基本牌或锦囊牌时,若此牌目标数为1且此时没有角色处于濒死状态,你令其移去一枚“钝”。系统随机选择一名角色,并将此牌的目标改为该角色。若该角色和原目标相同,则其失去1点体力。若其正处于出牌阶段内,则结束此阶段。', niufu:'牛辅', dcxiaoxi:'宵袭', dcxiaoxi_info:'锁定技。出牌阶段开始时,你声明X并减X点体力上限(X∈[1,2])。然后你选择一名攻击范围内的其他角色并选择一项:⒈获得该角色的X张牌。⒉视为对其使用X张【杀】。', diff --git a/character/xianding.js b/character/xianding.js index 107239cba..d4cd1644b 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -6257,7 +6257,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterCard:()=>false, selectCard:-1, - charlotte:true, content:function(){ 'step 0' player.addTempSkill('dcfengyan_gain','phaseUseAfter'); @@ -6283,7 +6282,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterCard:()=>false, selectCard:-1, - charlotte:true, content:function(){ player.addTempSkill('dcfengyan_sha','phaseUseAfter'); player.useCard({ diff --git a/character/yijiang.js b/character/yijiang.js index 8b589aee2..d135fe7f5 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -466,8 +466,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return _status.event.choice; }).set('choice',function(){ var num=trigger.player.countCards('h',card=>get.type2(card)==type); + var knownNum = trigger.player.countKnownCards(_status.event.player,card=>get.type2(card)==type); + if(trigger.player.isAllCardsKnown(_status.event.player)){ + return knownNum; + } + var restNum = num - knownNum; var numx; - if(type=='basic') numx=num+(Math.random()<0.2?(Math.random()>0.5?1:-1):0); + if(type=='basic') numx=num+Math.floor(Math.random()*restNum+1); else if(type=='trick'){ if(num>2) numx=2; else numx=1; @@ -478,7 +483,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ numx=[0,1].randomGet(); } - if(numx<0) numx=0; + if(numx=choices.length) numx=choices.length-1; return numx; }()); diff --git a/game/game.js b/game/game.js index 0f0079a0a..aaa37fdd5 100644 --- a/game/game.js +++ b/game/game.js @@ -622,8 +622,8 @@ ['tao',3] ]), effect:new Map([ - ['sha',event=>{ - if(event.step!=1) return; + ['sha',(event,option)=>{ + if(event.step!=0||option.state!='end') return; game.log(event.player,'触发了强化效果'); game.log(event.card,'抵消所需要的',new lib.element.VCard({ name:'shan' @@ -636,8 +636,8 @@ else map[id].shanRequired=2; }); }], - ['shan',event=>{ - if(event.step!=1) return; + ['shan',(event,option)=>{ + if(event.step!=0||option.state!='end') return; game.log(event.player,'触发了强化效果'); game.log('使用',event.card,'时视为两张',new lib.element.VCard({ name:'shan' @@ -646,8 +646,8 @@ trigger.getParent(2).decrease('shanRequired',1); }); }], - ['juedou',event=>{ - if(event.step!=1) return; + ['juedou',(event,option)=>{ + if(event.step!=0||option.state!='end') return; game.log(event.player,'触发了强化效果'); game.log('对',event.card,'的目标造成伤害时,伤害+1'); event.player.when({ @@ -656,14 +656,14 @@ trigger.increase('num'); }); }], - ['huogong',event=>{ - if(event.step!=1) return; + ['huogong',(event,option)=>{ + if(event.step!=0||option.state!='end') return; game.log(event.player,'触发了强化效果'); game.log(event.card,'造成的伤害+1'); event.increase('baseDamage',1); }], - ['tao',event=>{ - if(event.step!=1) return; + ['tao',(event,option)=>{ + if(event.step!=0||option.state!='end') return; game.log(event.player,'触发了强化效果'); game.log(event.card,'回复的体力+1'); event.increase('baseDamage',1); @@ -8395,6 +8395,7 @@ var that=this; this.timeout=setTimeout(function(){ + console.log(that,that._selfDestroyed) if(!that._selfDestroyed){ position.appendChild(that); } @@ -8826,23 +8827,6 @@ return list[0]; } }); - /** - * @deprecated - * !!!WARNING!!! - * Will be deprecated in next verision! - * Use {@link VCard#hasNature} instead. - */ - Object.defineProperty(Object.prototype,'hasNature',{ - configurable:true, - enumerable:false, - writable:true, - value:function(nature,player){ - var natures=get.natureList(this,player); - if(!nature) return natures.length>0; - if(nature=='linked') return natures.some(n=>lib.linked.includes(n)); - return get.is.sameNature(natures,nature); - } - }); window.onkeydown=function(e){ if(!ui.menuContainer||!ui.menuContainer.classList.contains('hidden')){ if(e.keyCode==116||((e.ctrlKey||e.metaKey)&&e.keyCode==82)){ @@ -11036,7 +11020,7 @@ return; } if(Array.isArray(file)){ - return file.forEach(value=>lib.init.js(path,value,onLoad,onError)); + return file.forEach(value=>lib.init.jsSync(path,value,onLoad,onError)); } let scriptSource; if(!file) scriptSource=path; @@ -19316,9 +19300,15 @@ for(var num=0;num{hcard.clearKnowers();}); + player.getCards('h').forEach(hcard=>{hcard.clearKnowers();}); } "step 2" if(num 0; } + //数此角色被知道的牌。 + countKnownCards(other,filter){ + return this.getKnownCards(other,filter).length; + } //Execute the delay card effect //执行延时锦囊牌效果 executeDelayCardEffect(card,target,judge,judge2){ @@ -30589,6 +30584,21 @@ } } } + removeKnower(player){ + if(!this._knowers){ + return; + } + if(typeof player == 'string'){ + this._knowers.remove(player); + }else{ + let type = get.itemtype(player); + if(type == 'player'){ + this._knowers.remove(player.playerid); + }else if(type == 'players'){ + player.forEach(p=>this._knowers.remove(p.playerid)); + } + } + } //清除此牌的知情者。 clearKnowers(){ if(this._knowers)delete this._knowers; @@ -30713,7 +30723,10 @@ if(this._uncheck.length==0) this.classList.remove('uncheck'); } discard(bool){ - this.fix(); + if(!this._selfDestroyed){ + this.fix(); + ui.discardPile.appendChild(this); + } this.classList.remove('glow'); if(bool===false){ ui.cardPile.insertBefore(this,ui.cardPile.childNodes[Math.floor(Math.random()*ui.cardPile.childNodes.length)]); @@ -30958,17 +30971,17 @@ return this; } /** - * @param {Parameters[0]} [type] - * @param {GameEvent} [event] + * @param {Parameters[0]} type + * @param {GameEvent} event + * @param {{ + * state?: 'begin' | 'end'; + * }} option * @returns {this} */ - callHandler(type,event){ - if(this.hasHandler(type)){ - if(!event) event=this; - this.getHandler(type).forEach(handler=>{ - if(typeof handler=='function') handler(event); - }); - } + callHandler(type,event,option){ + if(this.hasHandler(type)) this.getHandler(type).forEach(handler=>{ + if(typeof handler=='function') handler(event,option); + }); return this; } getDefaultHandlerType(){ @@ -30977,7 +30990,9 @@ } /** * @param {Parameters[0]} [type] - * @returns {((event: GameEvent) => void)[]} + * @returns {((event: GameEvent, option: { + * state?: 'begin' | 'end'; + * }) => void)[]} */ getHandler(type){ if(!type) type=this.getDefaultHandlerType(); @@ -30995,13 +31010,17 @@ } /** * @overload - * @param {...((event: GameEvent) => void)[]} handlers + * @param {...((event: GameEvent, option: { + * state?: 'begin' | 'end'; + * }) => void)[]} handlers * @returns {number} */ /** * @overload * @param {Parameters[0]} type - * @param {...((event: GameEvent) => void)[]} handlers + * @param {...((event: GameEvent, option: { + * state?: 'begin' | 'end'; + * }) => void)[]} handlers * @returns {number} */ pushHandler(type){ @@ -33079,8 +33098,8 @@ player.changeFury(-stratagemBuff.cost.get(cardName),true); const gameEvent=get.event(),effect=stratagemBuff.effect.get(cardName); if(typeof effect=='function') gameEvent.pushHandler('onNextUseCard',effect); - gameEvent.pushHandler('onNextUseCard',event=>{ - if(event.step==1) game.broadcastAll(cards=>cards.forEach(card=>card.clone.classList.add('stratagem-fury-glow')),event.cards); + gameEvent.pushHandler('onNextUseCard',(event,option)=>{ + if(event.step==0&&option.state=='end') game.broadcastAll(cards=>cards.forEach(card=>card.clone.classList.add('stratagem-fury-glow')),event.cards); }); }, ai:{ @@ -35838,6 +35857,7 @@ for(let i=0;i