神典韦

This commit is contained in:
Spmario233 2023-08-12 13:05:29 +08:00
parent 280419f6a1
commit 2c4ee2e5f6
4 changed files with 192 additions and 31 deletions

View File

@ -267,7 +267,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtypes:['equip3','equip4'],
nomod:true,
nopower:true,
unique:true,
//unique:true,
distance:{
globalFrom:-1,
globalTo:+1,

View File

@ -22,7 +22,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
character:{
shen_dianwei:['male','shen',4,['juanjia'],['wei']],
shen_dianwei:['male','shen',4,['juanjia','qiexie','cuijue'],['wei']],
shen_dengai:['male','shen',4,['dctuoyu','dcxianjin','dcqijing'],['wei']],
tw_shen_lvmeng:['male','shen',3,['twshelie','twgongxin'],['wu']],
shen_zhangjiao:['male','shen',3,['yizhao','sijun','sanshou','tianjie'],['qun']],
@ -83,7 +83,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
skill:{
//捐甲
//神典韦
juanjia:{
trigger:{
global:'phaseBefore',
@ -98,6 +98,162 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.expandEquip(1);
},
},
qiexie:{
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
filter:function(event,player){
return player.countEquipableSlot(1)>0;
},
content:function(){
'step 0'
if(!_status.characterlist){
lib.skill.pingjian.initList();
}
var list=_status.characterlist.randomGets(5);
if(!list.length) event.finish();
else{
var num=player.countEquipableSlot(1);
player.chooseButton([
'挈挟:选择至多'+get.cnNumber(num)+'张武将置入武器栏',
[list,'character'],
],[1,num],true)
}
'step 1'
if(result.bool){
var list=result.links;
game.broadcastAll(function(list){
for(var name of list) lib.skill.qiexie.createCard(name);
},list);
var cards=list.map(function(name){
var card=game.createCard('qiexie_'+name,'none',get.infoMaxHp(lib.character[name][2]));
return card;
});
player.addTempSkill('qiexie_blocker','qiexieAfter');
player.markAuto('qiexie_blocker',cards);
player.$gain2(cards);
game.delayx();
for(var card of cards) player.equip(card);
}
},
createCard:function(name){
if(!lib.card['qiexie_'+name]){
if(lib.translate[name+'_ab']) lib.translate['qiexie_'+name]=lib.translate[name+'_ab'];
else lib.translate['qiexie_'+name]=lib.translate[name];
var info=lib.character[name];
var card={
fullimage:true,
image:'character:'+name,
type:'equip',
subtype:'equip1',
enable:true,
selectTarget:-1,
filterCard:function(card,player,target){
if(player!=target) return false;
return target.canEquip(card,true);
},
modTarget:true,
allowMultiple:false,
content:lib.element.content.equipCard,
toself:true,
ai:{},
skills:['qiexie_destroy'],
}
var maxHp=get.infoMaxHp(info[2]);
if(maxHp!=1) card.distance={attackFrom:(1-maxHp)};
var skills=info[3].filter(function(skill){
var info=get.skillInfoTranslation(skill);
if(!info.includes('【杀】')) return false;
var list=get.skillCategoriesOf(skill);
list.remove('锁定技');
return list.length==0;
});
var str='锁定技。';
if(skills.length){
card.skills.addArray(skills);
str+='你视为拥有技能';
for(var skill of skills){
str+='〖'+get.translation(skill)+'〗';
str+='、';
}
str=str.slice(0,str.length-1);
str+=''
}
str+='此牌离开你的装备区后,改为置入剩余武将牌牌堆。';
lib.translate['qiexie_'+name+'_info']=str;
lib.card['qiexie_'+name]=card;
}
},
subSkill:{
blocker:{
mod:{
canBeReplaced:function(card,player){
if(player.getStorage('qiexie_blocker').contains(card)) return false;
},
},
charlotte:true,
onremove:true,
trigger:{player:'equipEnd'},
forced:true,
firstDo:true,
priority:Infinity,
filter:function(event){
var evt=event.getParent();
if(evt.name!='qiexie') return false;
return !evt.next.some(event=>{
return event.name=='equip';
})
},
content:function(){
player.removeSkill('qiexie_blocker');
},
},
destroy:{
trigger:{player:'loseBegin'},
equipSkill:true,
forceDie:true,
charlotte:true,
forced:true,
popup:false,
filter:function(event,player){
return event.cards.some(card=>card.name.indexOf('qiexie_')==0)
},
content:function(){
for(var card of trigger.cards){
if(card.name.indexOf('qiexie_')==0){
card._destroy=true;
game.log(card,'被放回武将牌堆');
var name=card.name.slice(7);
if(lib.character[name]) _status.characterlist.add(name);
}
}
},
},
},
},
cuijue:{
enable:'phaseUse',
filter:function(event,player){
return player.countCards('he')>0&&game.hasPlayer(target=>lib.skill.cuijue.filterTarget('SB',player,target));
},
filterCard:true,
filterTarget:function(card,player,target){
if(player.getStorage('cuijue_used').contains(target)||!player.inRange(target)) return false;
var distance=get.distance(player,target);
return !game.hasPlayer(current=>(current!=target&&player.inRange(current)&&get.distance(player,current)>distance));
},
position:'he',
content:function(){
player.addTempSkill('cuijue_used','phaseUseAfter');
player.markAuto('cuijue_used',[target]);
target.damage('nocard');
},
subSkill:{
used:{
onremove:true,
charlotte:true,
},
},
},
//神邓艾
dctuoyu:{
audio:2,
@ -7231,6 +7387,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
shen_dianwei:'神典韦',
juanjia:'捐甲',
juanjia_info:'锁定技。游戏开始时,你废除一个防具栏,然后获得一个额外的武器栏。',
qiexie:'挈挟',
qiexie_info:'锁定技。准备阶段,你在剩余武将牌堆中随机观看五张牌,选择其中的任意张,将其按照如下规则转化为武器牌置入你的武器栏:{⒈此牌不具有花色,且其攻击范围和点数等于此武将牌的体力上限。⒉此武器牌的技能为该武将牌上所有描述中包含“【杀】”且不具有锁定技以外的标签的技能。⒊此武器牌离开你的装备区时,改为放回武将牌堆。}',
cuijue:'摧决',
cuijue_info:'每回合每名角色限一次。出牌阶段你可以弃置一张牌然后对攻击范围内距离最远的一名其他角色造成1点伤害。',
extra_feng:'神话再临·风',
extra_huo:'神话再临·火',

View File

@ -10595,6 +10595,7 @@
equip1:'武器',
equip2:'防具',
equip3:'防御马',
'equip3_4':'坐骑',
equip4:'攻击马',
equip5:'宝物',
equip6:'特殊装备',
@ -10733,9 +10734,14 @@
var source=event.source,num=(cards.length-(left-lose));
if(!source||!source.isIn()) source=player;
source.chooseButton([
'选择'+(player==source?'':get.translation(player))+'的'+get.cnNumber(num)+'张'+get.translation(slot)+'牌置入弃牌堆',
'选择'+(player==source?'':get.translation(player))+'的'+get.cnNumber(num)+'张'+get.translation(slot)+'牌置入弃牌堆',
cards,
],true,num);
],true,num).set('filterOk',function(){
var evt=_status.event;
return ui.selected.buttons.reduce(function(num,button){
return num+get.numOf(get.subtypes(button.link,false),evt.slot)
},0)==evt.required;
}).set('required',num).set('slot',slot)
}
else event.goto(3);
}
@ -10816,7 +10822,12 @@
source.chooseButton([
'选择替换掉'+get.cnNumber(num)+'张'+get.translation(slot)+'牌',
cards,
],true,num);
],true,num).set('filterOk',function(){
var evt=_status.event;
return ui.selected.buttons.reduce(function(num,button){
return num+get.numOf(get.subtypes(button.link,false),evt.slot)
},0)==evt.required;
}).set('required',num).set('slot',slot)
}
else event.goto(3);
}
@ -11845,7 +11856,7 @@
if(player.hasEnabledSlot(i)) list.push('equip'+i);
}
if(event.horse){
if(list.contains('equip3')&&list.contains('equip4')) list.push('equip6');
if(list.contains('equip3')&&list.contains('equip4')) list.push('equip3_4');
list.remove('equip3');
list.remove('equip4');
}
@ -11869,7 +11880,7 @@
}
'step 1'
event.result={control:result.control};
if(result.control=='equip6'){
if(result.control=='equip3_4'){
player.disableEquip(3,4);
}
else player.disableEquip(result.control);
@ -11877,25 +11888,14 @@
swapEquip:function(){
"step 0"
game.log(player,'和',target,'交换了装备区中的牌')
var e1=player.getCards('e');
var todis1=[];
for(var i=0;i<e1.length;i++){
if(target.isDisabled(get.subtype(e1[i]))) todis1.push(e1[i]);
}
player.discard(todis1);
var e2=target.getCards('e');
var todis2=[];
for(var i=0;i<e2.length;i++){
if(player.isDisabled(get.subtype(e2[i]))) todis2.push(e2[i]);
}
target.discard(todis2);
"step 1"
event.cards=[player.getCards('e'),target.getCards('e')];
player.lose(event.cards[0],ui.ordering,'visible');
target.lose(event.cards[1],ui.ordering,'visible');
if(event.cards[0].length) player.$give(event.cards[0],target,false);
if(event.cards[1].length) target.$give(event.cards[1],player,false);
"step 2"
game.loseAsync({
player:player,
target:target,
cards1:event.cards[0],
cards2:event.cards[1],
}).setContent('swapHandcardsx');
"step 1"
for(var i=0;i<event.cards[1].length;i++){
if(get.position(event.cards[1][i],true)=='o') player.equip(event.cards[1][i]);
}
@ -18400,8 +18400,9 @@
return this.hasDisabled(arg)&&!this.hasEnabledSlot(arg);
},
isEmpty:function(num){
return this.countEnabledSlot(num)>player.getEquips(num);
return this.countEnabledSlot(num)>this.getEquips(num);
},
//以下函数将被废弃
$disableEquip:function(){},
$enableEquip:function(){},
//装备区End
@ -19355,9 +19356,9 @@
this.update();
},
uninit:function(){
for(var i=1;i<6;i++){
if(this.isDisabled(i)) this.$enableEquip('equip'+i);
}
this.expandedSlots={};
this.disabledSlots={};
this.$syncDisable();
if(this.isDisabledJudge()){
game.broadcastAll(function(player){
player.storage._disableJudge=false;
@ -37407,7 +37408,7 @@
if(card.ai.basic.equipValue==undefined) card.ai.basic.equipValue=1;
}
if(card.ai.basic.value==undefined) card.ai.basic.value=function(card,player,index,method){
if(player.isDisabled(get.subtype(card))) return 0.01;
if(!player.canEquip(card)) return 0.01;
var value=0;
var info=get.info(card);
var current=player.getEquip(info.subtype);

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB