This commit is contained in:
parent
47b4de9d34
commit
df98eb1deb
186
game/game.js
186
game/game.js
|
@ -2974,8 +2974,6 @@
|
|||
}
|
||||
}
|
||||
ui.css.layout=lib.init.css('layout/'+layout,'layout');
|
||||
// if(lib.config.fold_card) ui.css.fold=lib.init.css('layout/default','fold');
|
||||
// if(lib.config.threed_card) ui.css.threed=lib.init.css('layout/default','fold2');
|
||||
if(lib.config.blur_ui) ui.css.blur_ui=lib.init.css('layout/default','blur');
|
||||
ui.css.theme=lib.init.css('theme/'+lib.config.theme,'style');
|
||||
ui.css.card_style=lib.init.css('theme/style/card',lib.config.card_style);
|
||||
|
@ -10007,67 +10005,6 @@
|
|||
zipReady();
|
||||
}
|
||||
},
|
||||
checkForUpdate:function(forcecheck){
|
||||
if(_status.checkingForUpdate){
|
||||
alert('正在检查...');
|
||||
}
|
||||
else{
|
||||
_status.checkingForUpdate=true;
|
||||
var createLayer=function(){
|
||||
var layer=document.createElement('div');
|
||||
layer.classList.add('poplayer');
|
||||
layer.style.zIndex='100';
|
||||
layer.listen(function(){
|
||||
this.remove();
|
||||
});
|
||||
layer.style.background='rgba(0,0,0,0.5)';
|
||||
|
||||
var iframe=document.createElement('iframe');
|
||||
iframe.src='http://pan.baidu.com/s/1jG5oK8e';
|
||||
iframe.width=Math.round(ui.window.offsetWidth*0.8)+'px';
|
||||
iframe.height=Math.round(ui.window.offsetHeight*0.9)+'px';
|
||||
iframe.style.left=Math.round(ui.window.offsetWidth*0.1)+'px';
|
||||
iframe.style.top=Math.round(ui.window.offsetHeight*0.05)+'px';
|
||||
iframe.style.position='absolute';
|
||||
layer.appendChild(iframe);
|
||||
|
||||
ui.window.appendChild(layer);
|
||||
};
|
||||
var script=lib.init.js(lib.updateURL,'game/update',function(){
|
||||
_status.checkingForUpdate=false;
|
||||
script.remove();
|
||||
var update=window.noname_update;
|
||||
delete window.noname_update;
|
||||
if(forcecheck===false&&update.version==lib.config.check_version){
|
||||
return;
|
||||
}
|
||||
game.saveConfig('check_version',update.version);
|
||||
if(update.version!=lib.version){
|
||||
var str='有新版本'+update.version+'可用,是否下载?';
|
||||
if(navigator.notification&&navigator.notification.confirm){
|
||||
navigator.notification.confirm(
|
||||
update.content,
|
||||
function(index){
|
||||
if(index==1){
|
||||
createLayer();
|
||||
}
|
||||
},
|
||||
str,
|
||||
['确定','取消']
|
||||
);
|
||||
}
|
||||
else{
|
||||
if(confirm(str)){
|
||||
createLayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert('当前版本已是最新');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
playVideo:function(time,mode){
|
||||
if(!_status.replayvideo){
|
||||
localStorage.setItem(lib.configprefix+'playbackmode',lib.config.mode);
|
||||
|
@ -17321,14 +17258,126 @@
|
|||
|
||||
var button1,button2;
|
||||
|
||||
game.checkForAssetUpdate=function(forcecheck){
|
||||
if(_status.checkingForAssetUpdate){
|
||||
game.checkForUpdate=function(forcecheck){
|
||||
if(button1.disabled){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
button1.innerHTML='正在检查更新';
|
||||
button1.disabled=true;
|
||||
|
||||
var goupdate=function(){
|
||||
if(game.download){
|
||||
var script=lib.init.js(lib.updateURL,'game/source',function(){
|
||||
script.remove();
|
||||
var updates=window.noname_source_list;
|
||||
delete window.noname_source_list;
|
||||
|
||||
if(!ui.arena.classList.contains('menupaused')){
|
||||
ui.click.configMenu();
|
||||
ui.click.menuTab('帮助');
|
||||
}
|
||||
var p=button1.parentNode;
|
||||
button1.remove();
|
||||
var span=document.createElement('span');
|
||||
var n1=0;
|
||||
var n2=updates.length;
|
||||
var n=n2;
|
||||
span.innerHTML='正在下载文件('+n1+'/'+n2+')';
|
||||
p.appendChild(span);
|
||||
var finish=function(){
|
||||
span.innerHTML='游戏更新完毕('+n1+'/'+n2+')';
|
||||
p.appendChild(document.createElement('br'));
|
||||
var button=document.createElement('button');
|
||||
button.innerHTML='重新启动';
|
||||
button.onclick=game.reload;
|
||||
p.appendChild(button);
|
||||
}
|
||||
for(var i=0;i<updates.length;i++){
|
||||
game.download(updates[i],updates[i],function(){
|
||||
n--;
|
||||
n1++;
|
||||
span.innerHTML='正在下载文件('+n1+'/'+n2+')';
|
||||
if(n==0){
|
||||
setTimeout(finish,500);
|
||||
}
|
||||
},function(e){
|
||||
n--;
|
||||
game.print('下载失败:'+e.source);
|
||||
span.innerHTML='正在下载文件('+n1+'/'+n2+')';
|
||||
if(n==0){
|
||||
setTimeout(finish,500);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
var layer=document.createElement('div');
|
||||
layer.classList.add('poplayer');
|
||||
layer.style.zIndex='100';
|
||||
layer.listen(function(){
|
||||
this.remove();
|
||||
});
|
||||
layer.style.background='rgba(0,0,0,0.5)';
|
||||
|
||||
var iframe=document.createElement('iframe');
|
||||
iframe.src='http://pan.baidu.com/s/1jG5oK8e';
|
||||
iframe.width=Math.round(ui.window.offsetWidth*0.8)+'px';
|
||||
iframe.height=Math.round(ui.window.offsetHeight*0.9)+'px';
|
||||
iframe.style.left=Math.round(ui.window.offsetWidth*0.1)+'px';
|
||||
iframe.style.top=Math.round(ui.window.offsetHeight*0.05)+'px';
|
||||
iframe.style.position='absolute';
|
||||
layer.appendChild(iframe);
|
||||
|
||||
ui.window.appendChild(layer);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var script=lib.init.js(lib.updateURL,'game/update',function(){
|
||||
button1.disabled=false;
|
||||
button1.innerHTML='检查游戏更新';
|
||||
script.remove();
|
||||
var update=window.noname_update;
|
||||
delete window.noname_update;
|
||||
if(forcecheck===false&&update.version==lib.config.check_version){
|
||||
return;
|
||||
}
|
||||
game.saveConfig('check_version',update.version);
|
||||
if(update.version!=lib.version){
|
||||
var str='有新版本'+update.version+'可用,是否下载?';
|
||||
if(navigator.notification&&navigator.notification.confirm){
|
||||
navigator.notification.confirm(
|
||||
update.content,
|
||||
function(index){
|
||||
if(index==1){
|
||||
goupdate();
|
||||
}
|
||||
},
|
||||
str,
|
||||
['确定','取消']
|
||||
);
|
||||
}
|
||||
else{
|
||||
if(confirm(str)){
|
||||
goupdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert('当前版本已是最新');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var checkForAssetUpdate=function(forcecheck){
|
||||
if(button2.disabled){
|
||||
return;
|
||||
}
|
||||
else if(game.download){
|
||||
button2.innerHTML='正在检查更新';
|
||||
button2.disabled=true;
|
||||
_status.checkingForAssetUpdate=true;
|
||||
var script=lib.init.js(lib.updateURL,'game/asset',function(){
|
||||
script.remove();
|
||||
var updates=window.noname_asset_list;
|
||||
|
@ -17339,14 +17388,12 @@
|
|||
var proceed=function(){
|
||||
if(updates.length==0){
|
||||
if(forcecheck!==false) alert('素材已是最新');
|
||||
_status.checkingForAssetUpdate=false;
|
||||
button2.disabled=false;
|
||||
button2.innerHTML='检查素材更新';
|
||||
return;
|
||||
}
|
||||
if(forcecheck===false){
|
||||
if(!confirm('有新的素材可用,是否下载?')){
|
||||
_status.checkingForAssetUpdate=false;
|
||||
button2.disabled=false;
|
||||
button2.innerHTML='检查素材更新';
|
||||
return;
|
||||
|
@ -17365,7 +17412,6 @@
|
|||
span.innerHTML='正在下载素材('+n1+'/'+n2+')';
|
||||
p.appendChild(span);
|
||||
var finish=function(){
|
||||
_status.checkingForAssetUpdate=false;
|
||||
span.innerHTML='素材更新完毕('+n1+'/'+n2+')';
|
||||
p.appendChild(document.createElement('br'));
|
||||
var button=document.createElement('button');
|
||||
|
@ -17420,7 +17466,7 @@
|
|||
li1.lastChild.appendChild(button1);
|
||||
button2=document.createElement('button');
|
||||
button2.innerHTML='检查素材更新';
|
||||
button2.onclick=game.checkForAssetUpdate;
|
||||
button2.onclick=checkForAssetUpdate;
|
||||
li2.lastChild.appendChild(button2);
|
||||
|
||||
ul.appendChild(li1);
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
window.noname_source_list=[
|
||||
'card/compensate.js',
|
||||
'card/ex.js',
|
||||
'card/extra.js',
|
||||
'card/guozhan.js',
|
||||
'card/hearth.js',
|
||||
'card/mingzhong.js',
|
||||
'card/refresh.js',
|
||||
'card/shenqi.js',
|
||||
'card/standard.js',
|
||||
'card/swd.js',
|
||||
'card/yunchou.js',
|
||||
'card/zhenfa.js',
|
||||
'character/boss.js',
|
||||
'character/diy.js',
|
||||
'character/extra.js',
|
||||
'character/gujian.js',
|
||||
'character/guozhan.js',
|
||||
'character/hearth.js',
|
||||
'character/jiange.js',
|
||||
'character/rank.js',
|
||||
'character/refresh.js',
|
||||
'character/shenhua.js',
|
||||
'character/sp.js',
|
||||
'character/standard.js',
|
||||
'character/swd.js',
|
||||
'character/xiake.js',
|
||||
'character/xianjian.js',
|
||||
'character/yijiang.js',
|
||||
'character/yxs.js',
|
||||
'character/zhuogui.js',
|
||||
'game/asset.js',
|
||||
'game/background.js',
|
||||
'game/config.js',
|
||||
'game/game.js',
|
||||
'game/jszip.js',
|
||||
'game/package.js',
|
||||
'game/source.js',
|
||||
'game/update.js',
|
||||
'layout/default/blur.css',
|
||||
'layout/default/filter.css',
|
||||
'layout/default/layout.css',
|
||||
'layout/default/menu.css',
|
||||
'layout/mobile/equip.css',
|
||||
'layout/mobile/layout.css',
|
||||
'layout/mode/boss.css',
|
||||
'layout/mode/chess.css',
|
||||
'layout/mode/stone.css',
|
||||
'layout/newlayout/equip.css',
|
||||
'layout/newlayout/global.css',
|
||||
'layout/newlayout/layout.css',
|
||||
'layout/phone/layout.css',
|
||||
'mode/boss.js',
|
||||
'mode/chess.js',
|
||||
'mode/guozhan.js',
|
||||
'mode/identity.js',
|
||||
'mode/stone.js',
|
||||
'mode/versus.js',
|
||||
'play/character.js',
|
||||
'play/coin.js',
|
||||
'play/soldier.js',
|
||||
'play/weather.js',
|
||||
'play/wuxing.js',
|
||||
'theme/music/grid.png',
|
||||
'theme/music/style.css',
|
||||
'theme/music/wood.png',
|
||||
'theme/music/wood3.png',
|
||||
'theme/simple/card.png',
|
||||
'theme/simple/grid.png',
|
||||
'theme/simple/style.css',
|
||||
'theme/simple/unknown.png',
|
||||
'theme/simple/wood.png',
|
||||
'theme/simple/wood3.png',
|
||||
'theme/woodden/grid.png',
|
||||
'theme/woodden/style.css',
|
||||
'theme/woodden/wood.jpg',
|
||||
'theme/woodden/wood.png',
|
||||
'theme/woodden/wood2.jpg',
|
||||
'theme/woodden/wood2.png',
|
||||
'theme/style/card/default.css',
|
||||
'theme/style/card/music.css',
|
||||
'theme/style/card/simple.css',
|
||||
'theme/style/card/wood.css',
|
||||
'theme/style/cardback/default.css',
|
||||
'theme/style/cardback/music.css',
|
||||
'theme/style/cardback/official.css',
|
||||
'theme/style/cardback/wood.css',
|
||||
'theme/style/cardback/image/official.png',
|
||||
'theme/style/cardback/image/official2.png',
|
||||
'theme/style/hp/default.css',
|
||||
'theme/style/hp/official.css',
|
||||
'theme/style/hp/image/hp1.png',
|
||||
'theme/style/hp/image/hp2.png',
|
||||
'theme/style/hp/image/hp3.png',
|
||||
'theme/style/hp/image/hp4.png',
|
||||
'index.html'
|
||||
];
|
|
@ -1,4 +1,9 @@
|
|||
window.noname_update={
|
||||
version:'1.8.1',
|
||||
content:'检查更新功能;游戏内下载素材;bug修复;Mac/iOS优化'
|
||||
content:[
|
||||
'检查更新功能',
|
||||
'游戏内下载素材',
|
||||
'bug修复',
|
||||
'Mac/iOS优化'
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#arena:not(.low_performance) #me>div>.fold1>.card:not(.selected){margin-right: -15px;}
|
||||
#arena:not(.low_performance) #me>div>.fold2>.card:not(.selected){margin-right: -30px;}
|
||||
#arena:not(.low_performance) #me>div>.fold3>.card:not(.selected){margin-right: -45px;}
|
||||
|
||||
#arena:not(.low_performance) #me>div>.fold1>.card:not(.selected):hover,
|
||||
#arena:not(.low_performance) #me>div>.fold2>.card:not(.selected):hover,
|
||||
#arena:not(.low_performance) #me>div>.fold3>.card:not(.selected):hover{margin-right: 0;}
|
||||
|
||||
#arena:not(.low_performance) #me>div>div>.card:last-child{margin-right: 0 !important;}
|
||||
#arena:not(.low_performance) #me>div>div>.card.last{margin-right: 0 !important;}
|
||||
#arena:not(.low_performance) #me>div>div>.card.removing{margin-right: -52px !important;}
|
|
@ -1,15 +0,0 @@
|
|||
#me>div>.fold1>.card:not(.selected){margin-right: -30px;transform:perspective(1000px) rotateY(30deg);}
|
||||
#me>div>.fold2>.card:not(.selected){margin-right: -38px;transform:perspective(1000px) rotateY(38deg);}
|
||||
#me>div>.fold3>.card:not(.selected){margin-right: -45px;transform:perspective(1000px) rotateY(45deg);}
|
||||
|
||||
#me>div>.fold1>.card:not(.selected):hover,
|
||||
#me>div>.fold2>.card:not(.selected):hover,
|
||||
#me>div>.fold3>.card:not(.selected):hover{margin-right: -8px;transform:perspective(1000px) rotateY(0);}
|
||||
|
||||
#me>div>.fold1>.card.start,
|
||||
#me>div>.fold2>.card.start,
|
||||
#me>div>.fold3>.card.start{transform:none;}
|
||||
|
||||
#me>div>div>.card:last-child{margin-right: -8px;}
|
||||
#me>div>div>.card.last{margin-right: -8px;}
|
||||
#me>div>div>.card.removing{margin-right: -52px !important;}
|
|
@ -1,50 +0,0 @@
|
|||
::-webkit-scrollbar {
|
||||
display: block;
|
||||
height:8px;
|
||||
width:8px
|
||||
}
|
||||
|
||||
::-webkit-scrollbar:vertical {
|
||||
display: none;
|
||||
}
|
||||
::-webkit-scrollbar-button {
|
||||
height:0;
|
||||
width:0
|
||||
}
|
||||
::-webkit-scrollbar-button:start:decrement,::-webkit-scrollbar-button:end:increment {
|
||||
display:block
|
||||
}
|
||||
::-webkit-scrollbar-button:vertical:start:increment,::-webkit-scrollbar-button:vertical:end:decrement {
|
||||
display:none
|
||||
}
|
||||
::-webkit-scrollbar-track:vertical,::-webkit-scrollbar-track:horizontal,::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-thumb:horizontal,::-webkit-scrollbar-track:vertical,::-webkit-scrollbar-track:horizontal,::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-thumb:horizontal {
|
||||
border-style:solid;
|
||||
border-color:transparent
|
||||
}
|
||||
::-webkit-scrollbar-track:vertical::-webkit-scrollbar-track:horizontal{
|
||||
background-clip:padding-box;
|
||||
background-color:#fff;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-clip:padding-box;
|
||||
background-color:rgba(0,0,0,0.2);
|
||||
min-height:28px;
|
||||
padding-top:100;
|
||||
border-radius: 8px;
|
||||
-webkit-transition:all 0.5s;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color:rgba(0,0,0,.4);
|
||||
}
|
||||
::-webkit-scrollbar-thumb:active {
|
||||
background-color:rgba(0,0,0,.5)
|
||||
}
|
||||
::-webkit-scrollbar-track:vertical,::-webkit-scrollbar-track:horizontal,::-webkit-scrollbar-thumb:vertical,::-webkit-scrollbar-thumb:horizontal {
|
||||
border-width:0;
|
||||
}
|
||||
::-webkit-scrollbar-track:hover {
|
||||
background-color:rgba(0,0,0,0)
|
||||
}
|
||||
::-webkit-scrollbar-track:active {
|
||||
background-color:rgba(0,0,0,0)
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
#handcards1,#handcards2{
|
||||
white-space:normal;
|
||||
overflow-y: scroll;
|
||||
overflow-x:hidden;
|
||||
}
|
280
play/strategy.js
280
play/strategy.js
|
@ -1,280 +0,0 @@
|
|||
play.strategy={
|
||||
mode:['identity','guozhan','infinity'],
|
||||
game:{
|
||||
checkResult:function(){
|
||||
if(get.population('zhong')==0||(get.population('fan')+get.population('nei')==0)){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].spy=='zhong'){
|
||||
game.players[i].identity='zhong';
|
||||
game.players[i].setIdentity();
|
||||
game.players[i].draw(2);
|
||||
delete game.players[i].spy;
|
||||
delete game.players[i].storage._zhaoxiang
|
||||
}
|
||||
}
|
||||
}
|
||||
if(get.population('fan')==0||game.zhu.isDead()){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].spy=='fan'){
|
||||
game.players[i].identity='fan';
|
||||
game.players[i].setIdentity();
|
||||
game.players[i].draw(2);
|
||||
delete game.players[i].spy;
|
||||
delete game.players[i].storage._zhaoxiang
|
||||
}
|
||||
}
|
||||
}
|
||||
if(get.population('fan')+get.population('zhong')==0&&game.zhu.isAlive()){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].spy=='nei'){
|
||||
game.players[i].identity='nei';
|
||||
game.players[i].setIdentity();
|
||||
game.players[i].draw(2);
|
||||
delete game.players[i].spy;
|
||||
delete game.players[i].storage._zhaoxiang
|
||||
}
|
||||
}
|
||||
}
|
||||
if(game.zhu.isAlive()&&get.population('fan')+get.population('nei')>0) return;
|
||||
if(lib.storage.test){
|
||||
if(game.zhu.isAlive()){
|
||||
console.log('主忠胜利');
|
||||
}
|
||||
else if(game.players[0].identity=='nei'&&game.players.length==1){
|
||||
console.log('内奸胜利');
|
||||
}
|
||||
else{
|
||||
console.log('反贼胜利');
|
||||
}
|
||||
}
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
game.players[i].setIdentity(game.players[i].identity);
|
||||
}
|
||||
if(game.me.identity=='zhu'||game.me.identity=='zhong'){
|
||||
if(game.zhu.classList.contains('dead')){
|
||||
game.over(false);
|
||||
}
|
||||
else{
|
||||
game.over(true);
|
||||
}
|
||||
}
|
||||
else if(game.me.identity=='nei'){
|
||||
if(get.population('fan')+get.population('zhu')+get.population('zhong')==0){
|
||||
game.over(true);
|
||||
}
|
||||
else{
|
||||
game.over(false);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(get.population('fan')+get.population('zhong')>0&&game.zhu.classList.contains('dead')){
|
||||
game.over(true);
|
||||
}
|
||||
else{
|
||||
game.over(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
skill:{
|
||||
_zhaoxiang:{
|
||||
mode:['identity','infinity'],
|
||||
enable:'chooseToUse',
|
||||
filter:function(event,player){
|
||||
if(player.num('h')==0) return false;
|
||||
if(player.spy) return false;
|
||||
if(event.dying==player) return false;
|
||||
if(event.type!='dying') return false;
|
||||
if(event.dying.storage._zhaoxiang) return false;
|
||||
if(event.dying.storage.zhaoxiang2==player&&event.dying.skills.contains('zhaoxiang2')) return false;
|
||||
if(lib.config.mode=='infinity'){
|
||||
if(player==game.me){
|
||||
if(get.population('zhong')<Math.max(2,4-get.difficulty())&&event.dying.identity=='fan') return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(player.identity=='nei'||event.dying.identity=='zhu') return false;
|
||||
if(player.identityShown&&event.dying.identityShown){
|
||||
if(player.identity=='zhu'){
|
||||
if(event.dying.identity=='zhong') return false;
|
||||
}
|
||||
else if(player.identity==event.dying.identity) return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
filterCard:true,
|
||||
check:function(card){
|
||||
return ai.get.value(card);
|
||||
},
|
||||
discard:false,
|
||||
prepare:function(cards,player){
|
||||
player.$throw(cards);
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
game.log(get.translation(player)+'的出价为'+get.translation(cards));
|
||||
if(lib.config.mode=='identity'){
|
||||
event.parent.parent.dying.chooseControl('zhaoxiang_touxiang','zhaoxiang_zhaxiang','refuse',function(){
|
||||
if(Math.random()<ai.get.value(cards[0])/15) return 0;
|
||||
else if(Math.random()<0.4) return 1;
|
||||
return 2;
|
||||
});
|
||||
}
|
||||
else{
|
||||
event.parent.parent.dying.chooseControl('zhaoxiang_touxiang','refuse',function(){
|
||||
if(Math.random()<ai.get.value(cards[0])/15) return 0;
|
||||
return 1;
|
||||
});
|
||||
}
|
||||
"step 1"
|
||||
game.delay(2);
|
||||
"step 2"
|
||||
if(result.control=='zhaoxiang_touxiang'||result.control=='zhaoxiang_zhaxiang'){
|
||||
event.parent.parent.dying.popup('agree');
|
||||
game.log(get.translation(event.parent.parent.dying)+'投降');
|
||||
event.parent.parent.dying.storage._zhaoxiang=event.parent.parent.dying.identity;
|
||||
event.parent.parent.dying.gain(cards);
|
||||
event.parent.parent.dying.$gain2(cards);
|
||||
if(player.identity=='zhu'){
|
||||
event.parent.parent.dying.identity='zhong';
|
||||
}
|
||||
else{
|
||||
event.parent.parent.dying.identity=player.identity;
|
||||
}
|
||||
event.parent.parent.dying.setIdentity();
|
||||
event.parent.parent.dying.recover(1-event.parent.parent.dying.hp);
|
||||
if(event.parent.parent.dying.identity=='zhong'){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].identityShown&&game.players[i].identity=='fan') game.players[i].draw();
|
||||
}
|
||||
}
|
||||
else{
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].identityShown&&game.players[i].identity=='zhong'||
|
||||
game.players[i].identity=='zhu') game.players[i].draw();
|
||||
}
|
||||
}
|
||||
if(result.control=='zhaoxiang_zhaxiang'){
|
||||
event.parent.parent.dying.addSkill('strategy_zhaxiang');
|
||||
event.parent.parent.dying.spy=event.parent.parent.dying.storage._zhaoxiang;
|
||||
event.parent.parent.dying.ai.shown=0.1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.parent.parent.dying.popup('refuse');
|
||||
game.log(get.translation(event.parent.parent.dying)+'拒绝投降');
|
||||
event.parent.parent.dying.addSkill('zhaoxiang2');
|
||||
event.parent.parent.dying.storage.zhaoxiang2=player;
|
||||
event.parent.parent.dying.draw();
|
||||
player.$gain2(cards);
|
||||
player.gain(cards);
|
||||
}
|
||||
"step 3"
|
||||
game.checkResult();
|
||||
},
|
||||
intro:{
|
||||
content:function(storage){
|
||||
return '已被招降,原来身份为'+get.translation(storage+'2');
|
||||
},
|
||||
show:true
|
||||
},
|
||||
ai:{
|
||||
result:{
|
||||
player:function(){
|
||||
return Math.random()-0.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
zhaoxiang2:{
|
||||
trigger:{global:'phaseAfter'},
|
||||
forced:true,
|
||||
popup:false,
|
||||
content:function(){
|
||||
player.removeSkill('zhaoxiang2');
|
||||
delete player.storage.zhaoxiang2;
|
||||
}
|
||||
},
|
||||
_xianshen:{
|
||||
mode:['identity'],
|
||||
enable:'phaseUse',
|
||||
filter:function(event,player){
|
||||
return !player.identityShown;
|
||||
},
|
||||
content:function(){
|
||||
player.identityShown=true;
|
||||
player.setIdentity();
|
||||
if(player.identity=='nei') player.draw(3);
|
||||
else player.draw();
|
||||
},
|
||||
ai:{
|
||||
order:10,
|
||||
result:{
|
||||
player:function(player){
|
||||
if(player.ai.shown==0.95) return 1;
|
||||
if(player.ai.shown>=0.4&&player.num('h')<player.hp) return 1;
|
||||
return 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
_panbian:{
|
||||
mode:['identity'],
|
||||
enable:'phaseUse',
|
||||
filter:function(event,player){
|
||||
return typeof player.storage._zhaoxiang=='string'&&player.skills.contains('strategy_zhaxiang')==false;
|
||||
},
|
||||
filterCard:true,
|
||||
selectCard:2,
|
||||
check:function(card){
|
||||
return 6-ai.get.value(card);
|
||||
},
|
||||
content:function(){
|
||||
player.identity=player.storage._zhaoxiang;
|
||||
player.setIdentity();
|
||||
delete player.storage._zhaoxiang;
|
||||
},
|
||||
ai:{
|
||||
order:10,
|
||||
result:{
|
||||
player:function(player){
|
||||
if(player.identity=='zhong') return -ai.get.situation();
|
||||
return ai.get.situation();
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
strategy_zhaxiang:{
|
||||
trigger:{player:['useCardBefore','useSkillBefore']},
|
||||
forced:true,
|
||||
popup:false,
|
||||
filter:function(event,player){
|
||||
if(!player.spy) return false;
|
||||
if(event.targets&&event.targets.length==1&&event.targets[0]!=player){
|
||||
return Math.random()<1/3;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
trigger.untrigger();
|
||||
trigger.finish();
|
||||
player.discard(player.get('he'));
|
||||
player.identity=player.spy;
|
||||
player.setIdentity();
|
||||
delete player.spy;
|
||||
player.popup('strategy_zhaxiang');
|
||||
game.log(get.translation(player)+'暴露了真实身份');
|
||||
delete player.storage._zhaoxiang;
|
||||
}
|
||||
}
|
||||
},
|
||||
translate:{
|
||||
_zhaoxiang:'招降',
|
||||
_xianshen:'现身',
|
||||
_panbian:'叛变',
|
||||
zhaoxiang_touxiang:'投降',
|
||||
zhaoxiang_zhaxiang:'诈降',
|
||||
strategy_zhaxiang:'暴露',
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue