Change cooldowns to only decrease on kills
This commit is contained in:
parent
4924e41e84
commit
3716813a7b
@ -74,6 +74,7 @@ State MatchInProgress{
|
|||||||
|
|
||||||
function ScoreKill(Controller Killer, Controller Other)
|
function ScoreKill(Controller Killer, Controller Other)
|
||||||
{
|
{
|
||||||
|
local NicePlayerController niceKiller;
|
||||||
local PlayerReplicationInfo OtherPRI;
|
local PlayerReplicationInfo OtherPRI;
|
||||||
local float KillScore;
|
local float KillScore;
|
||||||
local Controller C;
|
local Controller C;
|
||||||
@ -198,7 +199,10 @@ function ScoreKill(Controller Killer, Controller Other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* End Marco's Kill Messages */
|
/* End Marco's Kill Messages */
|
||||||
|
niceKiller = NicePlayerController(killer);
|
||||||
|
if (niceKiller != none && niceKiller.abilityManager != none) {
|
||||||
|
niceKiller.abilityManager.AddToAllCooldowns(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function DramaticEvent(float BaseZedTimePossibility, optional float DesiredZedTimeDuration){
|
function DramaticEvent(float BaseZedTimePossibility, optional float DesiredZedTimeDuration){
|
||||||
|
@ -29,7 +29,7 @@ struct NiceAbilityDescription{
|
|||||||
// Image to be used as an ability's icon
|
// Image to be used as an ability's icon
|
||||||
var Texture icon;
|
var Texture icon;
|
||||||
// Default cooldown duration
|
// Default cooldown duration
|
||||||
var float cooldownLength;
|
var int cooldownLength;
|
||||||
// Can ability be canceled once activated?
|
// Can ability be canceled once activated?
|
||||||
var bool canBeCancelled;
|
var bool canBeCancelled;
|
||||||
};
|
};
|
||||||
@ -39,7 +39,7 @@ struct NiceAbilityStatus{
|
|||||||
// Complete description of ability in question
|
// Complete description of ability in question
|
||||||
var NiceAbilityDescription description;
|
var NiceAbilityDescription description;
|
||||||
// Current cooldown value
|
// Current cooldown value
|
||||||
var float cooldown;
|
var int cooldown;
|
||||||
// Current state of an ability
|
// Current state of an ability
|
||||||
var EAbilityState myState;
|
var EAbilityState myState;
|
||||||
};
|
};
|
||||||
@ -65,7 +65,7 @@ function AddAbility(NiceAbilityDescription description){
|
|||||||
if(currentAbilities[i].description.ID ~= description.ID)
|
if(currentAbilities[i].description.ID ~= description.ID)
|
||||||
return;
|
return;
|
||||||
newRecord.description = description;
|
newRecord.description = description;
|
||||||
newRecord.cooldown = 0.0;
|
newRecord.cooldown = 0;
|
||||||
newRecord.myState = ASTATE_READY;
|
newRecord.myState = ASTATE_READY;
|
||||||
currentAbilities[currentAbilitiesAmount] = newRecord;
|
currentAbilities[currentAbilitiesAmount] = newRecord;
|
||||||
currentAbilitiesAmount += 1;
|
currentAbilitiesAmount += 1;
|
||||||
@ -147,7 +147,7 @@ function SetAbilityState(int abilityIndex, EAbilityState newState){
|
|||||||
// Changes ability's cooldown by a given amount.
|
// Changes ability's cooldown by a given amount.
|
||||||
// If this brings cooldown to zero or below -
|
// If this brings cooldown to zero or below -
|
||||||
// resets current ability to a 'ready' (ASTATE_READY) state.
|
// resets current ability to a 'ready' (ASTATE_READY) state.
|
||||||
function AddToCooldown(int abilityIndex, float delta){
|
function AddToCooldown(int abilityIndex, int delta){
|
||||||
if(abilityIndex < 0 || abilityIndex >= currentAbilitiesAmount) return;
|
if(abilityIndex < 0 || abilityIndex >= currentAbilitiesAmount) return;
|
||||||
if(currentAbilities[abilityIndex].myState != ASTATE_COOLDOWN) return;
|
if(currentAbilities[abilityIndex].myState != ASTATE_COOLDOWN) return;
|
||||||
currentAbilities[abilityIndex].cooldown += delta;
|
currentAbilities[abilityIndex].cooldown += delta;
|
||||||
@ -155,12 +155,21 @@ function AddToCooldown(int abilityIndex, float delta){
|
|||||||
SetAbilityState(abilityIndex, ASTATE_READY);
|
SetAbilityState(abilityIndex, ASTATE_READY);
|
||||||
hackCounter ++;
|
hackCounter ++;
|
||||||
}
|
}
|
||||||
function Tick(float deltaTime){
|
|
||||||
|
function AddToAllCooldowns(int delta){
|
||||||
local int i;
|
local int i;
|
||||||
if(Role != Role_AUTHORITY) return;
|
|
||||||
for(i = 0;i < currentAbilitiesAmount;i ++)
|
for (i = 0; i < currentAbilitiesAmount; i += 1) {
|
||||||
AddToCooldown(i, -deltaTime);
|
if (currentAbilities[i].myState == ASTATE_COOLDOWN) {
|
||||||
|
currentAbilities[i].cooldown += delta;
|
||||||
|
if(currentAbilities[i].cooldown <= 0) {
|
||||||
|
SetAbilityState(i, ASTATE_READY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hackCounter ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
maxAbilitiesAmount=5
|
maxAbilitiesAmount=5
|
||||||
|
Loading…
Reference in New Issue
Block a user