删除 YouleNexus 内嵌 .git,统一由根仓库唯一管理。提交: - projects/ 旧 H5 模板 Game_Surface_3 与各子游戏源码 - cocoscreator_projects/YouleNexus 工程 + cocos-creator-mcp 扩展源码 - CLAUDE.md、.mcp.json 等配置 library/temp/node_modules/dist 等缓存由 .gitignore 排除。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
187 lines
4.4 KiB
JavaScript
187 lines
4.4 KiB
JavaScript
//定时器 在 gameabc_face.ontimer 中调用
|
|
var All_timer = {
|
|
//定时器id设置
|
|
recovery : 1064, //回放牌局
|
|
clock : id_config.clock, //钟定时器
|
|
put_err: id_config.put_err, //出牌错误
|
|
mingpai:1501, //明牌隐藏
|
|
aset:1807, //小局显示
|
|
feiji:1510, //飞机隐藏
|
|
huojian:1511, //火箭出烟
|
|
zhuomian:1512, //桌面抖动
|
|
zhadanzi:1800, //炸弹字
|
|
jiaofen :1803, //叫分结束
|
|
wzsy :1509, //王炸声音特效
|
|
}
|
|
All_timer.hide = function(){
|
|
set_self(All_timer.clock,57,0,0,0);
|
|
set_self(All_timer.put_err,57,0,0,0);
|
|
set_self(All_timer.recovery,57,0,0,0);
|
|
set_self(All_timer.mingpai,57,0,0,0);
|
|
set_self(All_timer.aset,57,0,0,0);
|
|
set_self(All_timer.feiji,57,0,0,0);
|
|
set_self(All_timer.huojian,57,0,0,0);
|
|
set_self(All_timer.zhuomian,57,0,0,0);
|
|
set_self(All_timer.zhadanzi,57,0,0,0);
|
|
set_self(All_timer.jiaofen,57,0,0,0);
|
|
set_self(All_timer.wzsy,57,0,0,0);
|
|
All_timer.hide1();
|
|
}
|
|
All_timer.time = {
|
|
|
|
}
|
|
All_timer.time_r = function(){
|
|
//定时器时间设置
|
|
All_timer.time.dealcard = 100; //发牌
|
|
All_timer.time.recovery = 2000; //回放牌局
|
|
All_timer.time.clock = 1000; //钟
|
|
All_timer.time.put_err = 3000; //出牌错误
|
|
All_timer.time.mingpai = 1500; //明牌隐藏
|
|
All_timer.time.aset = 3000; //小局
|
|
All_timer.time.feiji = 1000; //飞机隐藏
|
|
All_timer.time.huojian = 200; //火箭出烟
|
|
All_timer.time.zhuomian = 10; //桌面抖动
|
|
All_timer.time.zhadanzi = 1000; //炸弹字
|
|
All_timer.time.jiaofen = 1000; //叫分结束
|
|
All_timer.time.wzsy = 15000; //王炸声音结束
|
|
}
|
|
|
|
All_timer.timer = function(gameid , spid , times , timelong , alltimes){
|
|
switch (spid){
|
|
case All_timer.clock://时钟
|
|
if(Public_data.current>0){
|
|
Public_data.current--;
|
|
}else{
|
|
set_self(All_timer.clock,57,0,0,0);
|
|
}
|
|
if (Public_data.current == 10 || Public_data.current <=3 ) {
|
|
Utl.playSound(Sound.sjtx);
|
|
}
|
|
set_self(id_config.time_id,7,Public_data.current,0,0);
|
|
set_self(id_config.time_id,20,id_config.time_size*(ifast_inttostr(Public_data.current).length),0,0);
|
|
set_self(id_config.time_id,18,id_config.clock_x[Utl.changeToStatus(Public_data.data.control)]+id_config.time_clock_x-(ifast_inttostr(Public_data.current).length-1)*id_config.time_size/2,0,0);
|
|
break;
|
|
case All_timer.recovery://回放
|
|
if (Public_data.recovery.num+1<Public_data.recovery.pjhf.length-1) {
|
|
Public_data.recovery.num ++;
|
|
Public_data.Recovery();
|
|
|
|
Recovery.button();
|
|
set_self(id_config.retreat,41,1,0,0);
|
|
}else{
|
|
Recovery.Card_Game.hide();//关闭定时器
|
|
Game_Modify.over(msgrecovery);
|
|
}
|
|
break;
|
|
case All_timer.put_err://出牌错误
|
|
All_ani.put_err.show(1);
|
|
set_self(All_timer.put_err,57,0,0,0);
|
|
break;
|
|
case All_timer.mingpai://明牌开始隐藏隐藏
|
|
All_ani.mingpai.show(mingpaidonghua);
|
|
set_self(All_timer.mingpai,57,0,0,0);
|
|
break;
|
|
case All_timer.aset://小局显示
|
|
asetover();
|
|
set_self(All_timer.aset,57,0,0,0);
|
|
break;
|
|
case All_timer.feiji://飞机界面隐藏
|
|
for (var i = 0; i < 19; i++) {
|
|
set_self(id_config.feiji+i,37,0,0,0);
|
|
play_ani(1,id_config.feiji+i,0);
|
|
}
|
|
set_self(All_timer.feiji,57,0,0,0);
|
|
break;
|
|
case All_timer.huojian://火箭出烟
|
|
for (var i = 0; i < Public_data.data.maxman; i++) {
|
|
if (get_self(id_config.huojian+i,37,0,0,0) ==1) {
|
|
set_self(id_config.yan+i,37,1,0,0);
|
|
set_self(id_config.yan+i,18,id_config.yan_x[i],0,0);
|
|
play_ani(1,id_config.yan+i,43,0,8,0,1000,0,0,0,1,0,0);
|
|
break;
|
|
}
|
|
}
|
|
All_ani.zhuomian.show();
|
|
set_self(All_timer.huojian,57,0,0,0);
|
|
break;
|
|
case All_timer.zhuomian://桌面抖动
|
|
set_selfdiv('ifastgame',18,ifast_random(20)-10,0,0);
|
|
set_selfdiv('ifastgame',19,ifast_random(20)-10,0,0);
|
|
zmcs++;
|
|
if (zmcs==15)
|
|
{
|
|
zmcs = 0;
|
|
set_selfdiv('ifastgame',18,0,0,0);
|
|
set_selfdiv('ifastgame',19,0,0,0);
|
|
set_self(All_timer.zhuomian,57,0,0,0);
|
|
};
|
|
break;
|
|
case All_timer.zhadanzi://炸弹字
|
|
All_ani.zhadan.hide();
|
|
All_ani.wangzha.hide();
|
|
set_self(All_timer.zhadanzi,57,0,0,0);
|
|
break;
|
|
case All_timer.jiaofen://叫分结束
|
|
set_group(204,37,0,0,0);
|
|
jiabeixs();
|
|
clock(1); //时钟显示
|
|
dipaishu();
|
|
set_self(All_timer.jiaofen,57,0,0,0);
|
|
break;
|
|
case All_timer.wzsy://王炸音效结束
|
|
Utl.stopMusic();
|
|
Game_Config.soundList.MainSceneMusic = "00108.mp3";//王炸声音特效
|
|
Utl.playMusic();
|
|
set_self(All_timer.wzsy,57,0,0,0);
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|