@@ -103,7 +103,7 @@ public void testPrecisionShotCooldown() {
103
103
GridPosition enemyPos = new GridPosition (2 , 2 );
104
104
AgentState playerState = AgentStateFactory .newBattleAgentState (Team .PLAYER , playerPos , 3 , 5 , 2 , 5 , 65 , 0 );
105
105
playerState .abilities .add (new PrecisionShotAbility ());
106
- playerState .weapons .add (new Pistol ());
106
+ playerState .weapons .add (new Rifle ());
107
107
map .addAgent (playerState );
108
108
map .addAgent (AgentStateFactory .newBattleAgentState (Team .ENEMY , enemyPos , 3 , 5 , 2 , 5 , 65 , 0 ));
109
109
BattleController battle = new BattleController (map );
@@ -132,6 +132,27 @@ public void testPrecisionShotCooldown() {
132
132
}
133
133
}
134
134
135
+ @ Test
136
+ public void testPrecisionShotWeaponReq () {
137
+ BattleMap map = new BattleMap (3 , 4 );
138
+ GridPosition playerPos = new GridPosition (1 , 0 );
139
+ GridPosition enemyPos = new GridPosition (2 , 2 );
140
+ AgentState playerState = AgentStateFactory .newBattleAgentState (Team .PLAYER , playerPos , 3 , 5 , 2 , 5 , 65 , 0 );
141
+ playerState .abilities .add (new PrecisionShotAbility ());
142
+ playerState .weapons .add (new Pistol ());
143
+ map .addAgent (playerState );
144
+ map .addAgent (AgentStateFactory .newBattleAgentState (Team .ENEMY , enemyPos , 3 , 5 , 2 , 5 , 65 , 0 ));
145
+ BattleController battle = new BattleController (map );
146
+ Agent agent = map .getAgentAtPos (playerPos );
147
+ Agent target = map .getAgentAtPos (enemyPos );
148
+ try {
149
+ battle .performAction (new PrecisionShotAction (agent , target ));
150
+ fail ("Expected exception not thrown" );
151
+ } catch (IllegalActionException e ) {
152
+ }
153
+ }
154
+
155
+
135
156
@ Test
136
157
public void testNoSnapShot () {
137
158
BattleMap map = new BattleMap (5 , 5 );
0 commit comments