将三国杀官方身份武将中的reinit升级为changeCharacter

This commit is contained in:
Spmario233 2024-02-15 20:38:35 +08:00
parent 18ab1ea1b9
commit 2f0814ce40
4 changed files with 27 additions and 63 deletions

View File

@ -1244,14 +1244,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
locked:false, locked:false,
skillAnimation:true, skillAnimation:true,
animationColor:'fire', animationColor:'fire',
content:function(){ async content(event,trigger,player){
player.awakenSkill('sbhuoji'); player.awakenSkill('sbhuoji');
game.log(player,'成功完成使命'); game.log(player,'成功完成使命');
var list=[]; if (get.character(player.name1)[3].includes('sbhuoji')) {
if(player.name&&get.character(player.name)[3].includes('sbhuoji')) list.add(player.name); player.reinitCharacter(player.name1, 'sb_zhugeliang', false);
if(player.name1&&get.character(player.name1)[3].includes('sbhuoji')) list.add(player.name1); }
if(player.name2&&get.character(player.name2)[3].includes('sbhuoji')) list.add(player.name2); else if (player.name2&&get.character(player.name2)[3].includes('sbhuoji')) {
if(list.length) list.forEach(name=>player.reinit(name,'sb_zhugeliang')); player.reinitCharacter(player.name2, 'sb_zhugeliang', false);
}
else{ else{
player.changeSKills(['sbguanxing','sbkongcheng'],['sbhuoji','sbkanpo']); player.changeSKills(['sbguanxing','sbkongcheng'],['sbhuoji','sbkanpo']);
} }

View File

@ -1852,8 +1852,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
var num=target.maxHp;
event.num=num;
player.logSkill('skill_zhangji_B',target); player.logSkill('skill_zhangji_B',target);
var list=[]; var list=[];
for(var i=0;i<_status.characterlist.length;i++){ for(var i=0;i<_status.characterlist.length;i++){
@ -1872,10 +1870,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
if(result.bool){ if(result.bool){
event.character=result.links[0]; event.character=result.links[0];
if(target.name2!=undefined) target.chooseControl(target.name,target.name2).set('prompt','请选择要更换的武将牌').set('ai',function(){ if(target.name2!=undefined) target.chooseControl(target.name1,target.name2).set('prompt','请选择要更换的武将牌').set('ai',function(){
return lib.skill.skill_zhangji_B.getNum(target.name)<lib.skill.skill_zhangji_B.getNum(target.name2)?target.name:target.name2; return lib.skill.skill_zhangji_B.getNum(target.name)<lib.skill.skill_zhangji_B.getNum(target.name2)?target.name:target.name2;
}); });
else result.control=target.name; else result.control=target.name1;
} }
else{ else{
target.chat('拒绝'); target.chat('拒绝');
@ -1883,10 +1881,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.finish(); event.finish();
} }
'step 3' 'step 3'
if(result.control==target.name) target.changeGroup('wei',false); target.reinitCharacter(result.control,event.character);
game.log(target,'将','#g'+get.translation(result.control),'替换为了','#g'+get.translation(event.character));
target.reinit(result.control,event.character,false);
target.maxHp=num;
target.update(); target.update();
}, },
subSkill:{ subSkill:{
@ -12611,12 +12606,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else event.finish(); else event.finish();
'step 4' 'step 4'
target.reinit(result.control,'guansuo'); target.reinitCharacter(result.control,'guansuo');
if(target.name=='guansuo'&&target.group!='shu') target.changeGroup('shu');
if(_status.characterlist){
_status.characterlist.add(result.control);
_status.characterlist.remove('guansuo');
}
}, },
}, },
olzhennan:{ olzhennan:{
@ -17528,11 +17518,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('fuhan'); player.awakenSkill('fuhan');
'step 1' 'step 1'
event.num=Math.min(event.num,8); event.num=Math.min(event.num,8);
player.reinit('zhaoxiang',result.links[0],false); player.reinitCharacter('zhaoxiang',result.links[0]);
if(_status.characterlist){
_status.characterlist.add('zhaoxiang');
_status.characterlist.remove(result.links[0]);
}
'step 2' 'step 2'
var num=event.num-player.maxHp; var num=event.num-player.maxHp;
if(num>0) player.gainMaxHp(num); if(num>0) player.gainMaxHp(num);
@ -25520,16 +25506,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('xinfu_xushen'); player.awakenSkill('xinfu_xushen');
player.logSkill('xinfu_xushen',trigger.source); player.logSkill('xinfu_xushen',trigger.source);
if(trigger.source.name2!=undefined){ if(trigger.source.name2!=undefined){
trigger.source.chooseControl(trigger.source.name,trigger.source.name2).set('prompt','请选择要更换的武将牌'); trigger.source.chooseControl(trigger.source.name1,trigger.source.name2).set('prompt','请选择要更换的武将牌');
}else event._result={control:trigger.source.name}; }else event._result={control:trigger.source.name1};
} }
else event.finish(); else event.finish();
"step 2" "step 2"
trigger.source.reinit(result.control,'guansuo'); trigger.source.reinitCharacter(result.control,'guansuo');
if(_status.characterlist){
_status.characterlist.add(result.control);
_status.characterlist.remove('guansuo');
}
player.recover(); player.recover();
player.addSkills('xinfu_zhennan'); player.addSkills('xinfu_zhennan');
}, },

View File

@ -6605,16 +6605,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(target.name2!=undefined){ if(target.name2!=undefined){
target.chooseControl(target.name1,target.name2).set('prompt','请选择要更换的武将牌'); target.chooseControl(target.name1,target.name2).set('prompt','请选择要更换的武将牌');
} }
else event._result={control:target.name}; else event._result={control:target.name1};
} }
else event.goto(4); else event.goto(4);
'step 3' 'step 3'
target.reinit(result.control,'dc_guansuo'); target.reinitCharacter(result.control,'dc_guansuo');
if(target.name=='dc_guansuo'&&target.group!='shu') target.changeGroup('shu');
if(_status.characterlist){
_status.characterlist.add(result.control);
_status.characterlist.remove('dc_guansuo');
}
'step 4' 'step 4'
target.draw(3); target.draw(3);
}, },

View File

@ -3208,9 +3208,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!_status.characterlist){ if(!_status.characterlist){
lib.skill.pingjian.initList(); lib.skill.pingjian.initList();
} }
_status.characterlist.remove(character); player.reinitCharacter('ganfurenmifuren',character);
_status.characterlist.add('ganfurenmifuren');
player.reinit('ganfurenmifuren',character,false);
'step 2' 'step 2'
player.recover(1-player.hp); player.recover(1-player.hp);
player.addTempSkill('dcxunbie_muteki',{player:'phaseAfter'}); player.addTempSkill('dcxunbie_muteki',{player:'phaseAfter'});
@ -10426,37 +10424,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player!=event.dying) return false; if(player!=event.dying) return false;
return true; return true;
}, },
content:function(){ async content(event,trigger,player){
'step 0' 'step 0'
player.awakenSkill('syxiongyi'); player.awakenSkill('syxiongyi');
if(!_status.characterlist){ if(!_status.characterlist){
lib.skill.pingjian.initList(); lib.skill.pingjian.initList();
} }
event.hp=1-player.hp;
if(_status.characterlist.includes('xushi')){ if(_status.characterlist.includes('xushi')){
if(player.name1=='re_sunyi'||player.name2=='re_sunyi') event._result={control:'re_sunyi'}; if (player.name2&&get.character(player.name2)[3].includes('syxiongyi')) {
else if(player.name2!=undefined){ await player.reinitCharacter(player.name2, 'xushi');
player.chooseControl(player.name1,player.name2).set('prompt','请选择要更换的武将牌');
} }
else event._result={control:player.name1}; else {
hp+=2; await player.reinitCharacter(player.name1, 'xushi');
_status.characterlist.remove('xushi'); }
_status.characterlist.add('re_sunyi'); if(player.hp<3) await player.recover(3-player.hp);
player.reinit('re_sunyi','xushi',false);
} }
else{ else{
player.addSkills('olhunzi'); await player.addSkills('olhunzi');
event.goto(2); if(player.hp<1) await player.recover(1-player.hp);
} }
'step 1'
event.hp+=2;
var name=result.control;
_status.characterlist.remove('xushi');
_status.characterlist.add(name);
player.reinit(name,'xushi',false);
'step 2'
var hp=event.hp;
if(hp>0) player.recover(hp);
}, },
ai:{ ai:{
order:1, order:1,