noname/card/yibao.js

531 lines
13 KiB
JavaScript
Raw Normal View History

2015-04-29 03:25:17 +00:00
card.yibao={
card:{
hufu:{
fullskin:true,
type:'basic',
ai:{
value:[7.5,5,2],
useful:[7.5,5,2],
}
},
huoshan:{
fullskin:true,
type:'delay',
enable:function(card,player){
return (lib.filter.judge(card,player,player));
},
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player==target);
},
selectTarget:[-1,-1],
judge:function(card){
if(get.suit(card)=='heart'&&get.number(card)>1&&get.number(card)<10) return -6;
return 0;
},
effect:function(){
if(result.judge){
player.damage(2,'fire','nosource');
var players=get.players();
for(var i=0;i<game.players.length;i++){
if(get.distance(player,game.players[i])<=1&&player!=game.players[i]){
game.players[i].damage(1,'fire','nosource');
}
}
}
else{
if(!card.expired){
2015-06-27 16:21:25 +00:00
var target=player.next;
2015-12-10 15:57:45 +00:00
for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','huoshan')){
target=target.next;
}
else{
break;
}
2015-06-27 16:21:25 +00:00
}
2015-12-10 15:57:45 +00:00
if(target.num('j','huoshan')||target==player){
ui.discardPile.appendChild(card);
2015-04-29 03:25:17 +00:00
}
else{
2015-12-10 15:57:45 +00:00
if(card.name!='huoshan'){
target.addJudge('huoshan',card);
}
else{
target.addJudge(card);
}
2015-04-29 03:25:17 +00:00
}
}
else{
card.expired=false;
}
}
},
cancel:function(){
2015-06-27 16:21:25 +00:00
if(!card.expired){
var target=player.next;
2015-12-10 15:57:45 +00:00
for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','huoshan')){
target=target.next;
}
else{
break;
}
2015-06-27 16:21:25 +00:00
}
2015-12-10 15:57:45 +00:00
if(target.num('j','huoshan')||target==player){
ui.discardPile.appendChild(card);
2015-06-27 16:21:25 +00:00
}
else{
2015-12-10 15:57:45 +00:00
if(card.name!='huoshan'){
target.addJudge('huoshan',card);
}
else{
target.addJudge(card);
}
2015-06-27 16:21:25 +00:00
}
}
else{
card.expired=false;
}
2015-04-29 03:25:17 +00:00
},
ai:{
basic:{
useful:0,
value:0,
},
order:1,
result:{
target:function(player,target){
var rejudge,num=0;
for(var i=0;i<game.players.length;i++){
for(var j=0;j<game.players[i].skills.length;j++){
rejudge=get.tag(game.players[i].skills[j],'rejudge',game.players[i]);
if(rejudge!=undefined){
if(ai.get.attitude(target,game.players[i])>0&&
ai.get.attitude(game.players[i],target)>0) num+=rejudge;
else num-=rejudge;
}
}
}
if(num>0) return num;
if(num==0){
if(lib.config.mode=='identity'){
if(target.identity=='nei') return 1;
var situ=ai.get.situation();
if(target.identity=='fan'){
if(situ>1) return 1;
}
else{
if(situ<-1) return 1;
}
}
else if(lib.config.mode=='guozhan'){
if(target.identity=='ye') return 1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].identity=='unknown') return -1;
}
if(get.population(target.identity)==1){
if(target.maxHp>2&&target.hp<2) return 1;
if(game.players.length<3) return -1;
if(target.hp<=2&&target.num('he')<=3) return 1;
}
}
}
return -1;
}
},
tag:{
// damage:1,
// natureDamage:1,
// fireDamage:1,
}
}
},
hongshui:{
type:'delay',
enable:function(card,player){
return (lib.filter.judge(card,player,player));
},
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player==target);
},
selectTarget:[-1,-1],
judge:function(card){
if(get.suit(card)=='club'&&get.number(card)>1&&get.number(card)<10) return -3;
return 0;
},
fullskin:true,
effect:function(){
if(result.judge){
if(player.num('he')==0) player.loseHp();
2015-09-03 03:49:14 +00:00
else{
player.discard(player.get('he').randomGets(3));
}
2015-04-29 03:25:17 +00:00
var players=get.players();
2015-09-03 03:49:14 +00:00
for(var i=0;i<players.length;i++){
var dist=get.distance(player,players[i]);
if(dist<=2&&player!=players[i]){
var cs=players[i].get('he');
if(cs.length==0) players[i].loseHp();
else{
players[i].discard(cs.randomGets(3-Math.max(1,dist)));
}
2015-04-29 03:25:17 +00:00
}
}
}
else{
if(!card.expired){
2015-06-27 16:21:25 +00:00
var target=player.next;
2015-12-10 15:57:45 +00:00
for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','hongshui')){
target=target.next;
}
else{
break;
}
2015-06-27 16:21:25 +00:00
}
2015-12-10 15:57:45 +00:00
if(target.num('j','hongshui')||target==player){
ui.discardPile.appendChild(card);
2015-04-29 03:25:17 +00:00
}
else{
2015-12-10 15:57:45 +00:00
if(card.name!='hongshui'){
target.addJudge('hongshui',card);
}
else{
target.addJudge(card);
}
2015-04-29 03:25:17 +00:00
}
}
else{
card.expired=false;
}
}
},
cancel:function(){
2015-06-27 16:21:25 +00:00
if(!card.expired){
var target=player.next;
2015-12-10 15:57:45 +00:00
for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','hongshui')){
target=target.next;
}
else{
break;
}
2015-06-27 16:21:25 +00:00
}
2015-12-10 15:57:45 +00:00
if(target.num('j','hongshui')||target==player){
ui.discardPile.appendChild(card);
2015-06-27 16:21:25 +00:00
}
else{
2015-12-10 15:57:45 +00:00
if(card.name!='hongshui'){
target.addJudge('hongshui',card);
}
else{
target.addJudge(card);
}
2015-06-27 16:21:25 +00:00
}
}
else{
card.expired=false;
}
2015-04-29 03:25:17 +00:00
},
ai:{
basic:{
useful:0,
value:0,
},
order:1,
result:{
target:function(player,target){
var rejudge,num=0;
for(var i=0;i<game.players.length;i++){
for(var j=0;j<game.players[i].skills.length;j++){
rejudge=get.tag(game.players[i].skills[j],'rejudge',game.players[i]);
if(rejudge!=undefined){
if(ai.get.attitude(target,game.players[i])>0&&
ai.get.attitude(game.players[i],target)>0) num+=rejudge;
else num-=rejudge;
}
}
}
if(num>0) return num;
if(num==0){
if(lib.config.mode=='identity'){
if(target.identity=='nei') return 1;
var situ=ai.get.situation();
if(target.identity=='fan'){
if(situ>0) return 1;
}
else{
if(situ<0) return 1;
}
}
else if(lib.config.mode=='guozhan'){
if(game.players.length<=2) return -1;
if(target.identity=='ye') return 1;
for(var i=0;i<game.players.length;i++){
if(game.players[i].identity=='unknown') return -1;
}
if(get.population(target.identity)==1){
return 1;
}
}
}
return -1;
}
},
}
},
liuxinghuoyu:{
fullskin:true,
type:'trick',
enable:true,
filterTarget:function(card,player,target){
return target.num('he')>0;
},
content:function(){
"step 0"
target.chooseToDiscard('he',[1,2]).ai=function(card){
if(target.hasSkillTag('nofire')) return 0;
2015-11-24 00:50:54 +00:00
if(ai.get.damageEffect(target,player,target,'fire')>=0&&
!target.hasSkillTag('maixie')) return 0;
2015-11-06 10:05:08 +00:00
if(player.get('s').contains('xinwuyan')) return 0;
if(target.get('s').contains('xinwuyan')) return 0;
2015-04-29 03:25:17 +00:00
if(target.hasSkillTag('maixie')&&target.hp>1&&ui.selected.cards.length){
return 0;
}
2015-09-16 02:45:45 +00:00
if(card.name=='tao') return 0;
if(target.hp==1&&card.name=='jiu') return 0;
2015-04-29 03:25:17 +00:00
if(get.type(card)!='basic'){
return 10-ai.get.value(card);
}
return 8-ai.get.value(card);
};
"step 1"
if(!result.bool||result.cards.length<2){
if(result.bool) target.damage(2-result.cards.length,'fire');
else target.damage(2,'fire');
}
},
ai:{
basic:{
order:4,
value:7,
useful:2,
},
result:{
target:function(player,target){
if(target.hasSkillTag('nofire')) return 0;
2015-09-16 02:45:45 +00:00
var nh=target.num('he');
if(target==player) nh--;
if(nh==2) return -2.5;
if(nh==1) return -3;
2015-04-29 03:25:17 +00:00
return -2;
}
},
tag:{
damage:2,
fireDamage:2,
natureDamage:2,
discard:2,
loseCard:2,
position:'he',
}
}
},
dujian:{
fullskin:true,
type:'basic',
enable:true,
filterTarget:function(card,player,target){
return target.num('h')>0;
},
content:function(){
"step 0"
if(target.num('h')==0||player.num('h')==0){
event.finish();
return;
}
player.chooseCard(true);
"step 1"
event.card1=result.cards[0];
2015-05-09 05:36:58 +00:00
var rand=Math.random()<0.5;
target.chooseCard(true).ai=function(card){
if(rand) return Math.random();
return ai.get.value(card);
};
2015-04-29 03:25:17 +00:00
"step 2"
event.card2=result.cards[0];
2015-11-06 10:05:08 +00:00
ui.arena.classList.add('thrownhighlight');
game.addVideo('thrownhighlight1');
2015-04-29 03:25:17 +00:00
player.$compare(event.card1,target,event.card2);
game.delay(4);
"step 3"
2015-12-08 13:54:44 +00:00
game.log(player,'展示了',event.card1);
game.log(target,'展示了',event.card2);
2015-04-29 03:25:17 +00:00
if(get.color(event.card2)==get.color(event.card1)){
player.discard(event.card1).animate=false;
target.$gain2(event.card2);
var clone=event.card1.clone;
if(clone){
clone.style.transition='all 0.5s';
2015-11-05 02:34:35 +00:00
clone.style.transform='scale(1.2)';
2015-04-29 03:25:17 +00:00
clone.delete();
2015-11-04 01:59:00 +00:00
game.addVideo('deletenode',player,get.cardsInfo([clone]));
2015-04-29 03:25:17 +00:00
}
target.loseHp();
}
else{
player.$gain2(event.card1);
target.$gain2(event.card2);
target.addTempSkill('dujian2','phaseBegin');
}
2015-11-06 10:05:08 +00:00
ui.arena.classList.remove('thrownhighlight');
game.addVideo('thrownhighlight2');
2015-04-29 03:25:17 +00:00
},
ai:{
basic:{
order:2,
value:3,
useful:1,
},
result:{
player:function(player,target){
2015-05-05 09:23:31 +00:00
if(player.num('h')<=Math.max(2,player.hp)&&_status.event.name=='chooseToUse'){
2015-12-08 13:54:44 +00:00
if(typeof _status.event.filterCard=='function'&&
_status.event.filterCard({name:'dujian'})){
2015-05-05 09:23:31 +00:00
return -10;
}
if(_status.event.skill){
var viewAs=get.info(_status.event.skill).viewAs;
if(viewAs=='dujian') return -10;
if(viewAs&&viewAs.name=='dujian') return -10;
}
}
return 0;
2015-04-29 03:25:17 +00:00
},
2015-11-09 09:05:28 +00:00
target:function(player,target){
if(target.skills.contains('dujian2')||target.num('h')==0) return 0;
if(player.num('h')<=1) return 0;
return -1.5;
}
2015-04-29 03:25:17 +00:00
},
tag:{
loseHp:1
}
}
},
qiankundai:{
fullskin:true,
type:'equip',
subtype:'equip5',
onLose:function(){
player.draw();
},
skills:['qiankundai'],
ai:{
order:9.5,
basic:{
equipValue:function(card,player){
if(player.num('h','qiankundai')) return 6;
return 1;
}
}
}
},
},
skill:{
dujian2:{},
qiankundai:{
mod:{
maxHandcard:function(player,num){
return num+1;
}
},
},
_hufu_sha:{
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
return player.num('h','hufu')>0;
},
filterCard:{name:'hufu'},
viewAs:{name:'sha'},
prompt:'将一张虎符当杀使用或打出',
check:function(card){return 1},
ai:{
order:1,
useful:7.5,
value:7.5
}
},
_hufu_shan:{
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
return player.num('h','hufu')>0;
},
filterCard:{name:'hufu'},
viewAs:{name:'shan'},
prompt:'将一张虎符当闪使用或打出',
check:function(){return 1},
ai:{
order:1,
useful:7.5,
value:7.5
}
},
_hufu_jiu:{
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
return player.num('h','hufu')>0;
},
filterCard:{name:'hufu'},
viewAs:{name:'jiu'},
prompt:'将一张虎符当酒使用',
check:function(){return 1},
},
},
translate:{
huoshan:'火山',
huoshan_info:'出牌阶段对自己使用。若判定结果为红桃2~9则目标角色受到2点火焰伤害距离目标1以内的其他角色受到1点火焰伤害。若判定不为红桃2~9将之移动到下家的判定区里。',
hongshui:'洪水',
2015-09-03 03:49:14 +00:00
hongshui_info:'出牌阶段对自己使用。若判定结果为梅花2~9该角色随机弃置3张牌距离该角色为X的角色随机弃置3-X张牌若没有牌则失去一点体力X至少为1',
2015-04-29 03:25:17 +00:00
liuxinghuoyu:'流星火羽',
liuxinghuoyu_info:'出牌阶段对一名有手牌或装备牌的角色使用令其弃置0~2张牌并受到2-X点火焰伤害X为弃置的卡牌数',
dujian:'毒箭',
dujian_info:'出牌阶段,对一名有手牌或装备牌的角色使用,令其展示一张手牌,若与你选择的手牌颜色相同,你对其造成一点毒属性伤害',
qiankundai:'乾坤袋',
qiankundai_info:'你的手牌上限+1。当你失去该装备时你摸取一张牌。',
hufu:'虎符',
hufu_bg:'符',
_hufu_sha:'符杀',
_hufu_shan:'符闪',
_hufu_jiu:'符酒',
hufu_info:'你可以将一张虎符当作杀、闪或酒使用或打出',
},
list:[
['heart',1,'hufu'],
['spade',1,'hufu'],
['club',1,'qiankundai'],
['heart',6,'huoshan','fire'],
['club',7,'hongshui'],
['diamond',3,'liuxinghuoyu','fire'],
['heart',6,'liuxinghuoyu','fire'],
['heart',9,'liuxinghuoyu','fire'],
//['heart',11,'liuxinghuoyu','fire'],
//['heart',12,'liuxinghuoyu','fire'],
['spade',3,'dujian'],
//['club',6,'dujian','poison'],
//['club',9,'dujian','poison'],
['club',11,'dujian'],
['club',12,'dujian'],
//['club',3,'sha','poison'],
//['club',4,'sha','poison'],
//['club',5,'sha','poison'],
//['spade',6,'sha','poison'],
//['spade',7,'sha','poison'],
//['club',3,'sha','poison'],
//['club',4,'sha','poison'],
//['club',5,'sha','poison'],
//['spade',6,'sha','poison'],
//['spade',7,'sha','poison'],
],
}