Add custom mapping, random mapping, (custom) hitsound to lib.element.content.chooseToPlayBeatmap, and game.generateBeatmapTimeleap, and new beatmaps.

This commit is contained in:
Tipx-L 2023-08-09 10:41:07 -07:00
parent 2c4ee2e5f6
commit 1b4ac04fba
10 changed files with 112 additions and 11 deletions

Binary file not shown.

BIN
audio/effect/chickun.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/effect/hitsound.wav Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/effect/pigstep.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4110,7 +4110,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
{
name:'ignotus',
filename:'ignotus',
timeleap:[0,1412,2824,4235,5647,5824,7059,8294,8471,9882,10941,11294,12000,12706,13412,14118,14824,15529,15882,16059,16235,16412,16588],
//Number of tracks
//轨道数量
number_of_tracks:4,
//Customize the track to generate for every note (0 is the first track)
//自定义每个音符生成的轨道0是第一个轨道
mapping:[0,2,3,1,1,0,3,0,0,3,0,0,2,1,2],
//Convert from beats (0 is the first beat) to timeleap
//将节拍0是第一拍转换为开始时间点
timeleap:game.generateBeatmapTimeleap(170,[0,4,8,12,14,16,16.5,23.5,24,31,32,40,45,46,47]),
current:-110,
judgebar_height:0.16,
range1:[84,110],
@ -4123,6 +4131,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
{
name:'Super Mario 3D World Theme',
filename:'sm3dw_overworld',
//Random (Randomly choose tracks to generate notes each play)
//随机(每次演奏时音符会随机选择轨道生成)
mapping:'random',
timeleap:[0,1071,1518,2054,4018,4286,5357,6429,7500,8571,9643,10714,11786,12321,12589,12857,13929,15000,16071,17143,18214,18482,18750,19018,19286,20357],
current:-110,
judgebar_height:0.16,
@ -4133,6 +4144,67 @@ game.import('character',function(lib,game,ui,get,ai,_status){
node_color:'linear-gradient(rgba(120, 130, 240, 1), rgba(100, 100, 230, 1))',
judgebar_color:'linear-gradient(rgba(230, 40, 30, 1), rgba(220, 30, 10, 1))',
},
{
name:'只因你太美',
filename:'chicken_you_are_so_beautiful',
number_of_tracks:7,
mapping:[3,6,4,5,6,2,3,2,1,2,0,4,3,6,5,4,3,6,3,2,3,1,0,1,2,3,4,5,6],
timeleap:game.generateBeatmapTimeleap(107,[2,3.5,4.5,5.5,6.5,8.5,10,11.5,12.5,13.5,14.5,15.5,18,19.5,20.5,21.5,22.5,24.5,26,27.5,28.5,29.5,30.5,31,31.5,32,32.5,33,33.5]),
//Hitsound file name (By default in the audio/effect folder. To redirect to the extension, please write in the format of 'ext:extension_name')
//打击音文件名默认在audio/effect文件夹下 若要重定向到扩展 请写为'ext:扩展名称'的格式)
hitsound:'chickun.wav',
current:-110,
judgebar_height:0.16,
range1:[84,110],
range2:[90,104],
range3:[94,100],
speed:25,
node_color:'linear-gradient(#99f, #66c)',
judgebar_color:'linear-gradient(#ccf, #99c)',
},
{
name:'Croatian Rhapsody',
filename:'croatian_rhapsody',
mapping:[4,1,2,1,0,0,4,5,1,3,2,1,0,0],
timeleap:game.generateBeatmapTimeleap(96,[4,6,8,9,10,11,12,13.5,14,15.5,16,17,18,19]),
current:-110,
judgebar_height:0.16,
range1:[84,110],
range2:[90,104],
range3:[94,100],
speed:25,
node_color:'linear-gradient(#fff, #ccc)',
judgebar_color:'linear-gradient(#fff, #ccc)',
},
{
name:'罗刹海市',
filename:'rakshasa_sea_city',
number_of_tracks:7,
mapping:'random',
timeleap:game.generateBeatmapTimeleap(150,[0,2,4,6,7,9,11,13,14,16,18,20,21,23,25,27]),
current:-110,
judgebar_height:0.16,
range1:[84,110],
range2:[90,104],
range3:[94,100],
speed:25,
node_color:'linear-gradient(#333, #000)',
judgebar_color:'linear-gradient(#c66, #933)',
},
{
name:'Pigstep (Stereo Mix)',
filename:'pigstep',
number_of_tracks:16,
timeleap:game.generateBeatmapTimeleap(170,[3,4,6,6.5,7.5,11,12,14,14.5,15.5,19,20,22,22.5,23.5,27,28,30,30.5,31.5,35,36,38,38.5,39.5,43,44,46,46.5,47.5,51,52,54,54.5,55.5,59,60,62,62.5]),
current:-110,
judgebar_height:0.16,
range1:[84,110],
range2:[90,104],
range3:[94,100],
speed:25,
node_color:'linear-gradient(#066, #033)',
judgebar_color:'linear-gradient(#633, #300)',
},
],
derivation:'chongxu_faq',
},
@ -13427,7 +13499,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
chongxu:'冲虚',
chongxu_info:'出牌阶段限一次你可以随机演奏一首音乐并根据完成度来获得相应的分数至多五分。然后你可修改〖妙剑〗或〖莲华〗消耗3分并使用剩余的分数进行摸牌每张2分。',
chongxu_faq:'目前的曲库',
chongxu_faq_info:' <br>《鸟之诗》- 折户伸治<br>《竹取飛翔 ~ Lunatic Princess》- ZUN<br>《ignotus》- ak+q<br>《Super Mario 3D World Theme》- 横田真人',
chongxu_faq_info:' <br>《鸟之诗》- 折户伸治<br>《竹取飛翔 ~ Lunatic Princess》- ZUN<br>《ignotus》- ak+q<br>《Super Mario 3D World Theme》- 横田真人<br>《只因你太美》- SWIN-S<br>《Croatian Rhapsody》- Maksim<br>《罗刹海市》- 刀郎<br>《Pigstep (Stereo Mix)》- Lena Raine',
miaojian:'妙剑',
miaojian_info:'出牌阶段限一次。你可将一张【杀】当做刺【杀】使用,或将一张锦囊牌当做【无中生有】使用。',
miaojian1:'妙剑·改',

View File

@ -11107,8 +11107,23 @@
//初始化一堆变量
var score=0;
var added=timeleap.length;
var number_of_tracks=beatmap.number_of_tracks||6;
var custom_mapping=Array.isArray(beatmap.mapping);
var mapping=custom_mapping?beatmap.mapping.slice():beatmap.mapping;
var hitsound=beatmap.hitsound||'hitsound.wav';
if(hitsound.indexOf('ext:')==0) hitsound=lib.assetURL+'extension/'+hitsound.slice(4);
else hitsound=lib.assetURL+'audio/effect/'+hitsound;
var hitsound_audio=new Audio(hitsound);
hitsound_audio.volume=0.25;
var abs=1;
var node_pos=0;
if(custom_mapping){
node_pos=mapping.shift();
}
else if(mapping=='random'){
abs=Math.floor(Math.random()*number_of_tracks);
node_pos=abs;
}
var combo=0;
var max_combo=0;
var nodes=[];
@ -11190,11 +11205,11 @@
node.style["border-radius"]='3px';
node.style.position='absolute';
node.style.height=Math.ceil(height/10)+'px';
node.style.width=Math.ceil(width/6)-10+'px';
node.style.width=Math.ceil(width/number_of_tracks)-10+'px';
node._position=get.utc();
event.dialog.appendChild(node);
node.style.left=Math.ceil(width*node_pos/6+5)+'px';
node.style.left=Math.ceil(width*node_pos/number_of_tracks+5)+'px';
node.style.top='-'+(Math.ceil(height/10))+'px';
ui.refresh(node);
node.style.transition='all '+speed*110+'ms linear';
@ -11208,14 +11223,25 @@
}
},speed*110);
node_pos+=abs;
if(node_pos>5){
abs=-1;
node_pos=4;
if(custom_mapping){
node_pos=mapping.shift();
}
else if(node_pos<0){
abs=1;
node_pos=1;
else if(mapping=='random'){
while(node_pos==abs){
node_pos=Math.floor(Math.random()*number_of_tracks);
}
abs=node_pos;
}
else{
node_pos+=abs;
if(node_pos>number_of_tracks-1){
abs=-1;
node_pos=number_of_tracks-2;
}
else if(node_pos<0){
abs=1;
node_pos=1;
}
}
if(timeleap.length){
setTimeout(function(){
@ -11261,6 +11287,8 @@
if(player.damagepopups.length) player.$damagepop();
combo++;
max_combo=Math.max(combo,max_combo);
hitsound_audio.currentTime=0;
if(hitsound_audio.paused) hitsound_audio.play();
break;
}
};
@ -31007,6 +31035,7 @@
],
};
var game={
generateBeatmapTimeleap:(bpm,beats,offset)=>beats.map(value=>Math.round(value*60000/bpm+(offset||0))),
updateRenku:function(){
game.broadcast(function(renku){
_status.renku=renku;