Merge pull request #1076 from mengxinzxz/PR-Branch
隐匿勾玉显示;增加changeSkin适用性;技能调整;bugfix
This commit is contained in:
commit
92c96c860e
|
@ -477,7 +477,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
direct:true,
|
direct:true,
|
||||||
async content(event,trigger,player){
|
async content(event,trigger,player){
|
||||||
const result=await player.chooseTarget(get.prompt('dczhenrao'),'对一名可选角色造成1点伤害',(card,player,target)=>{
|
const result=await player.chooseTarget(get.prompt('dczhenrao'),'对一名可选角色造成1点伤害',(card,player,target)=>{
|
||||||
return get.event('targets').includes(target);
|
return get.event('targets').includes(target)&&!player.getStorage('dczhenrao').includes(target);
|
||||||
})
|
})
|
||||||
.set('targets',trigger.targets.concat(trigger.player).filter(target=>target.countCards('h')>player.countCards('h')))
|
.set('targets',trigger.targets.concat(trigger.player).filter(target=>target.countCards('h')>player.countCards('h')))
|
||||||
.set('ai',target=>{
|
.set('ai',target=>{
|
||||||
|
@ -2032,13 +2032,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
audio:2,
|
audio:2,
|
||||||
trigger:{player:'useCardAfter'},
|
trigger:{player:'useCardAfter'},
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
if(get.type(event.card)!='basic') return false;
|
return get.type(event.card)=='basic'&&_status.currentPhase;
|
||||||
if(player.getHistory('gain',evt=>{
|
|
||||||
return evt.getParent().name==='dccaisi';
|
|
||||||
}).reduce((num,evt)=>{
|
|
||||||
return num+evt.cards.length;
|
|
||||||
},0)>player.maxHp) return false;
|
|
||||||
return _status.currentPhase;
|
|
||||||
},
|
},
|
||||||
prompt2:function(event,player){
|
prompt2:function(event,player){
|
||||||
const num=player.countMark('dccaisi_more')+1;
|
const num=player.countMark('dccaisi_more')+1;
|
||||||
|
@ -2054,13 +2048,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(card) cards.add(card);
|
if(card) cards.add(card);
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
if(cards.length) player.gain(cards,'gain2');
|
if(cards.length) yield player.gain(cards,'gain2');
|
||||||
else{
|
else{
|
||||||
player.chat('没有非基本牌…');
|
player.chat('没有非基本牌…');
|
||||||
game.log(`但是${position=='discardPile'?'弃':''}牌堆里没有非基本牌!`);
|
game.log(`但是${position=='discardPile'?'弃':''}牌堆里没有非基本牌!`);
|
||||||
}
|
}
|
||||||
player.addTempSkill('dccaisi_more');
|
const sum=player.getHistory('useSkill',evt=>evt.skill=='dccaisi').length;
|
||||||
player.addMark('dccaisi_more',1,false);
|
if(sum<player.maxHp){
|
||||||
|
player.addTempSkill('dccaisi_more');
|
||||||
|
player.addMark('dccaisi_more',1,false);
|
||||||
|
}
|
||||||
|
else player.tempBanSkill('dccaisi');
|
||||||
},
|
},
|
||||||
subSkill:{more:{charlotte:true,onremove:true}},
|
subSkill:{more:{charlotte:true,onremove:true}},
|
||||||
},
|
},
|
||||||
|
@ -2073,10 +2071,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
content:function*(event,map){
|
content:function*(event,map){
|
||||||
const player=map.player;
|
const player=map.player;
|
||||||
if(player.maxHp<game.countPlayer()){
|
if(player.maxHp<game.countPlayer2()){
|
||||||
yield player.gainMaxHp();
|
yield player.gainMaxHp();
|
||||||
}
|
}
|
||||||
player.recover();
|
yield player.recover();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//魏贾充
|
//魏贾充
|
||||||
|
@ -12954,9 +12952,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
dcshizong_info:'当你需要使用一张基本牌时,你可以交给一名其他角色X张牌,然后其可以将一张牌置于牌堆底,视为你使用之。若其不为当前回合角色,此技能失效直到回合结束(X为你本回合发动〖恃纵〗的次数)。',
|
dcshizong_info:'当你需要使用一张基本牌时,你可以交给一名其他角色X张牌,然后其可以将一张牌置于牌堆底,视为你使用之。若其不为当前回合角色,此技能失效直到回合结束(X为你本回合发动〖恃纵〗的次数)。',
|
||||||
pangshanmin:'庞山民',
|
pangshanmin:'庞山民',
|
||||||
dccaisi:'才思',
|
dccaisi:'才思',
|
||||||
dccaisi_info:'当你于回合内/回合外使用基本牌结算结束后,若你本回合以此法得到的牌数小于你的体力上限,你可以从牌堆/弃牌堆随机获得一张非基本牌,然后本回合发动此技能获得的牌数+1。',
|
dccaisi_info:'当你于回合内/回合外使用基本牌结算结束后,你可以从牌堆/弃牌堆随机获得一张非基本牌,然后若你本回合发动此技能的次数:小于你的体力上限,本回合你发动此技能获得的牌数+1;大于等于你的体力上限,本回合此技能失效。',
|
||||||
dczhuoli:'擢吏',
|
dczhuoli:'擢吏',
|
||||||
dczhuoli_info:'锁定技。一名角色的回合结束时,若你本回合使用或获得的牌数大于体力值,你加1点体力上限(不能超过存活角色数),回复1点体力。',
|
dczhuoli_info:'锁定技。一名角色的回合结束时,若你本回合使用或获得的牌数大于体力值,你加1点体力上限(不能超过游戏人数),回复1点体力。',
|
||||||
yue_caiyong:'乐蔡邕',
|
yue_caiyong:'乐蔡邕',
|
||||||
yue_caiyong_prefix:'乐',
|
yue_caiyong_prefix:'乐',
|
||||||
dcjiaowei:'焦尾',
|
dcjiaowei:'焦尾',
|
||||||
|
|
|
@ -16673,8 +16673,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
re_liru_prefix:'手杀界',
|
re_liru_prefix:'手杀界',
|
||||||
re_chenqun:'手杀界陈群',
|
re_chenqun:'手杀界陈群',
|
||||||
re_chenqun_prefix:'手杀界',
|
re_chenqun_prefix:'手杀界',
|
||||||
old_yuanshu:'手杀界袁术',
|
|
||||||
old_yuanshu_prefix:'手杀界',
|
|
||||||
re_liru:'手杀界李儒',
|
re_liru:'手杀界李儒',
|
||||||
re_liru_prefix:'手杀界',
|
re_liru_prefix:'手杀界',
|
||||||
re_chenqun:'手杀界陈群',
|
re_chenqun:'手杀界陈群',
|
||||||
|
|
|
@ -13,7 +13,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
ol_gaoshun:['male','qun',4,['olxianzhen','decadejinjiu'],['die_audio:re_gaoshun']],
|
ol_gaoshun:['male','qun',4,['olxianzhen','decadejinjiu'],['die_audio:re_gaoshun']],
|
||||||
ol_sb_yuanshao:['male','qun',4,['olsbhetao','olsbshenli','olsbyufeng','olsbshishou'],['zhu']],
|
ol_sb_yuanshao:['male','qun',4,['olsbhetao','olsbshenli','olsbyufeng','olsbshishou'],['zhu']],
|
||||||
ol_yufan:['male','wu',3,['olzongxuan','olzhiyan'],['tempname:re_yufan','die_audio:re_yufan']],
|
ol_yufan:['male','wu',3,['olzongxuan','olzhiyan'],['tempname:re_yufan','die_audio:re_yufan']],
|
||||||
ol_chengpu:['male','wu',4,['ollihuo','olchunlao'],['tempname:xin_chengpu','die_audio:xin_chengpu']],
|
ol_chengpu:['male','wu',4,['dclihuo','olchunlao'],['tempname:xin_chengpu','die_audio:xin_chengpu']],
|
||||||
},
|
},
|
||||||
characterSort:{
|
characterSort:{
|
||||||
onlyOL:{
|
onlyOL:{
|
||||||
|
@ -52,7 +52,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
skill:{
|
skill:{
|
||||||
//程普
|
//程普
|
||||||
ollihuo:{
|
dclihuo:{
|
||||||
audio:'relihuo',
|
audio:'relihuo',
|
||||||
trigger:{player:'useCard1'},
|
trigger:{player:'useCard1'},
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
|
@ -103,12 +103,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
ai:{fireAttack:true},
|
ai:{fireAttack:true},
|
||||||
group:'ollihuo_add',
|
group:'dclihuo_add',
|
||||||
subSkill:{
|
subSkill:{
|
||||||
add:{
|
add:{
|
||||||
inherit:'lihuo2',
|
inherit:'lihuo2',
|
||||||
async content(event,trigger,player){
|
async content(event,trigger,player){
|
||||||
const {result:{bool,targets}}=await player.chooseTarget(get.prompt('ollihuo'),'为'+get.translation(trigger.card)+'增加一个目标',(card,player,target)=>{
|
const {result:{bool,targets}}=await player.chooseTarget(get.prompt('dclihuo'),'为'+get.translation(trigger.card)+'增加一个目标',(card,player,target)=>{
|
||||||
const trigger=get.event().getTrigger();
|
const trigger=get.event().getTrigger();
|
||||||
return !trigger.targets.includes(target)&&player.canUse(trigger.card,target);
|
return !trigger.targets.includes(target)&&player.canUse(trigger.card,target);
|
||||||
}).set('card',trigger.card).set('ai',target=>{
|
}).set('card',trigger.card).set('ai',target=>{
|
||||||
|
@ -116,7 +116,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
return get.effect(target,trigger.card,player,player);
|
return get.effect(target,trigger.card,player,player);
|
||||||
});
|
});
|
||||||
if(bool){
|
if(bool){
|
||||||
player.logSkill('ollihuo',targets);
|
player.logSkill('dclihuo',targets);
|
||||||
trigger.targets.addArray(targets);
|
trigger.targets.addArray(targets);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -248,9 +248,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
const {result:{bool,targets}}=await player.chooseTarget(get.prompt2('olzhiyan')).set('ai',target=>{
|
const {result:{bool,targets}}=await player.chooseTarget(get.prompt2('olzhiyan')).set('ai',target=>{
|
||||||
const player=get.event('player'),cards=get.event('cards');
|
const player=get.event('player'),cards=get.event('cards');
|
||||||
if(!cards.length) return 0;
|
if(!cards.length) return 0;
|
||||||
const card=cards[0];
|
const card=cards[0],att=get.attitude(player,target);
|
||||||
if(get.type(card,target)=='equip'&&(get.attitude(player,target)>0||get.recoverEffect(target,player,player)>0)) return get.recoverEffect(target,player,player)+get.attitude(player,target);
|
if(get.type(card,target)=='equip'&&(get.attitude(player,target)>0||get.recoverEffect(target,player,player)>0)) return get.recoverEffect(target,player,player)*20+att/114514;
|
||||||
if(get.type(card,target)!='equip'&&target.getHp()>=player.getHp()&&get.effect(target,{name:'losehp'},player,player)>0) return get.effect(target,{name:'losehp'},player,player);
|
if(get.type(card,target)!='equip'){
|
||||||
|
if(target.getHp()>=player.getHp()) return get.effect(target,{name:'losehp'},player,player)*20-att/114514;
|
||||||
|
return get.effect(target,{name:'draw'},player,player);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}).set('cards',Array.from(ui.cardPile.childNodes||[])||[]);
|
}).set('cards',Array.from(ui.cardPile.childNodes||[])||[]);
|
||||||
if(bool){
|
if(bool){
|
||||||
|
@ -1298,13 +1301,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
olzhiyan_info:'你或你的上家的结束阶段,你可以令一名角色正面朝上摸一张牌,然后若此牌:为装备牌,则其使用此牌并回复1点体力;不为装备牌且其体力值大于等于你,则其失去1点体力。',
|
olzhiyan_info:'你或你的上家的结束阶段,你可以令一名角色正面朝上摸一张牌,然后若此牌:为装备牌,则其使用此牌并回复1点体力;不为装备牌且其体力值大于等于你,则其失去1点体力。',
|
||||||
ol_chengpu:'OL界程普',
|
ol_chengpu:'OL界程普',
|
||||||
ol_chengpu_prefix:'OL界',
|
ol_chengpu_prefix:'OL界',
|
||||||
ollihuo:'疠火',
|
dclihuo:'疠火',
|
||||||
ollihuo_info:'①你使用的非火【杀】可以改为火【杀】,若如此做,此牌结算完毕后,若此牌造成过伤害,则你弃置一张牌或失去1点体力。②你使用火【杀】可以额外指定一个目标。',
|
dclihuo_info:'①你使用的非火【杀】可以改为火【杀】,若如此做,此牌结算完毕后,若此牌造成过伤害,则你弃置一张牌或失去1点体力。②你使用火【杀】可以额外指定一个目标。',
|
||||||
olchunlao:'醇醪',
|
olchunlao:'醇醪',
|
||||||
olchunlao_info:'①当你的【杀】因弃置进入弃牌堆后,你将位于弃牌堆的这些牌称为“醇”置于武将牌上。②一名角色处于濒死状态时,你可以将一张“醇”置入弃牌堆,然后令其视为使用一张【酒】。',
|
olchunlao_info:'①当你的【杀】因弃置进入弃牌堆后,你将位于弃牌堆的这些牌称为“醇”置于武将牌上。②一名角色处于濒死状态时,你可以将一张“醇”置入弃牌堆,然后令其视为使用一张【酒】。',
|
||||||
|
|
||||||
onlyOL_yijiang1:'OL专属·将1',
|
onlyOL_yijiang1:'OL专属·将1',
|
||||||
onlyOL_yijiang2:'OL专属·将2',
|
onlyOL_yijiang2:'OL专属·将2',
|
||||||
|
onlyOL_yijiang3:'OL专属·将3',
|
||||||
onlyOL_sb:'OL专属·上兵伐谋',
|
onlyOL_sb:'OL专属·上兵伐谋',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -15597,7 +15597,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
twfengji:'蜂集',
|
twfengji:'蜂集',
|
||||||
twfengji_info:'出牌阶段开始时,若你没有“示”,则你可以将一张牌作为“示”置于武将牌上并施法:从牌堆中获得X张与“示”牌名相同的牌,然后移去“示”。',
|
twfengji_info:'出牌阶段开始时,若你没有“示”,则你可以将一张牌作为“示”置于武将牌上并施法:从牌堆中获得X张与“示”牌名相同的牌,然后移去“示”。',
|
||||||
twyiju:'蚁聚',
|
twyiju:'蚁聚',
|
||||||
twyiju_info:'非锁定技。若你的武将牌上有“示”,则:①你使用【杀】的次数上限和攻击范围的基数改为你的体力值。②当你受到伤害时,你移去“示”,且令此伤害+1。',
|
twyiju_info:'若你的武将牌上有“示”,则:①你使用【杀】的次数上限和攻击范围的基数改为你的体力值。②当你受到伤害时,你移去“示”,且令此伤害+1。',
|
||||||
twbudao:'布道',
|
twbudao:'布道',
|
||||||
twbudao_info:'限定技。准备阶段,你可减1点体力上限,回复1点体力并选择获得一个〖布道〗技能池里的技能(三选一)。然后你可以令一名其他角色也获得此技能并交给你一张牌。',
|
twbudao_info:'限定技。准备阶段,你可减1点体力上限,回复1点体力并选择获得一个〖布道〗技能池里的技能(三选一)。然后你可以令一名其他角色也获得此技能并交给你一张牌。',
|
||||||
twzhouhu:'咒护',
|
twzhouhu:'咒护',
|
||||||
|
|
|
@ -5415,7 +5415,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
frequent:true,
|
frequent:true,
|
||||||
filter:function(event,player,name){
|
filter:function(event,player,name){
|
||||||
if(player==_status.currentPhase) return (name=='logSkill'&&event.skill=='dcliying'&&player.getExpansions('dcwangyuan').length<game.countPlayer());
|
if(player==_status.currentPhase) return (name=='logSkill'&&event.skill=='dcliying'&&player.getExpansions('dcwangyuan').length<game.countPlayer2());
|
||||||
if(name=='logSkill') return false;
|
if(name=='logSkill') return false;
|
||||||
if(player.getExpansions('dcwangyuan').length>=game.countPlayer()) return false;
|
if(player.getExpansions('dcwangyuan').length>=game.countPlayer()) return false;
|
||||||
if(event.name=='gain'&&event.player==player) return false;
|
if(event.name=='gain'&&event.player==player) return false;
|
||||||
|
|
|
@ -2688,6 +2688,12 @@ div:not(.handcards)>.card>.info>span,
|
||||||
background: rgba(63, 119, 173,1);
|
background: rgba(63, 119, 173,1);
|
||||||
border: 1px solid rgba(63, 119, 173, 1);
|
border: 1px solid rgba(63, 119, 173, 1);
|
||||||
}
|
}
|
||||||
|
.hp[data-condition="hidden"]>div:not(.lost):not(.shield) {
|
||||||
|
background-image:url('../../theme/style/hp/image/hidden_hp.png') !important;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
.hp[data-condition="high"]>div:not(.lost):not(.shield) {
|
.hp[data-condition="high"]>div:not(.lost):not(.shield) {
|
||||||
background: rgba(57, 123, 4,1);
|
background: rgba(57, 123, 4,1);
|
||||||
border: 1px solid rgba(39, 79, 7, 1);
|
border: 1px solid rgba(39, 79, 7, 1);
|
||||||
|
|
|
@ -323,21 +323,23 @@ export class Get extends Uninstantable {
|
||||||
static infoHp(hp) {
|
static infoHp(hp) {
|
||||||
if (typeof hp == 'number') return hp;
|
if (typeof hp == 'number') return hp;
|
||||||
else if (typeof hp == 'string' && hp.includes('/')) {
|
else if (typeof hp == 'string' && hp.includes('/')) {
|
||||||
return parseInt(hp.split('/')[0]);
|
const num = hp.split('/')[0];
|
||||||
|
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static infoMaxHp(hp) {
|
static infoMaxHp(hp) {
|
||||||
if (typeof hp == 'number') return hp;
|
if (typeof hp == 'number') return hp;
|
||||||
else if (typeof hp == 'string' && hp.includes('/')) {
|
else if (typeof hp == 'string' && hp.includes('/')) {
|
||||||
return parseInt(hp.split('/')[1]);
|
const num = hp.split('/')[1];
|
||||||
|
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static infoHujia(hp) {
|
static infoHujia(hp) {
|
||||||
if (typeof hp == 'string' && hp.includes('/')) {
|
if (typeof hp == 'string' && hp.includes('/')) {
|
||||||
var splited = hp.split('/');
|
const num = hp.split('/')[2];
|
||||||
if (splited.length > 2) return parseInt(splited[2]);
|
if (num) return num == 'Infinity' ? Infinity : parseInt(num);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2114,6 +2114,7 @@ export class Player extends HTMLDivElement {
|
||||||
}
|
}
|
||||||
//原有函数
|
//原有函数
|
||||||
init(character, character2, skill, update) {
|
init(character, character2, skill, update) {
|
||||||
|
let hidden = false;
|
||||||
if (typeof character == 'string' && !lib.character[character]) {
|
if (typeof character == 'string' && !lib.character[character]) {
|
||||||
lib.character[character] = get.character(character);
|
lib.character[character] = get.character(character);
|
||||||
}
|
}
|
||||||
|
@ -2169,7 +2170,7 @@ export class Player extends HTMLDivElement {
|
||||||
skills = [];
|
skills = [];
|
||||||
this.name = 'unknown';
|
this.name = 'unknown';
|
||||||
this.sex = 'male';
|
this.sex = 'male';
|
||||||
this.storage.nohp = true;
|
hidden = true;
|
||||||
skills.add('g_hidden_ai');
|
skills.add('g_hidden_ai');
|
||||||
}
|
}
|
||||||
if (character2 && lib.character[character2]) {
|
if (character2 && lib.character[character2]) {
|
||||||
|
@ -2223,17 +2224,19 @@ export class Player extends HTMLDivElement {
|
||||||
if (info2[4].includes('hiddenSkill') && !this.noclick) {
|
if (info2[4].includes('hiddenSkill') && !this.noclick) {
|
||||||
if (!this.hiddenSkills) this.hiddenSkills = [];
|
if (!this.hiddenSkills) this.hiddenSkills = [];
|
||||||
this.hiddenSkills.addArray(info2[3]);
|
this.hiddenSkills.addArray(info2[3]);
|
||||||
this.storage.nohp = true;
|
hidden = true;
|
||||||
skills.add('g_hidden_ai');
|
skills.add('g_hidden_ai');
|
||||||
}
|
}
|
||||||
else skills = skills.concat(info2[3]);
|
else skills = skills.concat(info2[3]);
|
||||||
}
|
}
|
||||||
if (this.storage.nohp) {
|
if (this.storage.nohp || hidden) {
|
||||||
this.storage.rawHp = this.hp;
|
this.storage.rawHp = this.hp;
|
||||||
this.storage.rawMaxHp = this.maxHp;
|
this.storage.rawMaxHp = this.maxHp;
|
||||||
this.hp = 1;
|
this.hp = 1;
|
||||||
this.maxHp = 1;
|
this.maxHp = 1;
|
||||||
this.node.hp.hide();
|
if (this.storage.nohp) {
|
||||||
|
this.node.hp.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (skill != false) {
|
if (skill != false) {
|
||||||
skills = skills.filter(skill => {
|
skills = skills.filter(skill => {
|
||||||
|
@ -2342,19 +2345,32 @@ export class Player extends HTMLDivElement {
|
||||||
*
|
*
|
||||||
* 如果lib.character[character]不存在,且想引用其他路径的图片素材或阵亡素材,请以[character,[]]的形式写入lib.character.characterSubstitute[name]中,第二个数组填入形式同lib.character[4]的书写形式
|
* 如果lib.character[character]不存在,且想引用其他路径的图片素材或阵亡素材,请以[character,[]]的形式写入lib.character.characterSubstitute[name]中,第二个数组填入形式同lib.character[4]的书写形式
|
||||||
*
|
*
|
||||||
* @param { string | string }
|
* @param { string | object | function } map
|
||||||
|
* @param { string } character
|
||||||
*/
|
*/
|
||||||
changeSkin(skill, character) {
|
changeSkin(map, character) {
|
||||||
if (!skill || !character) {
|
if (!map || !character) {
|
||||||
console.log('error: no sourceSkill or character to changeSkin', get.translation(this));
|
console.warn('error: no sourceMap or character to changeSkin', get.translation(this));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (typeof map == 'string') {
|
||||||
|
map = { skill: map };
|
||||||
|
}
|
||||||
for (const i of ['name', 'name1', 'name2']) {
|
for (const i of ['name', 'name1', 'name2']) {
|
||||||
if (i == 'name1' && this.name === this.name1) continue;
|
if (i == 'name1' && this.name === this.name1) continue;
|
||||||
const list = lib.characterSubstitute[this[i]];
|
const list = lib.characterSubstitute[this[i]];
|
||||||
if (this[i] && list) {
|
if (this[i] && list) {
|
||||||
if ((get.character(this[i], 3) || []).includes(skill)) {
|
const name = (i == 'name2' ? 'name2' : 'name');
|
||||||
const name = (i == 'name2' ? 'name2' : 'name');
|
if ((() => {
|
||||||
|
if (typeof map == 'function') {
|
||||||
|
return map(this, name);
|
||||||
|
}
|
||||||
|
if (typeof map.skill == 'string' && (get.character(this[i], 3) || []).includes(map.skill)) return true;
|
||||||
|
if (typeof map.characterName == 'string' && this[i] == map.characterName) return true;
|
||||||
|
if (typeof map.characterSkinName == 'string' && this.skin[name] == map.characterSkinName) return true;
|
||||||
|
if (typeof map.source == 'string' && name == map.source) return true;
|
||||||
|
return false;
|
||||||
|
})()) {
|
||||||
if (this.skin[name] != character) {
|
if (this.skin[name] != character) {
|
||||||
const origin = this.skin[name];
|
const origin = this.skin[name];
|
||||||
game.broadcastAll((player, name, character, list, origin) => {
|
game.broadcastAll((player, name, character, list, origin) => {
|
||||||
|
@ -3090,20 +3106,22 @@ export class Player extends HTMLDivElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.storage.nohp) {
|
if (!this.storage.nohp) {
|
||||||
if (this.maxHp == Infinity) {
|
const hidden = (this.classList.contains('unseen_show') || this.classList.contains('unseen2_show'));
|
||||||
hp.innerHTML = '∞';
|
const maxHp = (hidden ? 1 : this.maxHp);
|
||||||
|
if (maxHp == Infinity) {
|
||||||
|
hp.innerHTML = (this.hp == Infinity ? '∞' : (this.hp + '<br>/<br>' + '∞' + '<div></div>'));
|
||||||
}
|
}
|
||||||
else if (game.layout == 'default' && this.maxHp > 14) {
|
else if (game.layout == 'default' && maxHp > 14) {
|
||||||
hp.innerHTML = this.hp + '/' + this.maxHp;
|
hp.innerHTML = this.hp + '/' + maxHp;
|
||||||
hp.classList.add('text');
|
hp.classList.add('text');
|
||||||
}
|
}
|
||||||
else if (get.is.newLayout() &&
|
else if (get.is.newLayout() &&
|
||||||
(
|
(
|
||||||
this.maxHp > 9 ||
|
maxHp > 9 ||
|
||||||
(this.maxHp > 5 && this.classList.contains('minskin')) ||
|
(maxHp > 5 && this.classList.contains('minskin')) ||
|
||||||
((game.layout == 'mobile' || game.layout == 'long') && this.dataset.position == 0 && this.maxHp > 7)
|
((game.layout == 'mobile' || game.layout == 'long') && this.dataset.position == 0 && maxHp > 7)
|
||||||
)) {
|
)) {
|
||||||
hp.innerHTML = this.hp + '<br>/<br>' + this.maxHp + '<div></div>';
|
hp.innerHTML = this.hp + '<br>/<br>' + maxHp + '<div></div>';
|
||||||
if (this.hp == 0) {
|
if (this.hp == 0) {
|
||||||
hp.lastChild.classList.add('lost');
|
hp.lastChild.classList.add('lost');
|
||||||
}
|
}
|
||||||
|
@ -3114,16 +3132,16 @@ export class Player extends HTMLDivElement {
|
||||||
hp.innerHTML = '';
|
hp.innerHTML = '';
|
||||||
hp.classList.remove('text');
|
hp.classList.remove('text');
|
||||||
hp.classList.remove('textstyle');
|
hp.classList.remove('textstyle');
|
||||||
while (this.maxHp > hp.childNodes.length) {
|
while (maxHp > hp.childNodes.length) {
|
||||||
ui.create.div(hp);
|
ui.create.div(hp);
|
||||||
}
|
}
|
||||||
while (Math.max(0, this.maxHp) < hp.childNodes.length) {
|
while (Math.max(0, maxHp) < hp.childNodes.length) {
|
||||||
hp.removeChild(hp.lastChild);
|
hp.removeChild(hp.lastChild);
|
||||||
}
|
}
|
||||||
for (var i = 0; i < this.maxHp; i++) {
|
for (var i = 0; i < maxHp; i++) {
|
||||||
var index = i;
|
var index = i;
|
||||||
if (get.is.newLayout()) {
|
if (get.is.newLayout()) {
|
||||||
index = this.maxHp - i - 1;
|
index = maxHp - i - 1;
|
||||||
}
|
}
|
||||||
if (i < this.hp) {
|
if (i < this.hp) {
|
||||||
hp.childNodes[index].classList.remove('lost');
|
hp.childNodes[index].classList.remove('lost');
|
||||||
|
@ -3132,23 +3150,26 @@ export class Player extends HTMLDivElement {
|
||||||
hp.childNodes[index].classList.add('lost');
|
hp.childNodes[index].classList.add('lost');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if(this.maxHp==9){
|
// if(maxHp==9){
|
||||||
// hp.classList.add('long');
|
// hp.classList.add('long');
|
||||||
// }
|
// }
|
||||||
// else{
|
// else{
|
||||||
// hp.classList.remove('long');
|
// hp.classList.remove('long');
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if (hp.classList.contains('room')) {
|
if (hidden) {
|
||||||
|
hp.dataset.condition = 'hidden';
|
||||||
|
}
|
||||||
|
else if (hp.classList.contains('room')) {
|
||||||
hp.dataset.condition = 'high';
|
hp.dataset.condition = 'high';
|
||||||
}
|
}
|
||||||
else if (this.hp == 0) {
|
else if (this.hp == 0) {
|
||||||
hp.dataset.condition = '';
|
hp.dataset.condition = '';
|
||||||
}
|
}
|
||||||
else if (this.hp > Math.round(this.maxHp / 2) || this.hp === this.maxHp) {
|
else if (this.hp > Math.round(maxHp / 2) || this.hp === maxHp) {
|
||||||
hp.dataset.condition = 'high';
|
hp.dataset.condition = 'high';
|
||||||
}
|
}
|
||||||
else if (this.hp > Math.floor(this.maxHp / 3)) {
|
else if (this.hp > Math.floor(maxHp / 3)) {
|
||||||
hp.dataset.condition = 'mid';
|
hp.dataset.condition = 'mid';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3281,6 +3302,7 @@ export class Player extends HTMLDivElement {
|
||||||
num = this.storage[i].length;
|
num = this.storage[i].length;
|
||||||
}
|
}
|
||||||
if (num) {
|
if (num) {
|
||||||
|
if (num == Infinity) num = '∞';
|
||||||
if (!this.marks[i].markcount) {
|
if (!this.marks[i].markcount) {
|
||||||
this.marks[i].markcount = ui.create.div('.markcount.menubutton', this.marks[i]);
|
this.marks[i].markcount = ui.create.div('.markcount.menubutton', this.marks[i]);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue