1 package cz.cuni.amis.pogamut.ut3.bot.impl;
2
3 import java.util.logging.Logger;
4
5 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo;
6 import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.Game;
7 import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot;
8 import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType;
9 import cz.cuni.amis.pogamut.ut3.communication.messages.UT3ItemType;
10
11 public class UT3AgentInfo extends AgentInfo {
12
13 public UT3AgentInfo(UT2004Bot bot, Game game, Logger log) {
14 super(bot, game, log);
15 // TODO Auto-generated constructor stub
16 }
17
18 public UT3AgentInfo(UT2004Bot bot, Game game) {
19 this(bot, game, null);
20 }
21
22 @Override
23 public ItemType getCurrentWeaponType() {
24 if (getSelf() == null) {
25 return null;
26 }
27 return UT3ItemType.getItemType(getCurrentWeaponName());
28 }
29
30 /**
31 * Tells how much helmet armor the agent is wearing.
32 *
33 * <p>Armor rating of the helmet. Maximum is 20 points of protection,
34 * removing 50% of damage or completely blocking a single headshot.
35 * </p>
36 *
37 * @return Value of the helmet armor (0 - 20).
38 */
39 public Integer getHelmetArmor() {
40 if (getSelf() == null) {
41 return null;
42 }
43 return 0;
44 //return getSelf().getHelmetArmor();
45 }
46
47 /**
48 * Tells how much vest armor the agent is wearing.
49 *
50 * <p>Armor rating of the vest. Maximum provides 50 points of protection,
51 * removing 75% of damage.
52 * </p>
53 *
54 * @return Value of the vest armor (0 - 50).
55 */
56 public Integer getVestArmor() {
57 if (getSelf() == null) {
58 return null;
59 }
60 return 0;
61 //return getSelf().getVestArmor();
62 }
63
64 /**
65 * Tells how much thighpad armor the agent is wearing.
66 *
67 * <p>Armor rating of the thighpad. Maximum provide 30 points of protection,
68 * removing 50% of damage.
69 * </p>
70 *
71 * @return Value of the thighpad armor (0 - 30).
72 */
73 public Integer getThighpadArmor() {
74 if (getSelf() == null) {
75 return null;
76 }
77 return 0;
78 //return getSelf().getThighpadArmor();
79 }
80
81 /**
82 * Tells how much shieldbelt armor the agent is wearing.
83 *
84 * <p>Armor rating of the shieldbelt. Maximum provides 100 points of
85 * protection, removing 100% of damage.
86 * </p>
87 *
88 * @return Value of the shieldbelt armor (0 - 100).
89 */
90 public Integer getShieldBeltArmor() {
91 if (getSelf() == null) {
92 return null;
93 }
94 return 0;
95 //return getSelf().getShieldBeltArmor();
96 }
97
98 // /**
99 // * TODO: Refactor Pogamut, removing the hasUDamage, hasInvisibility, etc.
100 // * for the generic hasPowerUp
101 // **/
102 // /**
103 // * TODO: Agent can have multiple power-ups! Very rare but must be taken care
104 // * of (In GameBots and protocol)
105 // **/
106 //
107 // /**
108 // * Tells whether the agent has a powerup boost.
109 // *
110 // * <p>
111 // * Type of powerups are invisibility, invulnerability, berserk and
112 // * slowfield.
113 // * </p>
114 // *
115 // * @return true if agent has a powerup, otherwise false.
116 // */
117 // public boolean hasPowerUp() {
118 // return !getPowerUp().equals(NONE_WEAPON_ID);
119 // }
120 //
121 /**
122 * Tells which powerup the agent got.
123 *
124 * <p>
125 * Type of powerups are invisibility, invulnerability, berserk and
126 * slowfield.
127 * </p>
128 *
129 * @return name of the powerup.
130 */
131 public String getPowerUp() {
132 return "none";
133 //return this.getSelf().getPowerUp();
134 }
135
136 /**
137 * If the agent got a powerup, this returns the remaining time of the
138 * powerup.
139 *
140 * <p>
141 * Type of powerups are invisibility, invulnerability, berserk and
142 * slowfield.
143 * </p>
144 *
145 * @return Time remaining for powerup bonus boost. When this value is
146 * positive, the agent has the powerup bonus boost currently activated. When
147 * this value is negative, the agent does not have the powerup activated.
148 */
149 public double getPowerUpTime() {
150 return 0.0;
151 //return this.getSelf().getPowerUpTime();
152 }
153 }