v1.9.96.8

This commit is contained in:
Spmario233 2020-01-01 22:39:16 +08:00 committed by GitHub
parent 2fee38e20b
commit d38b215941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 91 additions and 43 deletions

View File

@ -10047,6 +10047,9 @@
} }
player.ai.tempIgnore=[]; player.ai.tempIgnore=[];
player.stat.push({card:{},skill:{}}); player.stat.push({card:{},skill:{}});
game.countPlayer(function(current){
current.actionHistory.push({useCard:[],respond:[],skipped:[]});
});
if(ui.land&&ui.land.player==player){ if(ui.land&&ui.land.player==player){
game.addVideo('destroyLand'); game.addVideo('destroyLand');
ui.land.destroy(); ui.land.destroy();
@ -11028,13 +11031,14 @@
}, },
phaseDraw:function(){ phaseDraw:function(){
"step 0" "step 0"
event.trigger("phaseDrawBegin1");
"step 1"
event.trigger("phaseDrawBegin2");
"step 2"
if(game.modPhaseDraw){ if(game.modPhaseDraw){
game.modPhaseDraw(player,event.num); game.modPhaseDraw(player,event.num);
} }
else{ else{
if((get.config('first_less')||_status.connectMode||_status.first_less_forced)&&game.phaseNumber==1&&_status.first_less){
event.num--;
}
if(event.num>0){ if(event.num>0){
var num=event.num; var num=event.num;
if(event.attachDraw){ if(event.attachDraw){
@ -11049,7 +11053,7 @@
} }
} }
} }
"step 1" "step 3"
if(Array.isArray(result)){ if(Array.isArray(result)){
event.cards=result; event.cards=result;
} }
@ -13319,6 +13323,32 @@
event.directHit=[]; event.directHit=[];
event.customArgs={default:{}}; event.customArgs={default:{}};
event.baseDamage=get.info(card,false).baseDamage||1; event.baseDamage=get.info(card,false).baseDamage||1;
player.actionHistory[player.actionHistory.length-1].useCard.push(event);
if(event.addCount!=false){
if(player.stat[player.stat.length-1].card[card.name]==undefined){
player.stat[player.stat.length-1].card[card.name]=1;
}
else{
player.stat[player.stat.length-1].card[card.name]++;
}
if(event.skill){
if(player.stat[player.stat.length-1].skill[event.skill]==undefined){
player.stat[player.stat.length-1].skill[event.skill]=1;
}
else{
player.stat[player.stat.length-1].skill[event.skill]++;
}
var sourceSkill=get.info(event.skill).sourceSkill;
if(sourceSkill){
if(player.stat[player.stat.length-1].skill[sourceSkill]==undefined){
player.stat[player.stat.length-1].skill[sourceSkill]=1;
}
else{
player.stat[player.stat.length-1].skill[sourceSkill]++;
}
}
}
}
event.trigger('useCard1'); event.trigger('useCard1');
"step 1" "step 1"
event.trigger('useCard2'); event.trigger('useCard2');
@ -13365,31 +13395,6 @@
game.logv(player,[card,cards],targets); game.logv(player,[card,cards],targets);
} }
} }
if(event.addCount!=false){
if(player.stat[player.stat.length-1].card[card.name]==undefined){
player.stat[player.stat.length-1].card[card.name]=1;
}
else{
player.stat[player.stat.length-1].card[card.name]++;
}
if(event.skill){
if(player.stat[player.stat.length-1].skill[event.skill]==undefined){
player.stat[player.stat.length-1].skill[event.skill]=1;
}
else{
player.stat[player.stat.length-1].skill[event.skill]++;
}
var sourceSkill=get.info(event.skill).sourceSkill;
if(sourceSkill){
if(player.stat[player.stat.length-1].skill[sourceSkill]==undefined){
player.stat[player.stat.length-1].skill[sourceSkill]=1;
}
else{
player.stat[player.stat.length-1].skill[sourceSkill]++;
}
}
}
}
"step 3" "step 3"
event.sortTarget=function(animate){ event.sortTarget=function(animate){
var info=get.info(card,false); var info=get.info(card,false);
@ -13983,6 +13988,7 @@
else{ else{
game.log(player,'打出了',card); game.log(player,'打出了',card);
} }
player.actionHistory[player.actionHistory.length-1].respond.push(event);
var cards2=cards.slice(0); var cards2=cards.slice(0);
if(cards2.length){ if(cards2.length){
var next=player.lose(cards2,ui.ordering,'visible'); var next=player.lose(cards2,ui.ordering,'visible');
@ -16195,7 +16201,17 @@
} }
return null; return null;
}, },
countUsed:function(card){ countUsed:function(card,type){
if(type===true){
var num=0;
var history=this.getHistory('useCard');
for(var i=0;i<history.length;i++){
if(!card) num++;
else if(typeof card=='string'&&history[i].card&&card==history[i].card.name) num++;
else if(typeof card=='object'&&history[i].card&&card.name==history[i].card.name) num++;
}
return num;
}
var num; var num;
var stat=this.getStat('card'); var stat=this.getStat('card');
if(!card){ if(!card){
@ -16733,6 +16749,9 @@
var next=game.createEvent('phaseDraw'); var next=game.createEvent('phaseDraw');
next.player=this; next.player=this;
next.num=2; next.num=2;
if((get.config('first_less')||_status.connectMode||_status.first_less_forced)&&game.phaseNumber==1&&_status.first_less){
next.num--;
}
next.setContent('phaseDraw'); next.setContent('phaseDraw');
return next; return next;
}, },
@ -19774,6 +19793,23 @@
} }
} }
}, },
getHistory:function(key,filter){
if(!key) return this.actionHistory[this.actionHistory.length-1];
if(!filter) return this.actionHistory[this.actionHistory.length-1][key];
else{
var history=this.getHistory(key).slice(0);
for(var i=0;i<history.length;i++){
if(!filter(history[i])) history.splice(i--,1);
}
return history;
}
},
getLastUsed:function(num){
if(typeof num!='number') num=0;
var history=this.getHistory('useCard');
if(history.length<=num) return null;
return history[history.length-num-1];
},
getStat:function(key){ getStat:function(key){
if(!key) return this.stat[this.stat.length-1]; if(!key) return this.stat[this.stat.length-1];
return this.stat[this.stat.length-1][key]; return this.stat[this.stat.length-1][key];
@ -22444,10 +22480,12 @@
finish:function(){ finish:function(){
this.finished=true; this.finished=true;
}, },
cancel:function(){ cancel:function(arg1,arg2,notrigger){
this.untrigger.call(this,arguments); this.untrigger.call(this,arguments);
this.finish(); this.finish();
if(notrigger!='notrigger'){
this.trigger(this.name+'Cancelled'); this.trigger(this.name+'Cancelled');
if(this.player&&lib.phaseName.contains(this.name)) this.player.getHistory('skipped').add(this.name)}
}, },
goto:function(step){ goto:function(step){
this.step=step-1; this.step=step-1;
@ -22682,6 +22720,11 @@
notLink:function(){ notLink:function(){
return this.getParent().name!='_lianhuan'&&this.getParent().name!='_lianhuan2'; return this.getParent().name!='_lianhuan'&&this.getParent().name!='_lianhuan2';
}, },
isPhaseUsing:function(player){
var evt=this.getParent('phaseUse');
if(!evt||evt.name!='phaseUse') return false;
return !player||player==evt.player;
},
addTrigger:function(skill,player){ addTrigger:function(skill,player){
if(!player) return; if(!player) return;
var evt=this.getParent('arrangeTrigger'); var evt=this.getParent('arrangeTrigger');
@ -25326,6 +25369,7 @@
western:'thunder', western:'thunder',
key:'key', key:'key',
}, },
phaseName:['phaseZhunbei','phaseJudge','phaseDraw','phaseUse','phaseDiscard','phaseJieshu'],
}; };
var game={ var game={
cardsDiscard:function(cards){ cardsDiscard:function(cards){
@ -29503,6 +29547,7 @@
if(next.player&&next.player.skipList.contains(next.name)){ if(next.player&&next.player.skipList.contains(next.name)){
event.trigger(next.name+'Skipped'); event.trigger(next.name+'Skipped');
next.player.skipList.remove(next.name); next.player.skipList.remove(next.name);
if(lib.phaseName.contains(next.name)) next.player.getHistory('skipped').add(next.name);
} }
else{ else{
next.parent=event; next.parent=event;
@ -29530,6 +29575,7 @@
if(next.player&&next.player.skipList.contains(next.name)){ if(next.player&&next.player.skipList.contains(next.name)){
event.trigger(next.name+'Skipped'); event.trigger(next.name+'Skipped');
next.player.skipList.remove(next.name); next.player.skipList.remove(next.name);
if(lib.phaseName.contains(next.name)) next.player.getHistory('skipped').add(next.name)
} }
else{ else{
next.parent=event; next.parent=event;
@ -41626,6 +41672,7 @@
node.damagepopups=[]; node.damagepopups=[];
node.judging=[]; node.judging=[];
node.stat=[{card:{},skill:{}}]; node.stat=[{card:{},skill:{}}];
node.actionHistory=[{useCard:[],respond:[],skipped:[]}];
node.tempSkills={}; node.tempSkills={};
node.storage={}; node.storage={};
node.marks={}; node.marks={};

View File

@ -1,11 +1,12 @@
window.noname_update={ window.noname_update={
version:'1.9.96.7.2', version:'1.9.96.8',
update:'1.9.96.7.1', update:'1.9.96.7.2',
changeLog:[ changeLog:[
'getHistory功能',
'BUG修复', 'BUG修复',
], ],
files:[ files:[
'card/extra.js', //'card/extra.js',
//'card/huanlekapai.js', //'card/huanlekapai.js',
//'card/sp.js', //'card/sp.js',
//'card/standard.js', //'card/standard.js',
@ -13,31 +14,31 @@ window.noname_update={
//'card/guozhan.js', //'card/guozhan.js',
//'card/gwent.js', //'card/gwent.js',
//'character/diy.js', //'character/diy.js',
//'character/extra.js', 'character/extra.js',
//'character/hearth.js', //'character/hearth.js',
//'character/gujian.js', //'character/gujian.js',
//'character/gwent.js', //'character/gwent.js',
//'character/mobile.js', //'character/mobile.js',
//'character/mtg.js', //'character/mtg.js',
//'character/old.js', //'character/old.js',
//'character/refresh.js', 'character/refresh.js',
'character/shenhua.js', 'character/shenhua.js',
//'character/sp.js', 'character/sp.js',
//'character/tw.js', //'character/tw.js',
//'character/standard.js', 'character/standard.js',
//'character/swd.js', //'character/swd.js',
//'character/xianjian.js', //'character/xianjian.js',
//'character/xinghuoliaoyuan.js', 'character/xinghuoliaoyuan.js',
//'character/yijiang.js', 'character/yijiang.js',
//'character/yxs.js', //'character/yxs.js',
//'extension/boss/extension.js', //'extension/boss/extension.js',
//'layout/default/layout.css', //'layout/default/layout.css',
//'mode/identity.js', //'mode/identity.js',
//'mode/doudizhu.js', //'mode/doudizhu.js',
//'mode/guozhan.js', 'mode/guozhan.js',
//'mode/single.js', //'mode/single.js',
//'mode/stone.js', //'mode/stone.js',
'mode/versus.js', //'mode/versus.js',
//'mode/boss.js', //'mode/boss.js',
'game/game.js', 'game/game.js',
//'game/config.js', //'game/config.js',