This commit is contained in:
parent
d2b8966447
commit
5e2a02e40f
|
@ -1,4 +1,5 @@
|
|||
1.5.4
|
||||
天气(选项-玩法中开启)
|
||||
战棋模式调整
|
||||
优化触屏模式
|
||||
明将国战模式
|
||||
|
|
|
@ -350,8 +350,10 @@ character.woods={
|
|||
}
|
||||
});
|
||||
"step 1"
|
||||
result.targets[0].gain(result.cards);
|
||||
player.$give(result.cards.length,result.targets[0]);
|
||||
if(result.targets&&result.targets[0]){
|
||||
result.targets[0].gain(result.cards);
|
||||
player.$give(result.cards.length,result.targets[0]);
|
||||
}
|
||||
}
|
||||
},
|
||||
dimeng:{
|
||||
|
|
|
@ -2242,6 +2242,7 @@ character.yijiang={
|
|||
if(player.skills.contains('qice5')) return 0;
|
||||
var num=0;
|
||||
var cards=player.get('h');
|
||||
if(cards.length>=3&&player.hp>=3) return 0;
|
||||
for(var i=0;i<cards.length;i++){
|
||||
num+=Math.max(0,ai.get.value(cards[i],player,'raw'));
|
||||
}
|
||||
|
@ -2489,7 +2490,6 @@ character.yijiang={
|
|||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
if(get.tag(card,'recover')&&player!=target) return [1,0,0,0.1];
|
||||
if(player.skills.contains('jueqing')) return [1,-2];
|
||||
var hasfriend=false;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
|
|
63
game/game.js
63
game/game.js
|
@ -716,54 +716,56 @@
|
|||
game.saveConfig('plays',lib.config.plays);
|
||||
}
|
||||
},
|
||||
// weather_noqing_playpackconfig:{
|
||||
// name:'异常天气出现概率',
|
||||
// init:'0.5',
|
||||
// item:{
|
||||
// '0.1':'10%',
|
||||
// '0.3':'30%',
|
||||
// '0.5':'50%',
|
||||
// '0.7':'70%',
|
||||
// }
|
||||
// weather_animation_playpackconfig:{
|
||||
// name:'天气动画',
|
||||
// init:true
|
||||
// },
|
||||
weather_noqing_playpackconfig:{
|
||||
name:'异常天气出现概率',
|
||||
init:'0.5',
|
||||
item:{
|
||||
'0.1':'10%',
|
||||
'0.3':'30%',
|
||||
'0.5':'50%',
|
||||
'0.7':'70%',
|
||||
'0.9':'90%',
|
||||
}
|
||||
},
|
||||
weather_chance_playpackconfig:{
|
||||
name:'天气效果触发概率',
|
||||
init:'0.2',
|
||||
init:'0.5',
|
||||
item:{
|
||||
'0.1':'10%',
|
||||
'0.2':'20%',
|
||||
'0.3':'30%',
|
||||
'0.5':'50%',
|
||||
'0.8':'80%',
|
||||
},
|
||||
onclick:function(item){
|
||||
game.saveConfig('weather_chance_playpackconfig',item);
|
||||
_status.weatherchance=parseFloat(lib.config.weather_chance_playpackconfig)||0;
|
||||
var chancestr=parseInt(_status.weatherchance*100)+'%';
|
||||
for(var i in lib.translate){
|
||||
if(i.indexOf('__weather_')==0){
|
||||
lib.translate[i.slice(1)]=lib.translate[i].replace(/&weather&/,chancestr);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
weather_duration_playpackconfig:{
|
||||
name:'异常天气持续时间',
|
||||
init:'[3,6]',
|
||||
init:'[4,4]',
|
||||
item:{
|
||||
'[3,3]':'3~6回合',
|
||||
'[3,6]':'3~9回合',
|
||||
'[6,3]':'6~9回合',
|
||||
'[6,6]':'6~12回合',
|
||||
'[2,4]':'1~3回合',
|
||||
'[4,4]':'3~6回合',
|
||||
'[4,7]':'3~9回合',
|
||||
'[7,4]':'6~9回合',
|
||||
'[7,7]':'6~12回合',
|
||||
}
|
||||
},
|
||||
weather_qingduration_playpackconfig:{
|
||||
name:'晴朗天气持续时间',
|
||||
init:'[3,6]',
|
||||
init:'[2,4]',
|
||||
item:{
|
||||
'[3,3]':'3~6回合',
|
||||
'[3,6]':'3~9回合',
|
||||
'[6,3]':'6~9回合',
|
||||
'[6,6]':'6~12回合',
|
||||
'[2,4]':'1~3回合',
|
||||
'[4,4]':'3~6回合',
|
||||
'[4,7]':'3~9回合',
|
||||
'[7,4]':'6~9回合',
|
||||
'[7,7]':'6~12回合',
|
||||
}
|
||||
},
|
||||
update:function(config,map){
|
||||
|
@ -825,7 +827,7 @@
|
|||
var node=this;
|
||||
if(node._clearing){
|
||||
localStorage.clear();
|
||||
indexedDB.deleteDatabase(lib.configprefix+'data');
|
||||
if(indexedDB) indexedDB.deleteDatabase(lib.configprefix+'data');
|
||||
game.reload();
|
||||
return;
|
||||
}
|
||||
|
@ -3378,6 +3380,7 @@
|
|||
},
|
||||
damage:function(){
|
||||
"step 0"
|
||||
if(num<0) num=0;
|
||||
if(num>0&&player.hujia&&!player.hasSkillTag('nohujia')){
|
||||
if(num>=player.hujia){
|
||||
num-=player.hujia;
|
||||
|
@ -8980,6 +8983,12 @@
|
|||
if(typeof suit!='string'){
|
||||
suit=['heart','diamond','club','spade'].randomGet();
|
||||
}
|
||||
else if(suit=='black'){
|
||||
suit=Math.random()<0.5?'club':'spade';
|
||||
}
|
||||
else if(suit=='red'){
|
||||
suit=Math.random()<0.5?'diamond':'heart';
|
||||
}
|
||||
if(typeof number!='number'){
|
||||
number=Math.ceil(Math.random()*13);
|
||||
}
|
||||
|
|
|
@ -866,6 +866,13 @@ div[data-color="unknownm"]{
|
|||
color:white !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
.player .wunature{
|
||||
display: none;
|
||||
}
|
||||
#arena>.player .wunature,
|
||||
#chess>.player .wunature{
|
||||
display: block;
|
||||
}
|
||||
div:hover>.wunature{
|
||||
/*opacity: 0.5;*/
|
||||
}
|
||||
|
@ -913,6 +920,9 @@ div:hover>.wunature{
|
|||
.selected{
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(255, 0, 0, 0.8) 0 0 15px !important;
|
||||
}
|
||||
#me .card.selected{
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgb(255, 0, 0) 0 0 5px, rgba(255, 0, 0, 1) 0 0 10px !important;
|
||||
}
|
||||
.glow{
|
||||
box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.8) 0 0 15px !important;
|
||||
}
|
||||
|
|
|
@ -426,7 +426,7 @@ mode.identity={
|
|||
list=list3.slice(0,6);
|
||||
}
|
||||
else{
|
||||
list=list3.slice(0,num).concat(list2);
|
||||
list=list2.concat(list3.slice(0,num));
|
||||
}
|
||||
}
|
||||
var dialog=ui.create.dialog('选择角色',[list,'character']);
|
||||
|
|
197
play/weather.js
197
play/weather.js
|
@ -2,20 +2,14 @@
|
|||
play.weather={
|
||||
arenaReady:function(){
|
||||
if(_status.video) return;
|
||||
_status.weather='qing';
|
||||
_status.weatherlife=Math.ceil(Math.random()*3);
|
||||
_status.weatherchance=parseFloat(lib.config.weather_chance_playpackconfig)||0;
|
||||
var chancestr=parseInt(_status.weatherchance*100)+'%';
|
||||
for(var i in lib.translate){
|
||||
if(i.indexOf('_weather_')==0){
|
||||
lib.translate['_'+i]=lib.translate[i];
|
||||
lib.translate[i]=lib.translate[i].replace(/&weather&/,chancestr);
|
||||
}
|
||||
}
|
||||
ui.weather=ui.create.system('晴',null,true);
|
||||
|
||||
ui.weather=ui.create.system('',null,true);
|
||||
lib.setPopped(ui.weather,function(){
|
||||
var uiintro=ui.create.dialog('hidden');
|
||||
var weatherinfo=get.translation('_weather_'+_status.weather+'_info');
|
||||
var chancestr=parseInt(_status.weatherchance*100)+'%';
|
||||
weatherinfo=weatherinfo.replace(/&weather&/,chancestr);
|
||||
uiintro.add(get.translation('_weather_'+_status.weather));
|
||||
if(weatherinfo.length<=0){
|
||||
uiintro.add('<div class="text center">'+weatherinfo+'</div>');
|
||||
|
@ -26,6 +20,8 @@ play.weather={
|
|||
uiintro.add(ui.create.div('.placeholder.slim'));
|
||||
return uiintro;
|
||||
},220);
|
||||
|
||||
game.changeWeather();
|
||||
},
|
||||
skill:{
|
||||
_weatherchange:{
|
||||
|
@ -33,38 +29,193 @@ play.weather={
|
|||
filter:function(){
|
||||
return ui.weather?true:false;
|
||||
},
|
||||
priority:-1,
|
||||
forced:true,
|
||||
content:function(){
|
||||
if(_status.weather!='qing'&&Math.random()<0.5){
|
||||
_status.weather='qing';
|
||||
_status.weatherlife--;
|
||||
if(_status.weatherlife<=0){
|
||||
game.changeWeather();
|
||||
}
|
||||
}
|
||||
},
|
||||
_weather_yu:{
|
||||
trigger:{player:'phaseAfter'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(_status.weather!='yu') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].num('j','hongshui')) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
player.addJudge(game.createCard('hongshui','black'));
|
||||
player.popup('雨');
|
||||
game.log('暴雨引发了洪水');
|
||||
}
|
||||
},
|
||||
_weather_lei:{
|
||||
trigger:{player:'phaseAfter'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(_status.weather!='lei') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].num('j','shandian')) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
player.addJudge(game.createCard('shandian'));
|
||||
player.popup('雷');
|
||||
game.log('打雷了');
|
||||
}
|
||||
},
|
||||
_weather_shuang:{
|
||||
trigger:{player:'damageBegin'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(_status.weather!='shuang') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
if(event.nature!='fire') return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
trigger.num--;
|
||||
player.popup('霜');
|
||||
game.log('由于温度过低火焰伤害减弱');
|
||||
}
|
||||
},
|
||||
_weather_wu:{
|
||||
trigger:{target:'useCardToBefore'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(_status.weather!='wu') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
if(event.card.name!='sha') return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
trigger.untrigger();
|
||||
trigger.finish();
|
||||
player.popup('雾');
|
||||
game.log('大雾使'+get.translation(player)+'躲避了杀');
|
||||
}
|
||||
},
|
||||
_weather_bao:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
forced:true,
|
||||
popup:false,
|
||||
filter:function(){
|
||||
if(_status.weather!='bao') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
player.damage('nosource');
|
||||
player.popup('雹');
|
||||
game.log(get.translation(player)+'被冰雹砸中');
|
||||
}
|
||||
},
|
||||
_weather_feng:{
|
||||
trigger:{player:'damageEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(_status.weather!='feng') return false;
|
||||
if(event.nature!='fire') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
return true;
|
||||
},
|
||||
popup:false,
|
||||
content:function(){
|
||||
'step 0'
|
||||
var list=[];
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i]!=player&&get.distance(player,game.players[i])<=1){
|
||||
list.push(game.players[i]);
|
||||
}
|
||||
}
|
||||
if(list.length){
|
||||
var target=list.randomGet();
|
||||
event.target=target;
|
||||
game.delay();
|
||||
}
|
||||
else{
|
||||
var weathers=['qing','yu','shuang','bao','wu','xue','feng','lei'];
|
||||
if(lib.config.mode!='chess'){
|
||||
weathers.remove('xue');
|
||||
}
|
||||
_status.weather=weathers.randomGet(_status.weather);
|
||||
event.finish();
|
||||
}
|
||||
'step 1'
|
||||
if(event.target){
|
||||
var target=event.target;
|
||||
game.delay();
|
||||
target.damage('fire',trigger.source||'nosource');
|
||||
target.popup('风');
|
||||
game.log('大风使'+get.translation(target)+'受到波及');
|
||||
}
|
||||
}
|
||||
},
|
||||
_weather_xue:{
|
||||
trigger:{player:'phaseAfter'},
|
||||
forced:true,
|
||||
popup:false,
|
||||
filter:function(){
|
||||
if(_status.weather!='xue') return false;
|
||||
if(Math.random()>_status.weatherchance) return false;
|
||||
if(lib.config.mode!='chess') return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
var list=[];
|
||||
if(player.movable(-1,0)) list.push('moveLeft');
|
||||
if(player.movable(1,0)) list.push('moveRight');
|
||||
if(player.movable(0,-1)) list.push('moveUp');
|
||||
if(player.movable(0,1)) list.push('moveDown');
|
||||
if(list.length){
|
||||
player.popup('雪');
|
||||
game.log('由于地滑,'+get.translation(player)+'发生移动');
|
||||
player[list.randomGet()]();
|
||||
}
|
||||
ui.weather.innerHTML=lib.translate['_weather_'+_status.weather];
|
||||
}
|
||||
}
|
||||
},
|
||||
game:{
|
||||
changeWeather:function(){
|
||||
var life;
|
||||
if(_status.weather=='qing'||Math.random()<parseFloat(lib.config.weather_noqing_playpackconfig)){
|
||||
var weathers=['yu','shuang','bao','wu','xue','feng','lei'];
|
||||
if(lib.config.mode!='chess'){
|
||||
weathers.remove('xue');
|
||||
}
|
||||
_status.weather=weathers.randomGet();
|
||||
life=JSON.parse(lib.config.weather_duration_playpackconfig);
|
||||
}
|
||||
else{
|
||||
_status.weather='qing';
|
||||
life=JSON.parse(lib.config.weather_qingduration_playpackconfig);
|
||||
}
|
||||
_status.weatherlife=life[0]+Math.floor(Math.random()*life[1]);
|
||||
ui.weather.innerHTML=lib.translate['_weather_'+_status.weather];
|
||||
}
|
||||
},
|
||||
weatherAnimation:{
|
||||
|
||||
},
|
||||
translate:{
|
||||
_weather_qing:'晴',
|
||||
_weather_qing_info:'没有任何事情发生',
|
||||
_weather_yu:'雨',
|
||||
_weather_yu_info:'在一名角色的回合结束阶段,若场上没有洪水,有&weather&的机率将一张洪水置于其判定区',
|
||||
_weather_yu_info:'在一名角色的回合结束后,若场上没有洪水,有&weather&的机率将一张洪水置于其判定区',
|
||||
_weather_shuang:'霜',
|
||||
_weather_shuang_info:'每当一名角色受到火焰伤害,有&weather&的机率令此伤害-1',
|
||||
_weather_wu:'雾',
|
||||
_weather_wu_info:'所有角色使用的杀有&weather&的机率失效',
|
||||
_weather_bao:'雹',
|
||||
_weather_bao_info:'每名角色在回合结束阶段有&weather&的机率受到一点伤害',
|
||||
_weather_bao_info:'每名角色在回合结束后有&weather&的机率受到一点伤害',
|
||||
_weather_xue:'雪',
|
||||
_weather_xue_info:'每名角色在回合结束阶段有&weather&的机率随机移动1格',
|
||||
_weather_xue_info:'每名角色在回合结束后有&weather&的机率随机移动1格',
|
||||
_weather_feng:'风',
|
||||
_weather_feng_info:'当一名角色受到火焰伤害后,有&weather&的机率令距离其1以内的一名其他角色受到一点火焰伤害',
|
||||
_weather_feng_info:'当一名角色受到火焰伤害后,有&weather&的机率令距离其1以内的一名随机角色受到一点火焰伤害',
|
||||
_weather_lei:'雷',
|
||||
_weather_lei_info:'在一名角色的回合结束阶段,若场上没有闪电,有&weather&的机率将一张闪电置于其判定区',
|
||||
_weather_lei_info:'在一名角色的回合结束后,若场上没有闪电,有&weather&的机率将一张闪电置于其判定区',
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue