目录结构调整

This commit is contained in:
2026-02-04 23:47:45 +08:00
parent 6938c911c3
commit 6b22238c6e
8780 changed files with 15333 additions and 574 deletions

View File

@@ -0,0 +1,850 @@
function Player(){
this.userid = "";//玩家ID
this.exp=0;//经验
this.level=1;//等级
this.mode = -1;//当前进行的游戏模式
this.nickname = "";//玩家昵称
this.score = 0;//当前游戏得分
this.highscore = [0,0,0,0,0];//历史最高分
this.rank = [-1,-1,-1,-1,-1];//当前排行
this.win = 0;//连胜场数
this.crank = [0,0,0,0,0];//排行变化
this.gamesum = [0,0,0,0,0];//游戏盘数总数
this.gold = 500;//游戏金币
this.paygold=0;//充值金币
this.items = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
this.gift=[];//礼包
this.box=[];//宝箱
this.signin=[0,0,0,-1];//签到天数
this.firstpay=[];
this.music=[1,1];
this.img="";
this.mycode = -1;
}
if(typeof(Player.prototype.setdata) == "undefined"){
Player.prototype.setdata = function(data){//设置玩家信息
//if(data.rank.length!=5){logmessage("排名数据出错:rank.length="+data.rank.length);return;}//排名数据出错
//if(data.crank.length!=5){logmessage("排名变化数据出错:crank.length="+data.crank.length);return;}//排名变化数据出错
//if(data.gamesum.length!=5){logmessage("游戏盘数数据出错:gamesum.length="+data.gamesum.length);return;}//游戏盘数数据出错
//if(data.items.length!=20){logmessage("装备数据出错:items.length="+data.items.length);return;}//装备数据出错
//this.userid = data.userid;//玩家ID
//this.mode = data.mode;
this.exp= data.exp;
this.mycode = data.mycode;
this.highscore = data.highscore;
//this.nickname = data.nickname;//玩家昵称
//this.score = data.score;//当前游戏得分
//this.gamesum = data.gamesum;//游戏盘数总数
this.gold = data.gold;//游戏金币
this.paygold = data.paygold;//充值金币
//this.rank=data.rank;
//this.crank=data.crank;
this.music=data.music;
this.items=data.items
//this.gamesum=data.gamesum;
this.gift=data.gift;
this.box=data.box;
this.signin=data.signin;
this.firstpay=data.firstpay;
var expone = (this.level+1)*(this.level+1)/100;
expPer = parseInt(this.exp/expone);
//for(var i=0;i<data.rank.length;i++){
//this.rank[i] = data.rank[i];
//}
//for(var i=0;i<data.crank.length;i++){
//this.crank[i]=data.crank;
//}
//for(var i=0;i<data.gamesum.length;i++){
//this.gamesum[i]=data.gamesum;
//}
//for(var i=0;i<data.items.length;i++){
//this.items[i]=data.items[i];
//}
};
}
if(typeof(Player.prototype.setWxInfo) == "undefined"){
Player.prototype.setWxInfo = function(nickname,userid,img){//进入游戏
this.nickname = nickname;
this.userid = userid;
this.img=img;
};
}
if(typeof(Player.prototype.playgame) == "undefined"){
Player.prototype.playgame = function(mode){//进入游戏
this.mode = mode;
this.score = 0;
utlnewgame(mode);
};
}
if(typeof(Player.prototype.changeMusic) == "undefined"){
Player.prototype.changeMusic = function(mode,v){//更改音效设置
this.music[mode] = v;
var dt={};
dt.data=this.music;
dt.sign = this.signin;
dt = ifast_jsontostring(dt);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s6="+data,function(){},function(){});
var data = {};
data.appid = APPID;
data.where_business_id = B_ID;
data.where_table_id = PlayerChart;
data.devkey = DEV_KEY;
data.where_s1 = g_player.userid;
data.s6 = dt;
AjaxHttp("/edit",data,function(){},function(){});
};
}
if(typeof(Player.prototype.getexp) == "undefined"){
Player.prototype.getexp = function(){//获得经验
var v = this.level;
var lvupTemp=0;
var lvTemp = this.level;
var expTemp;
var expValue = this.exp+=v;
while(expValue>0){
expValue-=(lvTemp+1)*(lvTemp+1);
if(expValue>=0){
expTemp = expValue;
lvupTemp++;
lvTemp++;
}else{
expTemp=expValue+(lvTemp+1)*(lvTemp+1);
}
}
//logmessage("升级等级 = "+lvupTemp+"经验 = "+expTemp);
if(lvupTemp>0){
//logmessage("升级!");
this.level+=lvupTemp;
}
this.exp=expTemp;
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&t4="+g_player.level+"&t5="+g_player.exp,function(){},function(){});
var data = {};
data.appid = APPID;
data.where_business_id = B_ID;
data.where_table_id = PlayerChart;
data.devkey = DEV_KEY;
data.where_s1 = g_player.userid;
data.t4 = g_player.level;
data.t5 = g_player.exp;
AjaxHttp("/edit",data,function(){},function(){});
var expone = (this.level+1)*(this.level+1)/100;
expPer = parseInt(expTemp/expone);
};
}
if(typeof(Player.prototype.sign) == "undefined"){
Player.prototype.sign = function(dist){//签到
if(this.signin[1]==0){
this.signin[0]++;
this.signin[1]=1;
this.signin[3]=dist;
var dt={};
dt.data=this.music;
dt.sign = this.signin;
dt = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s6="+data,function(){},function(){});
var data = {};
data.appid = APPID;
data.where_business_id = B_ID;
data.where_table_id = PlayerChart;
data.devkey = DEV_KEY;
data.where_s1 = this.userid;
data.s6 = dt;
AjaxHttp("/edit",data,function(){},function(){});
switch(this.signin[0]){
case 1:
//set_self(307,7,"恭喜获得50金币",0,0,0);
this.changegold(50);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 2:
//set_self(307,7,"恭喜获得初级变化道具",0,0,0);
this.additem(2,1);
updateItems();
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 3:
//set_self(307,7,"恭喜获得100金币",0,0,0);
this.changegold(100);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 4:
//set_self(307,7,"恭喜获得150金币",0,0,0);
this.changegold(150);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 5:
//set_self(307,7,"恭喜获得木质宝箱",0,0,0);
this.addbox(0,1);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 6:
//set_self(307,7,"恭喜获得50金币",0,0,0);
this.changegold(50);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 7:
//set_self(307,7,"恭喜获得道具高级变化",0,0,0);
this.additem(0,1);
updateItems();
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 8:
//set_self(307,7,"恭喜获得100金币",0,0,0);
this.changegold(100);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 9:
//set_self(307,7,"恭喜获得150金币",0,0,0);
this.changegold(150);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 10:
//set_self(307,7,"恭喜获得铜质宝箱",0,0,0);
this.addbox(1,1);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 11:
//set_self(307,7,"恭喜获得50金币",0,0,0);
this.changegold(50);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 12:
//set_self(307,7,"恭喜获得道具随机消除",0,0,0);
this.additem(4,1);
updateItems();
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 13:
//set_self(307,7,"恭喜获得100金币",0,0,0);
this.changegold(100);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 14:
//set_self(307,7,"恭喜获得150金币",0,0,0);
this.changegold(150);
set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
set_self(307,19,500,0,0);
set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 15:
//set_self(307,7,"恭喜获得银质宝箱",0,0,0);
this.addbox(2,1);
set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
set_self(307,19,500,0,0);
set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 16:
//set_self(307,7,"恭喜获得50金币",0,0,0);
this.changegold(50);
set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
set_self(307,19,500,0,0);
set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 17:
//set_self(307,7,"恭喜获得道具指定消除",0,0,0);
this.additem(3,1);
updateItems();
set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
set_self(307,19,500,0,0);
set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 18:
//set_self(307,7,"恭喜获得100金币",0,0,0);
this.changegold(100);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 19:
//set_self(307,7,"恭喜获得150金币",0,0,0);
this.changegold(150);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 20:
//set_self(307,7,"恭喜获得金质宝箱",0,0,0);
this.addbox(3,1);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 21:
//set_self(307,7,"恭喜获得50金币",0,0,0);
this.changegold(50);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 22:
//set_self(307,7,"恭喜获得全能魔法",0,0,0);
this.additem(1,1);
updateItems();
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 23:
//set_self(307,7,"恭喜获得100金币",0,0,0);
this.changegold(100);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 24:
//set_self(307,7,"恭喜获得150金币",0,0,0);
this.changegold(150);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 25:
//set_self(307,7,"恭喜获得钻石宝箱",0,0,0);
this.addbox(4,1);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 26:
//set_self(307,7,"恭喜获得50金币",0,0,0);
this.changegold(50);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 27:
//set_self(307,7,"恭喜获得全能魔法",0,0,0);
this.additem(5,1);
updateItems();
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 28:
//set_self(307,7,"恭喜获得100金币",0,0,0);
this.changegold(100);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 29:
//set_self(307,7,"恭喜获得150金币",0,0,0);
this.changegold(150);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
case 30:
//set_self(307,7,"恭喜获得钻石宝箱",0,0,0);
this.addbox(4,1);
//set_self(307,18,360-get_self(307,7,0,0,0).length*13.5,0,0);
//set_self(307,19,500,0,0);
//set_self(3,57,2000,0,0);
//set_self(307,37,1,0,0);
break;
}
set_self(217,7,this.signin[0],0,0);
set_self(217,20,get_self(217,7,0,0,0).length*18,0,0);
set_self(217,18,350-get_self(217,7,0,0,0).length*9,0,0);
return true;
}else{
return false;
}
};
}
if(typeof(Player.prototype.leavegame) == "undefined"){
Player.prototype.leavegame = function(){//离开游戏
//this.changehscore(this.score);
this.mode = -1;
this.score = 0;
};
}
if(typeof(Player.prototype.changegold) == "undefined"){
Player.prototype.changegold = function(v){//金币改变
if(this.gold+v<0){
return false;
}else{
this.gold+=v;
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&t2="+g_player.gold,function(){},function(){});
var data = {};
data.appid = APPID;
data.where_business_id = B_ID;
data.where_table_id = PlayerChart;
data.devkey = DEV_KEY;
data.where_s1 = this.userid;
data.t2 = g_player.gold;
AjaxHttp("/edit",data,function(){},function(){});
set_rec(141,this.gold);
set_self(205,7,this.gold,0,0);
set_self(205,20,get_self(205,7,0,0,0).length*18,0,0);
set_self(329,7,this.gold,0,0);
set_self(329,20,get_self(329,7,0,0,0).length*18,0,0);
return true;
}
};
}
if(typeof(Player.prototype.usec33) == "undefined"){
Player.prototype.usec33 = function(){//
if(this.paygold<PRICECLEAR){
return false;
}else{
this.paygold-=PRICECLEAR;
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&t3="+g_player.paygold,function(){},function(){});
var data = {};
data.appid = APPID;
data.where_business_id = B_ID;
data.where_table_id = PlayerChart;
data.devkey = DEV_KEY;
data.where_s1 = this.userid;
data.t3 = g_player.paygold;
AjaxHttp("/edit",data,function(){},function(){});
g_board.clear33();
return true;
}
};
}
if(typeof(Player.prototype.changepaygold) == "undefined"){
Player.prototype.changepaygold = function(v){//钻石改变
if(this.paygold+v<0){
return false;
}else{
this.paygold+=v;
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&t3="+g_player.paygold,function(){},function(){});
var data = {};
data.appid = APPID;
data.where_business_id = B_ID;
data.where_table_id = PlayerChart;
data.devkey = DEV_KEY;
data.where_s1 = this.userid;
data.t3 = g_player.paygold;
AjaxHttp("/edit",data,function(){},function(){});
set_rec(142,this.paygold);
set_self(206,7,this.paygold,0,0);
set_self(206,20,get_self(206,7,0,0,0).length*18,0,0);
set_self(311,7,this.paygold,0,0);
set_self(311,20,get_self(311,7,0,0,0).length*18,0,0);
set_self(313,7,this.paygold,0,0);
set_self(313,20,get_self(313,7,0,0,0).length*18,0,0);
set_self(330,7,this.paygold,0,0);
set_self(330,20,get_self(330,7,0,0,0).length*18,0,0);
return true;
}
};
}
if(typeof(Player.prototype.searchBag) == "undefined"){
Player.prototype.searchBag = function(){//查询背包当前可用容量
setBagData();
return 30-bagLen;
};
}
if(typeof(Player.prototype.addbox) == "undefined"){
Player.prototype.addbox = function(id,num){//获得宝箱
var bTemp=0;
for(var i=0;i<this.box.length;i++){
if(this.box[i][0]==id){
bTemp=1;
this.box[i][1]+=num;
updatebox();
//var data={};
//data.data=g_player.box;
//data = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s4="+data);
break;
}
}
if(bTemp==0){
if(this.searchBag()<=0){
showmessage("背包已满!");
}else{
this.box.push([id,num]);
C_Fun.sortArray(this.box,1,2,0);
updatebox();
//var data={};
//data.data=g_player.box;
//data = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s4="+data);
}
}
};
}
if(typeof(Player.prototype.openbox) == "undefined"){
Player.prototype.openbox = function(id){//打开宝箱
var bTemp=0;
for(var i=0;i<this.box.length;i++){
if(this.box[i][0]==id){
bTemp=1;
switch(id){
case 0:
var arr=[0,2,3,4];
var itemid = ifast_random(4);
this.additem(itemid,1);
itemid = ifast_random(4);
this.additem(itemid,1);
break;
case 1:
var arr=[0,2,3,4];
this.additem(0,1);
var itemid = ifast_random(4);
this.additem(itemid,1);
itemid = ifast_random(4);
this.additem(itemid,1);
break;
case 2:
this.additem(0,1);
var itemid = ifast_random(6);
this.additem(itemid,1);
itemid = ifast_random(6);
this.additem(itemid,1);
break;
case 3:
var arr=[1,5];
var itemid = ifast_random(2);
this.additem(arr[itemid],1);
itemid = ifast_random(6);
this.additem(itemid,1);
itemid = ifast_random(6);
this.additem(itemid,1);
break;
case 4:
this.additem(1,1);
this.additem(5,1);
var itemid = ifast_random(6);
this.additem(itemid,1);
itemid = ifast_random(6);
this.additem(itemid,1);
break;
}
this.box[i][1]--;
if(this.box[i][1]==0){
C_Fun.removeByValue2(this.box,id,0);
}
updateItems();
updatebox();
//var boxdata={};
//boxdata.data=g_player.box;
//boxdata = ifast_jsontostring(boxdata);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s5="+boxdata);
setBagData();
openBag();
break;
}
}
if(bTemp==0){
showmessage("背包内未找到该宝箱id = "+id);
}
};
}
if(typeof(Player.prototype.addgift) == "undefined"){
Player.prototype.addgift = function(id,num){//购买礼包
var bTemp=0;
for(var i=0;i<this.gift.length;i++){
if(this.gift[i][0]==id){
bTemp=1;
this.gift[i][1]+=num;
updategift();
return true;
}
}
if(bTemp==0){
if(this.searchBag()<=0){
//logmessage("背包已满!");
return false;
}else{
var arr=[id,num];
var dt=findGiftById(id);
if(dt!=null){
arr.push(dt.img[0]);
arr.push(dt.img[1]);
for(var i=0;i<dt.data.length;i++){
arr.push(dt.data[i][0]);
arr.push(dt.data[i][1]);
}
this.gift.push(arr);
updategift();
}
return true;
}
}
};
}
if(typeof(Player.prototype.opengift) == "undefined"){
Player.prototype.opengift = function(id){//打开礼包
var bTemp=0;
for(var i=0;i<this.gift.length;i++){
if(this.gift[i][0]==id){
bTemp=1;
this.gift[i][1]--;
var giftdt = findGiftById(id);
if(giftdt!=null){
for(var k=0;k<giftdt.data.length;k++){
this.additem(giftdt.data[k][0],giftdt.data[k][1]);
}
}
updateItems();
if(this.gift[i][1]==0){
C_Fun.removeByValue2(this.gift,id,0);
}
updategift();
//var data={};
//data.data=g_player.gift;
//data = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s4="+data);
setBagData();
openBag();
break;
}
}
if(bTemp==0){
showmessage("背包内未找到该宝箱id = "+id);
return false
}else{
return true;
}
};
}
if(typeof(Player.prototype.changescore) == "undefined"){
Player.prototype.changescore = function(v){//改变分数
this.score += v;
if(g_player.highscore[g_player.mode]<g_player.score &&isTips==0){
set_self(350,43,1,0,0);
set_self(350,18,180,0,0);
set_self(350,19,350,0,0);
set_self(350,37,1,0,0);
play_ani(1,350,33,100,120,0,500,0,0,0,1,0,0);
set_self(5,57,TIPSTIME,0,0);
isTips = 1;
}
//this.changehscore(this.score);
};
}
if(typeof(Player.prototype.changehscore) == "undefined"){
Player.prototype.changehscore = function(hc){//更改最高分
if(this.mode<0){showmessage("玩家当前游戏模式出错!");return;}
//showmessage("当前模式历史最高分:"+this.highscore[this.mode]+"当前得分:"+hc);
//set_rec(145,"历史最高分:"+this.highscore[this.mode]);
if(this.highscore[this.mode] < hc){
//set_rec(145,"历史最高分:"+this.highscore[this.mode]);
//startload();
//StartLoadData();
//var nowh = this.highscore[this.mode];
this.highscore[this.mode] = hc;
//var str_url = "";
//if(nowh<=0){//无排行榜信息
//if(this.mode==0){
//str_url = "http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=store&weid=9&typeid=a474768&outappid=tgly&t1="+this.level+"&t2="+hc+"&s1="+this.userid+"&s2="+this.nickname+"&s3="+this.img;
//}else if(this.mode==1){
//str_url = "http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=store&weid=9&typeid=a474768&outappid=tgly&t1="+this.level+"&t3="+hc+"&s1="+this.userid+"&s2="+this.nickname+"&s3="+this.img;
//}
//saveRank(str_url);
//}else{
//if(this.mode==0){
//str_url = "http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a474768&where_s1="+this.userid+"&t2="+hc+"&s2="+this.nickname+"&s3="+this.img;
//}else if(this.mode==1){
//str_url = "http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a474768&where_s1="+this.userid+"&t3="+hc+"&s2="+this.nickname+"&s3="+this.img;
//}
//updateRank(str_url);
//}
return true;
}else{
return false;
}
};
}
if(typeof(Player.prototype.setscore) == "undefined"){
Player.prototype.setscore = function(score){//更改分数为
this.score = score;
};
}
if(typeof(Player.prototype.sethscore) == "undefined"){
Player.prototype.sethscore = function(arr){//更改最高分分数为
};
}
if(typeof(Player.prototype.changerank) == "undefined"){
Player.prototype.changerank = function(arr){//更改排行
};
}
if(typeof(Player.prototype.finditem) == "undefined"){
Player.prototype.finditem = function(item){//查询道具
return this.items[item];
};
}
if(typeof(Player.prototype.setrank) == "undefined"){
Player.prototype.setrank = function(arr){//更改排行
};
}
if(typeof(Player.prototype.additem) == "undefined"){
Player.prototype.additem = function(item,num){//添加道具
//logmessage("添加前数量:"+this.items[item]);
if(this.items[item]==0){
if(this.searchBag()<=0){
//logmessage("背包已满");
return false;
}else{
this.items[item]+=num;
//var data={};
//data.data=g_player.items;
//data = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s3="+data);
set_self(197+item,7,g_player.items[item],0,0);
set_self(197+item,20,get_self(197+item,7,0,0,0).length*18,0,0);
//logmessage("添加成功!数量为:"+this.items[item]);
return true;
}
}else{
this.items[item]+=num;
//var data={};
//data.data=g_player.items;
//data = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s3="+data);
set_self(197+item,7,g_player.items[item],0,0);
set_self(197+item,20,get_self(197+item,7,0,0,0).length*18,0,0);
//logmessage("添加成功!数量为:"+this.items[item]);
return true;
}
};
}
if(typeof(Player.prototype.useitem) == "undefined"){
Player.prototype.useitem = function(item,num){//使用道具
if(this.items[item]>=num){
this.delitem(item,num);
set_self(197+item,7,this.items[item],0,0);
set_self(197+item,20,get_self(197+item,7,0,0,0).length*18,0,0);
switch(item){
case 0://道具0
C_Block.flashblock();
break;
case 1://道具1
g_board.changeone();
break;
case 2://道具2
C_Block.changecolor();
break;
case 3://道具3
break;
case 4://道具4
g_board.clearsome();
break;
case 5://道具5
g_board.clearone();
break;
}
}else{
//logmessage("道具 "+item+" 数量不足:\n 背包数量 = "+this.items[item]+"\n 所需数量 = "+num);
return false;
}
};
}
if(typeof(Player.prototype.delitem) == "undefined"){
Player.prototype.delitem = function(item,num){//删除道具
if(this.items[item]-num < 0){
showmessage("道具"+item+"数量不足!");
}else{
this.items[item]-=num;
updateItems();
//var data={};
//data.data=g_player.items;
//data = ifast_jsontostring(data);
//AjaxHttp("http://syhd.0791ts.cn/sdk/index.php?c=game&a=rank&do=update&outappid=tgly&where_weid=9&where_typeid=a603266&where_s1="+this.userid+"&s3="+data);
}
};
}