Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 |
class HealingBlastCharger extends Actor; var xEmitter ChargeEmitter; var Controller InstigatorController; var float ChargeTime; var float MaxHealing; var float MinHealing; var float HealingRadius; var RPGRules RPGRules; var float EXPMultiplier; var int MaxHealth; var Material EffectOverlay; function DoHealing(float Radius) { local float healingScale, dist; local vector dir; local Controller C; Local Pawn P; Local int HealthGiven; Local int localMaxHealth; Local XPawn xP; if (Instigator == None && InstigatorController != None) Instigator = InstigatorController.Pawn; if (Instigator.Controller == None) return; C = Level.ControllerList; while (C != None) { if ( C.Pawn != None && C.Pawn.Health > 0 && C.SameTeamAs(Instigator.Controller) && VSize(C.Pawn.Location - Location) < Radius && FastTrace(C.Pawn.Location, Location) ) { P = C.Pawn; if (P != None && P.isA('Vehicle')) P = Vehicle(P).Driver; if (P != None && !C.IsA('FriendlyMonsterController') && P.GetTeam() == Instigator.GetTeam() && Instigator.GetTeam() != None) { localMaxHealth = MaxHealth; // limit if booster in progress xP = xPawn(P); if (xP != None && xP.CurrentCombo != None && xP.CurrentCombo.Name == 'ComboDefensive' ) localMaxHealth = class'RW_Healer'.default.MaxHealth; // in booster, lets not mess it up // heal them dir = C.Pawn.Location - Location; dist = FMax(1,VSize(dir)); healingScale = 1 - FMax(0,dist/Radius); HealthGiven = max(1,(healingScale * (MaxHealing-MinHealing)) + MinHealing); HealthGiven = min((P.HealthMax + localMaxHealth) - P.Health, HealthGiven); if(HealthGiven > 0) { P.GiveHealth(HealthGiven, P.HealthMax + localMaxHealth); P.SetOverlayMaterial(EffectOverlay, 0.5, false); if(Instigator != P) { doHealed(HealthGiven, P, localMaxHealth); if (PlayerController(C) != None) { PlayerController(C).ReceiveLocalizedMessage(class'HealedConditionMessage', 0, Instigator.PlayerReplicationInfo); P.PlaySound(sound'PickupSounds.HealthPack',, 2 * P.TransientSoundVolume,, 1.5 * P.TransientSoundRadius); } } } } } C = C.NextController; } } //this function does no healing. it serves to figure out the correct amount of exp to grant to the player, and grants it. function doHealed(int HealthGiven, Pawn Victim, int localMaxHealth) { Local HealableDamageInv Inv; local int ValidHealthGiven; local float GrantExp; local RPGStatsInv StatsInv; Inv = HealableDamageInv(Victim.FindInventoryType(class'HealableDamageInv')); if(Inv != None) { ValidHealthGiven = Min(HealthGiven, Inv.Damage); if(ValidHealthGiven > 0) { StatsInv = RPGStatsInv(Instigator.FindInventoryType(class'RPGStatsInv')); if (StatsInv == None) { log("Warning: No stats inv found. Healing exp not granted."); return; } GrantExp = EXPMultiplier * float(ValidHealthGiven); Inv.Damage -= ValidHealthGiven; if (RPGRules != None) RPGRules.ShareExperience(StatsInv, GrantExp); } //help keep things in check so a player never has surplus damage in storage. if(Inv.Damage > (Victim.HealthMax + localMaxHealth) - Victim.Health) Inv.Damage = Max(0, (Victim.HealthMax + localMaxHealth) - Victim.Health); //never let it go negative. } } simulated function PostBeginPlay() { if (Level.NetMode != NM_DedicatedServer) ChargeEmitter = spawn(class'HealingChargeEmitter'); if (Role == ROLE_Authority) InstigatorController = Controller(Owner); super.PostBeginPlay(); } simulated function Destroyed() { if (ChargeEmitter != None) ChargeEmitter.Destroy(); Super.Destroyed(); } auto state Charging { Begin: if (Instigator == None) Destroy(); Sleep(ChargeTime); spawn(class'HealingExplosion'); bHidden = true; //for netplay - makes it irrelevant if (ChargeEmitter != None) ChargeEmitter.Destroy(); MakeNoise(1.0); PlaySound(sound'WeaponSounds.redeemer_explosionsound'); DoHealing(HealingRadius); Destroy(); } defaultproperties { DrawType=DT_None TransientSoundVolume=1.000000 TransientSoundRadius=5000.000000 MaxHealing=500.000000 MinHealing=100.000000 HealingRadius=2200.000000 ChargeTime=2.0 EffectOverlay=Shader'UTRPGTextures2.Overlays.PulseBlueShader1' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |