commit
199cb93bbd
62
game/game.js
62
game/game.js
|
@ -622,8 +622,8 @@
|
||||||
['tao',3]
|
['tao',3]
|
||||||
]),
|
]),
|
||||||
effect:new Map([
|
effect:new Map([
|
||||||
['sha',event=>{
|
['sha',(event,option)=>{
|
||||||
if(event.step!=1) return;
|
if(event.step!=0||option.state!='end') return;
|
||||||
game.log(event.player,'触发了强化效果');
|
game.log(event.player,'触发了强化效果');
|
||||||
game.log(event.card,'抵消所需要的',new lib.element.VCard({
|
game.log(event.card,'抵消所需要的',new lib.element.VCard({
|
||||||
name:'shan'
|
name:'shan'
|
||||||
|
@ -636,8 +636,8 @@
|
||||||
else map[id].shanRequired=2;
|
else map[id].shanRequired=2;
|
||||||
});
|
});
|
||||||
}],
|
}],
|
||||||
['shan',event=>{
|
['shan',(event,option)=>{
|
||||||
if(event.step!=1) return;
|
if(event.step!=0||option.state!='end') return;
|
||||||
game.log(event.player,'触发了强化效果');
|
game.log(event.player,'触发了强化效果');
|
||||||
game.log('使用',event.card,'时视为两张',new lib.element.VCard({
|
game.log('使用',event.card,'时视为两张',new lib.element.VCard({
|
||||||
name:'shan'
|
name:'shan'
|
||||||
|
@ -646,8 +646,8 @@
|
||||||
trigger.getParent(2).decrease('shanRequired',1);
|
trigger.getParent(2).decrease('shanRequired',1);
|
||||||
});
|
});
|
||||||
}],
|
}],
|
||||||
['juedou',event=>{
|
['juedou',(event,option)=>{
|
||||||
if(event.step!=1) return;
|
if(event.step!=0||option.state!='end') return;
|
||||||
game.log(event.player,'触发了强化效果');
|
game.log(event.player,'触发了强化效果');
|
||||||
game.log('对',event.card,'的目标造成伤害时,伤害+1');
|
game.log('对',event.card,'的目标造成伤害时,伤害+1');
|
||||||
event.player.when({
|
event.player.when({
|
||||||
|
@ -656,14 +656,14 @@
|
||||||
trigger.increase('num');
|
trigger.increase('num');
|
||||||
});
|
});
|
||||||
}],
|
}],
|
||||||
['huogong',event=>{
|
['huogong',(event,option)=>{
|
||||||
if(event.step!=1) return;
|
if(event.step!=0||option.state!='end') return;
|
||||||
game.log(event.player,'触发了强化效果');
|
game.log(event.player,'触发了强化效果');
|
||||||
game.log(event.card,'造成的伤害+1');
|
game.log(event.card,'造成的伤害+1');
|
||||||
event.increase('baseDamage',1);
|
event.increase('baseDamage',1);
|
||||||
}],
|
}],
|
||||||
['tao',event=>{
|
['tao',(event,option)=>{
|
||||||
if(event.step!=1) return;
|
if(event.step!=0||option.state!='end') return;
|
||||||
game.log(event.player,'触发了强化效果');
|
game.log(event.player,'触发了强化效果');
|
||||||
game.log(event.card,'回复的体力+1');
|
game.log(event.card,'回复的体力+1');
|
||||||
event.increase('baseDamage',1);
|
event.increase('baseDamage',1);
|
||||||
|
@ -30988,17 +30988,17 @@
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param {Parameters<typeof this.hasHandler>[0]} [type]
|
* @param {Parameters<typeof this.hasHandler>[0]} type
|
||||||
* @param {GameEvent} [event]
|
* @param {GameEvent} event
|
||||||
|
* @param {{
|
||||||
|
* state?: 'begin' | 'end';
|
||||||
|
* }} option
|
||||||
* @returns {this}
|
* @returns {this}
|
||||||
*/
|
*/
|
||||||
callHandler(type,event){
|
callHandler(type,event,option){
|
||||||
if(this.hasHandler(type)){
|
if(this.hasHandler(type)) this.getHandler(type).forEach(handler=>{
|
||||||
if(!event) event=this;
|
if(typeof handler=='function') handler(event,option);
|
||||||
this.getHandler(type).forEach(handler=>{
|
});
|
||||||
if(typeof handler=='function') handler(event);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
getDefaultHandlerType(){
|
getDefaultHandlerType(){
|
||||||
|
@ -31007,7 +31007,9 @@
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param {Parameters<typeof this.hasHandler>[0]} [type]
|
* @param {Parameters<typeof this.hasHandler>[0]} [type]
|
||||||
* @returns {((event: GameEvent) => void)[]}
|
* @returns {((event: GameEvent, option: {
|
||||||
|
* state?: 'begin' | 'end';
|
||||||
|
* }) => void)[]}
|
||||||
*/
|
*/
|
||||||
getHandler(type){
|
getHandler(type){
|
||||||
if(!type) type=this.getDefaultHandlerType();
|
if(!type) type=this.getDefaultHandlerType();
|
||||||
|
@ -31025,13 +31027,17 @@
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @overload
|
* @overload
|
||||||
* @param {...((event: GameEvent) => void)[]} handlers
|
* @param {...((event: GameEvent, option: {
|
||||||
|
* state?: 'begin' | 'end';
|
||||||
|
* }) => void)[]} handlers
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @overload
|
* @overload
|
||||||
* @param {Parameters<typeof this.hasHandler>[0]} type
|
* @param {Parameters<typeof this.hasHandler>[0]} type
|
||||||
* @param {...((event: GameEvent) => void)[]} handlers
|
* @param {...((event: GameEvent, option: {
|
||||||
|
* state?: 'begin' | 'end';
|
||||||
|
* }) => void)[]} handlers
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
pushHandler(type){
|
pushHandler(type){
|
||||||
|
@ -33109,8 +33115,8 @@
|
||||||
player.changeFury(-stratagemBuff.cost.get(cardName),true);
|
player.changeFury(-stratagemBuff.cost.get(cardName),true);
|
||||||
const gameEvent=get.event(),effect=stratagemBuff.effect.get(cardName);
|
const gameEvent=get.event(),effect=stratagemBuff.effect.get(cardName);
|
||||||
if(typeof effect=='function') gameEvent.pushHandler('onNextUseCard',effect);
|
if(typeof effect=='function') gameEvent.pushHandler('onNextUseCard',effect);
|
||||||
gameEvent.pushHandler('onNextUseCard',event=>{
|
gameEvent.pushHandler('onNextUseCard',(event,option)=>{
|
||||||
if(event.step==1) game.broadcastAll(cards=>cards.forEach(card=>card.clone.classList.add('stratagem-fury-glow')),event.cards);
|
if(event.step==0&&option.state=='end') game.broadcastAll(cards=>cards.forEach(card=>card.clone.classList.add('stratagem-fury-glow')),event.cards);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
|
@ -40913,7 +40919,9 @@
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
event.callHandler();
|
event.callHandler(event.getDefaultHandlerType(),event,{
|
||||||
|
state:'begin'
|
||||||
|
});
|
||||||
if(player&&player.classList.contains('dead')&&!event.forceDie&&event.name!='phaseLoop'){
|
if(player&&player.classList.contains('dead')&&!event.forceDie&&event.name!='phaseLoop'){
|
||||||
game.broadcastAll(function(){
|
game.broadcastAll(function(){
|
||||||
while(_status.dieClose.length){
|
while(_status.dieClose.length){
|
||||||
|
@ -41008,8 +41016,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.clearStepCache();
|
event.clearStepCache();
|
||||||
|
event.callHandler(event.getDefaultHandlerType(),event,{
|
||||||
|
state:'end'
|
||||||
|
});
|
||||||
event.step++;
|
event.step++;
|
||||||
if(event.finished) event.callHandler();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue