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 |
//----------------------------------------------------------- // LimitBreakUtil <br /> // <br /> // Utility Class for working around RPGAbilities // static funcitons. Most of the functionality // is in this class. <br /> // <br /> // Author: Continuum <br /> // //----------------------------------------------------------- class LimitBreakUtil extends Object config(UT2004RPG); /* 04Mar2007 Variables need to be gone through again... some aren't usefull and others have bad descriptions. */ /** Length of lvl 1 limit break. <br /> Higher lvls of limit break may add aditional time? */ var config float breakLength; /** Percentage of pawn lvl for adjusting amount of points based on players current level. */ var config float lvlFactor; /** Minimum number of limit points needed to reach a limit break. */ var config int minLimitPoints; /** Maximum number of limit points needed to reach a limit break. */ var config int maxLimitPoints; /** Percentage for adjusting amount of points based on damage. <br /> not used by default*/ var config float damageFactor; /** Used with lvlFactor when player has 75% - max health. */ var config float hpFull; /** Used with lvlFactor when player has 50% - 75% max Health. */ var config float hp50; /** Used with lvlFactor when player has 15% - 50% max Health. */ var config float hp15; /** Used with lvlFactor when player has less than 15% max Health. */ var config float hpCritical; /** Number of points needed for pawns limit break to be reached. */ var float playersLimitBreak; /** Current number of limit points the player has. */ var float limitPoints; /** true while players limitPoints == playersLimitBreak && countdown > 0 */ var bool isLimit; /** The players level. */ var int playerLvl; /** The players limit break lvl. */ var int limitLvl; /** Calculated from pawns current (health, max health, matched to hpFull - hpCritical ranges). */ var float healthFactor; /** Calculated from (lvlFactor, pawns level) & (pawns.Health, healthFactor) & (Damage) */ var float pointFactor; var int abilityLvl; /** Calculates the healthFactor used in limitPoint calculation.<br /> <ul> <li>@param health Injured.Health</li> <li>@param maxHealth Injured.SuperMaxHealth</li> </ul> */ function calcHealthFactor(float health, float superMaxHealth) { local float percOfSuperMax; percOfSuperMax = 1.00; percOfSuperMax = health / superMaxHealth; if(percOfSuperMax >= (0.75 * superMaxHealth)) { healthFactor = hpFull;//use hpFull when calculating limit points } else if(percOfSuperMax >= (0.50 * superMaxHealth)) { healthFactor = hp50;//use hp50 when calculating limit points } else if(percOfSuperMax >= (0.15 * superMaxHealth)) { healthFactor = hp15;//use hp15 when calculating limit points } else if(percOfSuperMax < (0.15 * superMaxHealth)) { healthFactor = hpCritical;//use hpCritical when calculating limit points } else { log("!!WARNING!! LimitBreakUtil.calcHealthFactor() has hit catch all (else) returning 0.01"); healthFactor = 0.01;//Something probably went wrong, return a number larger than 0 to use when calculating limit points } }//calcHealthFactor() /** Calculates the actuall limitPoints given to the pawn from recieving damage. */ function calcPoints(Pawn p, int Damage) { local AbilityLimitBreak ab; local RPGPlayerManip playerManip; abilityLvl = playerManip.getRPGPlayerAbilityLvl(p, ab);//need player lvl playerLvl = playerManip.getRPGPlayerLvl(p); /* (1 to 3) * ((0.15 to 1.00) * Damage) / (playerLvl * lvlFactor)) example 1 abilityLvl = 3, healthFactor = 0.50, Damage = 30, playerLvl = 100, lvlFactor = 0.60 limitPoints = 0.45 */ limitPoints = limitPoints + (abilityLvl * ((healthFactor * Damage) / playerLvl)); if(limitPoints >= playersLimitBreak) { isLimit = true; } }//calcPoints() DefaultProperties { limitPoints=0 breakLength=5 playersLimitBreak=800 lvlFactor=0.60 damageFactor=0.10 hpFull=0.15 hp50=0.50 hp15=0.75 hpCritical=1.00 minLimitPoints=100 maxLimitPoints=2000 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |