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; // ne peut pas niveller
}
//
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; // ne peut pas niveller
}