Esempio n. 1
0
 public static void apply(
     SkillResolver resolver,
     SkillUseInfo skillUseInfo,
     CardInfo summoner,
     String... summonedCardsDescs)
     throws HeroDieSignal {
   if (summoner == null) {
     throw new CardFantasyRuntimeException("summoner should not be null");
   }
   Skill skill = skillUseInfo.getSkill();
   if (summoner.hasUsed(skillUseInfo)) {
     return;
   }
   List<CardInfo> livingCards = summoner.getOwner().getField().getAliveCards();
   for (CardInfo fieldCard : livingCards) {
     if (fieldCard.getStatus().containsStatusCausedBy(skillUseInfo, CardStatusType.召唤)) {
       return;
     }
   }
   resolver.getStage().getUI().useSkill(summoner, skill, true);
   List<CardInfo> summonedCards =
       DeckBuilder.build(summonedCardsDescs).getCardInfos(summoner.getOwner());
   for (int i = 0; i < summonedCards.size(); ++i) {
     CardInfo summonedCard = summonedCards.get(i);
     resolver.summonCard(summoner.getOwner(), summonedCard, summoner, true);
     CardStatusItem weakStatusItem = CardStatusItem.weak(skillUseInfo);
     resolver.getStage().getUI().addCardStatus(summoner, summonedCard, skill, weakStatusItem);
     summonedCard.addStatus(weakStatusItem);
     CardStatusItem summonedStatusItem = CardStatusItem.summoned(skillUseInfo);
     resolver.getStage().getUI().addCardStatus(summoner, summonedCard, skill, summonedStatusItem);
     summonedCard.addStatus(summonedStatusItem);
   }
   summoner.setUsed(skillUseInfo);
 }
Esempio n. 2
0
 public static void apply(
     SkillResolver resolver,
     SkillUseInfo skillUseInfo,
     EntityInfo caster,
     Player enemyPlayer,
     int victimCount)
     throws HeroDieSignal {
   GameUI ui = resolver.getStage().getUI();
   Skill skill = skillUseInfo.getSkill();
   Randomizer random = Randomizer.getRandomizer();
   List<CardInfo> victims =
       random.pickRandom(enemyPlayer.getField().toList(), victimCount, true, null);
   ui.useSkill(caster, victims, skill, true);
   for (CardInfo victim : victims) {
     CardStatusItem statusItem = CardStatusItem.magicMark(skillUseInfo);
     if (!resolver.resolveAttackBlockingSkills(caster, victim, skill, 1).isAttackable()) {
       return;
     }
     ui.addCardStatus(caster, victim, skill, statusItem);
     victim.addStatus(statusItem);
   }
 }