标签:player cpp pre default control other extends mod super
目前待解决问题:不能与两个以上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
标签:player cpp pre default control other extends mod super
原文地址:http://www.cnblogs.com/ArHShRn/p/7140193.html