@@ -585,7 +585,7 @@ public void bite(MapLocation loc, int cheeseConsumed) {
585585
586586 if (cheeseConsumed > 0 ) {
587587 this .addCheese (-cheeseConsumed );
588- damage += (int ) Math .ceil (Math .log (cheeseConsumed ));
588+ damage += (int ) Math .ceil (Math .sqrt (cheeseConsumed ));
589589 }
590590
591591 targetRobot .addHealth (-damage );
@@ -617,7 +617,7 @@ public void scratch(MapLocation loc) {
617617 public void grabRobot (MapLocation loc ) {
618618 this .robotBeingCarried = this .gameWorld .getRobot (loc );
619619 this .robotBeingCarried .getGrabbed (this ); // Notify the grabbed robot that it has been picked up
620- this .gameWorld .getMatchMaker ().addRatNapAction (this .getID ());
620+ this .gameWorld .getMatchMaker ().addRatNapAction (this .robotBeingCarried . getID ());
621621
622622 if (this .robotBeingCarried .getTeam () != this .getTeam ()) {
623623 this .gameWorld .isCooperation = false ;
@@ -650,11 +650,10 @@ private void swapGrabber() {
650650 this .gameWorld .removeRobot (dropLoc );
651651 this .gameWorld .addRobot (dropLoc , this );
652652
653- this .gameWorld .getMatchMaker ().addRatNapAction (this .ID );
653+ this .gameWorld .getMatchMaker ().addRatNapAction (this .ID ); // expand this rat
654+ this .gameWorld .getMatchMaker ().addRatNapAction (grabber .ID ); // shrink carrier rat
654655
655- if (grabber .getTeam () != this .getTeam ()) {
656- grabber .remainingCarriedDuration = GameConstants .MAX_CARRY_DURATION ;
657- }
656+ grabber .remainingCarriedDuration = GameConstants .MAX_CARRY_DURATION ;
658657 }
659658
660659 private void getGrabbed (InternalRobot grabber ) {
@@ -668,9 +667,7 @@ private void getGrabbed(InternalRobot grabber) {
668667
669668 this .setInternalLocationOnly (grabber .getLocation ());
670669
671- if (grabber .getTeam () != this .getTeam ()) {
672- this .remainingCarriedDuration = GameConstants .MAX_CARRY_DURATION ;
673- }
670+ this .remainingCarriedDuration = GameConstants .MAX_CARRY_DURATION ;
674671
675672 }
676673
@@ -688,18 +685,11 @@ private void getThrown(Direction dir) {
688685 this .thrownDir = dir ;
689686 this .remainingThrowDuration = 4 ;
690687
691- MapLocation nextLoc = this .getLocation ().add (dir );
688+ this .setInternalLocationOnly (this .getLocation ());
689+ this .gameWorld .removeRobot (this .getLocation ());
692690
693- // Cat feeding!
694- if (this .gameWorld .getRobot (nextLoc ) != null ) { // there's a cat here
695- this .addHealth (-this .getHealth ()); // rat dies :(
696- // put cat to sleep
697- this .gameWorld .getRobot (nextLoc ).sleepTimeRemaining = GameConstants .CAT_SLEEP_TIME ;
698- this .gameWorld .getMatchMaker ().addCatFeedAction (this .getID ());
699- } else {
700- this .setInternalLocationOnly (this .getLocation ().add (dir ));
701- this .gameWorld .removeRobot (this .getLocation ());
702- }
691+ this .travelFlying (true );
692+ this .travelFlying (false );
703693 }
704694
705695 public void getDropped (MapLocation loc ) {
@@ -714,6 +704,8 @@ public void getDropped(MapLocation loc) {
714704 this .grabbedByRobot = null ;
715705 this .remainingCarriedDuration = 0 ;
716706 this .setInternalLocationOnly (loc );
707+
708+ this .gameWorld .getMatchMaker ().addRatNapAction (this .getID ());
717709
718710 if (this .getHealth () > 0 )
719711 this .gameWorld .addRobot (this .getLocation (), this );
@@ -729,6 +721,8 @@ public void hitGround() {
729721 this .addHealth (-damage );
730722
731723 this .gameWorld .getMatchMaker ().addDamageAction (this .ID , damage );
724+ this .gameWorld .getMatchMaker ().addRatNapAction (this .getID ());
725+
732726
733727 if (this .health > 0 ) {
734728 this .gameWorld .addRobot (this .location , this );
@@ -760,6 +754,7 @@ public void hitTarget(boolean isSecondMove) {
760754 setActionCooldownTurns (this .actionCooldownTurns + GameConstants .HIT_TARGET_COOLDOWN );
761755 setTurningCooldownTurns (this .turningCooldownTurns + GameConstants .HIT_TARGET_COOLDOWN );
762756 this .gameWorld .getMatchMaker ().addDamageAction (this .ID , damage );
757+ this .gameWorld .getMatchMaker ().addRatNapAction (this .getID ());
763758
764759 this .gameWorld .getMatchMaker ().addStunAction (this .ID , GameConstants .HIT_TARGET_COOLDOWN );
765760 }
@@ -1053,8 +1048,7 @@ public void processBeginningOfTurn() {
10531048 this .gameWorld .runCheeseMines ();
10541049
10551050 // if rat is being carried
1056- if (this .getType () == UnitType .BABY_RAT && this .isGrabbedByRobot ()
1057- && this .getGrabbedByRobot ().getTeam () != this .getTeam ()) {
1051+ if (this .getType () == UnitType .BABY_RAT && this .isGrabbedByRobot ()) {
10581052
10591053 // check if grabber has died
10601054 if (this .getGrabbedByRobot ().getHealth () <= 0 ) {
0 commit comments