首页 > 代码库 > [Developed]InstantHealing Mut - 即刻回血插件 - Killing Floor 2
[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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。