private int calcDamageDirection() { return ((calcAttackDirection() - getTargetState().getFacing()) + 6) % 6; }
protected void setDamageDirection(EntityState targetState, Coords shooterCoords) { int fromDirection = targetState.getPosition().direction(shooterCoords); setDamageDirection(((fromDirection - targetState.getFacing()) + 6) % 6); }
Mockito.when(mockTargetState.getFacing()).thenReturn(TARGET_FACING); Mockito.when(mockTargetState.getPosition()).thenReturn(TARGET_COORDS_9);
Mockito.when(mockGameOptions.booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_RANGE)).thenReturn(false); Mockito.when(mockTarget.hasQuirk(Mockito.eq(OptionsConstants.QUIRK_POS_LOW_PROFILE))).thenReturn(false); Mockito.when(mockShooterState.getFacing()).thenReturn(1); Mockito.doReturn(true).when(testFireControl).isInArc(Mockito.any(Coords.class), Mockito.anyInt(), Mockito.any(Coords.class), Mockito.anyInt());
/** * Initialize an entity state from a movement path */ EntityState(MovePath path) { position = path.getFinalCoords(); facing = path.getFinalFacing(); hexesMoved = path.getHexesMoved(); heat = path.getEntity().heat; if (path.getLastStepMovementType() == EntityMovementType.MOVE_WALK) { heat = getHeat() + 1; } else if (path.getLastStepMovementType() == EntityMovementType.MOVE_RUN) { heat = getHeat() + 2; } else if ((path.getLastStepMovementType() == EntityMovementType.MOVE_JUMP) && (getHexesMoved() <= 3)) { heat = getHeat() + 3; } else if ((path.getLastStepMovementType() == EntityMovementType.MOVE_JUMP) && (getHexesMoved() > 3)) { heat = getHeat() + getHexesMoved(); } prone = path.getFinalProne() || path.getFinalHullDown(); immobile = path.getEntity().isImmobile(); jumping = path.isJumping(); movementType = path.getLastStepMovementType(); naturalAptGun = path.getEntity().hasAbility(OptionsConstants.PILOT_APTITUDE_GUNNERY); naturalAptPilot = path.getEntity().hasAbility(OptionsConstants.PILOT_APTITUDE_PILOTING); setSecondaryFacing(getFacing()); }
int shooterFacing = shooterState.getFacing(); if (shooter.isSecondaryArcWeapon(shooter.getEquipmentNum(weapon))) { shooterFacing = shooterState.getSecondaryFacing();