Added basis for server-side cooldown checks, added warmup checks, closed #273

Note that cooldown check is currently used only for the holoemote
command. To add a cooldown to any command, all you have to do is
CreatureObject.addCooldown(name). In this commit I also moved some
cooldown variables from CombatCommand to BaseSWGCommand since many
non-combat commands had cooldowns (Wookie Roar, Holo-Emotes). I also put
in a warmup cooldown (time before command is called) for non-combat
commands.
This commit is contained in:
Waverunner
2014-04-03 19:23:31 -04:00
parent edcc6b9c34
commit 9e80b5eeae
8 changed files with 214 additions and 62 deletions
+4 -52
View File
@@ -67,16 +67,16 @@ public class CombatCommand extends BaseSWGCommand {
private int damageType, elementalType, elementalValue;
private String performanceSpam;
private byte hitSpam;
private float cooldown;
//private float cooldown;
private String delayAttackEggTemplate;
private String delayAttackParticle;
private float initialAttackDelay;
private float delayAttackInterval;
private int delayAttackLoops;
private int delayAttackEggPosition;
private String cooldownGroup;
private float executeTime;
private float warmupTime;
//private String cooldownGroup;
//private float executeTime;
//private float warmupTime;
private float vigorCost; // for commando kill meter and bm specials
private float criticalChance;
private int attack_rolls;
@@ -162,22 +162,6 @@ public class CombatCommand extends BaseSWGCommand {
}
}
DatatableVisitor visitor2 = ClientFileManager.loadFile("datatables/command/command_table.iff", DatatableVisitor.class);
for(int i = 0; i < visitor2.getRowCount(); i++) {
if(visitor2.getObject(i, 0) != null) {
if(((String) visitor2.getObject(i, 0)).equalsIgnoreCase(commandName)) {
cooldownGroup = (String) visitor2.getObject(i, 85);
warmupTime = (Float) visitor2.getObject(i, 86);
executeTime = (Float) visitor2.getObject(i, 87);
cooldown = (Float) visitor2.getObject(i, 88);
}
}
}
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
@@ -624,14 +608,6 @@ public class CombatCommand extends BaseSWGCommand {
}
public float getCooldown() {
return cooldown;
}
public void setCooldown(float cooldown) {
this.cooldown = cooldown;
}
public String getDelayAttackEggTemplate() {
return delayAttackEggTemplate;
}
@@ -680,30 +656,6 @@ public class CombatCommand extends BaseSWGCommand {
this.delayAttackLoops = delayAttackLoops;
}
public String getCooldownGroup() {
return cooldownGroup;
}
public void setCooldownGroup(String cooldownGroup) {
this.cooldownGroup = cooldownGroup;
}
public float getExecuteTime() {
return executeTime;
}
public void setExecuteTime(float executeTime) {
this.executeTime = executeTime;
}
public float getWarmupTime() {
return warmupTime;
}
public void setWarmupTime(float warmupTime) {
this.warmupTime = warmupTime;
}
public float getVigorCost() {
return vigorCost;
}