改进双将体力上限
This commit is contained in:
parent
3a61ee0774
commit
36f824eee0
|
@ -321,7 +321,7 @@ character.diy={
|
||||||
return event.source!=undefined;
|
return event.source!=undefined;
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
trigger.source.addSkill('benghuai');
|
trigger.source.loseMaxHp(true);
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
threaten:function(player,target){
|
threaten:function(player,target){
|
||||||
|
@ -331,7 +331,7 @@ character.diy={
|
||||||
target:function(card,player,target,current){
|
target:function(card,player,target,current){
|
||||||
if(target.hp<=1&&get.tag(card,'damage')){
|
if(target.hp<=1&&get.tag(card,'damage')){
|
||||||
if(player.skills.contains('jueqing')) return [1,-5];
|
if(player.skills.contains('jueqing')) return [1,-5];
|
||||||
return [1,0,0,-10];
|
return [1,0,0,-2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -774,7 +774,7 @@ character.diy={
|
||||||
honglian_info:'每当你受到来自其他角色的伤害,可以弃置伤害来源的所有红色牌',
|
honglian_info:'每当你受到来自其他角色的伤害,可以弃置伤害来源的所有红色牌',
|
||||||
jieyan_info:'出牌阶段限一次,你可以弃置一张红色手牌令场上所有角色受到一点火焰伤害',
|
jieyan_info:'出牌阶段限一次,你可以弃置一张红色手牌令场上所有角色受到一点火焰伤害',
|
||||||
diyguhuo_info:'锁定技,回合开始阶段,你摸两张牌,然后弃置区域内的两张牌',
|
diyguhuo_info:'锁定技,回合开始阶段,你摸两张牌,然后弃置区域内的两张牌',
|
||||||
diychanyuan_info:'锁定技,杀死你的角色获得技能【崩坏】',
|
diychanyuan_info:'锁定技,杀死你的角色失去一点体力上限',
|
||||||
zonghuo_info:'你可弃置一张牌将你即将造成的伤害变为火焰伤害',
|
zonghuo_info:'你可弃置一张牌将你即将造成的伤害变为火焰伤害',
|
||||||
shaoying_info:'每当你造成一次火焰伤害,可指定距离受伤害角色1以内的另一名角色,并展示牌堆顶的一张牌,若此牌为红色,该角色受到一点火焰伤害',
|
shaoying_info:'每当你造成一次火焰伤害,可指定距离受伤害角色1以内的另一名角色,并展示牌堆顶的一张牌,若此牌为红色,该角色受到一点火焰伤害',
|
||||||
tiangong_info:'锁定技,你防止即将受到的雷电伤害,每当你造成一次雷电伤害,你摸一张牌',
|
tiangong_info:'锁定技,你防止即将受到的雷电伤害,每当你造成一次雷电伤害,你摸一张牌',
|
||||||
|
|
|
@ -833,7 +833,7 @@ character.gujian={
|
||||||
if(trigger.name=='die') num=2;
|
if(trigger.name=='die') num=2;
|
||||||
player.storage.zhaolu-=num;
|
player.storage.zhaolu-=num;
|
||||||
if(player.storage.zhaolu<=0){
|
if(player.storage.zhaolu<=0){
|
||||||
player.loseMaxHp();
|
player.loseMaxHp(true);
|
||||||
player.storage.zhaolu=Math.min(5,game.players.length);
|
player.storage.zhaolu=Math.min(5,game.players.length);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -65,9 +65,7 @@ character.mountain={
|
||||||
player.recover();
|
player.recover();
|
||||||
}
|
}
|
||||||
"step 2"
|
"step 2"
|
||||||
if(lib.config.mode!='guozhan'||player.maxHp>=4){
|
|
||||||
player.loseMaxHp();
|
player.loseMaxHp();
|
||||||
}
|
|
||||||
player.storage.zhiji=true;
|
player.storage.zhiji=true;
|
||||||
if(player.hp>player.maxHp) player.hp=player.maxHp;
|
if(player.hp>player.maxHp) player.hp=player.maxHp;
|
||||||
player.update();
|
player.update();
|
||||||
|
@ -472,9 +470,7 @@ character.mountain={
|
||||||
if(player.storage.tuntian) return player.storage.tuntian.length>=3&&!player.storage.zaoxian;
|
if(player.storage.tuntian) return player.storage.tuntian.length>=3&&!player.storage.zaoxian;
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
if(lib.config.mode!='guozhan'||player.maxHp>=4){
|
|
||||||
player.loseMaxHp();
|
player.loseMaxHp();
|
||||||
}
|
|
||||||
player.addSkill('jixi');
|
player.addSkill('jixi');
|
||||||
player.storage.zaoxian=true;
|
player.storage.zaoxian=true;
|
||||||
}
|
}
|
||||||
|
@ -553,9 +549,7 @@ character.mountain={
|
||||||
priority:3,
|
priority:3,
|
||||||
group:'hunzi2',
|
group:'hunzi2',
|
||||||
content:function(){
|
content:function(){
|
||||||
if(lib.config.mode!='guozhan'||player.maxHp>=4){
|
|
||||||
player.loseMaxHp();
|
player.loseMaxHp();
|
||||||
}
|
|
||||||
if(player.hp>player.maxHp) player.loseHp();
|
if(player.hp>player.maxHp) player.loseHp();
|
||||||
player.addSkill('reyingzi');
|
player.addSkill('reyingzi');
|
||||||
delete player.tempSkills.yinghun;
|
delete player.tempSkills.yinghun;
|
||||||
|
@ -793,36 +787,6 @@ character.mountain={
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// fushen:{
|
|
||||||
// trigger:{player:'phaseBefore'},
|
|
||||||
// content:function(){
|
|
||||||
// "step 0"
|
|
||||||
// if(player.storage.fushen&&player.storage.fushen.classList.contains('dead')==false){
|
|
||||||
// if(player==game.me) game.swapPlayer(player.storage.fushen);
|
|
||||||
// else if(player.storage.fushen==game.me) game.swapPlayer(player);
|
|
||||||
// delete player.storage.fushen;
|
|
||||||
// event.finish();
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// player.chooseTarget(function(card,player,target){
|
|
||||||
// if(player==target) return false;
|
|
||||||
// return true;
|
|
||||||
// }).ai=function(){
|
|
||||||
// return -1;//1+Math.random();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// "step 1"
|
|
||||||
// if(result.bool){
|
|
||||||
// player.storage.fushen=result.targets[0];
|
|
||||||
// if(player==game.me){
|
|
||||||
// game.swapPlayer(result.targets[0]);
|
|
||||||
// }
|
|
||||||
// else if(result.targets[0]==game.me){
|
|
||||||
// game.swapPlayer(player);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
huashen:{
|
huashen:{
|
||||||
unique:true,
|
unique:true,
|
||||||
forbid:['guozhan'],
|
forbid:['guozhan'],
|
||||||
|
|
|
@ -240,9 +240,7 @@ character.refresh={
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
if(lib.config.mode!='guozhan'||player.maxHp>=4){
|
|
||||||
player.loseMaxHp();
|
player.loseMaxHp();
|
||||||
}
|
|
||||||
player.addSkill('gongxin');
|
player.addSkill('gongxin');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -938,10 +936,8 @@ character.refresh={
|
||||||
content:function(){
|
content:function(){
|
||||||
player.removeSkill('qianxin');
|
player.removeSkill('qianxin');
|
||||||
player.addSkill('jianyan');
|
player.addSkill('jianyan');
|
||||||
if(lib.config.mode!='guozhan'||player.maxHp>=4){
|
|
||||||
player.loseMaxHp();
|
player.loseMaxHp();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
jianyan:{
|
jianyan:{
|
||||||
enable:'phaseUse',
|
enable:'phaseUse',
|
||||||
|
|
|
@ -896,11 +896,7 @@ character.yijiang={
|
||||||
player.recover();
|
player.recover();
|
||||||
}
|
}
|
||||||
"step 2"
|
"step 2"
|
||||||
if(lib.config.mode!='guozhan'||player.maxHp>=4){
|
|
||||||
player.loseMaxHp();
|
player.loseMaxHp();
|
||||||
}
|
|
||||||
if(player.hp>player.maxHp) player.hp=player.maxHp;
|
|
||||||
player.update();
|
|
||||||
player.addSkill('paiyi');
|
player.addSkill('paiyi');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
128
game/game.js
128
game/game.js
|
@ -1651,16 +1651,26 @@ window.play={};
|
||||||
player.dying(event);
|
player.dying(event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
doubleDraw:function(){
|
||||||
|
"step 0"
|
||||||
|
player.chooseBool('你的武将牌上有单独的阴阳鱼,是否摸一张牌?');
|
||||||
|
"step 1"
|
||||||
|
if(result.bool){
|
||||||
|
player.draw();
|
||||||
|
}
|
||||||
|
},
|
||||||
loseMaxHp:function(){
|
loseMaxHp:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var forced=false;
|
|
||||||
for(var i=0;i<arguments.length;i++){
|
|
||||||
if(arguments[i]===true) forced=true;
|
|
||||||
}
|
|
||||||
game.log(get.translation(player)+'失去了'+get.cnNumber(num)+'点体力上限');
|
game.log(get.translation(player)+'失去了'+get.cnNumber(num)+'点体力上限');
|
||||||
if(player.totalHp){
|
if(!event.forced&&typeof player.singleHp==='boolean'){
|
||||||
player.totalHp-=num;
|
if(player.singleHp){
|
||||||
player.maxHp=Math.floor(player.totalHp/2);
|
player.singleHp=false;
|
||||||
|
player.maxHp-=num-1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
player.singleHp=true;
|
||||||
|
player.maxHp-=num;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
player.maxHp-=num;
|
player.maxHp-=num;
|
||||||
|
@ -1670,17 +1680,33 @@ window.play={};
|
||||||
if(player.maxHp<=0){
|
if(player.maxHp<=0){
|
||||||
player.die();
|
player.die();
|
||||||
}
|
}
|
||||||
|
"step 2"
|
||||||
|
if(!event.forced&&player.singleHp===true&&
|
||||||
|
!player.classList.contains('unseen')&&!player.classList.contains('unseen2')){
|
||||||
|
player.doubleDraw();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
gainMaxHp:function(){
|
gainMaxHp:function(){
|
||||||
|
"step 0"
|
||||||
game.log(get.translation(player)+'获得了'+get.cnNumber(num)+'点体力上限');
|
game.log(get.translation(player)+'获得了'+get.cnNumber(num)+'点体力上限');
|
||||||
if(player.totalHp){
|
if(typeof player.singleHp==='boolean'){
|
||||||
player.totalHp+=num;
|
if(player.singleHp){
|
||||||
player.maxHp=Math.floor(player.totalHp/2);
|
player.singleHp=false;
|
||||||
|
player.maxHp+=num;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
player.singleHp=true;
|
||||||
|
player.maxHp+=num-1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
player.maxHp+=num;
|
player.maxHp+=num;
|
||||||
}
|
}
|
||||||
player.update();
|
player.update();
|
||||||
|
"step 1"
|
||||||
|
if(player.singleHp===true&&!player.classList.contains('unseen')&&!player.classList.contains('unseen2')){
|
||||||
|
player.doubleDraw();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
changeHp:function(){
|
changeHp:function(){
|
||||||
player.hp+=num;
|
player.hp+=num;
|
||||||
|
@ -1929,13 +1955,19 @@ window.play={};
|
||||||
|
|
||||||
this.node.avatar2.show();
|
this.node.avatar2.show();
|
||||||
this.name2=character2;
|
this.name2=character2;
|
||||||
if(get.config('double_hp2')){
|
var hp1=info[2],hp2=info2[2];
|
||||||
this.hp=get.config('double_hp2')(info[2],info2[2])
|
switch(get.config('double_hp')){
|
||||||
|
case 'pingjun':{
|
||||||
|
this.maxHp=Math.floor((hp1+hp2)/2);
|
||||||
|
this.singleHp=((hp1+hp2)%2===1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else{
|
case 'zuidazhi':this.maxHp=Math.max(hp1,hp2);break;
|
||||||
this.hp=info[2]+info2[2]-3;
|
case 'zuixiaozhi':this.maxHp=Math.min(hp1,hp2);break;
|
||||||
|
case 'zonghe':this.maxHp=hp1+hp2;break;
|
||||||
|
default:this.maxHp=hp1+hp2-3;
|
||||||
}
|
}
|
||||||
this.maxHp=this.hp;
|
this.hp=this.maxHp;
|
||||||
this.node.count.classList.add('p2');
|
this.node.count.classList.add('p2');
|
||||||
skills=skills.concat(info2[3]);
|
skills=skills.concat(info2[3]);
|
||||||
}
|
}
|
||||||
|
@ -3133,6 +3165,12 @@ window.play={};
|
||||||
if(next.num<=0) _status.event.next.remove(next);
|
if(next.num<=0) _status.event.next.remove(next);
|
||||||
next.content=lib.element.playerproto.recover;
|
next.content=lib.element.playerproto.recover;
|
||||||
},
|
},
|
||||||
|
doubleDraw:function(){
|
||||||
|
var next=game.createEvent('doubleDraw');
|
||||||
|
next.player=this;
|
||||||
|
next.content=lib.element.playerproto.doubleDraw;
|
||||||
|
return next;
|
||||||
|
},
|
||||||
loseHp:function(num){
|
loseHp:function(num){
|
||||||
var next=game.createEvent('loseHp');
|
var next=game.createEvent('loseHp');
|
||||||
next.num=num;
|
next.num=num;
|
||||||
|
@ -3140,11 +3178,18 @@ window.play={};
|
||||||
if(next.num==undefined) next.num=1;
|
if(next.num==undefined) next.num=1;
|
||||||
next.content=lib.element.playerproto.loseHp;
|
next.content=lib.element.playerproto.loseHp;
|
||||||
},
|
},
|
||||||
loseMaxHp:function(num){
|
loseMaxHp:function(){
|
||||||
var next=game.createEvent('loseMaxHp');
|
var next=game.createEvent('loseMaxHp');
|
||||||
next.num=num;
|
|
||||||
next.player=this;
|
next.player=this;
|
||||||
if(next.num==undefined) next.num=1;
|
next.num=1;
|
||||||
|
for(var i=0;i<arguments.length;i++){
|
||||||
|
if(typeof arguments[i]==='number'){
|
||||||
|
next.num=arguments[i];
|
||||||
|
}
|
||||||
|
else if(typeof arguments[i]==='boolean'){
|
||||||
|
next.forced=arguments[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
next.content=lib.element.playerproto.loseMaxHp;
|
next.content=lib.element.playerproto.loseMaxHp;
|
||||||
},
|
},
|
||||||
gainMaxHp:function(num){
|
gainMaxHp:function(num){
|
||||||
|
@ -4329,7 +4374,14 @@ window.play={};
|
||||||
},
|
},
|
||||||
open:function(){
|
open:function(){
|
||||||
for(var i=0;i<ui.dialogs.length;i++){
|
for(var i=0;i<ui.dialogs.length;i++){
|
||||||
if(ui.dialogs[i]==this) continue;
|
if(ui.dialogs[i]==this){
|
||||||
|
this.show();
|
||||||
|
this.refocus();
|
||||||
|
ui.dialogs.remove(this);
|
||||||
|
ui.dialogs.unshift(this);
|
||||||
|
ui.update();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
if(ui.dialogs[i].static) ui.dialogs[i].unfocus();
|
if(ui.dialogs[i].static) ui.dialogs[i].unfocus();
|
||||||
else ui.dialogs[i].hide();
|
else ui.dialogs[i].hide();
|
||||||
}
|
}
|
||||||
|
@ -5564,6 +5616,9 @@ window.play={};
|
||||||
var end=player;
|
var end=player;
|
||||||
do{
|
do{
|
||||||
player.draw(num,false).log=false;
|
player.draw(num,false).log=false;
|
||||||
|
if(player.singleHp===true&&!player.classList.contains('unseen')&&!player.classList.contains('unseen2')){
|
||||||
|
player.doubleDraw();
|
||||||
|
}
|
||||||
player=player.next;
|
player=player.next;
|
||||||
}
|
}
|
||||||
while(player!=end);
|
while(player!=end);
|
||||||
|
@ -9269,40 +9324,6 @@ window.play={};
|
||||||
}
|
}
|
||||||
return func;
|
return func;
|
||||||
},
|
},
|
||||||
doubleHp:function(hp){
|
|
||||||
var func;
|
|
||||||
if(hp=='pingjun'){
|
|
||||||
func=function(hp1,hp2){
|
|
||||||
return Math.floor((hp1+hp2)/2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(hp=='hejiansan'){
|
|
||||||
func=function(hp1,hp2){
|
|
||||||
return hp1+hp2-3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(hp=='zuidazhi'){
|
|
||||||
func=function(hp1,hp2){
|
|
||||||
return Math.max(hp1,hp2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(hp=='zuixiaozhi'){
|
|
||||||
func=function(hp1,hp2){
|
|
||||||
return Math.min(hp1,hp2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(hp=='zonghe'){
|
|
||||||
func=function(hp1,hp2){
|
|
||||||
return hp1+hp2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(hp=='xiangcheng'){
|
|
||||||
func=function(hp1,hp2){
|
|
||||||
return hp1*hp2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return func;
|
|
||||||
},
|
|
||||||
difficulty:function(){
|
difficulty:function(){
|
||||||
switch(get.config('difficulty')){
|
switch(get.config('difficulty')){
|
||||||
case 'easy':return 1;
|
case 'easy':return 1;
|
||||||
|
@ -10647,7 +10668,6 @@ window.play={};
|
||||||
delete window.cheat;
|
delete window.cheat;
|
||||||
}
|
}
|
||||||
lib.config.sort_card=get.sortCard(lib.config.sort);
|
lib.config.sort_card=get.sortCard(lib.config.sort);
|
||||||
lib.config.mode_config[lib.config.mode].double_hp2=get.doubleHp(get.config('double_hp'));
|
|
||||||
delete window.config;
|
delete window.config;
|
||||||
delete window.mode;
|
delete window.mode;
|
||||||
delete window.card;
|
delete window.card;
|
||||||
|
|
|
@ -434,17 +434,8 @@ mode.guozhan={
|
||||||
this.addSkill(skills[i]);
|
this.addSkill(skills[i]);
|
||||||
}
|
}
|
||||||
if(!this.classList.contains('unseen')&&!this.classList.contains('unseen2')){
|
if(!this.classList.contains('unseen')&&!this.classList.contains('unseen2')){
|
||||||
if((lib.character[this.name][2]+lib.character[this.name2][2])%2==1){
|
if(this.singleHp){
|
||||||
var next=game.createEvent('guozhanDraw');
|
this.doubleDraw();
|
||||||
next.player=this;
|
|
||||||
next.content=function(){
|
|
||||||
"step 0"
|
|
||||||
player.chooseBool('你的武将有单独的阴阳鱼,是否摸一张牌?');
|
|
||||||
"step 1"
|
|
||||||
if(result.bool){
|
|
||||||
player.draw();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(this.perfectPair()){
|
if(this.perfectPair()){
|
||||||
var next=game.createEvent('guozhanDraw');
|
var next=game.createEvent('guozhanDraw');
|
||||||
|
|
Loading…
Reference in New Issue