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 |
class RPGClass extends RPGDeathAbility config(UT2004RPG) abstract; var config int LowLevel; var config int MediumLevel; static simulated function int Cost(RPGPlayerDataObject Data, int CurrentLevel) { local int x; if(CurrentLevel > 1) return 0; for (x = 0; x < Data.Abilities.length; x++) { if(ClassIsChildOf(Data.Abilities[x], Class'RPGClass') && Data.Abilities[x] != default.Class) return 0; } return default.StartingCost; } static simulated function RPGStatsInv getPlayerStats(Controller c) { Local GameRules G; Local RPGRules RPG; for(G = C.Level.Game.GameRulesModifiers; G != None; G = G.NextGameRules) { if(G.isA('RPGRules')) { RPG = RPGRules(G); break; } } if(RPG == None) { Log("WARNING: Unable to find RPGRules in GameRules."); return None; } return RPG.GetStatsInvFor(C); } static function bool GenuinePreventDeath(Pawn Killed, Controller Killer, class<DamageType> DamageType, vector HitLocation, int AbilityLevel) { local RPGStatsInv StatsInv; local int y; local int GhostLevel; local int GhostIndex; GhostIndex = -1; StatsInv = RPGStatsInv(Killed.FindInventoryType(class'RPGStatsInv')); if (StatsInv != None && StatsInv.DataObject.Level <= default.MediumLevel) { for (y = 0; y < StatsInv.Data.Abilities.length; y++) { if (ClassIsChildOf(StatsInv.Data.Abilities[y], class'AbilityGhost')) { GhostLevel = StatsInv.Data.AbilityLevels[y]; GhostIndex = y; } } if(StatsInv.DataObject.Level <= default.LowLevel) { if(GhostIndex >= 0) return StatsInv.Data.Abilities[GhostIndex].static.PreventDeath(Killed, Killer, DamageType, HitLocation, 2, false); else return class'DruidGhost'.static.GenuinePreventDeath(Killed, Killer, DamageType, HitLocation, 2); } else if(StatsInv.DataObject.Level <= default.MediumLevel) { if(GhostIndex >= 0) return StatsInv.Data.Abilities[GhostIndex].static.PreventDeath(Killed, Killer, DamageType, HitLocation, 1, false); else return class'DruidGhost'.static.GenuinePreventDeath(Killed, Killer, DamageType, HitLocation, 1); } } } static function bool PreventSever(Pawn Killed, name boneName, int Damage, class<DamageType> DamageType, int AbilityLevel) { local RPGStatsInv StatsInv; local int y; local int GhostLevel; local int GhostIndex; GhostIndex = -1; StatsInv = RPGStatsInv(Killed.FindInventoryType(class'RPGStatsInv')); if (StatsInv != None && StatsInv.DataObject.Level <= default.MediumLevel) { for (y = 0; y < StatsInv.Data.Abilities.length; y++) { if (ClassIsChildOf(StatsInv.Data.Abilities[y], class'AbilityGhost')) { GhostLevel = StatsInv.Data.AbilityLevels[y]; GhostIndex = y; } } if(StatsInv.DataObject.Level <= default.LowLevel) { if(GhostIndex >=0) return StatsInv.Data.Abilities[GhostIndex].static.PreventSever(Killed, boneName, Damage, DamageType, 3); else return class'DruidGhost'.static.PreventSever(Killed, boneName, Damage, DamageType, 3); } else if(StatsInv.DataObject.Level <= default.MediumLevel) { if(GhostIndex >=0) return StatsInv.Data.Abilities[GhostIndex].static.PreventSever(Killed, boneName, Damage, DamageType, Min(3, GhostLevel + 2)); else return class'DruidGhost'.static.PreventSever(Killed, boneName, Damage, DamageType, 2); } } } static simulated function ModifyVehicle(Vehicle V, int AbilityLevel) { // called when player enters a vehicle // UT2004RPG resets the vehicle health back to defaults when you get in. We need to reapply bonus local float Healthperc; // need to undo the change done by the MutUT2004RPG.DriverEnteredVehicle function Healthperc = float(V.Health) / V.HealthMax; // current health percent V.HealthMax = V.SuperHealthMax; V.Health =Healthperc * V.HealthMax; // now applied to new max } defaultproperties { LowLevel = 20 MediumLevel = 40 MaxLevel=1 StartingCost=1 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |