lv = 0;
count = 0; //初始化两个临时变量
for (var i=0;i<$gameParty._actors.length;i++) //遍历一下队伍,累加队伍成员的等级
{
lv += $gameActors.actor($gameParty._actors[i])._level;
count += 1;
}
lv /= count; //取平均数
$gameVariables.setValue(1,lv) //把平均等级赋值给变量1
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |