noZhuHp和noZhuSkill机制实行
This commit is contained in:
parent
11ecc7045d
commit
a5227b9ce2
110
mode/doudizhu.js
110
mode/doudizhu.js
|
@ -113,8 +113,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.addGlobalSkill('binglin_bingjin');
|
||||
break;
|
||||
default:
|
||||
game.zhu.addSkill('feiyang');
|
||||
game.zhu.addSkill('bahu');
|
||||
if(!game.zhu.isInitFilter('noZhuSkill')){
|
||||
game.zhu.addSkill('feiyang');
|
||||
game.zhu.addSkill('bahu');
|
||||
}
|
||||
}
|
||||
game.syncState();
|
||||
event.trigger('gameStart');
|
||||
|
@ -489,9 +491,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
else player.addSkill('binglin_neihong');
|
||||
}
|
||||
game.zhu.hp++;
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
_status.characterlist.remove(game.players[i].name1);
|
||||
_status.characterlist.remove(game.players[i].name2);
|
||||
|
@ -575,9 +579,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var player of game.players){
|
||||
if(player!=game.me) player.init(event.map[player.playerid].randomGet());
|
||||
}
|
||||
game.zhu.hp++;
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
_status.characterlist.remove(game.players[i].name1);
|
||||
_status.characterlist.remove(game.players[i].name2);
|
||||
|
@ -654,9 +660,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
_status.characterlist.remove(game.players[i].name1);
|
||||
_status.characterlist.remove(game.players[i].name2);
|
||||
if(game.players[i]==game.zhu){
|
||||
game.players[i].hp++;
|
||||
game.players[i].maxHp++;
|
||||
game.players[i].update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(function(){
|
||||
|
@ -707,9 +715,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
player.init(listc[0]);
|
||||
}
|
||||
if(player==game.zhu){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
}
|
||||
if(back){
|
||||
list.remove(get.sourceCharacter(player.name1));
|
||||
|
@ -1084,9 +1094,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.list.remove(get.sourceCharacter(game.me.name1));
|
||||
event.list.remove(get.sourceCharacter(game.me.name2));
|
||||
if(game.me==game.zhu){
|
||||
game.me.hp++;
|
||||
game.me.maxHp++;
|
||||
game.me.update();
|
||||
if(!game.me.isInitFilter('noZhuHp')){
|
||||
game.me.hp++;
|
||||
game.me.maxHp++;
|
||||
game.me.update();
|
||||
}
|
||||
}
|
||||
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
|
@ -1196,9 +1208,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
game.broadcast(function(result,zhu){
|
||||
for(var i in result){
|
||||
|
@ -1207,9 +1221,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
game.zhu=zhu;
|
||||
zhu.maxHp++;
|
||||
zhu.hp++;
|
||||
zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
ui.arena.classList.remove('choose-character');
|
||||
|
@ -1325,9 +1341,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
game.broadcast(function(result,zhu){
|
||||
for(var i in result){
|
||||
|
@ -1336,9 +1354,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
game.zhu=zhu;
|
||||
zhu.maxHp++;
|
||||
zhu.hp++;
|
||||
zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
ui.arena.classList.remove('choose-character');
|
||||
|
@ -1463,9 +1483,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
game.broadcast(function(result,zhu){
|
||||
for(var i in result){
|
||||
|
@ -1474,9 +1496,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
game.zhu=zhu;
|
||||
zhu.maxHp++;
|
||||
zhu.hp++;
|
||||
zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
ui.arena.classList.remove('choose-character');
|
||||
|
@ -1751,9 +1775,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
game.broadcast(function(result,zhu){
|
||||
for(var i in result){
|
||||
|
@ -1762,9 +1788,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
game.zhu=zhu;
|
||||
zhu.maxHp++;
|
||||
zhu.hp++;
|
||||
zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
ui.arena.classList.remove('choose-character');
|
||||
|
|
|
@ -908,9 +908,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.me.chooseButtonOL(list,function(player,result){
|
||||
if(game.online||player==game.me){
|
||||
player.init(result.links[0]);
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.$update();
|
||||
if(!player.isInitFilter('noZhuHp')){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.$update();
|
||||
}
|
||||
}
|
||||
});
|
||||
"step 5"
|
||||
|
@ -931,9 +933,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i in result){
|
||||
if(!lib.playerOL[i].name){
|
||||
lib.playerOL[i].init(result[i][0],result[i][1]);
|
||||
lib.playerOL[i].hp++;
|
||||
lib.playerOL[i].maxHp++;
|
||||
lib.playerOL[i].update();
|
||||
if(!lib.playerOL[i].isInitFilter('noZhuHp')){
|
||||
lib.playerOL[i].hp++;
|
||||
lib.playerOL[i].maxHp++;
|
||||
lib.playerOL[i].$update();
|
||||
}
|
||||
}
|
||||
}
|
||||
},result);
|
||||
|
@ -1089,12 +1093,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.map[event.bZhu].remove(character);
|
||||
game.bZhu.init(character);
|
||||
}
|
||||
game.rZhu.maxHp++;
|
||||
game.rZhu.hp++;
|
||||
game.rZhu.update();
|
||||
game.bZhu.maxHp++;
|
||||
game.bZhu.hp++;
|
||||
game.bZhu.update();
|
||||
if(!game.rzhu.isInitFilter('noZhuHp')){
|
||||
game.rzhu.maxHp++;
|
||||
game.rzhu.hp++;
|
||||
game.rzhu.update();
|
||||
}
|
||||
if(!game.bzhu.isInitFilter('noZhuHp')){
|
||||
game.bzhu.maxHp++;
|
||||
game.bzhu.hp++;
|
||||
game.bzhu.update();
|
||||
}
|
||||
if(!event.isZhu){
|
||||
var group=game.me.identity.indexOf('r')==0?event.rZhu:event.bZhu;
|
||||
game.me.chooseButton(true,['请选择您的武将牌',[event.map[group].randomRemove(5),'character']]);
|
||||
|
@ -1382,9 +1390,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
player.init(listc[0]);
|
||||
}
|
||||
if(player.identity=='mingzhong'){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.update();
|
||||
if(!player.isInitFilter('noZhuHp')){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.$update();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(player.identity=='zhu'&&!stratagemMode){
|
||||
|
@ -1410,9 +1420,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
player.init(choice);
|
||||
}
|
||||
if(game.players.length>4){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.update();
|
||||
if(!player.isInitFilter('noZhuHp')){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.$update();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(player.identity=='zhong'&&(Math.random()<0.5||['sunliang','key_akane'].includes(game.zhu.name))&&!stratagemMode){
|
||||
|
@ -2099,9 +2111,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.list.remove(get.sourceCharacter(game.me.name1));
|
||||
event.list.remove(get.sourceCharacter(game.me.name2));
|
||||
if(!event.stratagemMode&&game.me==game.zhu&&game.players.length>4){
|
||||
game.me.hp++;
|
||||
game.me.maxHp++;
|
||||
game.me.update();
|
||||
if(!game.me.isInitFilter('noZhuHp')){
|
||||
game.me.hp++;
|
||||
game.me.maxHp++;
|
||||
game.me.$update();
|
||||
}
|
||||
}
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if((event.stratagemMode||game.players[i]!=game.zhu)&&game.players[i]!=game.me){
|
||||
|
@ -2343,18 +2357,22 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.list2.remove(get.sourceCharacter(game.zhu.name2));
|
||||
|
||||
if(game.players.length>4){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
if(!game.zhu.isInitFilter('noZhuHp')){
|
||||
game.zhu.maxHp++;
|
||||
game.zhu.hp++;
|
||||
game.zhu.update();
|
||||
}
|
||||
}
|
||||
game.broadcast(function(zhu,name,name2,addMaxHp){
|
||||
if(!zhu.name){
|
||||
zhu.init(name,name2);
|
||||
}
|
||||
if(addMaxHp){
|
||||
zhu.maxHp++;
|
||||
zhu.hp++;
|
||||
zhu.update();
|
||||
if(!zhu.isInitFilter('noZhuHp')){
|
||||
zhu.maxHp++;
|
||||
zhu.hp++;
|
||||
zhu.update();
|
||||
}
|
||||
}
|
||||
},game.zhu,result.links[0],result.links[1],game.players.length>4);
|
||||
|
||||
|
|
|
@ -1607,9 +1607,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
choice=list[0];
|
||||
}
|
||||
player.init(choice);
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.update();
|
||||
if(!player.isInitFilter('noZhuHp')){
|
||||
player.hp++;
|
||||
player.maxHp++;
|
||||
player.$update();
|
||||
}
|
||||
}
|
||||
else if(Math.random()<0.5){
|
||||
var choice=0;
|
||||
|
@ -1873,9 +1875,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
event.list.remove(event.current.name1);
|
||||
event.list2.remove(event.current.name1);
|
||||
if(event.current.identity=='zhu'){
|
||||
event.current.hp++;
|
||||
event.current.maxHp++;
|
||||
event.current.update();
|
||||
if(!event.current.isInitFilter('noZhuHp')){
|
||||
event.current.hp++;
|
||||
event.current.maxHp++;
|
||||
event.current.$update();
|
||||
}
|
||||
}
|
||||
event.current.node.name_seat.remove();
|
||||
}
|
||||
|
@ -2038,13 +2042,17 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.friend[i].node.identity.dataset.color=get.translation(_status.color+'Color');
|
||||
game.enemy[i].node.identity.dataset.color=get.translation(!_status.color+'Color');
|
||||
}
|
||||
game.friendZhu.maxHp++;
|
||||
game.friendZhu.hp++;
|
||||
game.friendZhu.update();
|
||||
if(!game.friendZhu.isInitFilter('noZhuHp')){
|
||||
game.friendZhu.maxHp++;
|
||||
game.friendZhu.hp++;
|
||||
game.friendZhu.update();
|
||||
}
|
||||
|
||||
game.enemyZhu.maxHp++;
|
||||
game.enemyZhu.hp++;
|
||||
game.enemyZhu.update();
|
||||
if(!game.enemyZhu.isInitFilter('noZhuHp')){
|
||||
game.enemyZhu.maxHp++;
|
||||
game.enemyZhu.hp++;
|
||||
game.enemyZhu.update();
|
||||
}
|
||||
|
||||
game.onSwapControl();
|
||||
});
|
||||
|
@ -2528,13 +2536,17 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.enemy[i].node.identity.dataset.color=get.translation(!_status.color+'Color');
|
||||
}
|
||||
if(lib.storage.zhu&&lib.storage.main_zhu){
|
||||
game.friendZhu.maxHp++;
|
||||
game.friendZhu.hp++;
|
||||
game.friendZhu.update();
|
||||
if(!game.friendZhu.isInitFilter('noZhuHp')){
|
||||
game.friendZhu.maxHp++;
|
||||
game.friendZhu.hp++;
|
||||
game.friendZhu.update();
|
||||
}
|
||||
|
||||
game.enemyZhu.maxHp++;
|
||||
game.enemyZhu.hp++;
|
||||
game.enemyZhu.update();
|
||||
if(!game.enemyZhu.isInitFilter('noZhuHp')){
|
||||
game.enemyZhu.maxHp++;
|
||||
game.enemyZhu.hp++;
|
||||
game.enemyZhu.update();
|
||||
}
|
||||
}
|
||||
_status.friend.splice(0,num);
|
||||
_status.enemy.splice(0,num);
|
||||
|
@ -2898,9 +2910,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},event.current,result.links[0]);
|
||||
if(event.current.identity=='zhu'){
|
||||
event.current.hp++;
|
||||
event.current.maxHp++;
|
||||
event.current.update();
|
||||
if(!event.current.isInitFilter('noZhuHp')){
|
||||
event.current.maxHp++;
|
||||
event.current.hp++;
|
||||
event.current.update();
|
||||
}
|
||||
}
|
||||
event.current.classList.remove('selectedx');
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
|
|
Loading…
Reference in New Issue