1 package cz.cuni.amis.pogamut.ut2004.agent.module.sensomotoric;
2
3 import java.util.logging.Logger;
4
5 import cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule;
6 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo;
7 import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot;
8 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Combo;
9
10
11
12
13
14
15 public class AdrenalineCombo extends SensomotoricModule<UT2004Bot> {
16
17 private AgentInfo info;
18
19
20
21
22
23 public boolean canPerformCombo() {
24 return info.getAdrenaline() >= 100;
25 }
26
27
28
29
30
31 public boolean performBerserk() {
32 if (canPerformCombo()) {
33 act.act(new Combo("xGame.ComboBerserk"));
34 return true;
35 } else {
36 return false;
37 }
38 }
39
40
41
42
43
44 public boolean performDefensive() {
45 if (canPerformCombo()) {
46 act.act(new Combo("xGame.ComboDefensive"));
47 return true;
48 } else {
49 return false;
50 }
51 }
52
53
54
55
56
57 public boolean performInvisible() {
58 if (canPerformCombo()) {
59 act.act(new Combo("xGame.ComboDefensive"));
60 return true;
61 } else {
62 return false;
63 }
64 }
65
66
67
68
69
70 public boolean performSpeed() {
71 if (canPerformCombo()) {
72 act.act(new Combo("xGame.ComboDefensive"));
73 return true;
74 } else {
75 return false;
76 }
77 }
78
79 public AdrenalineCombo(UT2004Bot bot, AgentInfo info) {
80 this(bot, info, null);
81 }
82
83 public AdrenalineCombo(UT2004Bot bot, AgentInfo info, Logger log) {
84 super(bot, log);
85 this.info = info;
86 cleanUp();
87 }
88
89 @Override
90 protected void cleanUp() {
91 super.cleanUp();
92 }
93
94 }
95