红警建筑受损可以用小扳手来维修也可以出个工程师瞬间满血,对于坦克,苏军只能出维修厂,盟军可以维修厂,也可以多功能+工程师免费维修,下面我们来分析下,用小扳手,维修厂修建筑、修坦克是怎么收费的。
rules下有这么几句,翻译下看看
RefundPercent=50% ; percent of original cost to refund when building/unit is sold
RepairPercent=15% ; percent cost to fully repair as ratio of full cost
RepairRate=.016 ; minutes between applying repair step
RepairStep=8 ; hit points to heal per repair ‘tick’
URepairRate=.016 ; [units only] minutes between applying repair step
RefundPercent=50% 是指卖建筑、坦克退回你成本的50%
RepairPercent=15% 恢复一次的费用×15%作为维修费用
RepairRate=.016 维修频率
RepairStep=8 维修一下恢复8hp
计算公式如下
“repair step cost” = RepairPercent * ( Cost / ( Strength / RepairStep) )
每维修一下的成本=15%的维修费用*(单位总成本/(单位总血量/每次恢复血量))
举个例子 ,基地车买一个3000大洋,血量1000,每维修一下是花费多少钱呢?
15%*(3000/(1000/8))=15%*(3000/125)=15%*24=3.6
也就是基地车维修一下花3.6大洋,但是游戏内小数是忽略不计的也就是维修一下花3个大洋,如果花费不到1比如0.8,则花费金钱按照1来计算。
GetRepairStepCost
int TechnoTypeClass::GetRepairStepCost() {
int Cost = this->GetCost();
int costStep = Cost / (this->Strength / Rules->RepairStep);
float percentage = costStep * Rules ->RepairPercent;
int result = FloatToInt(percentage);
if ( result <= 1 )
result = 1;
return result;
}
那么问题来了,买一个工程师划算还是慢慢维修划算呢?
一个工程师500大洋,可以修500/3=166次
166×8=1328/1000=1.3个mcv,所以工程师来维修还是很贵的,好处是可以瞬间满血啊。您学到了咩?
ra2.club原创文章,转载请注明出处,谢谢。