删除 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>
143 lines
4.0 KiB
JavaScript
143 lines
4.0 KiB
JavaScript
var eqw_Logic=eqw_Logic||{};
|
|
eqw_Logic.GameStart=function(){
|
|
eqw_Desk.Create();
|
|
for(var i=0;i<eqw_Const.UnClickBtn.length;i++){
|
|
set_self(eqw_Const.UnClickBtn[i],41,0,0,0);
|
|
}
|
|
}
|
|
eqw_Logic.ChangeToStatus=function(seat){//将座位转化为对应位置
|
|
return (seat-Utl.getMySeat()+Game_Config.Max.PlayerCnt)%Game_Config.Max.PlayerCnt;
|
|
}
|
|
eqw_Logic.ChangeToSeat=function(status){//将位置转化为座位
|
|
|
|
return (status+Utl.getMySeat())%Game_Config.Max.PlayerCnt;
|
|
}
|
|
eqw_Logic.power2fs=function(x) {
|
|
return (x & ( x - 1)) === 0 ? (x == 1 ? 0 : (x-1).toString(2).length): false;
|
|
}
|
|
//获取某个位置玩家发到手上的牌
|
|
eqw_Logic.get_seat_cards_deal = function(cards, seat){
|
|
var aryCardIDs = [];
|
|
for (var i = 0; i < cards.length; i++){
|
|
var o_card = cards[i];
|
|
if (o_card[4] == seat + 1){
|
|
aryCardIDs.push(o_card[0]);
|
|
}
|
|
}
|
|
return cls_youle_erqiwang_arith.order_cards(eqw_Desk.MainCard, aryCardIDs);
|
|
}
|
|
|
|
//获取某个位置玩家发到手上的牌(庄家包含底牌)
|
|
eqw_Logic.get_seat_cards_owner = function(cards, seat){
|
|
var aryCardIDs = [];
|
|
for (var i = 0; i < cards.length; i++){
|
|
var o_card = cards[i];
|
|
if ((o_card[4] == seat + 1) || //发到手上
|
|
(o_card[4] == 0 && seat == eqw_Desk.BankerSeat)){ //庄家包括底牌
|
|
aryCardIDs.push(o_card[0]);
|
|
}
|
|
}
|
|
return cls_youle_erqiwang_arith.order_cards(eqw_Desk.MainCard, aryCardIDs);
|
|
}
|
|
//获取埋牌
|
|
eqw_Logic.get_bury_cards = function(cards){
|
|
var aryCardIDs = [];
|
|
for (var i = 0; i < cards.length; i++){
|
|
var o_card = cards[i];
|
|
if (o_card[5] == 0){
|
|
aryCardIDs.push(o_card[0]);
|
|
}
|
|
}
|
|
return cls_youle_erqiwang_arith.order_cards(eqw_Desk.MainCard, aryCardIDs);
|
|
}
|
|
//获取发牌时的底牌
|
|
eqw_Logic.get_bottom_cards = function(cards){
|
|
var aryCardIDs = [];
|
|
for (var i = 0; i < cards.length; i++){
|
|
var o_card = cards[i];
|
|
if (o_card[4] == 0){
|
|
aryCardIDs.push(o_card[0]);
|
|
}
|
|
}
|
|
return cls_youle_erqiwang_arith.order_cards(eqw_Desk.MainCard, aryCardIDs);
|
|
}
|
|
//判断是否可以发牌
|
|
eqw_Logic.CheckDealCards = function(){
|
|
|
|
|
|
}
|
|
eqw_Logic.play_bujiao = function(sex){
|
|
switch(sex){
|
|
default://男
|
|
var num = eqw_Const.soundsList.man_passcall.length;
|
|
var idx = ifast_random(num);
|
|
Utl.playSound(eqw_Const.soundsList.man_passcall[idx]);
|
|
break;
|
|
case 2://女
|
|
var num = eqw_Const.soundsList.woman_passcall.length;
|
|
var idx = ifast_random(num);
|
|
Utl.playSound(eqw_Const.soundsList.woman_passcall[idx]);
|
|
break;
|
|
}
|
|
}
|
|
|
|
eqw_Logic.play_jiaofen = function(sex,call){
|
|
switch(sex){
|
|
default://男
|
|
var idx1 = parseInt(call/5)-1;
|
|
var num = eqw_Const.soundsList.man_call[idx1].length;
|
|
var idx = ifast_random(num);
|
|
Utl.playSound(eqw_Const.soundsList.man_call[idx1][idx]);
|
|
break;
|
|
case 2://女
|
|
var idx1 = parseInt(call/5)-1;
|
|
var num = eqw_Const.soundsList.woman_call[idx1].length;
|
|
var idx = ifast_random(num);
|
|
Utl.playSound(eqw_Const.soundsList.woman_call[idx1][idx]);
|
|
break;
|
|
}
|
|
}
|
|
eqw_Logic.play_flower = function(sex,flower){
|
|
switch(sex){
|
|
default://男
|
|
var num = eqw_Const.soundsList.man_flower[flower-1].length;
|
|
var idx = ifast_random(num);
|
|
Utl.playSound(eqw_Const.soundsList.man_flower[flower-1][idx]);
|
|
break;
|
|
case 2://女
|
|
var num = eqw_Const.soundsList.woman_flower[flower-1].length;
|
|
var idx = ifast_random(num);
|
|
Utl.playSound(eqw_Const.soundsList.woman_flower[flower-1][idx]);
|
|
break;
|
|
}
|
|
}
|
|
eqw_Logic.play_banker = function(){
|
|
Utl.playSound(eqw_Const.soundsList.banker);
|
|
}
|
|
eqw_Logic.play_outpoker = function(){
|
|
Utl.playSound(eqw_Const.soundsList.outpoker);
|
|
}
|
|
eqw_Logic.play_dealcards = function(){
|
|
Utl.playSound(eqw_Const.soundsList.dealcards);
|
|
}
|
|
eqw_Logic.play_burry = function(){
|
|
Utl.playSound(eqw_Const.soundsList.burry);
|
|
}
|
|
eqw_Logic.play_timeup = function(){
|
|
Utl.playSound(eqw_Const.soundsList.timeup);
|
|
}
|
|
eqw_Logic.play_singlebalance = function(){
|
|
Utl.playSound(eqw_Const.soundsList.singlebalance);
|
|
}
|
|
eqw_Logic.play_balance = function(){
|
|
Utl.playSound(eqw_Const.soundsList.balance);
|
|
}
|
|
eqw_Logic.play_score = function(){
|
|
Utl.playSound(eqw_Const.soundsList.score);
|
|
}
|
|
|
|
|
|
|
|
|
|
|