This commit is contained in:
parent
d32b4fa95e
commit
d876f5dbf5
|
@ -75,6 +75,7 @@ character.hearth={
|
||||||
hs_malfurion:['hs_malorne'],
|
hs_malfurion:['hs_malorne'],
|
||||||
},
|
},
|
||||||
skill:{
|
skill:{
|
||||||
|
hsshenqi_forbid:{},
|
||||||
duxin:{
|
duxin:{
|
||||||
trigger:{player:['phaseBegin','phaseEnd']},
|
trigger:{player:['phaseBegin','phaseEnd']},
|
||||||
frequent:true,
|
frequent:true,
|
||||||
|
@ -820,12 +821,11 @@ character.hearth={
|
||||||
var list=[['','','hsshenqi_morijingxiang'],
|
var list=[['','','hsshenqi_morijingxiang'],
|
||||||
['','','hsshenqi_kongbusangzhong'],
|
['','','hsshenqi_kongbusangzhong'],
|
||||||
['','','hsshenqi_nengliangzhiguang']];
|
['','','hsshenqi_nengliangzhiguang']];
|
||||||
var dialog=ui.create.dialog('邪能:将武将牌翻面并获得一张神器牌',[list,'vcard'],'hidden');
|
var dialog=ui.create.dialog('邪能:选择一张神器牌并获得之',[list,'vcard'],'hidden');
|
||||||
player.chooseButton(dialog).ai=function(){return Math.random();};
|
player.chooseButton(dialog).ai=function(){return Math.random();};
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.buttons){
|
if(result.buttons){
|
||||||
player.logSkill('xieneng');
|
player.logSkill('xieneng');
|
||||||
player.turnOver();
|
|
||||||
player.gain(game.createCard(result.buttons[0].link[2]),'draw');
|
player.gain(game.createCard(result.buttons[0].link[2]),'draw');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3954,7 +3954,9 @@ character.hearth={
|
||||||
type:'hsshenqi',
|
type:'hsshenqi',
|
||||||
fullimage:true,
|
fullimage:true,
|
||||||
vanish:true,
|
vanish:true,
|
||||||
enable:true,
|
enable:function(card,player){
|
||||||
|
return !player.hasSkill('hsshenqi_forbid');
|
||||||
|
},
|
||||||
derivation:'hs_lafamu',
|
derivation:'hs_lafamu',
|
||||||
filterTarget:true,
|
filterTarget:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
|
@ -3962,6 +3964,12 @@ character.hearth={
|
||||||
target.recover();
|
target.recover();
|
||||||
target.draw(4);
|
target.draw(4);
|
||||||
},
|
},
|
||||||
|
contentAfter:function(){
|
||||||
|
if(!player.isTurnedOver()){
|
||||||
|
player.turnOver();
|
||||||
|
}
|
||||||
|
player.addTempSkill('hsshenqi_forbid','phaseAfter');
|
||||||
|
},
|
||||||
ai:{
|
ai:{
|
||||||
order:5,
|
order:5,
|
||||||
result:{
|
result:{
|
||||||
|
@ -3979,7 +3987,9 @@ character.hearth={
|
||||||
type:'hsshenqi',
|
type:'hsshenqi',
|
||||||
fullimage:true,
|
fullimage:true,
|
||||||
vanish:true,
|
vanish:true,
|
||||||
enable:true,
|
enable:function(card,player){
|
||||||
|
return !player.hasSkill('hsshenqi_forbid');
|
||||||
|
},
|
||||||
derivation:'hs_lafamu',
|
derivation:'hs_lafamu',
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target!=player;
|
return target!=player;
|
||||||
|
@ -3988,6 +3998,12 @@ character.hearth={
|
||||||
content:function(){
|
content:function(){
|
||||||
target.damage(Math.ceil(Math.random()*2));
|
target.damage(Math.ceil(Math.random()*2));
|
||||||
},
|
},
|
||||||
|
contentAfter:function(){
|
||||||
|
if(!player.isTurnedOver()){
|
||||||
|
player.turnOver();
|
||||||
|
}
|
||||||
|
player.addTempSkill('hsshenqi_forbid','phaseAfter');
|
||||||
|
},
|
||||||
ai:{
|
ai:{
|
||||||
order:9,
|
order:9,
|
||||||
result:{
|
result:{
|
||||||
|
@ -4006,7 +4022,9 @@ character.hearth={
|
||||||
type:'hsshenqi',
|
type:'hsshenqi',
|
||||||
fullimage:true,
|
fullimage:true,
|
||||||
vanish:true,
|
vanish:true,
|
||||||
enable:true,
|
enable:function(card,player){
|
||||||
|
return !player.hasSkill('hsshenqi_forbid');
|
||||||
|
},
|
||||||
derivation:'hs_lafamu',
|
derivation:'hs_lafamu',
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target!=player&&target.num('hej')>0;
|
return target!=player&&target.num('hej')>0;
|
||||||
|
@ -4015,6 +4033,12 @@ character.hearth={
|
||||||
content:function(){
|
content:function(){
|
||||||
if(target.num('hej')) player.gainPlayerCard(target,'hej',true,Math.ceil(Math.random()*2));
|
if(target.num('hej')) player.gainPlayerCard(target,'hej',true,Math.ceil(Math.random()*2));
|
||||||
},
|
},
|
||||||
|
contentAfter:function(){
|
||||||
|
if(!player.isTurnedOver()){
|
||||||
|
player.turnOver();
|
||||||
|
}
|
||||||
|
player.addTempSkill('hsshenqi_forbid','phaseAfter');
|
||||||
|
},
|
||||||
ai:{
|
ai:{
|
||||||
order:9.5,
|
order:9.5,
|
||||||
result:{
|
result:{
|
||||||
|
@ -4324,7 +4348,7 @@ character.hearth={
|
||||||
xunbao2:'寻宝',
|
xunbao2:'寻宝',
|
||||||
xunbao_info:'回合开始阶段,若你的武将牌上没有藏宝图,你可以将一张藏宝图置于你的武将牌上;若你的武将牌上有藏宝图,你可以弃置一张与藏宝图点数相同的牌并获得此藏宝图',
|
xunbao_info:'回合开始阶段,若你的武将牌上没有藏宝图,你可以将一张藏宝图置于你的武将牌上;若你的武将牌上有藏宝图,你可以弃置一张与藏宝图点数相同的牌并获得此藏宝图',
|
||||||
xieneng:'邪能',
|
xieneng:'邪能',
|
||||||
xieneng_info:'回合结束阶段,你可以将武将牌翻面,并获得一张神器牌',
|
xieneng_info:'回合结束阶段,你可以选择一张神器牌并获得之',
|
||||||
fbeifa:'北伐',
|
fbeifa:'北伐',
|
||||||
fbeifa_info:'每当你失去最后一张手牌,你可以视为使用一张无视距离的杀,若此杀造成伤害,你摸一张牌,每回合最多发动3次',
|
fbeifa_info:'每当你失去最后一张手牌,你可以视为使用一张无视距离的杀,若此杀造成伤害,你摸一张牌,每回合最多发动3次',
|
||||||
yufa:'驭法',
|
yufa:'驭法',
|
||||||
|
@ -4333,11 +4357,11 @@ character.hearth={
|
||||||
bingyan_info:'出牌阶段限一次,你可以将一张红色牌当作炽羽袭,或将一张黑色牌当作惊雷闪使用',
|
bingyan_info:'出牌阶段限一次,你可以将一张红色牌当作炽羽袭,或将一张黑色牌当作惊雷闪使用',
|
||||||
hsshenqi:'神器',
|
hsshenqi:'神器',
|
||||||
hsshenqi_morijingxiang:'末日镜像',
|
hsshenqi_morijingxiang:'末日镜像',
|
||||||
hsshenqi_morijingxiang_info:'从所有其他角色的区域内各获得1~2张牌',
|
hsshenqi_morijingxiang_info:'从所有其他角色的区域内各获得1~2张牌;使用后将武将牌翻至背面且本回合内无法继续使用神器牌',
|
||||||
hsshenqi_kongbusangzhong:'恐怖丧钟',
|
hsshenqi_kongbusangzhong:'恐怖丧钟',
|
||||||
hsshenqi_kongbusangzhong_info:'对所有其他角色各造成1~2点伤害',
|
hsshenqi_kongbusangzhong_info:'对所有其他角色各造成1~2点伤害;使用后将武将牌翻至背面且本回合内无法继续使用神器牌',
|
||||||
hsshenqi_nengliangzhiguang:'能量之光',
|
hsshenqi_nengliangzhiguang:'能量之光',
|
||||||
hsshenqi_nengliangzhiguang_info:'令一名角色增加一点体力上限,回复一点体力,并摸四张牌',
|
hsshenqi_nengliangzhiguang_info:'令一名角色增加一点体力上限,回复一点体力,并摸四张牌;使用后将武将牌翻至背面且本回合内无法继续使用神器牌',
|
||||||
hsbaowu:'宝物',
|
hsbaowu:'宝物',
|
||||||
hsbaowu_huangjinyuanhou:'黄金猿猴',
|
hsbaowu_huangjinyuanhou:'黄金猿猴',
|
||||||
hsbaowu_huangjinyuanhou_info:'回复全部体力,弃置所有手牌,并获得等量的无中生有;直到下个回合开始,防上即将受到的一切伤害',
|
hsbaowu_huangjinyuanhou_info:'回复全部体力,弃置所有手牌,并获得等量的无中生有;直到下个回合开始,防上即将受到的一切伤害',
|
||||||
|
|
|
@ -5038,6 +5038,7 @@ character.sp={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var target=trigger.player;
|
var target=trigger.player;
|
||||||
|
player.line(target,'green');
|
||||||
var judge=trigger.judge(target.judging[0]);
|
var judge=trigger.judge(target.judging[0]);
|
||||||
var attitude=ai.get.attitude(target,player);
|
var attitude=ai.get.attitude(target,player);
|
||||||
target.choosePlayerCard('请选择代替判定的牌','he','visible',true,player).set('ai',function(button){
|
target.choosePlayerCard('请选择代替判定的牌','he','visible',true,player).set('ai',function(button){
|
||||||
|
@ -5086,7 +5087,7 @@ character.sp={
|
||||||
}
|
}
|
||||||
ui.discardPile.appendChild(trigger.player.judging[0]);
|
ui.discardPile.appendChild(trigger.player.judging[0]);
|
||||||
trigger.player.judging[0]=event.card;
|
trigger.player.judging[0]=event.card;
|
||||||
if(!get.owner(result.cards[0],'judge')){
|
if(!get.owner(event.card,'judge')){
|
||||||
trigger.position.appendChild(event.card);
|
trigger.position.appendChild(event.card);
|
||||||
}
|
}
|
||||||
game.log(trigger.player,'的判定牌改为',event.card);
|
game.log(trigger.player,'的判定牌改为',event.card);
|
||||||
|
|
|
@ -448,6 +448,10 @@ character.yijiang={
|
||||||
else{
|
else{
|
||||||
str+=',或取消并弃置'+get.cnNumber(result.cards.length)+'张牌';
|
str+=',或取消并弃置'+get.cnNumber(result.cards.length)+'张牌';
|
||||||
}
|
}
|
||||||
|
if(!trigger.source.storage.huisheng){
|
||||||
|
trigger.source.storage.huisheng=[];
|
||||||
|
}
|
||||||
|
trigger.source.storage.huisheng.push(player);
|
||||||
trigger.source.chooseButton([str,result.cards],forced).set('ai',function(button){
|
trigger.source.chooseButton([str,result.cards],forced).set('ai',function(button){
|
||||||
if(_status.event.goon){
|
if(_status.event.goon){
|
||||||
return ai.get.value(button.link);
|
return ai.get.value(button.link);
|
||||||
|
|
|
@ -28284,6 +28284,7 @@
|
||||||
useful:function(card){
|
useful:function(card){
|
||||||
if(get.position(card)=='j') return -1;
|
if(get.position(card)=='j') return -1;
|
||||||
if(get.position(card)=='e') return ai.get.equipValue(card);
|
if(get.position(card)=='e') return ai.get.equipValue(card);
|
||||||
|
if(!lib.temp) lib.temp={};
|
||||||
if(lib.temp[card.name]==undefined) lib.temp[card.name]=[card];
|
if(lib.temp[card.name]==undefined) lib.temp[card.name]=[card];
|
||||||
else lib.temp[card.name].add(card);
|
else lib.temp[card.name].add(card);
|
||||||
var i=lib.temp[card.name].find(card);
|
var i=lib.temp[card.name].find(card);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
window.noname_update={
|
window.noname_update={
|
||||||
version:'1.8.15.3',
|
version:'1.8.15.4',
|
||||||
changeLog:[
|
changeLog:[
|
||||||
'修bug',
|
'修bug',
|
||||||
],
|
],
|
||||||
|
@ -8,6 +8,8 @@ window.noname_update={
|
||||||
'character/sp.js',
|
'character/sp.js',
|
||||||
'character/yxs.js',
|
'character/yxs.js',
|
||||||
'character/ow.js',
|
'character/ow.js',
|
||||||
|
'character/hearth.js',
|
||||||
|
'character/yijiang.js',
|
||||||
'game/game.js',
|
'game/game.js',
|
||||||
'layout/default/layout.css',
|
'layout/default/layout.css',
|
||||||
],
|
],
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 120 KiB |
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
Binary file not shown.
After Width: | Height: | Size: 119 KiB |
|
@ -9,6 +9,10 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.storyscene.removing{
|
||||||
|
pointer-events: none;
|
||||||
|
transform: translateY(500px);
|
||||||
|
}
|
||||||
.storyscene.lockscroll{
|
.storyscene.lockscroll{
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
@ -67,6 +71,13 @@
|
||||||
.storyscene>.player.scene.startscene{
|
.storyscene>.player.scene.startscene{
|
||||||
-webkit-animation: scene_start 0.5s;
|
-webkit-animation: scene_start 0.5s;
|
||||||
}
|
}
|
||||||
|
.player.scene>.menu>.menubutton.enter{
|
||||||
|
position: absolute;
|
||||||
|
top:auto;
|
||||||
|
bottom: 10px;
|
||||||
|
width: 70px;
|
||||||
|
left: calc(50% - 35px);
|
||||||
|
}
|
||||||
|
|
||||||
@-webkit-keyframes scene_start{
|
@-webkit-keyframes scene_start{
|
||||||
from{
|
from{
|
||||||
|
|
|
@ -4032,24 +4032,32 @@ mode.chess={
|
||||||
game.changeCoin(-3);
|
game.changeCoin(-3);
|
||||||
}
|
}
|
||||||
list.randomSort();
|
list.randomSort();
|
||||||
_status.event.dialog.close();
|
|
||||||
var dialog=ui.create.dialog('选择出场角色','hidden');
|
var buttons=ui.create.div('.buttons');
|
||||||
_status.event.dialog=dialog;
|
var node=_status.event.dialog.buttons[0].parentNode;
|
||||||
dialog.classList.add('fullwidth');
|
_status.event.dialog.buttons=ui.create.buttons(list.slice(0,parseInt(get.config('battle_number'))*4+parseInt(get.config('replace_number'))+5),'character',buttons);
|
||||||
dialog.classList.add('fullheight');
|
_status.event.dialog.content.insertBefore(buttons,node);
|
||||||
dialog.classList.add('fixed');
|
buttons.animate('start');
|
||||||
dialog.add('0/'+_status.event.selectButton());
|
node.remove();
|
||||||
dialog.add([list.slice(0,parseInt(get.config('battle_number'))*4+parseInt(get.config('replace_number'))+5),'character']);
|
|
||||||
if(bossbuttons.length){
|
// _status.event.dialog.close();
|
||||||
dialog.add('挑战魔王');
|
// var dialog=ui.create.dialog('选择出场角色','hidden');
|
||||||
dialog.add(bosses);
|
// _status.event.dialog=dialog;
|
||||||
}
|
// dialog.classList.add('fullwidth');
|
||||||
if(jiangebuttons.length){
|
// dialog.classList.add('fullheight');
|
||||||
dialog.add('守卫剑阁');
|
// dialog.classList.add('fixed');
|
||||||
dialog.add(jiange);
|
// dialog.add('0/'+_status.event.selectButton());
|
||||||
}
|
// dialog.add([list.slice(0,parseInt(get.config('battle_number'))*4+parseInt(get.config('replace_number'))+5),'character']);
|
||||||
event.addConfig(dialog);
|
// if(bossbuttons.length){
|
||||||
dialog.open();
|
// dialog.add('挑战魔王');
|
||||||
|
// dialog.add(bosses);
|
||||||
|
// }
|
||||||
|
// if(jiangebuttons.length){
|
||||||
|
// dialog.add('守卫剑阁');
|
||||||
|
// dialog.add(jiange);
|
||||||
|
// }
|
||||||
|
// event.addConfig(dialog);
|
||||||
|
// dialog.open();
|
||||||
game.uncheck();
|
game.uncheck();
|
||||||
game.check();
|
game.check();
|
||||||
};
|
};
|
||||||
|
|
139
mode/story.js
139
mode/story.js
|
@ -9,6 +9,28 @@ mode.story={
|
||||||
story:{
|
story:{
|
||||||
version:1,
|
version:1,
|
||||||
scene:{
|
scene:{
|
||||||
|
connect:{
|
||||||
|
hulaoguan:{
|
||||||
|
name:'虎牢关',
|
||||||
|
to:['middle','east']
|
||||||
|
},
|
||||||
|
huanghedukou:{
|
||||||
|
name:'黄河渡口',
|
||||||
|
to:['east','north']
|
||||||
|
},
|
||||||
|
yanmenguan:{
|
||||||
|
name:'雁门关',
|
||||||
|
to:['north','northwest']
|
||||||
|
},
|
||||||
|
changjiangdukou:{
|
||||||
|
name:'长江渡口',
|
||||||
|
to:['east','southeast']
|
||||||
|
},
|
||||||
|
jiamengguan:{
|
||||||
|
name:'葭萌关',
|
||||||
|
to:['south','southeast']
|
||||||
|
}
|
||||||
|
},
|
||||||
middle:{
|
middle:{
|
||||||
taoyuanxiang:{
|
taoyuanxiang:{
|
||||||
name:'桃源乡',
|
name:'桃源乡',
|
||||||
|
@ -25,15 +47,11 @@ mode.story={
|
||||||
xujiacun:{
|
xujiacun:{
|
||||||
name:'许家村',
|
name:'许家村',
|
||||||
},
|
},
|
||||||
xiangyang:{
|
|
||||||
name:'襄阳'
|
|
||||||
},
|
},
|
||||||
|
east:{
|
||||||
luoyang:{
|
luoyang:{
|
||||||
name:'洛阳'
|
name:'洛阳'
|
||||||
},
|
},
|
||||||
changan:{
|
|
||||||
name:'长安'
|
|
||||||
},
|
|
||||||
juyang:{
|
juyang:{
|
||||||
name:'雎阳'
|
name:'雎阳'
|
||||||
},
|
},
|
||||||
|
@ -43,6 +61,9 @@ mode.story={
|
||||||
beihai:{
|
beihai:{
|
||||||
name:'北海'
|
name:'北海'
|
||||||
},
|
},
|
||||||
|
tianshizhong:{
|
||||||
|
name:'天师冢'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
north:{
|
north:{
|
||||||
yecheng:{
|
yecheng:{
|
||||||
|
@ -60,9 +81,8 @@ mode.story={
|
||||||
xieliang:{
|
xieliang:{
|
||||||
name:'解良'
|
name:'解良'
|
||||||
},
|
},
|
||||||
huashan:{
|
|
||||||
name:'华山'
|
|
||||||
},
|
},
|
||||||
|
northwest:{
|
||||||
wuwei:{
|
wuwei:{
|
||||||
name:'武威'
|
name:'武威'
|
||||||
},
|
},
|
||||||
|
@ -72,19 +92,33 @@ mode.story={
|
||||||
xiongnu:{
|
xiongnu:{
|
||||||
name:'匈奴'
|
name:'匈奴'
|
||||||
},
|
},
|
||||||
huanghedukou:{
|
huashan:{
|
||||||
name:'黄河渡口'
|
name:'华山'
|
||||||
}
|
},
|
||||||
|
changan:{
|
||||||
|
name:'长安'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
south:{
|
south:{
|
||||||
|
chengdu:{
|
||||||
|
name:'成都'
|
||||||
|
},
|
||||||
wulin:{
|
wulin:{
|
||||||
name:'武陵'
|
name:'武陵'
|
||||||
},
|
},
|
||||||
|
nanman:{
|
||||||
|
name:'南蛮'
|
||||||
|
},
|
||||||
|
shanyue:{
|
||||||
|
name:'山越'
|
||||||
|
},
|
||||||
changsha:{
|
changsha:{
|
||||||
name:'长沙'
|
name:'长沙'
|
||||||
},
|
},
|
||||||
chengdu:{
|
},
|
||||||
name:'成都'
|
southeast:{
|
||||||
|
xiangyang:{
|
||||||
|
name:'襄阳'
|
||||||
},
|
},
|
||||||
jianye:{
|
jianye:{
|
||||||
name:'建业'
|
name:'建业'
|
||||||
|
@ -95,18 +129,9 @@ mode.story={
|
||||||
jiangxia:{
|
jiangxia:{
|
||||||
name:'江夏'
|
name:'江夏'
|
||||||
},
|
},
|
||||||
shanyue:{
|
|
||||||
name:'山越'
|
|
||||||
},
|
|
||||||
nanman:{
|
|
||||||
name:'南蛮'
|
|
||||||
},
|
|
||||||
zhongshan:{
|
zhongshan:{
|
||||||
name:'钟山'
|
name:'钟山'
|
||||||
},
|
},
|
||||||
changjiangdukou:{
|
|
||||||
name:'长江渡口'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -380,7 +405,9 @@ mode.story={
|
||||||
save='save1';
|
save='save1';
|
||||||
}
|
}
|
||||||
if(!lib.storage[save]){
|
if(!lib.storage[save]){
|
||||||
lib.storage[save]={};
|
lib.storage[save]={
|
||||||
|
area:'middle'
|
||||||
|
};
|
||||||
game.data=lib.storage[save];
|
game.data=lib.storage[save];
|
||||||
game.saveData();
|
game.saveData();
|
||||||
}
|
}
|
||||||
|
@ -390,11 +417,14 @@ mode.story={
|
||||||
lib.init.css('layout/mode','story');
|
lib.init.css('layout/mode','story');
|
||||||
game.delay();
|
game.delay();
|
||||||
'step 1'
|
'step 1'
|
||||||
var scenes={
|
var scenes={};
|
||||||
middle:ui.create.div('.storyscene'),
|
for(var i in lib.story.scene){
|
||||||
north:ui.create.div('.storyscene'),
|
if(i!='connect'){
|
||||||
south:ui.create.div('.storyscene',ui.window),
|
scenes[i]=ui.create.div('.storyscene')
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
game.data.area=game.data.area||'middle';
|
||||||
|
ui.window.appendChild(scenes[game.data.area].animate('start'));
|
||||||
var clickScene=function(e){
|
var clickScene=function(e){
|
||||||
if(this._clicking) return;
|
if(this._clicking) return;
|
||||||
if(this.classList.contains('flipped')){
|
if(this.classList.contains('flipped')){
|
||||||
|
@ -417,11 +447,18 @@ mode.story={
|
||||||
if(Math.abs(sceneNode.dx)<20){
|
if(Math.abs(sceneNode.dx)<20){
|
||||||
sceneNode.dx=0;
|
sceneNode.dx=0;
|
||||||
}
|
}
|
||||||
|
// else{
|
||||||
|
// console.log(sceneNode.scrollLeft,sceneNode.dx);
|
||||||
|
// if(sceneNode.scrollLeft<20&&sceneNode.dx<0){
|
||||||
|
// console.log(1);
|
||||||
|
// sceneNode.dx=0;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
if(!sceneNode.interval&&sceneNode.dx){
|
if(!sceneNode.interval&&sceneNode.dx){
|
||||||
sceneNode.interval=setInterval(function(){
|
sceneNode.interval=setInterval(function(){
|
||||||
var dx=sceneNode.dx;
|
var dx=sceneNode.dx;
|
||||||
if(Math.abs(dx)<=2){
|
if(Math.abs(dx)<=2){
|
||||||
sceneNode.scrollLeft+=dx;
|
sceneNode.scrollLeft-=dx;
|
||||||
clearInterval(sceneNode.interval);
|
clearInterval(sceneNode.interval);
|
||||||
delete sceneNode.interval;
|
delete sceneNode.interval;
|
||||||
}
|
}
|
||||||
|
@ -467,14 +504,38 @@ mode.story={
|
||||||
};
|
};
|
||||||
node.addEventListener('webkitTransitionEnd',onEnd);
|
node.addEventListener('webkitTransitionEnd',onEnd);
|
||||||
}
|
}
|
||||||
var createScene=function(name,position){
|
var switchScene=function(){
|
||||||
var scene=lib.story.scene[position][name];
|
var to=this.parentNode.to;
|
||||||
var node=ui.create.div('.player.scene',clickScene).animate('start');
|
var current=this.parentNode.parentNode;
|
||||||
|
restoreScene(current,true);
|
||||||
|
current.parentNode.delete();
|
||||||
|
ui.window.appendChild(scenes[to].animate('start'));
|
||||||
|
}
|
||||||
|
var createScene=function(name,position,connect){
|
||||||
|
var scene;
|
||||||
|
if(connect){
|
||||||
|
scene=lib.story.scene.connect[name];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
scene=lib.story.scene[position][name];
|
||||||
|
}
|
||||||
|
var node=ui.create.div('.player.scene',clickScene);
|
||||||
node.style.transform='perspective(1600px) rotateY(-180deg) scale(0.7)';
|
node.style.transform='perspective(1600px) rotateY(-180deg) scale(0.7)';
|
||||||
node.name=name;
|
node.name=name;
|
||||||
ui.create.div('.avatar',node).setBackground('mode/story/scene/'+name);
|
ui.create.div('.avatar',node).setBackground('mode/story/scene/'+name);
|
||||||
ui.create.div('.name',node,get.verticalStr(scene.name)).dataset.nature='soilm';
|
ui.create.div('.name',node,get.verticalStr(scene.name)).dataset.nature='soilm';
|
||||||
node.content=ui.create.div('.menu',node);
|
var content=ui.create.div('.menu',node);
|
||||||
|
node.content=content;
|
||||||
|
if(connect){
|
||||||
|
content.to=scene.to;
|
||||||
|
if(content.to[0]==position){
|
||||||
|
content.to=content.to[1];
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
content.to=content.to[0];
|
||||||
|
}
|
||||||
|
ui.create.div('.menubutton.large.enter','进入',node.content,switchScene);
|
||||||
|
}
|
||||||
scenes[position].appendChild(node);
|
scenes[position].appendChild(node);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
@ -484,14 +545,16 @@ mode.story={
|
||||||
restoreScene(current);
|
restoreScene(current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(var i in lib.story.scene.middle){
|
for(var i in lib.story.scene){
|
||||||
createScene(i,'middle');
|
if(i=='connect') continue;
|
||||||
|
for(var j in lib.story.scene[i]){
|
||||||
|
createScene(j,i);
|
||||||
}
|
}
|
||||||
for(var i in lib.story.scene.north){
|
|
||||||
createScene(i,'north');
|
|
||||||
}
|
}
|
||||||
for(var i in lib.story.scene.south){
|
for(var i in lib.story.scene.connect){
|
||||||
createScene(i,'south');
|
for(var j=0;j<lib.story.scene.connect[i].to.length;j++){
|
||||||
|
createScene(i,lib.story.scene.connect[i].to[j],true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue