Пример #1
0
  public static void update(ViewGroup group, Actor actor) {
    TableLayout actorinfo_stats_table =
        (TableLayout) group.findViewById(R.id.actorinfo_stats_table);

    updateTraitsTable(
        actorinfo_stats_table,
        actor.getMoveCost(),
        actor.getAttackCost(),
        actor.getAttackChance(),
        actor.getDamagePotential(),
        actor.getCriticalSkill(),
        actor.getCriticalMultiplier(),
        actor.getBlockChance(),
        actor.getDamageResistance(),
        actor.isImmuneToCriticalHits());

    TextView actorinfo_currentconditions_title =
        (TextView) group.findViewById(R.id.actorinfo_currentconditions_title);
    ActorConditionList actorinfo_currentconditions =
        (ActorConditionList) group.findViewById(R.id.actorinfo_currentconditions);
    if (actor.conditions.isEmpty()) {
      actorinfo_currentconditions_title.setVisibility(View.GONE);
      actorinfo_currentconditions.setVisibility(View.GONE);
    } else {
      actorinfo_currentconditions_title.setVisibility(View.VISIBLE);
      actorinfo_currentconditions.setVisibility(View.VISIBLE);
      actorinfo_currentconditions.update(actor.conditions);
    }
  }
 private static boolean hasCriticalAttack(Actor attacker, Actor target) {
   if (!attacker.hasCriticalAttacks()) return false;
   if (target.isImmuneToCriticalHits()) return false;
   return true;
 }