noZhuHp和noZhuSkill机制实行

This commit is contained in:
mengxinzxz 2024-02-01 08:58:32 +08:00
parent 11ecc7045d
commit a5227b9ce2
3 changed files with 150 additions and 90 deletions

View File

@ -113,8 +113,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('binglin_bingjin'); game.addGlobalSkill('binglin_bingjin');
break; break;
default: default:
game.zhu.addSkill('feiyang'); if(!game.zhu.isInitFilter('noZhuSkill')){
game.zhu.addSkill('bahu'); game.zhu.addSkill('feiyang');
game.zhu.addSkill('bahu');
}
} }
game.syncState(); game.syncState();
event.trigger('gameStart'); event.trigger('gameStart');
@ -489,9 +491,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
else player.addSkill('binglin_neihong'); else player.addSkill('binglin_neihong');
} }
game.zhu.hp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.maxHp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
_status.characterlist.remove(game.players[i].name1); _status.characterlist.remove(game.players[i].name1);
_status.characterlist.remove(game.players[i].name2); _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){ for(var player of game.players){
if(player!=game.me) player.init(event.map[player.playerid].randomGet()); if(player!=game.me) player.init(event.map[player.playerid].randomGet());
} }
game.zhu.hp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.maxHp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
_status.characterlist.remove(game.players[i].name1); _status.characterlist.remove(game.players[i].name1);
_status.characterlist.remove(game.players[i].name2); _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].name1);
_status.characterlist.remove(game.players[i].name2); _status.characterlist.remove(game.players[i].name2);
if(game.players[i]==game.zhu){ if(game.players[i]==game.zhu){
game.players[i].hp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.players[i].maxHp++; game.zhu.maxHp++;
game.players[i].update(); game.zhu.hp++;
game.zhu.update();
}
} }
} }
setTimeout(function(){ setTimeout(function(){
@ -707,9 +715,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.init(listc[0]); player.init(listc[0]);
} }
if(player==game.zhu){ if(player==game.zhu){
player.hp++; if(!game.zhu.isInitFilter('noZhuHp')){
player.maxHp++; game.zhu.maxHp++;
player.update(); game.zhu.hp++;
game.zhu.update();
}
} }
if(back){ if(back){
list.remove(get.sourceCharacter(player.name1)); 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.name1));
event.list.remove(get.sourceCharacter(game.me.name2)); event.list.remove(get.sourceCharacter(game.me.name2));
if(game.me==game.zhu){ if(game.me==game.zhu){
game.me.hp++; if(!game.me.isInitFilter('noZhuHp')){
game.me.maxHp++; game.me.hp++;
game.me.update(); game.me.maxHp++;
game.me.update();
}
} }
for(var i=0;i<game.players.length;i++){ 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++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.hp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
game.broadcast(function(result,zhu){ game.broadcast(function(result,zhu){
for(var i in result){ for(var i in result){
@ -1207,9 +1221,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu=zhu; game.zhu=zhu;
zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
zhu.hp++; game.zhu.maxHp++;
zhu.update(); game.zhu.hp++;
game.zhu.update();
}
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');
@ -1325,9 +1341,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.hp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
game.broadcast(function(result,zhu){ game.broadcast(function(result,zhu){
for(var i in result){ for(var i in result){
@ -1336,9 +1354,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu=zhu; game.zhu=zhu;
zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
zhu.hp++; game.zhu.maxHp++;
zhu.update(); game.zhu.hp++;
game.zhu.update();
}
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');
@ -1463,9 +1483,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.hp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
game.broadcast(function(result,zhu){ game.broadcast(function(result,zhu){
for(var i in result){ for(var i in result){
@ -1474,9 +1496,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu=zhu; game.zhu=zhu;
zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
zhu.hp++; game.zhu.maxHp++;
zhu.update(); game.zhu.hp++;
game.zhu.update();
}
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');
@ -1751,9 +1775,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.hp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
game.broadcast(function(result,zhu){ game.broadcast(function(result,zhu){
for(var i in result){ for(var i in result){
@ -1762,9 +1788,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
game.zhu=zhu; game.zhu=zhu;
zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
zhu.hp++; game.zhu.maxHp++;
zhu.update(); game.zhu.hp++;
game.zhu.update();
}
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');

View File

@ -908,9 +908,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.me.chooseButtonOL(list,function(player,result){ game.me.chooseButtonOL(list,function(player,result){
if(game.online||player==game.me){ if(game.online||player==game.me){
player.init(result.links[0]); player.init(result.links[0]);
player.hp++; if(!player.isInitFilter('noZhuHp')){
player.maxHp++; player.hp++;
player.$update(); player.maxHp++;
player.$update();
}
} }
}); });
"step 5" "step 5"
@ -931,9 +933,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
for(var i in result){ for(var i in result){
if(!lib.playerOL[i].name){ if(!lib.playerOL[i].name){
lib.playerOL[i].init(result[i][0],result[i][1]); lib.playerOL[i].init(result[i][0],result[i][1]);
lib.playerOL[i].hp++; if(!lib.playerOL[i].isInitFilter('noZhuHp')){
lib.playerOL[i].maxHp++; lib.playerOL[i].hp++;
lib.playerOL[i].update(); lib.playerOL[i].maxHp++;
lib.playerOL[i].$update();
}
} }
} }
},result); },result);
@ -1089,12 +1093,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
event.map[event.bZhu].remove(character); event.map[event.bZhu].remove(character);
game.bZhu.init(character); game.bZhu.init(character);
} }
game.rZhu.maxHp++; if(!game.rzhu.isInitFilter('noZhuHp')){
game.rZhu.hp++; game.rzhu.maxHp++;
game.rZhu.update(); game.rzhu.hp++;
game.bZhu.maxHp++; game.rzhu.update();
game.bZhu.hp++; }
game.bZhu.update(); if(!game.bzhu.isInitFilter('noZhuHp')){
game.bzhu.maxHp++;
game.bzhu.hp++;
game.bzhu.update();
}
if(!event.isZhu){ if(!event.isZhu){
var group=game.me.identity.indexOf('r')==0?event.rZhu:event.bZhu; var group=game.me.identity.indexOf('r')==0?event.rZhu:event.bZhu;
game.me.chooseButton(true,['请选择您的武将牌',[event.map[group].randomRemove(5),'character']]); 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]); player.init(listc[0]);
} }
if(player.identity=='mingzhong'){ if(player.identity=='mingzhong'){
player.hp++; if(!player.isInitFilter('noZhuHp')){
player.maxHp++; player.hp++;
player.update(); player.maxHp++;
player.$update();
}
} }
} }
else if(player.identity=='zhu'&&!stratagemMode){ else if(player.identity=='zhu'&&!stratagemMode){
@ -1410,9 +1420,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.init(choice); player.init(choice);
} }
if(game.players.length>4){ if(game.players.length>4){
player.hp++; if(!player.isInitFilter('noZhuHp')){
player.maxHp++; player.hp++;
player.update(); player.maxHp++;
player.$update();
}
} }
} }
else if(player.identity=='zhong'&&(Math.random()<0.5||['sunliang','key_akane'].includes(game.zhu.name))&&!stratagemMode){ 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.name1));
event.list.remove(get.sourceCharacter(game.me.name2)); event.list.remove(get.sourceCharacter(game.me.name2));
if(!event.stratagemMode&&game.me==game.zhu&&game.players.length>4){ if(!event.stratagemMode&&game.me==game.zhu&&game.players.length>4){
game.me.hp++; if(!game.me.isInitFilter('noZhuHp')){
game.me.maxHp++; game.me.hp++;
game.me.update(); game.me.maxHp++;
game.me.$update();
}
} }
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if((event.stratagemMode||game.players[i]!=game.zhu)&&game.players[i]!=game.me){ 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)); event.list2.remove(get.sourceCharacter(game.zhu.name2));
if(game.players.length>4){ if(game.players.length>4){
game.zhu.maxHp++; if(!game.zhu.isInitFilter('noZhuHp')){
game.zhu.hp++; game.zhu.maxHp++;
game.zhu.update(); game.zhu.hp++;
game.zhu.update();
}
} }
game.broadcast(function(zhu,name,name2,addMaxHp){ game.broadcast(function(zhu,name,name2,addMaxHp){
if(!zhu.name){ if(!zhu.name){
zhu.init(name,name2); zhu.init(name,name2);
} }
if(addMaxHp){ if(addMaxHp){
zhu.maxHp++; if(!zhu.isInitFilter('noZhuHp')){
zhu.hp++; zhu.maxHp++;
zhu.update(); zhu.hp++;
zhu.update();
}
} }
},game.zhu,result.links[0],result.links[1],game.players.length>4); },game.zhu,result.links[0],result.links[1],game.players.length>4);

View File

@ -1607,9 +1607,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
choice=list[0]; choice=list[0];
} }
player.init(choice); player.init(choice);
player.hp++; if(!player.isInitFilter('noZhuHp')){
player.maxHp++; player.hp++;
player.update(); player.maxHp++;
player.$update();
}
} }
else if(Math.random()<0.5){ else if(Math.random()<0.5){
var choice=0; var choice=0;
@ -1873,9 +1875,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
event.list.remove(event.current.name1); event.list.remove(event.current.name1);
event.list2.remove(event.current.name1); event.list2.remove(event.current.name1);
if(event.current.identity=='zhu'){ if(event.current.identity=='zhu'){
event.current.hp++; if(!event.current.isInitFilter('noZhuHp')){
event.current.maxHp++; event.current.hp++;
event.current.update(); event.current.maxHp++;
event.current.$update();
}
} }
event.current.node.name_seat.remove(); 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.friend[i].node.identity.dataset.color=get.translation(_status.color+'Color');
game.enemy[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++; if(!game.friendZhu.isInitFilter('noZhuHp')){
game.friendZhu.hp++; game.friendZhu.maxHp++;
game.friendZhu.update(); game.friendZhu.hp++;
game.friendZhu.update();
}
game.enemyZhu.maxHp++; if(!game.enemyZhu.isInitFilter('noZhuHp')){
game.enemyZhu.hp++; game.enemyZhu.maxHp++;
game.enemyZhu.update(); game.enemyZhu.hp++;
game.enemyZhu.update();
}
game.onSwapControl(); 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'); game.enemy[i].node.identity.dataset.color=get.translation(!_status.color+'Color');
} }
if(lib.storage.zhu&&lib.storage.main_zhu){ if(lib.storage.zhu&&lib.storage.main_zhu){
game.friendZhu.maxHp++; if(!game.friendZhu.isInitFilter('noZhuHp')){
game.friendZhu.hp++; game.friendZhu.maxHp++;
game.friendZhu.update(); 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.friend.splice(0,num);
_status.enemy.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]); },event.current,result.links[0]);
if(event.current.identity=='zhu'){ if(event.current.identity=='zhu'){
event.current.hp++; if(!event.current.isInitFilter('noZhuHp')){
event.current.maxHp++; event.current.maxHp++;
event.current.update(); event.current.hp++;
event.current.update();
}
} }
event.current.classList.remove('selectedx'); event.current.classList.remove('selectedx');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){