Merge branch 'libccy:PR-Branch' into PR-Branch
This commit is contained in:
commit
1a49bf5943
|
@ -287,11 +287,32 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
target.draw(num);
|
target.draw(num);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ai:{threaten:3},
|
ai:{
|
||||||
|
threaten:3,
|
||||||
|
effect:{
|
||||||
|
player:(card,player,target)=>{
|
||||||
|
if(!target||typeof card!=='object'||player._clanjiejian_mod_temp||get.type(card)==='equip'||
|
||||||
|
get.attitude(player,target)<=0||get.cardNameLength(card)!==player.getHistory('useCard').length+1) return;
|
||||||
|
let targets=[target],evt=_status.event.getParent('useCard');
|
||||||
|
targets.addArray(ui.selected.targets);
|
||||||
|
if(evt&&evt.card==card) targets.addArray(evt.targets);
|
||||||
|
return [1,0.8*get.cardNameLength(card)/targets.length];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
mod:{
|
mod:{
|
||||||
aiOrder:function(player,card,num){
|
aiOrder:function(player,card,num){
|
||||||
if(typeof card=='object'&&get.cardNameLength(card)==player.getHistory('useCard').length+1&&get.type(card)!='equip'){
|
if(typeof card=='object'&&get.type(card)!=='equip'){
|
||||||
if(get.effect(player,card,player,player)>0) return num+10;
|
let cs=get.cardNameLength(card)-player.getHistory('useCard').length-1;
|
||||||
|
if(cs<0) return num;
|
||||||
|
if(cs>0) return num/3;
|
||||||
|
player._clanjiejian_mod_temp=true;
|
||||||
|
let bool=game.hasPlayer(target=>{
|
||||||
|
if(get.attitude(player,target)<=0||!player.canUse(card,target,null,true)) return false;
|
||||||
|
return get.effect(target,card,player,player)+get.effect(target,{name:'draw'},player,player)>0;
|
||||||
|
});
|
||||||
|
delete player._clanjiejian_mod_temp;
|
||||||
|
if(bool) return num+15;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -5434,6 +5434,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
renjie2:{
|
renjie2:{
|
||||||
audio:2,
|
audio:2,
|
||||||
|
mod:{
|
||||||
|
aiOrder:(player,card,num)=>{
|
||||||
|
if(num<=0||typeof card!=='object'||!player.isPhaseUsing()) return 0;
|
||||||
|
if(player.awakenedSkills.includes('sbaiyin')){
|
||||||
|
if(player.countMark('renjie')<3&&player.getUseValue(card)<Math.min(1.8,0.18*player.hp*player.hp)) return 0;
|
||||||
|
}
|
||||||
|
else if(player.countMark('renjie')<4&&player.getUseValue(card)<Math.min(4,player.hp*player.hp/4)) return 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
trigger:{
|
trigger:{
|
||||||
player:'loseAfter',
|
player:'loseAfter',
|
||||||
global:'loseAsyncAfter',
|
global:'loseAsyncAfter',
|
||||||
|
@ -5469,6 +5478,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
jilue:{
|
jilue:{
|
||||||
unique:true,
|
unique:true,
|
||||||
group:['jilue_guicai','jilue_fangzhu','jilue_wansha','jilue_zhiheng','jilue_jizhi'],
|
group:['jilue_guicai','jilue_fangzhu','jilue_wansha','jilue_zhiheng','jilue_jizhi'],
|
||||||
|
ai:{
|
||||||
|
combo:'renjie'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
jilue_guicai:{
|
jilue_guicai:{
|
||||||
audio:1,
|
audio:1,
|
||||||
|
|
|
@ -1444,11 +1444,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
}),targets=game.filterPlayer(current=>{
|
}),targets=game.filterPlayer(current=>{
|
||||||
return !player.getStorage('dcshangyu_transfer').includes(current);
|
return !player.getStorage('dcshangyu_transfer').includes(current);
|
||||||
}).sortBySeat(_status.currentPhase);
|
}).sortBySeat(_status.currentPhase);
|
||||||
|
if(targets.length&&targets[0]===_status.currentPhase&&!_status.currentPhase.getCardUsable('sha')) targets.push(targets.shift());
|
||||||
event.cards=cards;
|
event.cards=cards;
|
||||||
player.chooseTarget(`赏誉:将${get.translation(cards)}交给一名可选角色`,(card,player,target)=>{
|
player.chooseTarget(`赏誉:将${get.translation(cards)}交给一名可选角色`,(card,player,target)=>{
|
||||||
return !player.getStorage('dcshangyu_transfer').includes(target);
|
return !player.getStorage('dcshangyu_transfer').includes(target);
|
||||||
},true).set('ai',target=>{
|
},true).set('ai',target=>{
|
||||||
let att=get.sgn(get.attitude(_status.event.player,target)),idx=1+_status.event.targets.indexOf(target);
|
let att=get.sgnAttitude(_status.event.player,target),idx=1+_status.event.targets.indexOf(target);
|
||||||
if(att<0) return -idx;
|
if(att<0) return -idx;
|
||||||
return att+1/idx;
|
return att+1/idx;
|
||||||
}).set('targets',targets);
|
}).set('targets',targets);
|
||||||
|
|
|
@ -1557,8 +1557,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
});
|
});
|
||||||
return !player.wontYe('wei')||!game.hasPlayer(current=>current.identity=='wei')
|
return !player.wontYe('wei')||!game.hasPlayer(current=>current.identity=='wei')
|
||||||
},
|
},
|
||||||
check:function(event,player,name){
|
check:function(event,player){
|
||||||
return name!='damageBegin1';
|
return !event.player.hasSkillTag('filterDamage',null,{
|
||||||
|
player:event.source,
|
||||||
|
card:event.card,
|
||||||
|
})&&get.damageEffect(event.player,event.source,player,_status.event.player)>0;
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
trigger.num++;
|
trigger.num++;
|
||||||
|
|
|
@ -824,17 +824,11 @@ export class Get extends Uninstantable {
|
||||||
const constructor = obj.constructor;
|
const constructor = obj.constructor;
|
||||||
let target;
|
let target;
|
||||||
if (!canTranverse[getType(obj)]) {
|
if (!canTranverse[getType(obj)]) {
|
||||||
try {
|
target = obj;
|
||||||
// @ts-ignore
|
return target;
|
||||||
target = new constructor(obj);
|
|
||||||
} catch (error) {
|
|
||||||
if (obj instanceof HTMLElement) {
|
|
||||||
target = obj.cloneNode(true); // 不能cloneNode就寄吧,累了
|
|
||||||
} else throw error
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
else target = constructor ? new constructor() : Object.create(null);
|
else target = constructor ? new constructor(target) : Object.create(null);
|
||||||
map.set(obj, target);
|
map.set(obj, target);
|
||||||
|
|
||||||
if (obj instanceof Map) {
|
if (obj instanceof Map) {
|
||||||
|
|
|
@ -12,11 +12,11 @@ export class Card extends HTMLDivElement {
|
||||||
* @param {true} [noclick]
|
* @param {true} [noclick]
|
||||||
*/
|
*/
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
constructor(position, info, noclick) {
|
constructor(position) {
|
||||||
if (position instanceof Card) {
|
if (position instanceof Card) {
|
||||||
const other = position;
|
const other = position;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
[position, info, noclick] = other._args;
|
[position] = other._args;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @type {this}
|
* @type {this}
|
||||||
|
@ -24,9 +24,8 @@ export class Card extends HTMLDivElement {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const card = ui.create.div('.card', position);
|
const card = ui.create.div('.card', position);
|
||||||
Object.setPrototypeOf(card, Card.prototype);
|
Object.setPrototypeOf(card, Card.prototype);
|
||||||
card.build(info, noclick);
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
card._args = [position, info, noclick];
|
card._args = [position];
|
||||||
return card;
|
return card;
|
||||||
}
|
}
|
||||||
build(info, noclick) {
|
build(info, noclick) {
|
||||||
|
@ -35,6 +34,7 @@ export class Card extends HTMLDivElement {
|
||||||
card.buildIntro(noclick);
|
card.buildIntro(noclick);
|
||||||
card.buildProperty();
|
card.buildProperty();
|
||||||
card.buildEventListener(info);
|
card.buildEventListener(info);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
buildEventListener(info) {
|
buildEventListener(info) {
|
||||||
let card = this;
|
let card = this;
|
||||||
|
|
|
@ -35,7 +35,7 @@ export class Dialog extends HTMLDivElement {
|
||||||
else if (argument == 'noforcebutton') noForceButton = true;
|
else if (argument == 'noforcebutton') noForceButton = true;
|
||||||
else dialog.add(argument);
|
else dialog.add(argument);
|
||||||
});
|
});
|
||||||
if (!hidden) dialog.open();
|
//if (!hidden) dialog.open();
|
||||||
if (!lib.config.touchscreen) dialog.contentContainer.onscroll = ui.update;
|
if (!lib.config.touchscreen) dialog.contentContainer.onscroll = ui.update;
|
||||||
if (!noTouchScroll) {
|
if (!noTouchScroll) {
|
||||||
dialog.contentContainer.ontouchstart = ui.click.dialogtouchStart;
|
dialog.contentContainer.ontouchstart = ui.click.dialogtouchStart;
|
||||||
|
|
|
@ -8,24 +8,22 @@ import { UI as ui } from '../../ui/index.js';
|
||||||
export class Player extends HTMLDivElement {
|
export class Player extends HTMLDivElement {
|
||||||
/**
|
/**
|
||||||
* @param {HTMLDivElement|DocumentFragment} [position]
|
* @param {HTMLDivElement|DocumentFragment} [position]
|
||||||
* @param {true} [noclick]
|
|
||||||
*/
|
*/
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
constructor(position, noclick) {
|
|
||||||
|
constructor(position) {
|
||||||
if (position instanceof Player) {
|
if (position instanceof Player) {
|
||||||
const other = position;
|
const other = position;
|
||||||
[position, noclick] = other._args;
|
[position] = other._args;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {this}
|
* @type {this}
|
||||||
*/
|
*/
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const player = ui.create.div('.player', position);
|
const player = ui.create.div('.player', position);
|
||||||
Object.setPrototypeOf(player, Player.prototype);
|
Object.setPrototypeOf(player, Player.prototype);
|
||||||
player.build(noclick);
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
player._args = [position, noclick];
|
player._args = [position];
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -181,6 +179,7 @@ export class Player extends HTMLDivElement {
|
||||||
player.buildProperty();
|
player.buildProperty();
|
||||||
player.buildExtra();
|
player.buildExtra();
|
||||||
player.buildEventListener(noclick);
|
player.buildEventListener(noclick);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
buildNode() {
|
buildNode() {
|
||||||
let player = this;
|
let player = this;
|
||||||
|
|
|
@ -8655,7 +8655,11 @@ class Create extends Uninstantable {
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
static dialog() {
|
static dialog() {
|
||||||
return new lib.element.Dialog(...arguments);
|
let dialog = new lib.element.Dialog(...arguments);
|
||||||
|
if(!Array.from(arguments).includes('hidden')){
|
||||||
|
dialog.open();
|
||||||
|
}
|
||||||
|
return dialog;
|
||||||
}
|
}
|
||||||
static line2() {
|
static line2() {
|
||||||
var node = ui.create.line.apply(this, arguments);
|
var node = ui.create.line.apply(this, arguments);
|
||||||
|
@ -9898,7 +9902,7 @@ class Create extends Uninstantable {
|
||||||
dialog.buttons.add(next.firstChild);
|
dialog.buttons.add(next.firstChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static player(position, noclick) { return new lib.element.Player(position, noclick) }
|
static player(position, noclick) { return new lib.element.Player(position).build(noclick); }
|
||||||
static connectPlayers(ip) {
|
static connectPlayers(ip) {
|
||||||
ui.updateConnectPlayerPositions();
|
ui.updateConnectPlayerPositions();
|
||||||
game.connectPlayers = [];
|
game.connectPlayers = [];
|
||||||
|
@ -10047,7 +10051,7 @@ class Create extends Uninstantable {
|
||||||
// ui.updatehl();
|
// ui.updatehl();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static card(position, info, noclick) { return new lib.element.Card(position, info, noclick)}
|
static card(position, info, noclick) { return new lib.element.Card(position).build(info, noclick);}
|
||||||
static cardsAsync() {
|
static cardsAsync() {
|
||||||
if (lib.onfree) {
|
if (lib.onfree) {
|
||||||
_status.waitingForCards = Array.from(arguments);
|
_status.waitingForCards = Array.from(arguments);
|
||||||
|
|
Loading…
Reference in New Issue