audio
This commit is contained in:
parent
8e190a7382
commit
ed0f61b54b
|
@ -1557,6 +1557,11 @@ card.standard={
|
||||||
}
|
}
|
||||||
event.goto(3);
|
event.goto(3);
|
||||||
}
|
}
|
||||||
|
if(withme||withol){
|
||||||
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
game.players[i].showTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
event.withol=withol;
|
event.withol=withol;
|
||||||
if(list2.length){
|
if(list2.length){
|
||||||
event.aichoice=list2.randomGet();
|
event.aichoice=list2.randomGet();
|
||||||
|
@ -1594,6 +1599,9 @@ card.standard={
|
||||||
}
|
}
|
||||||
'step 4'
|
'step 4'
|
||||||
clearTimeout(event.wuxietimeout);
|
clearTimeout(event.wuxietimeout);
|
||||||
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
game.players[i].hideTimer();
|
||||||
|
}
|
||||||
if(event.wuxieresult2=='ai'){
|
if(event.wuxieresult2=='ai'){
|
||||||
event.wuxieresult.chooseToUse({
|
event.wuxieresult.chooseToUse({
|
||||||
filterCard:function(card,player){
|
filterCard:function(card,player){
|
||||||
|
|
93
game/game.js
93
game/game.js
|
@ -5175,7 +5175,9 @@
|
||||||
if(event.audio===false){
|
if(event.audio===false){
|
||||||
cardaudio=false;
|
cardaudio=false;
|
||||||
}
|
}
|
||||||
if(cardaudio&&lib.config.background_audio){
|
if(cardaudio){
|
||||||
|
var audiofunc=function(player,card){
|
||||||
|
if(lib.config.background_audio){
|
||||||
var sex=player.sex=='female'?'female':'male';
|
var sex=player.sex=='female'?'female':'male';
|
||||||
if(lib.card[card.name].audio||lib.config.background_ogg){
|
if(lib.card[card.name].audio||lib.config.background_ogg){
|
||||||
if(card.name=='sha'&&(card.nature=='fire'||card.nature=='thunder')){
|
if(card.name=='sha'&&(card.nature=='fire'||card.nature=='thunder')){
|
||||||
|
@ -5189,6 +5191,10 @@
|
||||||
game.playAudio('card/default');
|
game.playAudio('card/default');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
audiofunc(player,card);
|
||||||
|
game.broadcast(audiofunc,player,card);
|
||||||
|
}
|
||||||
if(event.animate!=false){
|
if(event.animate!=false){
|
||||||
if(card.name=='wuxie'&&event.getParent().target){
|
if(card.name=='wuxie'&&event.getParent().target){
|
||||||
var lining=event.getParent().target2||event.getParent().target;
|
var lining=event.getParent().target2||event.getParent().target;
|
||||||
|
@ -5535,6 +5541,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','draw');
|
game.playAudio('effect','draw');
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','draw');
|
||||||
|
}
|
||||||
|
});
|
||||||
if(event.drawDeck){
|
if(event.drawDeck){
|
||||||
if(event.drawDeck>num){
|
if(event.drawDeck>num){
|
||||||
event.drawDeck=num;
|
event.drawDeck=num;
|
||||||
|
@ -5572,6 +5583,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','discard');
|
game.playAudio('effect','discard');
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','discard');
|
||||||
|
}
|
||||||
|
});
|
||||||
game.log(player,'弃置了',cards);
|
game.log(player,'弃置了',cards);
|
||||||
player.lose(cards);
|
player.lose(cards);
|
||||||
if(event.animate!=false){
|
if(event.animate!=false){
|
||||||
|
@ -5627,6 +5643,7 @@
|
||||||
player.popup(card.name,'wood');
|
player.popup(card.name,'wood');
|
||||||
}
|
}
|
||||||
if(cardaudio&&event.getParent(3).name=='useCard'){
|
if(cardaudio&&event.getParent(3).name=='useCard'){
|
||||||
|
var audiofunc=function(player,card){
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
var sex=player.sex=='female'?'female':'male';
|
var sex=player.sex=='female'?'female':'male';
|
||||||
if(lib.card[card.name].audio||lib.config.background_ogg){
|
if(lib.card[card.name].audio||lib.config.background_ogg){
|
||||||
|
@ -5636,6 +5653,9 @@
|
||||||
game.playAudio('card/default');
|
game.playAudio('card/default');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
audiofunc(player,card);
|
||||||
|
game.broadcast(audiofunc,player,card);
|
||||||
}
|
}
|
||||||
if(cards.length&&(cards.length>1||cards[0].name!=card.name)){
|
if(cards.length&&(cards.length>1||cards[0].name!=card.name)){
|
||||||
game.log(player,'打出了',card,'(',cards,')');
|
game.log(player,'打出了',card,'(',cards,')');
|
||||||
|
@ -5867,6 +5887,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','damage'+(num>1?'2':''));
|
game.playAudio('effect','damage'+(num>1?'2':''));
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(num){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','damage'+(num>1?'2':''));
|
||||||
|
}
|
||||||
|
},num);
|
||||||
var str='受到了';
|
var str='受到了';
|
||||||
if(source) str+='来自<span class="bluetext">'+(source==player?'自己':get.translation(source))+'</span>的';
|
if(source) str+='来自<span class="bluetext">'+(source==player?'自己':get.translation(source))+'</span>的';
|
||||||
str+=get.cnNumber(num)+'点';
|
str+=get.cnNumber(num)+'点';
|
||||||
|
@ -5936,6 +5961,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','recover');
|
game.playAudio('effect','recover');
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','recover');
|
||||||
|
}
|
||||||
|
});
|
||||||
if(num>player.maxHp-player.hp) num=player.maxHp-player.hp;
|
if(num>player.maxHp-player.hp) num=player.maxHp-player.hp;
|
||||||
if(num>0){
|
if(num>0){
|
||||||
player.changeHp(num,false);
|
player.changeHp(num,false);
|
||||||
|
@ -5951,6 +5981,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','loseHp');
|
game.playAudio('effect','loseHp');
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','loseHp');
|
||||||
|
}
|
||||||
|
});
|
||||||
game.log(player,'失去了'+get.cnNumber(num)+'点体力')
|
game.log(player,'失去了'+get.cnNumber(num)+'点体力')
|
||||||
player.changeHp(-num);
|
player.changeHp(-num);
|
||||||
"step 1"
|
"step 1"
|
||||||
|
@ -6086,6 +6121,7 @@
|
||||||
proc(player);
|
proc(player);
|
||||||
game.broadcast(proc,player);
|
game.broadcast(proc,player);
|
||||||
|
|
||||||
|
var audiofunc=function(player){
|
||||||
if(lib.config.background_speak){
|
if(lib.config.background_speak){
|
||||||
if(lib.character[player.name]&&
|
if(lib.character[player.name]&&
|
||||||
lib.character[player.name][4].contains('die_audio')){
|
lib.character[player.name][4].contains('die_audio')){
|
||||||
|
@ -6094,10 +6130,10 @@
|
||||||
else if(lib.config.background_ogg){
|
else if(lib.config.background_ogg){
|
||||||
game.playAudio('die',player.name.slice(player.name.indexOf('_')+1));
|
game.playAudio('die',player.name.slice(player.name.indexOf('_')+1));
|
||||||
}
|
}
|
||||||
// else if(lib.config.background_audio){
|
|
||||||
// game.playAudio('effect','die_'+(player.sex==='female'?'female':'male'));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
audiofunc(player);
|
||||||
|
game.broadcast(audiofunc,player);
|
||||||
if(!_status.connectMode&&player==game.me&&!_status.over&&!game.controlOver){
|
if(!_status.connectMode&&player==game.me&&!_status.over&&!game.controlOver){
|
||||||
ui.control.show();
|
ui.control.show();
|
||||||
if(get.config('revive')&&lib.mode[lib.config.mode].config.revive){
|
if(get.config('revive')&&lib.mode[lib.config.mode].config.revive){
|
||||||
|
@ -6155,6 +6191,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect',get.subtype(card));
|
game.playAudio('effect',get.subtype(card));
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(type){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect',type);
|
||||||
|
}
|
||||||
|
},get.subtype(card));
|
||||||
player.$equip(card);
|
player.$equip(card);
|
||||||
game.addVideo('equip',player,get.cardInfo(card));
|
game.addVideo('equip',player,get.cardInfo(card));
|
||||||
game.log(player,'装备了',card);
|
game.log(player,'装备了',card);
|
||||||
|
@ -6176,6 +6217,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','judge');
|
game.playAudio('effect','judge');
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','judge');
|
||||||
|
}
|
||||||
|
});
|
||||||
cards[0].fix();
|
cards[0].fix();
|
||||||
cards[0].style.transform='';
|
cards[0].style.transform='';
|
||||||
cards[0].classList.remove('drawinghidden');
|
cards[0].classList.remove('drawinghidden');
|
||||||
|
@ -6303,6 +6349,11 @@
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
game.playAudio('effect','link');
|
game.playAudio('effect','link');
|
||||||
}
|
}
|
||||||
|
game.broadcast(function(){
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
game.playAudio('effect','link');
|
||||||
|
}
|
||||||
|
});
|
||||||
player.classList.remove('target');
|
player.classList.remove('target');
|
||||||
player.classList.toggle('linked');
|
player.classList.toggle('linked');
|
||||||
game.broadcast(function(player){
|
game.broadcast(function(player){
|
||||||
|
@ -8213,6 +8264,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showTimer:function(time){
|
showTimer:function(time){
|
||||||
|
if(!time&&lib.configOL){
|
||||||
|
time=parseInt(lib.configOL.choose_timeout)*1000;
|
||||||
|
}
|
||||||
if(_status.connectMode&&!game.online){
|
if(_status.connectMode&&!game.online){
|
||||||
game.broadcast(function(player,time){
|
game.broadcast(function(player,time){
|
||||||
player.showTimer(time);
|
player.showTimer(time);
|
||||||
|
@ -11428,6 +11482,9 @@
|
||||||
ui.click.auto();
|
ui.click.auto();
|
||||||
ui.timer.hide();
|
ui.timer.hide();
|
||||||
});
|
});
|
||||||
|
if(!game.online&&game.me){
|
||||||
|
game.me.showTimer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
stopCountChoose:function(){
|
stopCountChoose:function(){
|
||||||
|
@ -11436,6 +11493,9 @@
|
||||||
delete _status.countDown;
|
delete _status.countDown;
|
||||||
ui.timer.hide();
|
ui.timer.hide();
|
||||||
}
|
}
|
||||||
|
if(_status.connectMode&&!game.online&&game.me){
|
||||||
|
game.me.hideTimer();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
connect:function(ip,callback){
|
connect:function(ip,callback){
|
||||||
if(game.online) return;
|
if(game.online) return;
|
||||||
|
@ -11566,6 +11626,7 @@
|
||||||
ui.window.appendChild(audio);
|
ui.window.appendChild(audio);
|
||||||
},
|
},
|
||||||
trySkillAudio:function(skill,player,directaudio){
|
trySkillAudio:function(skill,player,directaudio){
|
||||||
|
game.broadcast(game.trySkillAudio,skill,player,directaudio);
|
||||||
var info=get.info(skill);
|
var info=get.info(skill);
|
||||||
if(!info) return;
|
if(!info) return;
|
||||||
if((!info.direct||directaudio)&&lib.config.background_speak&&
|
if((!info.direct||directaudio)&&lib.config.background_speak&&
|
||||||
|
@ -13747,16 +13808,28 @@
|
||||||
if(game.online){
|
if(game.online){
|
||||||
var dialog=ui.create.dialog();
|
var dialog=ui.create.dialog();
|
||||||
dialog.content.innerHTML=result;
|
dialog.content.innerHTML=result;
|
||||||
if(arguments[1]==true){
|
var result2=arguments[1];
|
||||||
|
if(result2==true){
|
||||||
dialog.content.firstChild.innerHTML='战斗胜利';
|
dialog.content.firstChild.innerHTML='战斗胜利';
|
||||||
}
|
}
|
||||||
else if(arguments[1]==false){
|
else if(result2==false){
|
||||||
dialog.content.firstChild.innerHTML='战斗失败';
|
dialog.content.firstChild.innerHTML='战斗失败';
|
||||||
}
|
}
|
||||||
ui.update();
|
ui.update();
|
||||||
if(!ui.restart){
|
if(!ui.restart){
|
||||||
ui.restart=ui.create.control('restart',game.reload);
|
ui.restart=ui.create.control('restart',game.reload);
|
||||||
}
|
}
|
||||||
|
if(lib.config.background_audio){
|
||||||
|
if(result2===true){
|
||||||
|
game.playAudio('effect','win');
|
||||||
|
}
|
||||||
|
else if(result2===false){
|
||||||
|
game.playAudio('effect','lose');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
game.playAudio('effect','tie');
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
|
@ -14048,10 +14121,10 @@
|
||||||
}
|
}
|
||||||
dialog.add(ui.create.div('.placeholder'));
|
dialog.add(ui.create.div('.placeholder'));
|
||||||
dialog.add(ui.create.div('.placeholder'));
|
dialog.add(ui.create.div('.placeholder'));
|
||||||
for(var i=0;i<game.players.length;i++){
|
var clients=game.players.concat(game.dead);
|
||||||
if(game.players[i].isOnline2()){
|
for(var i=0;i<clients.length;i++){
|
||||||
console.log(game.players[i]);
|
if(clients[i].isOnline2()){
|
||||||
game.players[i].send(game.over,dialog.content.innerHTML,game.checkOnlineResult(game.players[i]));
|
clients[i].send(game.over,dialog.content.innerHTML,game.checkOnlineResult(clients[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game.addVideo('over',null,dialog.content.innerHTML);
|
game.addVideo('over',null,dialog.content.innerHTML);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
window.noname_update={
|
window.noname_update={
|
||||||
version:'1.8.2.4',
|
version:'1.8.2.5',
|
||||||
changeLog:[
|
changeLog:[
|
||||||
|
'联机音效',
|
||||||
'投降按钮',
|
'投降按钮',
|
||||||
'出牌进度条',
|
'出牌进度条',
|
||||||
'修复若干卡死问题',
|
'修复若干卡死问题',
|
||||||
|
|
Loading…
Reference in New Issue