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 |
class DruidShieldRegen extends RPGAbility config(UT2004RPG) abstract; var config int NoDamageDelay, ShieldPerLevel; var config float ShieldRegenRate, RegenPerLevel; static simulated function int Cost(RPGPlayerDataObject Data, int CurrentLevel) { local int x; local bool ok; for (x = 0; x < Data.Abilities.length && !ok; x++) if (Data.Abilities[x] == class'ClassEngineer') ok = true; if(!ok) { if(CurrentLevel > 0) log("Warning:"@data.Name@"has"@default.class@"Level"@CurrentLevel@"but does not have an associated Class to allow them to purchase it"); return 0; } return Super.Cost(Data, CurrentLevel); } static simulated function ModifyPawn(Pawn Other, int AbilityLevel) { local DruidShieldRegenInv R; local Inventory Inv; local int MaxShield; if (Other == None) return; if (Other.Role != ROLE_Authority) return; //remove old one, if it exists //might happen if player levels up this ability while still alive Inv = Other.FindInventoryType(class'DruidShieldRegenInv'); if (Inv != None) Inv.Destroy(); R = Other.spawn(class'DruidShieldRegenInv', Other,,,rot(0,0,0)); if (R == None) return; // ? R.NoDamageDelay = default.NoDamageDelay; MaxShield = default.ShieldPerLevel*AbilityLevel; R.MaxShieldRegen = MaxShield; // choice is to either have a flat regen rate, adding so much a second // or to have the amount regened based upon the level (e.g. 0.33 would generate level/3 per second) // so, whichever is best use. R.ShieldRegenRate = fmax(default.ShieldRegenRate,default.RegenPerLevel*float(AbilityLevel)); R.GiveTo(Other); Other.AddShieldStrength(MaxShield); // start off topped up } defaultproperties { AbilityName="Shield Regeneration" Description="Regenerates your shield at 1 per second. Does not regenerate past starting shield amount. (Max level 15) You must be an Engineer to purchase this skill.|Cost (per level): 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5" StartingCost=5 CostAddPerLevel=0 MaxLevel=15 NoDamageDelay=5 ShieldPerLevel=10 ShieldRegenRate=1.0 RegenPerLevel=0.2 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |