コード例 #1
0
ファイル: MarkofAsylum.java プロジェクト: jmagicdev/jmagic
    @Override
    public DamageAssignment.Batch match(Event context, DamageAssignment.Batch damageAssignments) {
      DamageAssignment.Batch ret = new DamageAssignment.Batch();

      Set valid =
          CREATURES_YOU_CONTROL.evaluate(context.state, this.getSourceObject(context.state));

      for (DamageAssignment damage : damageAssignments)
        if (!damage.isCombatDamage && valid.contains(context.state.get(damage.takerID)))
          ret.add(damage);

      return ret;
    }
コード例 #2
0
    @Override
    public DamageAssignment.Batch match(Event context, DamageAssignment.Batch damageAssignments) {
      DamageAssignment.Batch batch = new DamageAssignment.Batch();

      GameObject source = (GameObject) this.getStaticSourceObject(context.game.actualState);
      int enchantedPlayer = source.getAttachedTo();

      for (DamageAssignment assignment : damageAssignments)
        if (context.state.<Identified>get(assignment.takerID).ID == enchantedPlayer)
          batch.add(assignment);

      return batch;
    }