[Developed]InstantHealing Mut - 即刻回血插件 - Killing Floor 2
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Developed]InstantHealing Mut - 即刻回血插件 - Killing Floor 2相关的知识,希望对你有一定的参考价值。
目前待解决问题:不能与两个以上Mut并用 (如RestricPW)
待拓展功能:第一针效率100%,第二针+10%,第三针+20%;对于HMT401来说三针总共效率增加130%
--
原理:
扩展Mutator,利用
function ModifyPlayer(Pawn Other)
/* called by GameInfo.RestartPlayer() change the players jumpz, etc. here */ function ModifyPlayer(Pawn Other) { if ( NextMutator != None ) NextMutator.ModifyPlayer(Other); }
对每个 调用RestartPlayer() 进行自定义
其中对于回血的代码,Pharrahnox有描述
/** Instantly heals every player by HealthRegenAmount. This will not exceed the players‘ max health. */ function RegenerateHealth() { local KFPlayerController KFPC; local Pawn Player; //For all player controllers foreach WorldInfo.AllControllers(class‘KFPlayerController‘, KFPC) { //If they have possessed a pawn (a player) if(KFPC.Pawn != None) { Player = KFPC.Pawn; Player.Health = Min(Player.Health + HealthRegenAmount, Player.HealthMax); } } }
--
以下是目前实现
class InstantHealing extends Mutator; function ModifyPlayer(Pawn Other) { local KFPawn_Human KFPH; KFPH=KFPawn_Human(Other); KFPH.HealthRegenRate=KFPH.HealthToRegen; super.ModifyPlayer(Other); } defaultproperties { }
以上是关于[Developed]InstantHealing Mut - 即刻回血插件 - Killing Floor 2的主要内容,如果未能解决你的问题,请参考以下文章