@Override
 public Message execute(ActionContext context, C0270_CopyLineCurrPanelReqMessage reqMsg) {
   RoleInstance role = this.getCurrentRole(context);
   if (role == null) {
     return null;
   }
   return GameContext.getCopyLineApp().getCopyLinePanelRespMessage(role, (byte) 0);
 }
예제 #2
0
 @Override
 public boolean canEnter(AbstractRole role) {
   if (role instanceof RoleInstance) {
     Result result = GameContext.getCopyLineApp().canEnter((RoleInstance) role, this.copyId);
     return result.isSuccess();
   }
   return false;
 }
예제 #3
0
 public MapCopyLineInstance(sacred.alliance.magic.app.map.Map map) {
   super(map);
   this.copyId = map.getMapConfig().getCopyId();
   this.copyLineConfig = GameContext.getCopyLineApp().getCopyLineConfig(this.copyId);
   /*if(null != this.copyLineConfig){
   	this.chapterId = this.copyLineConfig.getChapterId();
   	this.copyIndex = this.copyLineConfig.getCopyIndex();
   }*/
 }
예제 #4
0
 /**
  * 计算评分
  *
  * @param role
  */
 private void calculateScore(RoleInstance role) {
   try {
     // TODO:
     byte starScore = (byte) RandomUtil.randomInt(1, 5);
     GameContext.getCopyLineApp().disposeCopyPass(role, this.copyId, starScore);
     // 通关评分
     C0273_CopyLinePassScoreNotifyMessage message = new C0273_CopyLinePassScoreNotifyMessage();
     message.setConsumeHP(0);
     message.setHpStar((byte) 3);
     message.setPassStar(starScore);
     message.setTime(50);
     message.setTimeStar((byte) 3);
     role.getBehavior().sendMessage(message);
   } catch (Exception e) {
     logger.error(this.getClass().getName() + ".calculateScore error: ", e);
   }
 }