File tree Expand file tree Collapse file tree
engine/src/main/battlecode/world Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -940,10 +940,12 @@ public void pounce(int[] delta) {
940940 int dy = delta [1 ];
941941
942942 MapLocation [] oldLocs = this .getAllPartLocations ();
943+
943944 for (MapLocation partLoc : oldLocs ) {
944945 // shift location by dx, dy
945946 MapLocation translatedLoc = partLoc .translate (dx , dy );
946947 InternalRobot crushedRobot = this .gameWorld .getRobot (translatedLoc );
948+
947949 if (crushedRobot != null && (crushedRobot .getID () != this .ID )) {
948950 // destroy robot
949951 crushedRobot .addHealth (-crushedRobot .getHealth ());
@@ -953,10 +955,15 @@ public void pounce(int[] delta) {
953955 // actually translate the cat
954956 this .translateLocation (dx , dy );
955957
958+ MapLocation [] newLocs = this .getAllPartLocations ();
959+
960+ for (MapLocation partLoc : newLocs ) {
961+ this .controller .processTrapsAtLocation (partLoc );
962+ }
963+
956964 // incur double the movement cooldown
957965 this .addMovementCooldownTurns (this .dir );
958966 this .addMovementCooldownTurns (this .dir );
959-
960967 }
961968
962969 public MapLocation getCatCornerByChirality (){
Original file line number Diff line number Diff line change @@ -797,6 +797,7 @@ public void processTrapsAtLocation(MapLocation loc) {
797797 if (trap .getTeam () == this .robot .getTeam () || wrongTrapType ) {
798798 continue ;
799799 }
800+
800801 this .gameWorld .triggerTrap (trap , robot );
801802
802803 }
You can’t perform that action at this time.
0 commit comments