Translations:Difficulty scaling/380/zh: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
Created page with "<source lang="c++"> if (actor->params["LevelSensorMode"] < 1) return false; if (actor_name.contains("Enemy")) { for (enemy_table : this->byml["enemy"]) { i = -1;..."
 
(No difference)

Latest revision as of 12:40, 11 May 2020

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Difficulty scaling)
<source lang="c++">
if (actor->params["LevelSensorMode"] < 1)
  return false;
//
if (actor_name.contains("Enemy")) {
  for (enemy_table : this->byml["enemy"]) {
   i = -1;
   for (j = 0; j < enemy_table["actors"].size; ++j) {
     entry = enemy_table["actors"][j];
     if (entry["name"] == actor_name && this->enemy_points > entry["value"]) {
       i = j;
       break;
     }
   }
   //
   if (i == -1)
     continue;
   //
   do {
     entry = enemy_table["actors"][i];
     if (this->enemy_points <= entry["value"])
       break;
     ++i;
   } while (i < enemy_table["actors"].size);
   //
   *actor_to_use = entry["name"];
   return true;
  }
  return false;  // cannot scale up
}
//
if (actor_name.contains("Weapon")) {
  weapon_name = actor->getWeaponName();
  modifier = actor->params["SharpWeaponJudgeType"];
  if (modifier == WeaponModifier::RandomBlue)
   modifier = get_random_blue_modifier(actor->getWeaponName());
  //
  if (scaleWeapon(weapon_name, &weapon_to_use, &modifier_to_use)) {
   actor->setProperty("SharpWeaponJudgeType", modifier_to_use);
   *actor_to_use = weapon_to_use;
   return true;
  }
  return false;  // cannot scale up
}
</source>
if (actor->params["LevelSensorMode"] < 1)
  return false;

if (actor_name.contains("Enemy")) {
  for (enemy_table : this->byml["enemy"]) {
    i = -1;
    for (j = 0; j < enemy_table["actors"].size; ++j) {
      entry = enemy_table["actors"][j];
      if (entry["name"] == actor_name && this->enemy_points > entry["value"]) {
        i = j; // 名字對,而且經驗值也夠
        break;
      }
    }

    if (i == -1)
      continue; // 找不到換下一個

    do {
      entry = enemy_table["actors"][i];
      if (this->enemy_points <= entry["value"])
        break; // 有找到就枚舉到經驗值最高又符合條件的才停
      ++i;
    } while (i < enemy_table["actors"].size);

    *actor_to_use = entry["name"];
    return true;
  }
  return false;  // cannot scale up
}

if (actor_name.contains("Weapon")) { // 找到敵人後,手上的武器單獨處理
  weapon_name = actor->getWeaponName();
  modifier = actor->params["SharpWeaponJudgeType"];
  if (modifier == WeaponModifier::RandomBlue)
    modifier = get_random_blue_modifier(actor->getWeaponName()); // 抽獎

  if (scaleWeapon(weapon_name, &weapon_to_use, &modifier_to_use)) {
    actor->setProperty("SharpWeaponJudgeType", modifier_to_use); // 用找的
    *actor_to_use = weapon_to_use;
    return true; // 有找到
  }
  return false;  // cannot scale up // 沒找到
}