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']]);
'step 2'
target.addSkillLog(result.control);
target.storage.zhuSkill_shanli=[result.control];
target.setAvatarQueue(target.name1||target.name,[event.chara[event.skills.indexOf(result.control)]]);
'step 3'
if(target.isZhu2()) event.trigger('zhuUpdate');
},
},
hongyi:{

View File

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

View File

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

View File

@ -3420,29 +3420,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
filter:function(event,player){
if(!player.hasZhuSkill('ruoyu'))return false;
if(player.storage.ruoyu) return false;
return player.isMinHp();
},
content:function(){
'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.gainMaxHp();
player.recover();
'step 1'
player.addSkillLog('rejijiang');
'step 2'
if(player.isZhu2()) event.trigger('zhuUpdate');
}
},
qiaobian:{

View File

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

View File

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

View File

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

View File

@ -20348,6 +20348,11 @@
this.node.hp.hide();
}
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++){
this.addSkill(skills[i]);
}
@ -20498,6 +20503,8 @@
this.removeSkill(info1[3][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]);
}
if(Array.isArray(maxHp)){
@ -26128,22 +26135,25 @@
hasStockSkill:function(skill,arg1,arg2,arg3){
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){
if(!this.hasSkill(skill)) return false;
var mode=get.mode();
if(mode=='identity'||(mode=='versus'&&(_status.mode=='four'||_status.mode=='guandu'))){
if(mode!='identity'){
if(player&&this.side!=player.side) return false;
if(player){
var mode=get.mode();
if(mode=='identity'&&_status.mode=='purple'){
if(this.identity.slice(0,1)!=player.identity.slice(0,1)) return false;
}
if(_status.mode=='purple'){
if(player&&this.identity.slice(0,1)!=player.identity.slice(0,1)) 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;
if(mode=='versus'&&(_status.mode=='four'||_status.mode=='guandu')){
if(this.side!=player.side) return false;
}
}
return false;
return true;
},
hasGlobalTag:function(tag,arg){
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.setIdentity();
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');
if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend();
delete game.zhong;