Merge pull request #300 from mengxinzxz/PR-Branch

主公技机制修改简化+遗留问题修复
This commit is contained in:
Spmario233 2023-09-08 18:12:49 +08:00 committed by GitHub
commit 78f6a550c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 130 deletions

View File

@ -7688,8 +7688,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseControl(skills).set('dialog',['选择令'+get.translation(target)+'获得一个技能',[chara,'character']]); player.chooseControl(skills).set('dialog',['选择令'+get.translation(target)+'获得一个技能',[chara,'character']]);
'step 2' 'step 2'
target.addSkillLog(result.control); target.addSkillLog(result.control);
target.storage.zhuSkill_shanli=[result.control];
target.setAvatarQueue(target.name1||target.name,[event.chara[event.skills.indexOf(result.control)]]); target.setAvatarQueue(target.name1||target.name,[event.chara[event.skills.indexOf(result.control)]]);
'step 3'
if(target.isZhu2()) event.trigger('zhuUpdate');
}, },
}, },
hongyi:{ hongyi:{

View File

@ -381,17 +381,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return current!=player&&current.group=='wei'; return current!=player&&current.group=='wei';
}); });
}, },
init:function(player){
if(player.hasZhuSkill('rexingshuai')){
player.markSkill('rexingshuai');
player.storage.rexingshuai=false;
}
},
intro:{
content:'limited',
},
limited:true, limited:true,
mark:false, mark:true,
content:function(){ content:function(){
'step 0' 'step 0'
player.awakenSkill('rexingshuai'); player.awakenSkill('rexingshuai');
@ -9704,20 +9695,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gainMaxHp(); player.gainMaxHp();
'step 1' 'step 1'
if(player.hp<3) player.recover(3-player.hp); if(player.hp<3) player.recover(3-player.hp);
game.log(player,'获得了技能','#g【思蜀】','和','#g【激将】'); player.addSkillLog('sishu');
player.addSkill('sishu'); player.addSkillLog('rejijiang');
if(player.hasSkill('olruoyu')){ 'step 2'
player.addSkill('rejijiang'); if(player.isZhu2()) event.trigger('zhuUpdate');
}
else{
player.addAdditionalSkill('olruoyu','rejijiang');
}
if(!player.isZhu){
player.storage.zhuSkill_olruoyu=['rejijiang'];
}
else{
event.trigger('zhuUpdate');
}
} }
}, },
olfangquan:{ olfangquan:{

View File

@ -557,9 +557,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
sbzhiba:{ sbzhiba:{
init:function(player){
if(player.hasZhuSkill('sbzhiba')) player.markSkill('sbzhiba');
},
audio:2, audio:2,
trigger:{player:'dying'}, trigger:{player:'dying'},
filter:function(event,player){ filter:function(event,player){
@ -568,7 +565,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
zhuSkill:true, zhuSkill:true,
limited:true, limited:true,
mark:false, mark:true,
skillAnimation:true, skillAnimation:true,
animationColor:'wood', animationColor:'wood',
content:function(){ content:function(){

View File

@ -3420,29 +3420,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseZhunbeiBegin'}, trigger:{player:'phaseZhunbeiBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(!player.hasZhuSkill('ruoyu'))return false;
if(player.storage.ruoyu) return false;
return player.isMinHp(); return player.isMinHp();
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.storage.ruoyu=true;
player.gainMaxHp();
'step 1'
player.recover();
if(player.hasSkill('ruoyu')){
player.addSkill('rejijiang');
}
else{
player.addAdditionalSkill('ruoyu','rejijiang');
}
if(!player.isZhu){
player.storage.zhuSkill_ruoyu=['rejijiang'];
}
else{
event.trigger('zhuUpdate');
}
player.awakenSkill('ruoyu'); player.awakenSkill('ruoyu');
player.gainMaxHp();
player.recover();
'step 1'
player.addSkillLog('rejijiang');
'step 2'
if(player.isZhu2()) event.trigger('zhuUpdate');
} }
}, },
qiaobian:{ qiaobian:{

View File

@ -15237,15 +15237,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('choiceList',['获得技能〖妄尊〗',str]).set('choice',choice); }).set('choiceList',['获得技能〖妄尊〗',str]).set('choice',choice);
'step 2' 'step 2'
if(result.control=='选项一'){ if(result.control=='选项一'){
player.addSkill('rewangzun'); player.addSkillLog('rewangzun');
player.popup('rewangzun');
} }
else{ else{
player.draw(2); player.draw(2);
if(event.list){ if(event.list){
player.addSkill(event.list); for(var i of event.list) player.addSkillLog(event.list);
player.popup(event.list[0]);
player.storage.zhuSkill_yjixi=event.list;
game.broadcastAll(function(list){ game.broadcastAll(function(list){
game.expandSkills(list); game.expandSkills(list);
for(var i of list){ for(var i of list){
@ -15884,7 +15881,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
player.addAdditionalSkill('weidi',list); player.addAdditionalSkill('weidi',list);
player.storage.zhuSkill_weidi=list;
game.broadcastAll(function(list){ game.broadcastAll(function(list){
game.expandSkills(list); game.expandSkills(list);
for(var i of list){ for(var i of list){
@ -15990,16 +15986,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseZhunbeiBegin'}, trigger:{player:'phaseZhunbeiBegin'},
animationColor:'thunder', animationColor:'thunder',
skillAnimation:'legend', skillAnimation:'legend',
filter:function(event,player){
return !player.storage.yongdi;
},
init:function(player){
player.storage.yongdi=false;
},
mark:true, mark:true,
intro:{
content:'limited'
},
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
@ -16011,7 +15998,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var att=get.attitude(player,target); var att=get.attitude(player,target);
if(att<=1) return 0; if(att<=1) return 0;
var mode=get.mode(); var mode=get.mode();
if(mode=='identity'||(mode=='versus'&&_status.mode=='four')){ if(mode=='identity'||(mode=='versus'&&(_status.mode=='four'||_status.mode=='guandu'))){
if(target.name&&lib.character[target.name]){ if(target.name&&lib.character[target.name]){
for(var i=0;i<lib.character[target.name][3].length;i++){ for(var i=0;i<lib.character[target.name][3].length;i++){
if(lib.skill[lib.character[target.name][3][i]].zhuSkill){ if(lib.skill[lib.character[target.name][3][i]].zhuSkill){
@ -16024,36 +16011,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('goon',!player.hasUnknown()); }).set('goon',!player.hasUnknown());
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.awakenSkill('yongdi');
player.storage.yongdi=true;
player.logSkill('yongdi',result.targets);
var target=result.targets[0]; var target=result.targets[0];
target.gainMaxHp(true); player.logSkill('yongdi',target);
player.awakenSkill('yongdi');
target.gainMaxHp();
target.recover(); target.recover();
var mode=get.mode(); var mode=get.mode();
if(mode=='identity'||(mode=='versus'&&_status.mode=='four')||mode=='doudizhu'){ var skills=target.getStockSkills(true,true).filter(skill=>{
if(target.name&&lib.character[target.name]){ if(target.hasSkill(skill)) return false;
var skills=lib.character[target.name][3]; var info=get.info(skill);
target.storage.zhuSkill_yongdi=[]; return info&&info.zhuSkill;
for(var i=0;i<skills.length;i++){ });
var info=lib.skill[skills[i]]; if(skills.length){
if(info.zhuSkill){ for(var i of skills) target.addSkillLog(i);
target.storage.zhuSkill_yongdi.push(skills[i]);
if(info.init){
info.init(target);
}
if(info.init2){
info.init2(target);
}
}
}
}
} }
} }
}, },
ai:{ ai:{expose:0.2},
expose:0.2
}
}, },
regushe:{ regushe:{
audio:'gushe', audio:'gushe',

View File

@ -11457,28 +11457,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(!event.target||!event.target.isIn()||!player.hasZhuSkill('twfengqi',event.target)) return false; if(!event.target||!event.target.isIn()||!player.hasZhuSkill('twfengqi',event.target)) return false;
var skills=event.target.getStockSkills(true,true); var target=event.target;
for(var i of skills){ return target.getStockSkills(true,true).some(skill=>{
var info=get.info(i); if(target.hasSkill(skill)) return false;
if(info.zhuSkill&&!event.target.hasZhuSkill(i)) return true; var info=get.info(skill);
} return info&&info.zhuSkill;
return false; });
}, },
skillAnimation:true, skillAnimation:true,
animationColor:'thunder', animationColor:'thunder',
content:function(){ content:function(){
'step 0' 'step 0'
event.target=trigger.target; event.target=trigger.target;
event.target.chooseBool(get.prompt('twfengqi'),'激活武将牌上的所有主公技'); event.target.chooseBool(get.prompt('twfengqi'),'获得武将牌上的所有主公技');
'step 1' 'step 1'
if(result.bool){ if(result.bool){
target.logSkill('twfengqi',player); target.logSkill('twfengqi',player);
var skills=target.getStockSkills(true,true).filter(function(i){ var skills=target.getStockSkills(true,true).filter(skill=>{
var info=get.info(i); if(target.hasSkill(skill)) return false;
if(info.zhuSkill&&!target.hasZhuSkill(i)) return true; var info=get.info(skill);
return info&&info.zhuSkill;
}); });
target.markAuto('zhuSkill_twfengqi',skills); for(var i of skills) target.addSkillLog(i);
game.log(target,'激活了武将牌上的主公技')
} }
}, },
}, },
@ -13763,7 +13763,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
twgezhi:'革制', twgezhi:'革制',
twgezhi_info:'①当你于出牌阶段内首次使用某种类别的牌时,你可以重铸一张手牌。②出牌阶段结束时,若你本阶段内因〖革制①〗失去过至少两张牌,则你可以令一名角色选择获得一个其未获得过的效果:⒈攻击范围+2⒉手牌上限+2⒊加1点体力上限。', twgezhi_info:'①当你于出牌阶段内首次使用某种类别的牌时,你可以重铸一张手牌。②出牌阶段结束时,若你本阶段内因〖革制①〗失去过至少两张牌,则你可以令一名角色选择获得一个其未获得过的效果:⒈攻击范围+2⒉手牌上限+2⒊加1点体力上限。',
twfengqi:'烽起', twfengqi:'烽起',
twfengqi_info:'主公技,锁定技。①其他群势力角色发动〖鬻爵①〗时,将每阶段上限改为四张。②以其他角色为目标的〖革制②〗结算结束后,目标角色可以激活其武将牌上的主公技。', twfengqi_info:'主公技,锁定技。①其他群势力角色发动〖鬻爵①〗时,将每阶段上限改为四张。②以其他角色为目标的〖革制②〗结算结束后,目标角色可以获得其武将牌上的主公技。',
tw_caocao:'TW曹操', tw_caocao:'TW曹操',
twlingfa:'令法', twlingfa:'令法',
twlingfa_info:'①第一轮游戏开始时你可选择获得如下效果直到本轮结束其他角色使用【杀】时若其有牌则其需弃置一张牌否则受到你造成的1点伤害。②第二轮游戏开始时你可选择获得如下效果直到本轮结束其他角色使用【桃】结算结束后若其有牌则其需交给你一张牌否则受到你造成的1点伤害。③第三轮游戏开始时你失去〖令法〗并获得〖治暗〗。', twlingfa_info:'①第一轮游戏开始时你可选择获得如下效果直到本轮结束其他角色使用【杀】时若其有牌则其需弃置一张牌否则受到你造成的1点伤害。②第二轮游戏开始时你可选择获得如下效果直到本轮结束其他角色使用【桃】结算结束后若其有牌则其需交给你一张牌否则受到你造成的1点伤害。③第三轮游戏开始时你失去〖令法〗并获得〖治暗〗。',

View File

@ -1355,19 +1355,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
//孙体 //孙体
xinzhaofu:{ xinzhaofu:{
mark:false,
init:function(player){
if(player.hasZhuSkill('xinzhaofu')){
player.markSkill('xinzhaofu');
player.storage.xinzhaofu=false;
}
},
audio:'zhaofu', audio:'zhaofu',
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return player.hasZhuSkill('xinzhaofu'); return player.hasZhuSkill('xinzhaofu');
}, },
mark:true,
limited:true, limited:true,
skillAnimation:true, skillAnimation:true,
animationColor:'wood', animationColor:'wood',
@ -8748,28 +8742,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//priority:6, //priority:6,
zhuSkill:true, zhuSkill:true,
filter:function(event,player){ filter:function(event,player){
if(player.storage.xingshuai) return false;
if(player.hp>0) return false; if(player.hp>0) return false;
if(!player.hasZhuSkill('xingshuai')) return false; if(!player.hasZhuSkill('xingshuai')) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.group=='wei'; return current!=player&&current.group=='wei';
}); });
}, },
init:function(player){ mark:true,
if(player.hasZhuSkill('xingshuai')){
player.markSkill('xingshuai');
player.storage.xingshuai=false;
}
},
intro:{
content:'limited'
},
unique:true, unique:true,
limited:true, limited:true,
mark:false,
content:function(){ content:function(){
'step 0' 'step 0'
player.storage.xingshuai=true;
player.awakenSkill('xingshuai'); player.awakenSkill('xingshuai');
var targets=game.filterPlayer(); var targets=game.filterPlayer();
targets.remove(player); targets.remove(player);

View File

@ -20348,6 +20348,11 @@
this.node.hp.hide(); this.node.hp.hide();
} }
if(skill!=false){ if(skill!=false){
skills=skills.filter(skill=>{
var info=get.info(skill);
if(info&&info.zhuSkill&&!this.isZhu2()) return false;
return true;
});
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
this.addSkill(skills[i]); this.addSkill(skills[i]);
} }
@ -20498,6 +20503,8 @@
this.removeSkill(info1[3][i]); this.removeSkill(info1[3][i]);
} }
for(var i=0;i<info2[3].length;i++){ for(var i=0;i<info2[3].length;i++){
var info=get.info(info2[3][i]);
if(info&&info.zhuSkill&&!this.isZhu2()) continue;
this.addSkill(info2[3][i]); this.addSkill(info2[3][i]);
} }
if(Array.isArray(maxHp)){ if(Array.isArray(maxHp)){
@ -26128,22 +26135,25 @@
hasStockSkill:function(skill,arg1,arg2,arg3){ hasStockSkill:function(skill,arg1,arg2,arg3){
return game.expandSkills(this.getStockSkills(arg1,arg2,arg3)).contains(skill); return game.expandSkills(this.getStockSkills(arg1,arg2,arg3)).contains(skill);
}, },
isZhu2:function(){
var player=this,mode=get.mode();
if(!this.isZhu) return false;
if(mode=='identity') return true;
if(mode=='versus'&&(_status.mode=='four'||_status.mode=='guandu')) return true;
return false;
},
hasZhuSkill:function(skill,player){ hasZhuSkill:function(skill,player){
if(!this.hasSkill(skill)) return false; if(!this.hasSkill(skill)) return false;
if(player){
var mode=get.mode(); var mode=get.mode();
if(mode=='identity'||(mode=='versus'&&(_status.mode=='four'||_status.mode=='guandu'))){ if(mode=='identity'&&_status.mode=='purple'){
if(mode!='identity'){ if(this.identity.slice(0,1)!=player.identity.slice(0,1)) return false;
if(player&&this.side!=player.side) return false;
} }
if(_status.mode=='purple'){ if(mode=='versus'&&(_status.mode=='four'||_status.mode=='guandu')){
if(player&&this.identity.slice(0,1)!=player.identity.slice(0,1)) return false; if(this.side!=player.side) return false;
}
if(this.isZhu==true) return true;
for(var i in this.storage){
if(i.indexOf('zhuSkill_')==0&&this.storage[i].contains(skill)) return true;
} }
} }
return false; return true;
}, },
hasGlobalTag:function(tag,arg){ hasGlobalTag:function(tag,arg){
var skills=lib.skill.global.slice(0); var skills=lib.skill.global.slice(0);

View File

@ -2347,6 +2347,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.zhu.ai.shown=1; game.zhu.ai.shown=1;
game.zhu.setIdentity(); game.zhu.setIdentity();
game.zhu.isZhu=true; game.zhu.isZhu=true;
var skills=player.getStockSkills(true,true).filter(skill=>{
if(player.hasSkill(skill)) return false;
var info=get.info(skill);
return info&&info.zhuSkill;
});
if(skills.length){
for(var i of skills) player.addSkillLog(i);
}
game.zhu.node.identity.classList.remove('guessing'); game.zhu.node.identity.classList.remove('guessing');
if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend(); if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend();
delete game.zhong; delete game.zhong;