国崎往人 change

This commit is contained in:
Spmario233 2023-09-28 04:04:47 +08:00
parent cfa7be8de6
commit f7a54a0d7b
5 changed files with 42 additions and 197 deletions

View File

@ -4442,160 +4442,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var str=get.translation(player)+'正在表演《小空飞天》...<br>';
ui.create.dialog(str).videoId=id;
};
var chooseButton=function(){
var roundmenu=false;
if(ui.roundmenu&&ui.roundmenu.display!='none'){
roundmenu=true;
ui.roundmenu.style.display='none';
}
var event=_status.event;
event.settleed=false;
event.score=0;
event.dialog=ui.create.dialog('forcebutton','hidden');
event.dialog.textPrompt=event.dialog.add('<div class="text center">准备好了吗?准备好了的话就点击屏幕开始吧!</div>');
event.dialog.textPrompt.style["z-index"]=10;
event.switchToAuto=function(){
event._result={
bool:true,
score:event.score,
};
event.dialog.close();
game.resume();
_status.imchoosing=false;
if(roundmenu) ui.roundmenu.style.display='';
};
event.dialog.classList.add('fixed');
event.dialog.classList.add('scroll1');
event.dialog.classList.add('scroll2');
event.dialog.classList.add('fullwidth');
event.dialog.classList.add('fullheight');
event.dialog.classList.add('noupdate');
event.dialog.style.overflow='hidden';
event.dialog.open();
var height=event.dialog.offsetHeight;
var width=event.dialog.offsetWidth;
var top=50;
var speed=0;
var start=false;
var bird=ui.create.div('');
bird.style["background-image"]='linear-gradient(rgba(6, 3, 55, 1), rgba(6, 3, 35, 1))';
bird.style["border-radius"]='3px';
var pipes=[];
bird.style.position='absolute';
bird.style.height='40px';
bird.style.width='40px';
bird.style.left=Math.ceil(width/3)+'px';
bird.style.top=(top/100*height)+'px';
bird.updatePosition=function(){
bird.style.transform='translateY('+(top/100*height-bird.offsetTop)+'px)';
};
event.dialog.appendChild(bird);
var isDead=function(){
if(top>100||top<0) return true;
var btop=top;
var bleft=100/3;
var bdown=btop+5;
var bright=bleft+5;
for(var i of pipes){
var left2=i.left;
var right2=left2+10;
var bottom2=i.height1;
var top2=i.height2;
if(left2>bright||right2<bleft) continue;
if(btop<bottom2) return true;
if(bdown>top2) return true;
return false;
}
return false;
};
var fly=function(){
if(!start){
start=true;
event.dialog.textPrompt.innerHTML='<div class="text center">当前分数:'+event.score+'</div>';
speed=-4;
event.fly=setInterval(function(){
top+=speed;
if(top<0) top=0;
bird.updatePosition();
for(var i of pipes){
i.left-=0.5;
i.updateLeft();
}
speed+=0.5;
if(speed>2.5) speed=2.5;
if(isDead()==true){
event.settle();
}
},35);
var addPipe=function(){
var num=get.rand(5,55);
var pipe1=ui.create.div('');
pipe1.style["background-image"]='linear-gradient(rgba(57, 133, 4, 1), rgba(60, 135, 6, 1))';
pipe1.style["border-radius"]='3px';
pipe1.style.position='absolute';
pipe1.height1=num;
pipe1.height2=num+50;
pipe1.left=110;
pipe1.num=1;
pipe1.style.height=Math.ceil(height*num/100)+'px';
pipe1.style.width=(width/10)+'px';
pipe1.style.left=(pipe1.left*width/100)+'px';
pipe1.style.top='0px';
var pipe2=ui.create.div('');
pipe2.style["background-image"]='linear-gradient(rgba(57, 133, 4, 1), rgba(60, 135, 6, 1))';
pipe2.style["border-radius"]='3px';
pipe1.pipe2=pipe2;
pipe2.style.position='absolute';
pipe2.style.height=Math.ceil((100-pipe1.height2)*height/100)+'px';
pipe2.style.width=(width/10)+'px';
pipe2.style.left=(pipe1.left*width/100)+'px';
pipe2.style.top=Math.ceil(pipe1.height2*height/100)+'px';
pipes.add(pipe1);
event.dialog.appendChild(pipe1);
event.dialog.appendChild(pipe2);
pipe1.updateLeft=function(){
this.style.transform='translateX('+((this.left/100*width)-this.offsetLeft)+'px)';
this.pipe2.style.transform='translateX('+((this.left/100*width)-this.pipe2.offsetLeft)+'px)';
if(this.left<25&&!this.score){
this.score=true;
event.score++;
event.dialog.textPrompt.innerHTML='<div class="text center">当前分数:'+event.score+'</div>';
if(event.score>=5) event.settle();
}
if(this.left<-15){
this.remove();
this.pipe2.remove();
pipes.remove(this);
}
}
};
event.addPipe=setInterval(addPipe,2500);
}
else if(speed>0){
speed=-4;
}
};
document.addEventListener(lib.config.touchscreen?'touchend':'click',fly);
event.settle=function(){
clearInterval(event.fly);
clearInterval(event.addPipe);
document.removeEventListener(lib.config.touchscreen?'touchend':'click',fly);
setTimeout(function(){
event.switchToAuto()
},1000);
};
game.pause();
game.countChoose();
};
var chooseButton=function(){lib.skill.yufeng.$playFlappyBird(5,'小空飞天')};
//event.switchToAuto=switchToAuto;
game.broadcastAll(createDialog,player,event.videoId);
if(event.isMine()){

View File

@ -102,7 +102,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseZhunbeiBegin'},
forced:true,
filter:function(event,player){
return player.countEquipableSlot(1)>0;
return player.countEmptySlot(1)>0;
},
content:function(){
'step 0'
@ -126,9 +126,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
if(!list.length) event.finish();
else{
var num=player.countEquipableSlot(1);
var num=player.countEmptySlot(1);
player.chooseButton([
'挈挟:选择至多'+get.cnNumber(num)+'张武将置入武器栏',
'挈挟:选择'+(num>1?'至多':'')+get.cnNumber(num)+'张武将置入武器栏',
[list,function(item,type,position,noclick,node){
return lib.skill.qiexie.$createButton(item,type,position,noclick,node);
}],
@ -160,8 +160,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var card=game.createCard('qiexie_'+name,'none',get.infoMaxHp(lib.character[name][2]));
return card;
});
player.addTempSkill('qiexie_blocker','qiexieAfter');
player.markAuto('qiexie_blocker',cards);
player.$gain2(cards);
game.delayx();
for(var card of cards) player.equip(card);
@ -290,29 +288,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
subSkill:{
blocker:{
mod:{
canBeReplaced:function(card,player){
if(player.getStorage('qiexie_blocker').contains(card)) return false;
},
},
charlotte:true,
onremove:true,
trigger:{player:'equipEnd'},
forced:true,
firstDo:true,
priority:Infinity,
filter:function(event){
var evt=event.getParent();
if(evt.name!='qiexie') return false;
return !evt.next.some(event=>{
return event.name=='equip';
})
},
content:function(){
player.removeSkill('qiexie_blocker');
},
},
destroy:{
trigger:{player:'loseBegin'},
equipSkill:true,
@ -347,12 +322,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var distance=get.distance(player,target);
return !game.hasPlayer(current=>(current!=target&&player.inRange(current)&&get.distance(player,current)>distance));
},
selectTarget:[0,1],
filterOk:function(){
var player=_status.event.player;
if(game.hasPlayer(target=>lib.skill.cuijue.filterTarget('SB',player,target))) return ui.selected.targets.length>0;
return true;
},
position:'he',
check:card=>6-get.value(card),
complexTarget:true,
check:card=>{
var player=_status.event.player,goon=0;
try{
ui.selected.cards.add(card);
if(game.hasPlayer(target=>{
return lib.skill.cuijue.filterTarget('SB',player,target);
})){
goon=6;
}
}catch(e){}
ui.selected.cards.remove(card);
return goon-get.value(card);
},
content:function(){
player.addTempSkill('cuijue_used','phaseUseAfter');
player.markAuto('cuijue_used',[target]);
target.damage('nocard');
if(target){
player.addTempSkill('cuijue_used','phaseUseAfter');
player.markAuto('cuijue_used',[target]);
target.damage('nocard');
}
},
ai:{
order:2,
@ -7375,7 +7371,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
qiexie:'挈挟',
qiexie_info:'锁定技。准备阶段,你在剩余武将牌堆中随机观看五张牌,选择其中的任意张,将其按照如下规则转化为武器牌置入你的武器栏:{⒈此牌不具有花色,且其攻击范围和点数等于此武将牌的体力上限。⒉此武器牌的技能为该武将牌上所有描述中包含“【杀】”且不具有锁定技以外的标签的技能。⒊此武器牌离开你的装备区时,改为放回武将牌堆。}',
cuijue:'摧决',
cuijue_info:'每回合每名角色限一次。出牌阶段,你可以弃置一张牌,然后对攻击范围内距离最远的一名其他角色造成1点伤害。',
cuijue_info:'每回合每名角色限一次。出牌阶段,你可以弃置一张牌,并可以选择攻击范围内距离最远的一名其他角色造成1点伤害。',
extra_feng:'神话再临·风',
extra_huo:'神话再临·火',

View File

@ -6569,6 +6569,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 0"
if(_status.connectMode) event.time=lib.configOL.choose_timeout;
event.videoId=lib.status.videoId++;
var maxScore = Math.max(2,1+player.countMark('yufeng'));
if(player.isUnderControl()){
game.swapPlayerAuto(player);
}
@ -6577,7 +6578,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.countChoose();
setTimeout(function(){
_status.imchoosing=false;
var max=Math.max(2,1+game.me.countMark('yufeng'));
var max=Math.max(2,1+player.countMark('yufeng'));
var score=Math.random()<0.5?max:get.rand(1,max);
event._result={
bool:true,
@ -6595,14 +6596,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var str=get.translation(player)+'正在表演《御风飞行》...<br>';
ui.create.dialog(str).videoId=id;
};
var chooseButton=function(){lib.skill.yufeng.$playFlappyBird()};
var chooseButton=function(maxScore){lib.skill.yufeng.$playFlappyBird(maxScore)};
//event.switchToAuto=switchToAuto;
game.broadcastAll(createDialog,player,event.videoId);
if(event.isMine()){
chooseButton();
chooseButton(maxScore);
}
else if(event.isOnline()){
event.player.send(chooseButton);
event.player.send(chooseButton,maxScore);
event.player.wait();
game.pause();
}
@ -6651,7 +6652,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
else player.draw(event.score);
},
$playFlappyBird:function(){
$playFlappyBird:function(maxScore,title){
//Forked from: https://github.com/aaarafat/JS-Flappy-Bird
const event=_status.event;
@ -6679,7 +6680,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
canvas.style.border='3px solid';
const RAD = Math.PI / 180;
const maxScore = Math.max(2,1+game.me.countMark('yufeng'));
const ctx=canvas.getContext('2d');
let frames = 0;
let dx = 0.1;
@ -6814,13 +6814,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(UI.score.curr >= maxScore){
state.curr = state.gameSuccess;
this.timeElapsed = 0;
updateText('御风飞行表演成功!')
updateText(`${title||'御风飞行'}表演成功!`)
setTimeout(switchToAuto,2000);
}
else if (this.y + r >= gnd.y || this.collisioned()) {
state.curr = state.gameOver;
this.timeElapsed = 0;
updateText('御风飞行表演失败……')
updateText(`${title||'御风飞行'}表演失败……`)
setTimeout(switchToAuto,2000);
}
@ -6889,6 +6889,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const UI = {
getReady: { sprite: new Image() },
gameOver: { sprite: new Image() },
gameClear: { sprite: new Image() },
tap: [{ sprite: new Image() }, { sprite: new Image() }],
score: {
curr: 0,
@ -6917,7 +6918,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
this.tx = parseFloat(canvas.width - this.tap[0].sprite.width) / 2;
this.ty =
this.y + this.gameOver.sprite.height - this.tap[0].sprite.height;
ctx.drawImage(this.gameOver.sprite, this.x, this.y);
ctx.drawImage((state.curr == state.gameOver ? this.gameOver : this.gameClear).sprite, this.x, this.y);
}
},
update: function () {
@ -6935,7 +6936,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
bg.sprite.src = lib.assetURL+"image/flappybird/BG.png";
pipe.top.sprite.src = lib.assetURL+"image/flappybird/toppipe.png";
pipe.bot.sprite.src = lib.assetURL+"image/flappybird/botpipe.png";
UI.gameOver.sprite.src = lib.assetURL+"image/flappybird/go.png";
UI.gameOver.sprite.src = lib.assetURL+"image/flappybird/gameover.png";
UI.gameClear.sprite.src = lib.assetURL+"image/flappybird/gameclear.png";
UI.getReady.sprite.src = lib.assetURL+"image/flappybird/getready.png";
UI.tap[0].sprite.src = lib.assetURL+"image/flappybird/tap/t0.png";
UI.tap[1].sprite.src = lib.assetURL+"image/flappybird/tap/t1.png";

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B